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
john_taylor_jr
Wanderer


Joined: 17 Jan 2003
Posts: 57
Location: USA

PostPosted: Fri Dec 05, 2003 9:00 am   

Reparse Trigger Problem
 
#VAR avoid {Elven Captain|Elven Warrior}
#VAR online {Tom|Sam|Harry}
#VAR bot {1}
#TRIGGER {^* are here.$} {kill=1}
#COND {{@avoid}} {kill=0} {reparse}
#COND {{@online}} {kill=0} {reparse}
#COND {@bot=1 @kill=1} {attack} {exp}

I can't seem to get it to process either condition 1 or condition 2
It skips right to condition 3
Even with a lines like

Elven Warrior and Two Elven Men are here.

or

Tom, Elf and Goblin are here.
Reply with quote
Toetag
Magician


Joined: 10 Oct 2000
Posts: 356
Location: USA

PostPosted: Fri Dec 05, 2003 2:29 pm   
 
looks like you are using string lists, might want to try the %ismember function:

#IF (%ismember( %1, @avoid)) {kill=0} {reparse}
#IF (%ismember( %1, @online)) {kill=0} {reparse}


note:
1: string lists are case sensitive, so elven wont match Elven
2: using * as a pattern match will mess up your trigger, since you are looking for Elven Warrior and the line that comes through is "Elven Warrior and Two Elven Men are here.". Your %1 variable would be "Elven Warrior and Two Elven Men" which is not in your @avoid string list. I'd adjust the trigger. Same story for "Tom, Elf and Goblin are here.", your variable would be, "Tom, Elf and Goblin".
Reply with quote
john_taylor_jr
Wanderer


Joined: 17 Jan 2003
Posts: 57
Location: USA

PostPosted: Fri Dec 05, 2003 2:54 pm   
 
I'm looking for it to match any of the
@avoid or @online people
I can't adjust the trigger as they may not be
present at all or present anywhere in the line.
The triggers match when I do pattern matching
but as conditions the triggers do not fire.
Reply with quote
Larkin
Wizard


Joined: 25 Mar 2003
Posts: 1113
Location: USA

PostPosted: Fri Dec 05, 2003 4:17 pm   
 
I don't know how to fix your whole problem, but I can tell you that this pattern has no variable returns. You need to put parenthese around your wildcard for zMUD to save your text in the %1 variable.

Other than that, I'd recommend looping through each list with #forall and using %pos to look for a match in your %1 variable.

Larkin
Reply with quote
Toetag
Magician


Joined: 10 Oct 2000
Posts: 356
Location: USA

PostPosted: Fri Dec 05, 2003 5:53 pm   
 
The conditions wont fire as you are doing a pattern matching on anything before "are here.". So as i explained in the 2: note. The %1 variable that is set by the trigger will NEVER match any of those in the list you've displayed.

There is no way that:
"Elven Warrior" = "Elven Warrior and Two Elven Men"

and as Larkin mentioned (*), didn't even catch that at the time.

[EDIT]

you could try to trigger off the stringlist. This can get messy as anytime a memeber of the string list appears to Zmud it will fire the trigger command

Trigger:
{@avoid}

just a thought, not sure it will be much help.
Reply with quote
john_taylor_jr
Wanderer


Joined: 17 Jan 2003
Posts: 57
Location: USA

PostPosted: Sat Dec 06, 2003 11:06 am   
 
I'm not using any if statements at all with the #COND reparse it is pattern matching basicly it's like setting a patern matching trigger that only checks that one particular line instead of any text recieved by the mud.
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Sat Dec 06, 2003 12:53 pm   
 
States 1 and 2 work fine for me, it is state 3 that des not seem to want to fire. My guess is that the problem lies on when zMUD decides to evaluate an expression trigger.

Try putting the expression in an #IF inside the second state instead:
#IF ((@bot = 1) and (@kill = 1)) {attack} {exp}

and then eliminate the third state.
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