1
0

budilnik.qsrc 4.2 KB

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