1
0

budilnik 4.5 KB

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