|
mgoho Beginner
Joined: 22 Jun 2004 Posts: 17
|
Posted: Thu Nov 11, 2004 6:17 pm
#ADDITEM not working the way I want it to! |
Hey, I'm sure this is a simple fix.
I want to add an item to a string. Easy right?
#TRIGGER {* lance glows brightly, then fades...oops.$} {
#SHOW @enchanttimes
#additem enchants @enchanttimes
#SHOW @enchants
#VARIABLE lancestatus 0
#VARIABLE enchanttimes 0
cast bless lance
cast cont lance
cast 'enchant weapon' lance
}
There's the trigger. Paraphrasing, when the lance I enchant fades, I want to take the variable enchanttimes and add it to the string list enchants. The #SHOW commands are just to see the variable, then show the string list, after the ADDITEM command should have added the variable.
Ok, the problem is it doesn't add the variable if it's already in the string list. i.e. if enchanttimes = 7, and the string list enchants is 3|5|6|7, it won't add it.
Help! |
|
|
|
mortie Wanderer
Joined: 26 Sep 2002 Posts: 73 Location: United Kingdom
|
Posted: Thu Nov 11, 2004 7:14 pm |
Check out the %additem function. This allows duplicates
|
|
Last edited by mortie on Thu Nov 11, 2004 7:18 pm; edited 1 time in total |
|
|
|
mgoho Beginner
Joined: 22 Jun 2004 Posts: 17
|
Posted: Thu Nov 11, 2004 7:15 pm |
How would I incorporate that into my trigger?
|
|
|
|
mortie Wanderer
Joined: 26 Sep 2002 Posts: 73 Location: United Kingdom
|
Posted: Thu Nov 11, 2004 7:25 pm |
e.g
enchants=%additem(@enchanttimes,@enchants)
Its always an idea to check out both the function and the command equivalents in the online help. Useful to understand what both do. |
|
|
|
|
|