|
Theoden Newbie
Joined: 07 Aug 2002 Posts: 9 Location: Australia
|
Posted: Thu Oct 06, 2005 12:56 pm
Help capturing variables in the trigger pattern |
Could someone help me make this work ,I want to capture lines that come after the pattern as variables.
Pattern
In the forest you notice:
Fred the Dwarf
Bob the Drow
This how I would like it to work but it seems to be failing
#Trigger In the forest you notice~:$(&%d{inf1})$(&%d{inf2})$(&%d{inf3})$
Any advice would be appreciated. |
|
|
|
saplingg Novice
Joined: 06 Oct 2005 Posts: 31
|
Posted: Thu Oct 06, 2005 1:17 pm |
%d is for numbers
You need to use %w for words
Read the zMUD helpfiel on "wild cards" |
|
|
|
Vitae Enchanter
Joined: 17 Jun 2005 Posts: 673 Location: New York
|
Posted: Thu Oct 06, 2005 1:48 pm |
Never really worked with CONDITIONS but i'll think you should check into it.
#Trigger In the forest you notice~:
#COND (*)
#COND msg seen after people
wish i could help ya better, but only used #cond like 3 times, and it was all from other people helping me. |
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: Thu Oct 06, 2005 9:25 pm |
#CLASS Things
#VARIABLE ThingsList {} {}
#TRIGGER "ThingsCapture" {^In the * you notice:$} {ThingsList=""}
#COND {} {#IF (%line="") {#STATE ThingsCapture 3;#SET ThingsCapture 3 1} {#ADDITEM ThingsList {%line}}} {looplines|param=20}
#COND {*} {#ECHO {Error in ThingsCapture: Captured lines exceeded 20};#STATE ThingsCapture 0}
#COND {} {#NOOP Preform further processing here.} {manual}
#CLASS 0
That should do it, but as with all scripts I write here, unless otherwise stated, it is off the top of my head and may be missing a closing something or other. Simply copy and paste into the command line. |
|
_________________ The only good questions are the ones we have never answered before.
Search the Forums |
|
|
|
|
|