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
JWhitney
Wanderer


Joined: 20 Oct 2006
Posts: 51

PostPosted: Wed Jun 22, 2011 7:42 pm   

Checking If Integer Is Divisible By..
 
Is there a way to evaluate a number to see if it is divisible by another number? For example, I have a kill counter, and every 10 or so kills I want to check some things with a trigger, but I don't want to have to reset the kill counter and set up #IF's for 10, 20, 30, etc kills.

I'm looking for something like:

#IF (@kills [IS DIVISIBLE BY] 10) {then do this}

I'm probably overlooking it, but thank you for any assistance you may offer.[/code]
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Wed Jun 22, 2011 8:10 pm   
 
#IF (!%mod(@kills,10)) {then do this}
Reply with quote
JWhitney
Wanderer


Joined: 20 Oct 2006
Posts: 51

PostPosted: Wed Jun 22, 2011 8:42 pm   
 
Worked perfectly, thank you!
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