How would I do this?
I'm starting to think this:
if(text2num(copytext("[Attacker.HPIV/4]",lentext("[Attacker.HPIV/4]")-1,lentext("[Attacker.HPIV/4]")))==2)
...
But it looks a little long...
ID:270440
May 8 2006, 1:32 pm (Edited on May 8 2006, 1:48 pm)
|
|
I trying to implement odd formulas (this one requiring the use of only remainders :) ) I need to check if the remainder of n divided by 4, equals 2 or 3.
How would I do this? I'm starting to think this: if(text2num(copytext("[Attacker.HPIV/4]",lentext("[Attacker.HPIV/4]")-1,lentext("[Attacker.HPIV/4]")))==2) But it looks a little long... |
Mega fart cannon wrote:
I need to check if the remainder of n divided by 4, equals 2 or 3. If I understand what you want correctly, you should use the % operator. Something like the following should work: mob/verb/Remainder() If you just want to know if it's 2 or 3, but doesn't matter which:
if(n%4==2 || n%4==3)
*Edit* Dratz, beaten again! |
if(n % 4 == 2 || n % 4 == 3)
...