Well I have been doing the following for single button:
In script:
Code:
def si = new groovy.lang.GroovyClassLoader(); si.addClasspath("scripts/Denial/");
def ss = si.loadClass("Functions");
if(!ss.countDown(this, "Hurry up and get naked.", "Naked", 30)){
show("Don't keep me waiting like that, bitch!\nGive your balls 10 slaps");
}
In Function.groovy
Code:
def static countDown(main, message, button, time){
boolean stop = false;
boolean onTime = false;
def timedButton;
while(!stop && time>0){
main.show(time + "\n\n\n" + message);
timedButton = main.showButton(button, 1);
if(timedButton!=1){
stop = true;
onTime = true;
}
time--;
}
return onTime;
}
This all works fine, and shows a countdown, where you will have returned "false" to the script if the timer has run out, and "true" if you reported in time.
Now I just need to see if I can find a workaround with several buttons...
You cannot time getSelectedValue(), can you?