New To Shake Scripting

Hi. I've been working with shake for some time, but never got to write scripts in it. I need a very basic script that turns the opacity of a muzzle flash on and off based on what frame I'm on. I was thinking about using the modulus function, but didn't find any references to it in shake manual.
basically, my line of script looked like this:

if (time%3){
maskPercent = 100}
else if[maskPercent = 0
};

I think there might be a number of problems with it

First of all, is modulus implemented in Shake and if so, what's the syntaxis for it?

Secondly, the command structure goes like if - else if. Does it mean that on the second part (else if) I need to specify the opposite of the statement I used in the first part? Or should I simply leave it the way it is now?

Thank you very much,
Luka

there's a fair bit of how to deal with expressions in th shake manual, in fact i think it's a whole chapter (dont have it with me but i'm quite sure the % function is described too)

so you might want to read up on that, but basically you could take a fade node for your mask and try something like:

(time%3 == 0) ? 1 : 0

read: if time is a multiple of 3 then set opacity to 1 (100%) else to 0