|
Morrel Newbie
Joined: 18 Nov 2004 Posts: 2
|
Posted: 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 |
|
|
|
a5hi5m Beginner
Joined: 04 Mar 2004 Posts: 24 Location: Australia
|
Posted: 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 |
|
|
|
nexela Wizard
Joined: 15 Jan 2002 Posts: 1644 Location: USA
|
Posted: 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}
} |
|
|
|
Morrel Newbie
Joined: 18 Nov 2004 Posts: 2
|
Posted: Sat Nov 20, 2004 2:18 am |
Excellent, thanks for the feedback. I'll try out the alternatives :)
|
|
|
|
|
|