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


Joined: 07 Aug 2002
Posts: 9
Location: Australia

PostPosted: Mon Sep 08, 2003 2:12 am   

Trigger Help
 
I dont realy know how to do this but after reading and looking at other triggers i have come up with this trigger .Problem is it always gives me Intelligence potions. Could someone smarter than me please have a look and tell what i am doing wrong.
Pattern You are the proud owner of a (%w) Potion.

%1=@potn
#if (@potn=Orange) {@potn = intelligence} {#if (@potn=Pink) {@potn = constitution} {#if (@potn=magenta) {@potn = wisdom} {#if (%1=Yellow ) {@potn = Strength} {#if (@potn=Blue) {@potn = healing} {#if (@potn=Cyan) {@potn = Mana} {#if (@potn=Clear) {@potn = Restore}}}}}}}
#alarm +3 {
wi water potion
create @potn
}

Zmud 6.62
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Mon Sep 08, 2003 8:25 am   
 
You have your variable assignment backward. Replace %1=@potn with
potn = %1
or
#VAR potn %1

Actually, you could just use %1 for the #IF conditions.
Pattern:
You are the proud owner of [an] (%w) Potion.
Value:
#IF (%1 = Orange) {potn = intelligence}
#IF (%1 = Pink) {potn = constitution}
#IF (%1 = magenta) {potn = wisdom}
#IF (%1 = Yellow) {potn = Strength}
#IF (%1 = Blue) {potn = healing}
#IF (%1 = Cyan) {potn = Mana}
#IF (%1 = Clear) {potn = Restore}
#ALARM +3 {
wi water potion
create @potn
}
Reply with quote
Theoden
Newbie


Joined: 07 Aug 2002
Posts: 9
Location: Australia

PostPosted: Mon Sep 08, 2003 3:42 pm   
 
Thank you ,appreciate your help. But it still didn't work .I made the variable change but it is still only giving me the first potion. I also tried it with %1 and the trigger set you suggested. I think I am missing something ,any other sugestions ?
Reply with quote
krohnu
Beginner


Joined: 09 Mar 2003
Posts: 28

PostPosted: Mon Sep 08, 2003 6:06 pm   
 
I think your trouble stands in one place, I could be wrong but in your if...
#if (@potn=Orange)

that sets @potn to Orange
it should be:
#if (@potn == Orange)

that is a check if equal, not a set to equal.
hope that helps
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Mon Sep 08, 2003 6:31 pm   
 
Yes, you are indeed wrong.
Reply with quote
krohnu
Beginner


Joined: 09 Mar 2003
Posts: 28

PostPosted: Mon Sep 08, 2003 6:46 pm   
 
Hmm.. Odd, oh well but I use the == and it always works for me.
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Mon Sep 08, 2003 6:48 pm   
 
#IF is case sensitive. If you are the proud owner of a Pink potion, @potn will be "constitution". If you are the proud owner of a pink potion, @potn will remain unchanged.

@potn was probably set to "intelligence" the first time you ran your script and hasn't been changed since.
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