Turn Intervals?

I'm trying to configure something with $gameTroop.turnCount(), but I just realized I don't know how to make it only detect intervals.

EX. I want a function to activate with scripting at turn 2 > 4 > 6 > 8 > 10 > etc. (1 > 3 > 5 > 7, etc. for odd turns)

Instead of having to pick a specific turn (= 10) or above or below (<= / >=).

What would be the best way to do this?
modulo operations. they give you the remainder after dividing
in the case of even numbers, $gameTroop.turnCount()%2===0
in the case of odds, $gameTroop.turnCount()%2===1
@Robro33 Ooh. Very nice.

So if I wanted to have a script call that only activates starting turn 2 and every even turn onward, it'd probably be like:

$gameTroop.turnCount()%2===0 && $gameTroop.turnCount() >= 2
yep. exactly so.
although depending on where its being checked it *might* not be necessary to see if its turn 2 or later. keeping it has no real impact though if its not actually needed however
A'ight. Thread's solved.
I wouldn't know how to write it in script, but yeah! @Robro33 said it best. Respect the Modulo.
20241004_153447.png
This thread is closed due to being reported as solved. If you need it reopened, report the thread to let us know. Thank you!

Original thread: https://forums.rpgmakerweb.com/threads/turn-intervals.172353/