The blink rate is controlled by the thisSecond where 1000 is 1 second and 100 is 10 times per second, which I find to be way to fast for clients to ever see. All they see is the token turning off in the beginning and on at the end of timer.
Code: Select all
[H: time = json.get(getInfo("client"),"timeInMs")]
[H: endTime = 3000]
[H, if(json.isEmpty(macro.args)), code: {
[H: startTime = time]
[H: lastSecond = 0]
[H: ids = getSelected()]
};{
[H: startTime = getStrProp(macro.args,"startTime")]
[H: lastSecond = getStrProp(macro.args,"lastSecond")]
[H: ids = getStrProp(macro.args,"ids")]
}]
[H: elapsedTime = time - startTime]
[H: thisSecond = floor(elapsedTime/500)]
[H, foreach(id,ids), code: {
[H, if(thisSecond > lastSecond), code: {
[H: setVisible(1 - getVisible(id),id)]
[H: setState("Hidden",1 - getState("Hidden",id),id)]
};{}]
}]
[H, if(elapsedTime < endTime), code: {
[H: args = strformat("startTime=%{startTime};lastSecond=%{thisSecond};ids=%{ids}")]
[H: link = macroLinkText("blink@this","none",args)]
[H: execLink(link,1)]
};{
[H, foreach(id,ids), code: {
[H: setVisible(1,id)]
[H: setState("Hidden",0,id)]
}]
}]