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


Joined: 19 Apr 2004
Posts: 1
Location: USA

PostPosted: Mon Apr 19, 2004 7:22 am   

Little help with a goto trigger.
 
Hi, I tried making a little trigger that'd help me with clan building, but it's giving me some grief so I'm looking for a little help. Here's what I've got so far:

Pattern: goto %1

Value:
#IF (%1 = "clan1") {Goto 100}
#IF (%1 = "clan2") {Goto 200}
#IF (%1 = "clan3") {Goto 300}
etc. etc.

The problem occurs when I try to goto something with two names, say like a dwarven slave, then all of the #IF's are true and takes me to all of the vnums. Any help would be really appreciated.
Reply with quote
Selorien
Newbie


Joined: 02 Apr 2004
Posts: 3

PostPosted: Mon Apr 19, 2004 8:31 am   
 
I'm not completely sure, but i think it would work if you used %-1 instead:

#IF {%-1 = "clan1"} {goto 100}
etc...
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Mon Apr 19, 2004 11:20 am   
 
I believe you want an #ALIAS and not a #TRIGGER.
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Mon Apr 19, 2004 4:25 pm   
 
USE DELIMITERS!!!!!
#IF ("%1" = "clan1")

After substitution, your condition (with no delimiters around %1):
#IF (dwarven slave = "clan1")
Grouping the above gives:
#IF ((dwarven) (slave = "clan1"))
Since 'dwarven' is not a defined condition, it is not evaluated further. 'slave = "clan1"' is false. After evaluating, the condition becomes:
#IF (dwarven 0)
Since there is no operator between dwarven and the 0, this is a string. Strings of 1 or more characters are true. This makes your condition always true when %1 consists of more than one word.
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