Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
adamandkate
Wanderer


Joined: 14 Oct 2009
Posts: 57

PostPosted: Mon Dec 21, 2009 3:04 pm   

adding numbers to a key ?
 
I currently have this simple script (thanks to the fantastic help of mattlofton)

#if (%iskey(@mylist,%4)) {#addkey mylist %4 %1}

Is there a way to make it ADD %1 to the current key.. rather then replace its current value?

eg..

mylist = one=14|two=28|three=6

if %1 = 10 and %4 = two..

it would lead to a variable of


mylist = one=14|two=38|three=6

where as currently it causes


mylist = one=14|two=10|three=6

Tried to use the math function to do what i want without much luck. will keep trying tho

thanks guys[url][/url]
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Mon Dec 21, 2009 5:23 pm   
 
#addkey mylist %4 (%db(@mylist,%4)+%1)
Reply with quote
adamandkate
Wanderer


Joined: 14 Oct 2009
Posts: 57

PostPosted: Tue Dec 22, 2009 9:15 pm   
 
thats great. thanks zugg. enjoy your xmas break
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD 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