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
Crymson4
Novice


Joined: 20 Nov 2001
Posts: 35
Location: USA

PostPosted: Tue Nov 27, 2001 10:55 am   

Interpreting a String literally?
 
I made a trigger to do a pretty simple IF check.

%1 tells you 'Let me in!"

Then the action is.

#IF (%1=@P1) {Do true stuff} {Do false stuff}

Problem is, it's not doing EITHER. Even if %1 matches @P1 EXACTLY (The player name), it won't run the trigger, true or false. Is there something I need to do to tweak it to where it'll match up Strings (text) instead of numbers? (as I've had no problems with it matching numbers in the past)

Thanks.

-=Crymson


Reality is the effect of alcohol deficiency
Reply with quote
Acaila
Apprentice


Joined: 30 Aug 2001
Posts: 187
Location: Netherlands

PostPosted: Tue Nov 27, 2001 11:12 am   
 
You need to put the %1 in the pattern between (), otherwise it won't be saved as a wildcard, and you can't call it with %1 in your value.

#TRIGGER {(%1) tells you 'Let me in!"} {#IF (%1=@P1) {Do true stuff} {Do false stuff}}

Better would be to replace that %1 in your pattern with a more specific wildcard like %w or %x, because the general rule is to only use %1, %2, etc in values, not in patterns.

Acaila
Reply with quote
decantor
Apprentice


Joined: 14 Nov 2001
Posts: 100

PostPosted: Tue Nov 27, 2001 1:36 pm   
 
You might also need to contain @P1 in quotes, though in some circumstances you wont need to.

#TRIGGER {(%w) tells you 'let me in!'} {#IF (%1 = "@P1") {true} {false}
Reply with quote
Crymson4
Novice


Joined: 20 Nov 2001
Posts: 35
Location: USA

PostPosted: Tue Nov 27, 2001 7:08 pm   
 
I knew I had to change the wildcard, but I couldn't remember where, so I defaulted back to %1. Thanks for setting me straight all the way around.

-=Crymson

Reality is the effect of alcohol deficiency
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