getTimer(id).settings.callback( element ) or 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. Example: [js try=”true” highlight=”8″] newText(“start”, “Ready… go!”) .print() , newButton(“click”, “Click me!”) .print() , newTimer(“hurry”, 1000) .settings.callback( …
Wiki Category Archives:
textinput.settings.text
getTextInput(id).settings.text(“string”) (since beta 0.3) (Re)sets the text in the input box. [js highlight=”11″ try=”true”]newTextInput(“poem”, “”) .settings.before( newText(“flowers”, “Violets are blue, roses are red, “) ) .print() , newButton(“validate”, “Validate”) .print() .wait() .remove() , getTextInput(“poem”) .settings.disable() .settings.text(“DISABLED”)[/js] Adds a one-line input box to the screen preceded with Violets are blue, roses are red, on its left, …
textinput.settings.once
getTextInput(id).settings.once() Disables the input box after the key enter/return has been pressed for the first time while editing. [js highlight=”3″ try=”true”]newTextInput(“poem”, “”) .settings.before( newText(“flowers”, “Violets are blue, roses are red, “) ) .settings.once() .print() .wait() [/js] Adds a one-line input box to the screen preceded with Violets are blue, roses are red, on its left …
textinput.settings.log
getTextInput(id).settings.log() or getTextInput(id).settings.log(“final”) (since beta 0.3) or getTextInput(id).settings.log(“validate”) (since beta 0.3) or getTextInput(id).settings.log(“first”) (since beta 0.3) or getTextInput(id).settings.log(“last”) (since beta 0.3) or getTextInput(id).settings.log(“all”) (since beta 0.3) or getTextInput(id).settings.log(“final”, “first”, …) (since beta 0.3) Will add a line to the result file containing the text in the input box at the moment of the event. By …
textinput.settings.lines
getTextInput(id).settings.lines( number ) Sets the maximum number of lines for the input box (1 by default). As a special case, you set it to 0 to remove the limit constraint. Example: [js highlight=”2″ try=”true”]newTextInput(“haiku”, “hatsu shigure\nsaru mo komino o\nhoshige nari”) .settings.lines(3) .print()[/js] Adds a 3-line input box to the screen containing a haiku (note the …
textinput.settings.length
getTextInput(id).settings.length( number ) (since beta 0.3) Limits the maximum number of characters that can be entered in the input box. 0 or lower means no limit (default setting). Note that linebreaks count as characters in the limit (\n and \r). Example: [js highlight=”2″ try=”true”]newTextInput(“haiku”, “hatsu shigure\nsaru mo komino o\nhoshige nari”) .settings.length(45) .settings.lines(3) .print()[/js] Adds a …
text.settings.text
getText(id).settings.text( string ) Resets the text of the element. Example: [js highlight=”8″ try=”true”]newText(“onlyTextOnScreen”, “You have not pressed the spacebar yet”) .print() , newKey(“spacebar”, ” “) .wait() , getText(“onlyTextOnScreen”) .settings.text(“Now you have pressed the spacebar.”) [/js] Updates the text after the spacebar was presssed.
selector.settings.shuffle
getSelector(id).settings.shuffle() (deprecated since beta 0.3) or getSelector(id).settings.shuffle( element1, element2, … ) See the action command
selector.settings.once
getSelector(id).settings.once() Disables the selector after the first selection has happened. Example: [js highlight=”9″ try=”true”] newImage(“square”, “square.png”) , newImage(“triangle”, “triangle.png”) .settings.before( getImage(“square”) ) .print() , newSelector(“shapes”) .settings.add( getImage(“square”) , getImage(“triangle”) ) .settings.once() [/js] Adds two images side by side and a button to click below them. Any selection is definitive: further clicks will not move the …
selector.settings.log
getSelector(id).settings.log() or getSelector(id).settings.log(“first”) (since beta 0.4) or getSelector(id).settings.log(“last”) (since beta 0.4) or getSelector(id).settings.log(“all”) A line will be added to the results file when an element is selected indicating its reference name and the timestamp of selection. Leaving the parentheses blank or calling “last” will log the last selection. Calling “first” will log the first selection. …