|
DanaLea Beginner
Joined: 31 Jul 2002 Posts: 19 Location: USA
|
Posted: Sat May 17, 2003 7:34 am
Coding help (varibles and triggers) |
I'm trying to change a variable value with a trigger. I have a variable called weapon that I want loaded with my current weapon, and I want the value updated whenever I change weapons automaticly. The mud issues a command like: "You wield Urania's Circle of Stars." the trigger I have is {^You wield &weapon} which works just fine. But here's the problem. When I dual weild, the mud message is somthin glike "You wield Dirt Claws in your off-hand." which puts "Dirt Claws in your off-hand." into my weapon variable. I want the dirt claws to be in my dual variable. Can anyone help me with this?
thanks in advance
-dana |
|
|
|
mega_ Beginner
Joined: 15 May 2003 Posts: 16 Location: Estonia
|
Posted: Sat May 17, 2003 8:23 am |
#TR {^You wield (%*) in your off-hand.} {#variable dualweapon %1}
If you want to just the first word then use (%w)* |
|
|
|
DanaLea Beginner
Joined: 31 Jul 2002 Posts: 19 Location: USA
|
Posted: Sat May 17, 2003 8:52 am |
it's still putting it in the @weapon slot. is there a way to have both? my main weapon in the @weapon slot and my dual weapon in the @dual slot?
|
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Sat May 17, 2003 9:02 am |
Don't use %*. There's no reason to.
#TR {^You wield (*).} {#IF (%ends( "%1", "in your off-hand")) {#VAR dual {%remove( "in your off-hand", "%1"}} {#VAR weapon {%1}}}
LightBulb
Advanced Member |
|
|
|
DanaLea Beginner
Joined: 31 Jul 2002 Posts: 19 Location: USA
|
Posted: Sat May 17, 2003 9:55 am |
Thank you, that works perfectly. :)
-dana |
|
|
|
DanaLea Beginner
Joined: 31 Jul 2002 Posts: 19 Location: USA
|
Posted: Wed May 21, 2003 4:10 pm |
ok, it's not so perfect.
it works fine while i'm logged into the game. but if i log out, even if i do not close zMud, then log back in, both varibles change to "Claws", they don't maintian their values. here's the trigger:
^You wield (*).
#IF (%ends( "%1", "in your off-hand")) {#VAR dual {%remove( "in your off-hand", "%1"}} {#VAR weapon {%1}}
and below that, in a split screnen/window, it says there is a syntax error with "^ syntax error" pointing at the first } after "in your off-hand", "%1"}}
any help?
-Dana |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Wed May 21, 2003 6:26 pm |
That means at some point you assigned those variables a default value of Claws. Remove the default value and uncheck "Use default value".
It's missing a ).
#IF (%ends( "%1", "in your off-hand")) {#VAR dual {%remove( "in your off-hand", "%1")}} {#VAR weapon {%1}}
LightBulb
Advanced Member |
|
|
|
|
|