1
0

budilnik 4.0 KB

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