Difference between revisions of "Scripting Tutorial: Creating a Simple Timer"
Jump to navigation
Jump to search
m
Scripting Tutorial: Creating a Simple Timer (edit)
Revision as of 20:09, 17 July 2009
, 20:09, 17 July 2009→Mechanics: Minor Corrections
imported>Qazaaq m (adding internal links) |
imported>Shademe m (→Mechanics: Minor Corrections) |
||
|
When the condition evaluates false i.e., when the timer variable's value equals or exceeds 5, our message is displayed. Since '''getSecondsPasssed''' returns values that are comparable to realtime seconds, the script has effectively run for 5 seconds.
But the script doesn't end here - it keeps
<pre>scn timerTestScript
if ( doOnce ) ; the == operator isn't necessary when checking boolean values....
return ; ... the above expression is equivalent to (
elseif( timer > 5 )
set doOnce to 1
Message "Your 5 seconds are up"
else
set timer to timer + getSecondsPassed
| |||