Guest User

Untitled

a guest
Oct 10th, 2018
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 4.13 KB | None | 0 0
  1. os.pullEvent = os.pullEventRaw
  2. function clear()
  3. term.clear()
  4. term.setCursorPos(1)
  5. end
  6.  
  7. function choose2()
  8. term.clear()
  9. term.setCursorPos(1,1)
  10. print(" Log-in   <exit>")
  11. ev, k = os.pullEvent()
  12. if k == 203 or k == 205 then
  13. sleep(0.2)
  14. choose()
  15. elseif k == 28 then
  16. term.clear()
  17. term.setCursorPos(1,1)
  18. print("----------")
  19. print("----------")
  20. print("")
  21. print("----------")
  22. print("----------")
  23. sleep(0.5)
  24. term.clear()
  25. term.setCursorPos(1,1)
  26. print("----------")
  27. print("----------")
  28. print("000")
  29. print("----------")
  30. print("----------")
  31. sleep(0.5)
  32. term.clear()
  33. term.setCursorPos(1,1)
  34. print("----------")
  35. print("----------")
  36. print("000000")
  37. print("----------")
  38. print("----------")
  39. sleep(0.5)
  40. term.clear()
  41. term.setCursorPos(1,1)
  42. print("----------")
  43. print("----------")
  44. print("0000000000")
  45. print("----------")
  46. print("----------")
  47. sleep(1)
  48. textutils.slowPrint("Shutting down the computer")
  49. sleep(1)
  50. os.shutdown()
  51. else
  52. sleep(0.2)
  53. choose2()
  54. end
  55. end
  56.  
  57. function correctlock()
  58. write"Password: "
  59. lock = read("*")
  60. if lock == "pass" then
  61. print("correct please edit some files and make it better")
  62. else
  63. textutils.slowPrint("Username or Password incorrect, rebooting        computer...")
  64. sleep(1)
  65. os.reboot()
  66. end
  67. end
  68.  
  69. function lock()
  70. term.clear()
  71. term.setCursorPos(1,1)
  72. write"Username: "
  73. lock = read()
  74. if lock == "admin" then
  75. correctlock()
  76. else
  77. write"Password: "
  78. input = read("*")
  79. sleep(0.5)
  80. textutils.slowPrint("Username or Password is incorrect, rebooting      computer...")
  81. sleep(1)
  82. os.reboot()
  83. end
  84. end
  85.  
  86.  
  87.  
  88. function guest()
  89. term.clear()
  90. term.setCursorPos(1,1)
  91. sleep(0.5)
  92. print("Prepare for startup, please wait until done.")
  93. sleep(0.5)
  94. term.clear()
  95. term.setCursorPos(1,1)
  96. print("00000")
  97. print("    0")
  98. print("00000")
  99. print("    0")
  100. print("00000")
  101. sleep(1)
  102. term.clear()
  103. term.setCursorPos(1,1)
  104. print("00000")
  105. print("    0")
  106. print("00000")
  107. print("0")
  108. print("00000")
  109. sleep(1)
  110. term.clear()
  111. term.setCursorPos(1,1)
  112. print("  0  ")
  113. print(" 00  ")
  114. print("0 0  ")
  115. print("  0  ")
  116. print("00000")
  117. sleep(1)
  118. term.clear()
  119. term.setCursorPos(1,1)
  120. print("Computer succesfully logged-in!")
  121. sleep(2)
  122. term.clear()
  123. term.setCursorPos(1,1)
  124. textutils.slowPrint("Welcome guest")
  125. textutils.slowPrint("Your options: ")
  126. textutils.slowPrint("1. Game (default game)")
  127. textutils.slowPrint("2. About")
  128. textutils.slowPrint("3. Logg-off")
  129. textutils.slowPrint("please select your choose by typping 1, 2 or 3")
  130. q = read()
  131. if q == "1" then
  132. shell.run("worm")
  133. guest()
  134. elseif q == "2" then
  135. term.clear()
  136. term.setCursorPos(1,1)
  137. print("This is version v0.6")
  138. print("Made by guusje4525")
  139. print("")
  140. print("")
  141. print("This computer will restart in: ")
  142. print("00000")
  143. print("0")
  144. print("00000")
  145. print("    0")
  146. print("00000")
  147. sleep(1)
  148. term.setCursorPos(1,6)
  149. print("0   0")
  150. print("0   0")
  151. print("00000")
  152. print("    0")
  153. print("    0")
  154. sleep(1)
  155. term.setCursorPos(1,6)
  156. print("00000")
  157. print("    0")
  158. print("00000")
  159. print("    0")
  160. print("00000")
  161. sleep(1)
  162. term.setCursorPos(1,6)
  163. print("00000")
  164. print("    0")
  165. print("00000")
  166. print("0    ")
  167. print("00000")
  168. sleep(1)
  169. term.setCursorPos(1,6)
  170. print(" 00  ")
  171. print("0 0  ")
  172. print("  0  ")
  173. print("  0  ")
  174. print("00000")
  175. sleep(1)
  176. os.shutdown()
  177. elseif q == "3" then
  178. term.clear()
  179. term.setCursorPos(1,1)
  180. login()
  181. else
  182. print("incorrect option")
  183. print("the file may removed or check you spelling")
  184. sleep(1.5)
  185. guest()
  186. end
  187. end
  188.  
  189. function login()
  190. term.clear()
  191. term.setCursorPos(1,1)
  192. print(";------------------------------;")
  193. print(";  (Please enter you username) ;")
  194. print(";------------------------------;")
  195. print(";                              ;")
  196. print(";------------------------------;")
  197. print(";  (available accounts:        ;")
  198. print(";  (admin and guest)           ;")
  199. term.setCursorPos(4,4)
  200. user = read()
  201. if user == "guus" then
  202. print("oo hello guus")
  203. lock()
  204. elseif user == "admin" then
  205. lock()
  206. else
  207. guest()
  208. end
  209. end
  210.  
  211.  
  212.  
  213. function choose()
  214. term.clear()
  215. term.setCursorPos(1,1)
  216. print("<Log-in>   exit")
  217.  
  218. ev, k = os.pullEvent()
  219.  
  220. if k == 203 or k == 205 then
  221. sleep(0.2)
  222. choose2()
  223. elseif k == 28 then
  224. login()
  225. else
  226. sleep(0.2)
  227. choose()
  228. end
  229. end
  230.  
  231.  
  232. choose()
Add Comment
Please, Sign In to add comment