Advertisement
Guest User

Untitled

a guest
Aug 20th, 2014
199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.09 KB | None | 0 0
  1. os.pullEvent = os.pullEventRaw
  2. passwort = 7989
  3. count = 0
  4. a = 0
  5. b = 0
  6. c = 0
  7. d = 0
  8. eingabe = 0
  9. zugang = 0
  10.  
  11. function Rahmen()
  12. shell.run("clear")
  13. term.setTextScale(5)
  14. term.setBackgroundColor(colors.green)
  15. term.setCursorPos(3,2)
  16. print("123")
  17. term.setCursorPos(3,3)
  18. print("456")
  19. term.setCursorPos(3,4)
  20. print("789")
  21. end
  22.  
  23. term.setBackgroundColor(colors.black)
  24.  
  25. function Eingabe()
  26. while count < 4 do
  27. event,side,x,y = os.pullEvent()
  28. if event == "monitor_touch" then
  29.  
  30. if x == 3 and y == 2 then
  31. count = count + 1
  32. if count == 1 then
  33. a = 1
  34. term.setBackgroundColor(colors.black)
  35. write("*")
  36. elseif count == 2 then
  37. b = 1
  38. write("*")
  39. elseif count == 3 then
  40. c = 1
  41. write("*")
  42. elseif count == 4 then
  43. d = 1
  44. write("*")
  45. end
  46. end
  47.  
  48. if x == 4 and y == 2 then
  49. count = count + 1
  50. if count == 1 then
  51. a = 2
  52. term.setBackgroundColor(colors.black)
  53. write("*")
  54. elseif count == 2 then
  55. b = 2
  56. write("*")
  57. elseif count == 3 then
  58. c = 2
  59. write("*")
  60. elseif count == 4 then
  61. d = 2
  62. write("*")
  63. end
  64. end
  65.  
  66. if x == 5 and y == 2 then
  67. count = count + 1
  68. if count == 1 then
  69. a = 3
  70. term.setBackgroundColor(colors.black)
  71. write("*")
  72. elseif count == 2 then
  73. b = 3
  74. write("*")
  75. elseif count == 3 then
  76. c = 3
  77. write("*")
  78. elseif count == 4 then
  79. d = 3
  80. write("*")
  81. end
  82. end
  83.  
  84. if x == 3 and y == 3 then
  85. count = count + 1
  86. if count == 1 then
  87. a = 4
  88. term.setBackgroundColor(colors.black)
  89. write("*")
  90. elseif count == 2 then
  91. b = 4
  92. write("*")
  93. elseif count == 3 then
  94. c = 4
  95. write("*")
  96. elseif count == 4 then
  97. d = 4
  98. write("*")
  99. end
  100. end
  101.  
  102. if x == 4 and y == 3 then
  103. count = count + 1
  104. if count == 1 then
  105. a = 5
  106. term.setBackgroundColor(colors.black)
  107. write("*")
  108. elseif count == 2 then
  109. b = 5
  110. write("*")
  111. elseif count == 3 then
  112. c = 5
  113. write("*")
  114. elseif count == 4 then
  115. d = 5
  116. write("*")
  117. end
  118. end
  119.  
  120. if x == 5 and y == 3 then
  121. count = count + 1
  122. if count == 1 then
  123. a = 6
  124. term.setBackgroundColor(colors.black)
  125. write("*")
  126. elseif count == 2 then
  127. b = 6
  128. write("*")
  129. elseif count == 3 then
  130. c = 6
  131. write("*")
  132. elseif count == 4 then
  133. d = 6
  134. write("*")
  135. end
  136. end
  137.  
  138. if x == 3 and y == 4 then
  139. count = count + 1
  140. if count == 1 then
  141. a = 7
  142. term.setBackgroundColor(colors.black)
  143. write("*")
  144. elseif count == 2 then
  145. b = 7
  146. write("*")
  147. elseif count == 3 then
  148. c = 7
  149. write("*")
  150. elseif count == 4 then
  151. d = 7
  152. write("*")
  153. end
  154. end
  155.  
  156. if x == 4 and y == 4 then
  157. count = count + 1
  158. if count == 1 then
  159. a = 8
  160. term.setBackgroundColor(colors.black)
  161. write("*")
  162. elseif count == 2 then
  163. b = 8
  164. write("*")
  165. elseif count == 3 then
  166. c = 8
  167. write("*")
  168. elseif count == 4 then
  169. d = 8
  170. write("*")
  171. end
  172. end
  173.  
  174. if x == 5 and y == 4 then
  175. count = count + 1
  176. if count == 1 then
  177. a = 9
  178. term.setBackgroundColor(colors.black)
  179. write("*")
  180. elseif count == 2 then
  181. b = 9
  182. write("*")
  183. elseif count == 3 then
  184. c = 9
  185. write("*")
  186. elseif count == 4 then
  187. d = 9
  188. write("*")
  189. end
  190. end
  191.  
  192. end
  193. end
  194. count = 0
  195. end
  196.  
  197. while true do
  198. Rahmen()
  199. Eingabe()
  200.  
  201. eingabe = (""..a..""..b..""..c..""..d.."")
  202. zugang = (passwort-eingabe)
  203. if zugang == 0 then
  204. write("OK")
  205. rs.setOutput("bottom", true)
  206. sleep(3,5)
  207. rs.setOutput("bottom", false)
  208. else write("FALSCH")
  209. end
  210.  
  211. sleep(3)
  212. term.setBackgroundColor(colors.black)
  213. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement