Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUSHclient ➜ General ➜ Capturing to a new window problem

Capturing to a new window problem

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Apostle   (3 posts)  Bio
Date Wed 30 Jul 2008 06:32 AM (UTC)

Amended on Wed 30 Jul 2008 06:33 AM (UTC) by Apostle

Message
First off, I'm very new to scripting of any sort, and have just begun researching the MUSHclient help files. I've looked over many of the channel capturing threads and have been trying to adapt what has been said in those to what I am trying to do, but it's not working out at all.

I want to capture everything between two lines into a separate window. I want to capture this into a new window called Mapper:

470h, 584m ex-(--PutoranHills.-----------------------------v11144--)
| /
[ ]-[ ]-[ ]-
|
|
|
[o] [ ] [o]
\ | /
^o^ [ ] [o] | [o] [ ] ^o^
\ | /
[v] [o]-(i)-[o] [v]
/ \
[o] [o]-[ ] [o] [o]-[ ]
\ /
[ ]-[o] [o] [ ] [ ]
/ \ | /
[ ] [ ]-[ ]-[ ]
/ | \
[o] [o] [ ] [ ]
/ \
(-- Inventor's Square. | ----------------------------)

So essentially, I want to capture everything between:
470h, 584m ex-(--*-----------------------------v*--)

and:
(--* ----------------------------)

All of the threads I've seen talking about channel capturing says not to capture by a set amount of lines, but instead do it in three triggers: The initial trigger that captures first line and enables the two proceeding triggers. The second trigger that captures everything in between, and a final trigger that ends the capture and shuts off itself and the second trigger (is that right?) Anyways, I was wondering if I could get some help with this, or if I could get directed to a page where something like this was already covered.

Thank you!
Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #1 on Wed 30 Jul 2008 07:38 AM (UTC)
Message
Well it is pretty easy to do it with 3 triggers. An example I did the other day is here:

http://www.gammon.com.au/forum/?id=8816

That was for a mapper plugin, and your looks bit like a map. You may want to read up on the [code] tag to help display stuff better.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Apostle   (3 posts)  Bio
Date Reply #2 on Wed 30 Jul 2008 05:52 PM (UTC)
Message
Thanks for the quick response Nick! It is a similar map, but not for Aardworlf. I tried modifying what you had up there best I could. I just changed the start and end triggers to look like this:

<!-- Triggers -->

<triggers>

<trigger
enabled="y"
match="\(--*------------------------------------*--\)"
script="map_redirect"
omit_from_output="y"
name="map_start"
sequence="100"
>
</trigger>

<trigger
enabled="n"
match="*"
script="map_redirect"
name="multi_line_map"
omit_from_output="y"
sequence="10"
>
</trigger>

<trigger
enabled="y"
match="\(--*-----------\)"
script="map_redirect"
omit_from_output="y"
name="map_end"
sequence="5"
>
</trigger>


</triggers>

But I haven't yet been able to test it because I'm having trouble with the telnet_options.lua. I tried saving that file you linked just as I would a .xml file, but it still saves as a notepad file. Is that correct or should it actually switch to .lua file just like the .xml's do?
Top

Posted by Apostle   (3 posts)  Bio
Date Reply #3 on Wed 30 Jul 2008 06:30 PM (UTC)
Message
Ah, I thought I replied to this post on my thread, but I did to the thread you linked! I posted a follow up to this thread here.

http://www.gammon.com.au/forum/?id=8816
Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #4 on Wed 30 Jul 2008 08:51 PM (UTC)
Message
I moved it back.

If this isn't Aardwolf you don't need the telnet options file. Ignore it.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


14,335 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.