Advertisement
nethaxion

Tick Timer

May 4th, 2024
30
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.08 KB | Gaming | 0 0
  1. <?xml version="1.0" encoding="ISO-8859-1" ?>
  2. <cmud>
  3. <class name="TickTimer" copy="yes">
  4. <trigger priority="192090" copy="yes">
  5. <pattern>$--&gt; Turn.</pattern>
  6. <value>#GAG
  7. //#TSET 60
  8. STARTCOUNTDOWNSEC 59</value>
  9. </trigger>
  10. <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">
  11. <caption>Tick in @timerDisplay</caption>
  12. <expr>(@timerMinutes * 60) + @timerSeconds</expr>
  13. <gaugemax>@timerMax</gaugemax>
  14. <gaugelow>10</gaugelow>
  15. </button>
  16. <trigger name="CountdownTimer" type="Alarm" priority="10" copy="yes">
  17. <pattern>*1</pattern>
  18. <value>#if (@timerMinutes == 0 &amp;&amp; @timerSeconds == 0) {
  19. #T- CountdownTimer
  20. }
  21. #if (@timerSeconds &lt; 1) {
  22. timerMinutes = @timerMinutes - 1
  23. timerSeconds = 59
  24. }
  25. timerDisplay = @DisplayTime()
  26. timerSeconds = @timerSeconds - 1</value>
  27. </trigger>
  28. <var name="timerDisplay" copy="yes">00:52</var>
  29. <var name="timerMinutes" usedef="true" copy="yes">0</var>
  30. <alias name="StartCountdownMin" copy="yes">
  31. <value>#if ($minutes == %null) {AdjustMinutes 1} {AdjustMinutes $minutes}
  32. timerSeconds = 0
  33. timerDisplay = @DisplayTime()
  34. #T+ CountdownTimer</value>
  35. <arglist>$minutes</arglist>
  36. </alias>
  37. <var name="timerSeconds" usedef="true" copy="yes">51</var>
  38. <func name="DisplayTime" copy="yes">
  39. <value>#if (@timerMinutes &lt; 0) {
  40. timerMinutes = 0
  41. timerSeconds = 0
  42. }
  43. #return %concat(%if(@timerMinutes &gt; 0,@timerMinutes,%concat(0,@timerMinutes)),":",%if(@timerSeconds &gt; 9,@timerSeconds,%concat(0,@timerSeconds)))</value>
  44. </func>
  45. <alias name="StopCountdown" copy="yes">
  46. <value>#T- CountdownTimer
  47. timerMinutes = 0
  48. timerSeconds = 0
  49. timerDisplay = "00:00"</value>
  50. </alias>
  51. <alias name="ResumeCountdown" copy="yes">
  52. <value>#T+ CountdownTimer</value>
  53. </alias>
  54. <alias name="AdjustMinutes" copy="yes">
  55. <value>#if ($value &gt; 60) {
  56. timerMinutes = 59
  57. timerMax = (60 * 60)
  58. } {
  59. #if ($value &lt; 0) {
  60. timerMinutes = 0
  61. } {
  62. timerMinutes = $value
  63. timerMax = ($value * 60)
  64. }
  65. }
  66. timerSeconds = 0</value>
  67. <arglist>$value</arglist>
  68. </alias>
  69. <var name="timerMax" usedef="true" copy="yes">59</var>
  70. <alias name="PauseCountdown" copy="yes">
  71. <value>#T- CountdownTimer</value>
  72. </alias>
  73. <alias name="StartCountdownSec" copy="yes">
  74. <value>#if ($seconds == %null) {AdjustSeconds 1} {AdjustSeconds $seconds}
  75. timerMinutes = 0
  76. timerDisplay = @DisplayTime()
  77. #T+ CountdownTimer</value>
  78. <arglist>$seconds</arglist>
  79. </alias>
  80. <alias name="AdjustSeconds" copy="yes">
  81. <value>#if ($value &gt; 60) {
  82. timerSeconds = 60
  83. timerMax = 60
  84. } {
  85. #if ($value &lt; 0) {
  86. timerSeconds = 0
  87. } {
  88. timerSeconds = $value
  89. timerMax = $value
  90. }
  91. }
  92. timerMinutes = 0</value>
  93. <arglist>$value</arglist>
  94. </alias>
  95. </class>
  96. </cmud>
  97.  
Tags: mud cmud ANSALON
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement