Awhile back Toan created this code for me to make an incremental counter. This is working perfect thank you. However, I now need the counter to pause/delay for just a moment for 500 milliseconds when it reaches 50, 125, 250 and then not advance past 400. I’ve tried adding another setTimer but just can’t get it to work! Any help would be much appreciated. Many thanks in advance.
Thank you so much for your speedy responses. This problem has been driving me mad! It’s almost working. Is there a way I can control the delay/pause time separately, as i need to adjust it the increment speed at times? Also when its counting up, as times when i stop with a mouseup at 50, 125, 250 it won’t continue counting up when i press the mouse again. I really appreciate your help. Many thanks.
I don’t believe it, I thought this was done! My client has changed their firmware. When the ‘variableValue’ is = 0 (zero), ‘clickHoldCount’ should read as CONT (short for continuous) instead of 0. It never counts below CONT (0). I’ve tried doing it but again have messed up your lovely setup. Any help would be greatly appreciated.
You can remove the clickHoldCount number variable in your project, then add it again with the type TEXT and the initial value CONT.
After that change the script as follows:
// look for this line
var variableValue = prez.variable(countVariable);
// replace the above line by this one:
var variableValue = parseInt(prez.variable(countVariable)) || 0;