1
0

budilnik.qsrc 4.3 KB

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