getTimer(id).settings.callback( element )
getTimer(id).settings.callback( function )
Warning: until PennController beta 0.2, this command has a bug that freezes the script
Will execute the function or element command when the timer has finished running for the first time.
[js try=”true” highlight=”8″]
newText(“start”, “Ready… go!”)
newButton(“click”, “Click me!”)
.settings.callback( getButton(“click”).remove() )
newText(“success”, “You’re quick!”)
Adds a line of text saying Ready… go! to the screen above a button reading Click me!, then starts a 1s timer and waits for a click on the button. After 1s, the button disappears. The text You’re quick! appears on the page after a click on the button. If the button was not clicked within 1s, the text does not show up and the script waits for a click forever (since the button no longer can be clicked). If the button was clicked, then the button’s
wait command is validated and the text shows up (the button will still disappear after one second, as specified in the callback).