1
0

budilnik.qsrc 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  1. # budilnik
  2. menu_off = 1
  3. if $ARGS[0] = 'start':
  4. *clr & cla
  5. gs 'stat'
  6. '<center><img <<$set_imgh>> src="images/shared/home/bedroom/bed2.jpg"></center>'
  7. *nl
  8. *nl
  9. if numbud = 4:'<center><b><<bud1>><<bud2>>:<<bud3>><<bud4>></b></center>'
  10. if numbud = 3:'<center><b><<bud1>><<bud2>>:<<bud3>></b><<bud4>></center>'
  11. if numbud = 2:'<center><b><<bud1>><<bud2>></b>:<<bud3>><<bud4>></center>'
  12. if numbud = 1:'<center><b><<bud1>></b><<bud2>>:<<bud3>><<bud4>></center>'
  13. if numbud = 0:'<center><<bud1>><<bud2>> : <<bud3>><<bud4>></center>'
  14. *nl
  15. '<center><b><a href="exec:gt ''budilnik'', ''1''">1</a> <a href="exec:gt ''budilnik'', ''2''">2</a> <a href="exec:gt ''budilnik'', ''3''">3</a></b></center>'
  16. '<center><b><a href="exec:gt ''budilnik'', ''4''">4</a> <a href="exec:gt ''budilnik'', ''5''">5</a> <a href="exec:gt ''budilnik'', ''6''">6</a></b></center>'
  17. '<center><b><a href="exec:gt ''budilnik'', ''7''">7</a> <a href="exec:gt ''budilnik'', ''8''">8</a> <a href="exec:gt ''budilnik'', ''9''">9</a></b></center>'
  18. '<center><b><a href="exec:gt ''budilnik'', ''0''">0</a></b></center>'
  19. '<center><b><a href="exec: bud_weekend = 0 & gt ''budilnik'', ''Reset''">Reset (week)</a> <a href="exec: bud_weekend = 0 & gt ''budilnik'', ''Time''">Set this time for the week</a></b></center>'
  20. '<center><b><a href="exec: bud_weekend = 1 & gt ''budilnik'', ''Reset''">Reset (weekend)</a> <a href="exec: bud_weekend = 1 & gt ''budilnik'', ''Time''">Set this time for the weekend</a></b></center>'
  21. *nl
  22. if budilnikOn = 0:
  23. '<center>Your alarm is currently turned <a href="exec: budilnikOn = 1 & gt ''budilnik'', ''start''"><b>off</a></b></center>'
  24. else
  25. '<center>Your alarm is currently turned <a href="exec: budilnikOn = 0 & gt ''budilnik'', ''start''"><b>on</b></a></center>'
  26. '<center>The alarm is set to '+iif(timer < 10,'0<<timer>>','<<timer>>')+':'+iif(timerM < 10,'0<<timerM>>','<<timerM>>')+' during the week and to '+iif(timerEnd < 10,'0<<timerEnd>>','<<timerEnd>>')+':'+iif(timerEndM < 10,'0<<timerEndM>>','<<timerEndM>>')+' during the weekend.</center>'
  27. end
  28. act 'Finish':
  29. cla
  30. bud1 = 0
  31. bud2 = 0
  32. bud3 = 0
  33. bud4 = 0
  34. numbud = 0
  35. gt 'budilnik', 'fin'
  36. end
  37. end
  38. if $ARGS[0] = 'Time':
  39. cla
  40. budilnikOn = 1
  41. if bud_weekend = 1:
  42. timerEnd = bud1 * 10 + bud2
  43. timerEndM = bud3 * 10 + bud4
  44. if timerEnd > 23:timerEnd = 0
  45. if timerEndM > 60:timerEndM = 0
  46. else
  47. timer = bud1 * 10 + bud2
  48. timerM = bud3 * 10 + bud4
  49. if timer > 23:timer = 0
  50. if timerM > 60:timerM = 0
  51. end
  52. gt 'budilnik', 'start'
  53. end
  54. if $ARGS[0] = '1':
  55. cla
  56. !!if numbud = 4:end
  57. if numbud = 3:bud4 = 1 & numbud = 4
  58. if numbud = 2:bud3 = 1 & numbud = 3
  59. if numbud = 1:bud2 = 1 & numbud = 2
  60. if numbud = 0:bud1 = 1 & numbud = 1
  61. gt 'budilnik', 'start'
  62. end
  63. if $ARGS[0] = '2':
  64. cla
  65. !!if numbud = 4:end
  66. if numbud = 3:bud4 = 2 & numbud = 4
  67. if numbud = 2:bud3 = 2 & numbud = 3
  68. if numbud = 1:bud2 = 2 & numbud = 2
  69. if numbud = 0:bud1 = 2 & numbud = 1
  70. gt 'budilnik', 'start'
  71. end
  72. if $ARGS[0] = '3':
  73. cla
  74. !!if numbud = 4:end
  75. if numbud = 3:bud4 = 3 & numbud = 4
  76. if numbud = 2:bud3 = 3 & numbud = 3
  77. if numbud = 1:bud2 = 3 & numbud = 2
  78. if numbud = 0:bud1 = 3 & numbud = 1
  79. gt 'budilnik', 'start'
  80. end
  81. if $ARGS[0] = '4':
  82. cla
  83. !!if numbud = 4:end
  84. if numbud = 3:bud4 = 4 & numbud = 4
  85. if numbud = 2:bud3 = 4 & numbud = 3
  86. if numbud = 1:bud2 = 4 & numbud = 2
  87. if numbud = 0:bud1 = 4 & numbud = 1
  88. gt 'budilnik', 'start'
  89. end
  90. if $ARGS[0] = '5':
  91. cla
  92. !!if numbud = 4:end
  93. if numbud = 3:bud4 = 5 & numbud = 4
  94. if numbud = 2:bud3 = 5 & numbud = 3
  95. if numbud = 1:bud2 = 5 & numbud = 2
  96. if numbud = 0:bud1 = 5 & numbud = 1
  97. gt 'budilnik', 'start'
  98. end
  99. if $ARGS[0] = '6':
  100. cla
  101. !!if numbud = 4:end
  102. if numbud = 3:bud4 = 6 & numbud = 4
  103. if numbud = 2:bud3 = 6 & numbud = 3
  104. if numbud = 1:bud2 = 6 & numbud = 2
  105. if numbud = 0:bud1 = 6 & numbud = 1
  106. gt 'budilnik', 'start'
  107. end
  108. if $ARGS[0] = '7':
  109. cla
  110. !!if numbud = 4:end
  111. if numbud = 3:bud4 = 7 & numbud = 4
  112. if numbud = 2:bud3 = 7 & numbud = 3
  113. if numbud = 1:bud2 = 7 & numbud = 2
  114. if numbud = 0:bud1 = 7 & numbud = 1
  115. gt 'budilnik', 'start'
  116. end
  117. if $ARGS[0] = '8':
  118. cla
  119. !!if numbud = 4:end
  120. if numbud = 3:bud4 = 8 & numbud = 4
  121. if numbud = 2:bud3 = 8 & numbud = 3
  122. if numbud = 1:bud2 = 8 & numbud = 2
  123. if numbud = 0:bud1 = 8 & numbud = 1
  124. gt 'budilnik', 'start'
  125. end
  126. if $ARGS[0] = '9':
  127. cla
  128. !!if numbud = 4:end
  129. if numbud = 3:bud4 = 9 & numbud = 4
  130. if numbud = 2:bud3 = 9 & numbud = 3
  131. if numbud = 1:bud2 = 9 & numbud = 2
  132. if numbud = 0:bud1 = 9 & numbud = 1
  133. gt 'budilnik', 'start'
  134. end
  135. if $ARGS[0] = '0':
  136. cla
  137. !!if numbud = 4:end
  138. if numbud = 3:bud4 = 0 & numbud = 4
  139. if numbud = 2:bud3 = 0 & numbud = 3
  140. if numbud = 1:bud2 = 0 & numbud = 2
  141. if numbud = 0:bud1 = 0 & numbud = 1
  142. gt 'budilnik', 'start'
  143. end
  144. if $ARGS[0] = 'Reset':
  145. cla
  146. if bud_weekend = 1:
  147. timerEnd = 0
  148. timerEndM = 0
  149. else
  150. timer = 0
  151. timerM = 0
  152. end
  153. bud1 = 0
  154. bud2 = 0
  155. bud3 = 0
  156. bud4 = 0
  157. numbud = 0
  158. gt 'budilnik', 'start'
  159. end
  160. if $ARGS[0] = 'fin': gt $loc, $metka
  161. --- budilnik ---------------------------------