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


Joined: 23 Feb 2002
Posts: 23

PostPosted: Fri Apr 06, 2007 1:14 am   

Math Confusion
 
Ok, so I am trying to make an alarm that will decrease the value of each item in a database variable every second. The code in the alarm is :

Code:

#loopdb @failsafe {
#if (%val < 0) {
#delkey failsafe %key
} {
#addkey failsafe %key (%val-1)
#echo %val %key
}
}


However, the %val-1 seems to always evaluate to -1 rather than decreasing %val by 1.
I've tried a bunch of ways using #math and other things, but I can't seem to figure it out. I'm probably doing something wrong, so if someone could point it out I would greatly appreciate it.
Reply with quote
benjunmun
Beginner


Joined: 23 Feb 2002
Posts: 23

PostPosted: Fri Apr 06, 2007 1:16 am   
 
Ah, wait, I figured it out. I need to use %number on the %val to make it evaluate as a number. Would this be a bug in the autotyping?
Reply with quote
Zugg
MASTER


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

PostPosted: Fri Apr 06, 2007 4:25 am   
 
Sounds like a bug in the autotyping for %val. I've added it to the bug list. Thanks for reporting it.
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