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
Morrel
Newbie


Joined: 18 Nov 2004
Posts: 2

PostPosted: Thu Nov 18, 2004 7:22 am   

Trouble with more than 1 #IF statement in trigger
 
Setting up a simple bot trigger. It's giving me errors where before the update to 7+ I never had them.

^ yyparse stack overflow
To be specific.

I set the trigger up like this:


Pattern:
^(%w) says '!(%w)'.$

Value:
#IF (%2 =~ "spell1") {c 'full spell1 name' %1}
#IF (%2 =~ "spell2") {c 'full spell2 name' %1}


It appears fine with one #IF statement, starts giving me the stack overflow once I add a second #IF statement. By the way, this trigger works, I just dislike the nasty errors and would like to rectify them if possible or an explanation as to why they're appearing.

Thanks in Advance,
Morrel
Reply with quote
a5hi5m
Beginner


Joined: 04 Mar 2004
Posts: 24
Location: Australia

PostPosted: Thu Nov 18, 2004 10:55 am   
 
you could try..

#IF (%2 =~ "spell1") {c 'full spell1 name' %1} {#IF (%2 =~ "spell2") {c 'full spell2 name' %1} {#noop}}
_________________
Smoking@BatMUD
Reply with quote
nexela
Wizard


Joined: 15 Jan 2002
Posts: 1644
Location: USA

PostPosted: Thu Nov 18, 2004 1:14 pm   
 
Actually for something like this I would either use a simple group match trigger or #CASE trigger both with a List var to easily add or change items


//Enter these at the command line (where you type mud commands) then you can open the settings editor to view/adjust them
//First one is a general cast trigger second is a case option which can be used if there are options other then cast

#VAR spells {flight|remove curse|bless|massive armor}
#TRIGGER {^(%w) says '~!({@spells})'.$ } {cast '%item(@spells,%ismember("%2",@spells))' %1}


//Second choice #CASE trigger
#VAR spells {flight|remove curse|bless|massive armor}
#TRIGGER {^(%w) says '~!({@spells})'.$ } {
#CASE %ismember("%2",@spells) {cast 'flight' %1} {invoke 'remove curse' %1} {play 'bless' %1} {hold orb;use orb %1} {#NOOP This always last for case 0}
}
_________________
Zmud Support Library
Zmud Knowledge Base
Reply with quote
Morrel
Newbie


Joined: 18 Nov 2004
Posts: 2

PostPosted: Sat Nov 20, 2004 2:18 am   
 
Excellent, thanks for the feedback. I'll try out the alternatives :)
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