Guest User

Untitled

a guest
Aug 8th, 2018
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.31 KB | None | 0 0
  1. os.pullEvent = os.pullEventRaw
  2. shell.run("clear")
  3.  
  4. local back = "back"
  5. currentUsername = ("user")
  6. currentPass = ("pass")
  7. currentEdit = ("edit")
  8. loggedIn = false
  9.  
  10. while true do
  11.  
  12. term.clear()
  13. term.setCursorPos(1,1)
  14.  
  15. print("Default username is 'user'.")
  16. print("Default password is 'pass'.")
  17. print("")
  18. print ("username: ")
  19. username = read()
  20. print("")
  21. print ("password: ")
  22. pass = read("*")
  23.  
  24. if pass == (currentPass) and username == (currentUsername) then
  25. print ("correct password. Access granted.")
  26. sleep (1.5)
  27. loggedIn = true
  28. else
  29. print ("FUCK OFF YOU SHITBAG.")
  30. sleep (0.7)
  31. print ("goodbye :D")
  32. sleep (0.2)
  33. os.reboot()
  34. end
  35.  
  36. function menu()
  37. shell.run("clear")
  38. print("-- BPO's Moonshine Still --")
  39. print("[0] All Pumps Off")
  40. print("[1] Pump #1 [3] Pump #3")
  41. print("[2] Pump #2 [4] Pump #4")
  42. print("[5] All Pumps On")
  43. print("[6] Lava [7] Lava Pump")
  44. print("[8] Water [9] Water Pump")
  45. print("[10] Change Username")
  46. print("[11] Change Password")
  47. print("[12] Change Edit Password")
  48. print("[#] Log Off ")
  49. print("")
  50. term.setCursorPos(10,c)
  51. print("<--")
  52. end
  53.  
  54. while loggedIn == true do
  55. local event, p1 = os.pullEvent("key")
  56. c = 2
  57. menu()
  58. if p1 == 200 and c > 2 then
  59. c = c - 1
  60. menu()
  61. elseif p1 == 208 and c < 16 then
  62. c = c + 1
  63. menu()
  64. end
  65. func = c-2
  66. if p1 == 28 then
  67. if func == 0 then
  68. redstone.setBundledOutput(back, 0)
  69. sleep (1)
  70. elseif func == 1 then
  71. redstone.setBundledOutput(back, colors.blue)
  72. sleep (1)
  73. elseif func == 2 then
  74. redstone.setBundledOutput(back, colors.green)
  75. sleep (1)
  76. elseif func == 3 then
  77. redstone.setBundledOutput(back, colors.red)
  78. sleep (1)
  79. elseif func == 4 then
  80. redstone.setBundledOutput(back, colors.white)
  81. sleep (1)
  82. elseif func == 5 then
  83. redstone.setBundledOutput(back, colors.blue+colors.green+colors.red+colors.white+colors.magenta+colors.orange+colors.pink+colors.gray)
  84. sleep (1)
  85. elseif func == 6 then
  86. redstone.setBundledOutput(back, colors.magenta)
  87. sleep (1)
  88. elseif func == 7 then
  89. redstone.setBundledOutput(back, colors.orange)
  90. sleep (1)
  91. elseif func == 8 then
  92. redstone.setBundledOutput(back, colors.pink)
  93. sleep (1)
  94. elseif func == 9 then
  95. redstone.setBundledOutput(back, colors.gray)
  96. sleep (1)
  97. elseif func == 10 then
  98. print("Password: ")
  99. pass = read("*")
  100. if pass == (currentPass) then
  101. print("Correct password.")
  102. print("What do you want the new username to be?")
  103. username = read("*")
  104. print("Username changed.")
  105. currentUsername = (username)
  106. print("")
  107. print("Your new username is now")
  108. print(currentUsername)
  109. sleep (2)
  110. else
  111. print("wrong password.")
  112. sleep (2)
  113. end
  114. elseif func == 11 then
  115. print("Old password: ")
  116. pass = read("*")
  117. if pass == (currentPass) then
  118. print("Correct password.")
  119. print("What do you want the new password to be?")
  120. pass = read("*")
  121. print("Password changed.")
  122. currentPass = (pass)
  123. print("")
  124. print("Your password is now")
  125. print(currentPass)
  126. sleep (2)
  127. else
  128. print("wrong password.")
  129. sleep (2)
  130. end
  131. elseif func == 12 then
  132. print("Default edit password is 'edit'.")
  133. print("Edit Password: ")
  134. edit = read("*")
  135. if edit == (currentPass) then
  136. print("Correct password.")
  137. print("What do you want the new edit password to be?")
  138. edit = read("*")
  139. print("Password changed.")
  140. currentEdit = (edit)
  141. print("")
  142. print("Your Edit password is now")
  143. print(currentEdit)
  144. sleep (2)
  145. else
  146. print("wrong password.")
  147. sleep (2)
  148. end
  149. elseif func == currentEdit then
  150. shell.run("edit","startup")
  151. elseif func == 14 then
  152. loggedIn = false
  153. print("logging off.")
  154. sleep (0.7)
  155. print("logging off. .")
  156. sleep (0.7)
  157. print("logging off. . .")
  158. sleep (0.6)
  159. os.shutdown()
  160. else
  161. os.reboot()
  162. end
  163. end
  164. end
  165. end
Add Comment
Please, Sign In to add comment