Guest User

Untitled

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