Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?xml version="1.0" encoding="ISO-8859-1" ?>
- <cmud>
- <class name="TickTimer" copy="yes">
- <trigger priority="192090" copy="yes">
- <pattern>$--> Turn.</pattern>
- <value>#GAG
- //#TSET 60
- STARTCOUNTDOWNSEC 59</value>
- </trigger>
- <button name="btnTimer" type="Gauge" autosize="false" width="200" height="40" autopos="false" left="-4" top="-4" toolbar="0" toolstyle="true" color="green" textcolor="white" border="silver" gaugelowcol="red" priority="40" copy="yes">
- <caption>Tick in @timerDisplay</caption>
- <expr>(@timerMinutes * 60) + @timerSeconds</expr>
- <gaugemax>@timerMax</gaugemax>
- <gaugelow>10</gaugelow>
- </button>
- <trigger name="CountdownTimer" type="Alarm" priority="10" copy="yes">
- <pattern>*1</pattern>
- <value>#if (@timerMinutes == 0 && @timerSeconds == 0) {
- #T- CountdownTimer
- }
- #if (@timerSeconds < 1) {
- timerMinutes = @timerMinutes - 1
- timerSeconds = 59
- }
- timerDisplay = @DisplayTime()
- timerSeconds = @timerSeconds - 1</value>
- </trigger>
- <var name="timerDisplay" copy="yes">00:52</var>
- <var name="timerMinutes" usedef="true" copy="yes">0</var>
- <alias name="StartCountdownMin" copy="yes">
- <value>#if ($minutes == %null) {AdjustMinutes 1} {AdjustMinutes $minutes}
- timerSeconds = 0
- timerDisplay = @DisplayTime()
- #T+ CountdownTimer</value>
- <arglist>$minutes</arglist>
- </alias>
- <var name="timerSeconds" usedef="true" copy="yes">51</var>
- <func name="DisplayTime" copy="yes">
- <value>#if (@timerMinutes < 0) {
- timerMinutes = 0
- timerSeconds = 0
- }
- #return %concat(%if(@timerMinutes > 0,@timerMinutes,%concat(0,@timerMinutes)),":",%if(@timerSeconds > 9,@timerSeconds,%concat(0,@timerSeconds)))</value>
- </func>
- <alias name="StopCountdown" copy="yes">
- <value>#T- CountdownTimer
- timerMinutes = 0
- timerSeconds = 0
- timerDisplay = "00:00"</value>
- </alias>
- <alias name="ResumeCountdown" copy="yes">
- <value>#T+ CountdownTimer</value>
- </alias>
- <alias name="AdjustMinutes" copy="yes">
- <value>#if ($value > 60) {
- timerMinutes = 59
- timerMax = (60 * 60)
- } {
- #if ($value < 0) {
- timerMinutes = 0
- } {
- timerMinutes = $value
- timerMax = ($value * 60)
- }
- }
- timerSeconds = 0</value>
- <arglist>$value</arglist>
- </alias>
- <var name="timerMax" usedef="true" copy="yes">59</var>
- <alias name="PauseCountdown" copy="yes">
- <value>#T- CountdownTimer</value>
- </alias>
- <alias name="StartCountdownSec" copy="yes">
- <value>#if ($seconds == %null) {AdjustSeconds 1} {AdjustSeconds $seconds}
- timerMinutes = 0
- timerDisplay = @DisplayTime()
- #T+ CountdownTimer</value>
- <arglist>$seconds</arglist>
- </alias>
- <alias name="AdjustSeconds" copy="yes">
- <value>#if ($value > 60) {
- timerSeconds = 60
- timerMax = 60
- } {
- #if ($value < 0) {
- timerSeconds = 0
- } {
- timerSeconds = $value
- timerMax = $value
- }
- }
- timerMinutes = 0</value>
- <arglist>$value</arglist>
- </alias>
- </class>
- </cmud>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement