Capturing to a new window problem

Posted by Apostle on Wed 30 Jul 2008 06:32 AM — 5 posts, 19,401 views.

#0
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!
Amended on Wed 30 Jul 2008 06:33 AM by Apostle
Australia Forum Administrator #1
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.
#2
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?
#3
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
Australia Forum Administrator #4
I moved it back.

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