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
mgoho
Beginner


Joined: 22 Jun 2004
Posts: 17

PostPosted: 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!
Reply with quote
mortie
Wanderer


Joined: 26 Sep 2002
Posts: 73
Location: United Kingdom

PostPosted: 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
Reply with quote
mgoho
Beginner


Joined: 22 Jun 2004
Posts: 17

PostPosted: Thu Nov 11, 2004 7:15 pm   
 
How would I incorporate that into my trigger?
Reply with quote
mortie
Wanderer


Joined: 26 Sep 2002
Posts: 73
Location: United Kingdom

PostPosted: 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.
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