|
Theoden Newbie
Joined: 07 Aug 2002 Posts: 9 Location: Australia
|
Posted: 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 |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: 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
} |
|
|
|
Theoden Newbie
Joined: 07 Aug 2002 Posts: 9 Location: Australia
|
Posted: 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 ?
|
|
|
|
krohnu Beginner
Joined: 09 Mar 2003 Posts: 28
|
Posted: 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 |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Mon Sep 08, 2003 6:31 pm |
Yes, you are indeed wrong.
|
|
|
|
krohnu Beginner
Joined: 09 Mar 2003 Posts: 28
|
Posted: Mon Sep 08, 2003 6:46 pm |
Hmm.. Odd, oh well but I use the == and it always works for me.
|
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: 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. |
|
|
|
|
|