Capturing a string of text

Posted by James Paull on Fri 13 Sep 2002 11:12 PM — 6 posts, 23,578 views.

Malaysia #0
I have read the posts that deal with this, but I can’t get it to work. Here is what I have, I look forward to any help.

Some of my script file:

sub logon
world.closelog
world.openlog "C:\Program Files\MUSHclient\worlds\capture.txt", false
world.send "info here"
world.send "listen"
end sub

sub logoff
World.closelog
world.openlog "C:\Program Files\MUSHclient\worlds\avalon.txt", true
end sub

I have a trigger that should execute “sub logoff” when the response for “listen” comes back but it doesn’t work. It does work when I type in “listen”. I can work with any text I can assign to a variable or a file but how do I do get that far?
Thanks for any help.
James
Australia Forum Administrator #1
Can you copy and paste the trigger here? Sounds funny that it works when you type "listen" but not when the trigger fires. Are you sure you don't have an alias instead?
Malaysia #2
I have no alias', my trigger is as follows:
^You tilt your head and listen intently\.$
any any grey grey grey
all blank but enabled and regular and script logoff
rest default.
thanks,
James
Malaysia #3
Sorry forget my post I guess I figured it out. I had to change my script to read Sub logoff(thename, theoutput, thewildcards) though I don't understand why. Thank you though.
later,
James
Canada #4
TheName - The name of the Trigger/Alias that called this script.

TheOutput - The entire line that caused the trigger to fire, or the entire alias line you entered.

TheWildcards - An array consisting of all the wildcards captured with the trigger or alias.

MUSHclient will try and send those values to your scripted subroutine. An error occurs if your subroutine is not written to accept three arguments.
Amended on Sat 14 Sep 2002 03:42 PM by Magnum
Malaysia #5
Thanks for the description Magnum, it makes sense.
James