Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
Theoden
Newbie


Joined: 07 Aug 2002
Posts: 9
Location: Australia

PostPosted: 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.
Reply with quote
saplingg
Novice


Joined: 06 Oct 2005
Posts: 31

PostPosted: 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"
Reply with quote
Vitae
Enchanter


Joined: 17 Jun 2005
Posts: 673
Location: New York

PostPosted: 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.
_________________
http://www.Aardwolf.com
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: 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
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net