|
superbovine Newbie
Joined: 19 Jun 2003 Posts: 8
|
Posted: Thu Jun 19, 2003 1:43 am
help wit %if |
this is the trigger pattern:
^Rahnkara the Highpriestess leaves (%1).(%2)
%1 can be north, south, east, or west
so for example:
Rahnkara the Highpriestess leaves north.
would be a valid statement.
but i am having problems with trigger security where people are emoting the statement
with:
Rahnkara the Highpriestess leaves north. user-name
what i would like to do is have an if statement to check it.
her is what i want in psdeo-code
IF %2 exist then do not move
Else issue the command %1
%if(%2="",%1,say that was a trick %2)
the red area is where i am having problems. i dunno what to put there.
since sometimes %2 contain anything how to check for existence? would the way to go is use $. but i couldn't get that to work either.
help! |
|
|
|
geniusclown Magician
Joined: 23 Apr 2003 Posts: 358 Location: USA
|
Posted: Thu Jun 19, 2003 3:23 am |
First off, in the trigger pattern, you don't use %1 and %2. zMUD uses whatever's in the first set of () as %1 and whatever's in the second () as %2, etc. So, try:
quote: #TRIGGER {^Rahnkara the highpriestess leaves (*).$} {go %1}
Or, even better, use the conditional trigger:
quote: #TRIGGER {^Rahnkara the highpriestess leaves ({north|east|south|west}).$} {go %1}
If you really want to use an if statement, you can do:
quote: #TRIGGER {^Rahnkara the highpriestess leaves ({north|east|south|west}).(*)} {#IF (%2="") {go %1} {say That was a trick, %2!}
|
|
|
|
superbovine Newbie
Joined: 19 Jun 2003 Posts: 8
|
Posted: Thu Jun 19, 2003 10:35 am |
you da shiznit!
|
|
|
|
|
|
|
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
|
|