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
Kalus
Beginner


Joined: 01 Dec 2000
Posts: 27

PostPosted: Sun Apr 28, 2002 2:43 pm   

Trigger Problem
 
I'm trying to write a trigger to automatically do things depending on what the leader of the group i'm in does, and would like to make it so i can easily modify the triggers to work when i'm grouped with different people.

Here's the pattern i'm using
%w raises a heavy oak staff into the air.

and here's the value
#IF (@leader==%1) {#SHOW working} {#SHOW NOT}

The Trigger is set off every time as expected, but it never evaluates as true, always false. I'm not really sure if I'm using the variable right in the trigger, I do have the leaders name stored in it correctly though. I remember before being able to see what was stored in each param using the test tab, but it doesn't seem to work that way any more (not sure if that was an older version, or if i messed up the settings some how). Any help would be appreciated, thanks.

Kalus
Reply with quote
Reddytedy
Apprentice


Joined: 13 Oct 2000
Posts: 114
Location: USA

PostPosted: Sun Apr 28, 2002 3:08 pm   
 
quote:

I'm trying to write a trigger to automatically do things depending on what the leader of the group i'm in does, and would like to make it so i can easily modify the triggers to work when i'm grouped with different people.

Here's the pattern i'm using
%w raises a heavy oak staff into the air.

and here's the value
#IF (@leader==%1) {#SHOW working} {#SHOW NOT}

The Trigger is set off every time as expected, but it never evaluates as true, always false. I'm not really sure if I'm using the variable right in the trigger, I do have the leaders name stored in it correctly though. I remember before being able to see what was stored in each param using the test tab, but it doesn't seem to work that way any more (not sure if that was an older version, or if i messed up the settings some how). Any help would be appreciated, thanks.

Kalus



Okay dunno way you are using == in your if statement. That doesn't look like a supported argument.

If %1 = @leader than you want it to work right?

if so use..
^(%w) raises a heavy oak staff into the air.
#IF (%1=@Leader) {#SHOW Working} {#SHOW NOT}

Alan

!v1 return the logical NOT of value1

not v1 same as above

-v1 return the negative of value1

v1 * v2 multiply value1 by value2

v1 / v2 divide v1 by v2. Any fraction is discarded.

v1 v2 divide v1 by v2 and return the modulo

v1 + v2 add value1 to value2. If values are not numeric, the text values are concatenated.

v1 - v2 subtract value2 from value1

v1 = v2 true if value1 is the same as value2

v1 > v2 true if value1 is greater than value2

v1 < v2 true if value1 is less than value2

v1 >= v2 true if value1 is greater than or equal to value2

v1 <= v2 true if value1 is less than or equal to value2

v1 <> v2 true if value1 is not equal to value2

v1 != v2 true if value1 is not equal to value2

v1 =~ v2 true if the string v1 matches the pattern in v2

v1 & v2 returns the logical AND of value1 and value2

v1 and v2 same as above

v1 | v2 returns the logical OR of value1 and value2

v1 or v2 same as above

v1 xor v2 returns the logical XOR of value1 and value2

Come play with us in Dragonrealms

http://www.play.net/dr
Reply with quote
Sildaren
Wanderer


Joined: 19 Jul 2001
Posts: 59
Location: Germany

PostPosted: Sun Apr 28, 2002 4:44 pm   
 
The mistake in the trigger is the pattern.
Use
(%w) raises a heavy oak staff into the air.
the () around the wildcard make zMUD capture the string to the variable %1.
Without () variable %1 is empty (null-length string), and the resulting #IF expression looks like:
#IF (@leader=) ...
which is never true.

PS.
Using == instead of = seems to be undocumented, so I'd avoid it.
(It works, but nowbody guarantees it will keep working 3 versions later).
Reply with quote
Kalus
Beginner


Joined: 01 Dec 2000
Posts: 27

PostPosted: Sun Apr 28, 2002 5:11 pm   
 
i actually tried both suggestions previously w/ no luck, however when i changed it to
#IF (%1=~@Leader), it worked perfect, but i have no idea why.

Kalus
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