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


Joined: 27 Oct 2001
Posts: 16
Location: USA

PostPosted: Thu Aug 22, 2002 4:00 am   

Uh, help with a trigger?
 
Mud output:
Beggar leaves south.
or
Lookout leaves south.
right now my @badbad is set for lookout. and this is my trigger:
#TRIGGER {(%w) leaves (%w).} {%if ( %lower(%1)==@badbad) %2}
why when the begger leaves i follow instead of just lookout? what am I missing? please?

Ryan Young
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: Thu Aug 22, 2002 5:03 am   
 
#TRIGGER {(%w) leaves (%w).} {#IF ( %lower(%1)==@badbad) {%2}}


Ton Diening
Reply with quote
Charbal
GURU


Joined: 15 Jun 2001
Posts: 654
Location: USA

PostPosted: Thu Aug 22, 2002 7:41 am   
 
Since == is not officially a valid operator (see here), you should use = which is used for both comparison and assignment in zScript unlike some other programming languages.

So:
#TRIGGER {(%w) leaves (%w).} {#IF (%lower(%1)=@badbad) {%2}}

If you aren't planning on having the trigger do anything when the person leaving _isn't_ @badbad, you can simplify it further:

#TRIGGER {@badbad leaves (%w).} {%1}



 - Charbal
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