onoff123

Untitled

Jun 19th, 2022 (edited)
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.90 KB | None | 0 0
  1. --If you're looking at this,
  2. --I just want to say thank you to all of you for supporting my channel.
  3. --I've never thought my videos would gain that much traction.
  4. --I'll continue to make more Create Mod/Minecraft content in the future (perhaps other things...).
  5. --Feel free to leave a comment in the video after you read this message.
  6. --Cod 3/18/2022
  7.  
  8. --This is probably really terrible code.
  9. --I'm still quite new to Lua (at the time of writing).
  10. --I was originally going to use RFTools, but it's not in the pack...
  11. --At least it gets the job done
  12.  
  13. --Here to steal my password again?
  14.  
  15. os.pullEvent = os.pullEventRaw
  16. os.loadAPI("touchpoint")
  17.  
  18. local monitor = peripheral.wrap("left")
  19. monitor.setTextScale(0.5)
  20. local t = touchpoint.new("left")
  21. local password = "12355"
  22.  
  23. t:add("Pressurize", nil, 2, 3, 14, 5, colors.red, colors.lime)
  24. t:add("Depressurize", nil, 2, 7, 14, 9, colors.red, colors.lime)
  25.  
  26. t:draw()
  27.  
  28. function getPass()
  29. while true do
  30. term.clear()
  31. term.setCursorPos(1,1)
  32. write("Please enter the password: ")
  33. local input = read("*")
  34. if input == password then
  35. term.clear()
  36. term.setCursorPos(1,1)
  37. print("Access granted")
  38. while true do
  39. local event, p1 = t:handleEvents(os.pullEvent())
  40. if event == "button_click" and p1 == "Pressurize" then
  41. t:flash("Pressurize")
  42. rs.setOutput("back", true)
  43. sleep(0.5)
  44. rs.setOutput("back", false)
  45. break
  46. elseif event == "button_click" and p1 == "Depressurize" then
  47. t:flash("Depressurize")
  48. rs.setOutput("right", true)
  49. sleep(0.5)
  50. rs.setOutput("right", false)
  51. sleep(4)
  52. rs.setOutput("right", true)
  53. sleep(0.5)
  54. rs.setOutput("right", false)
  55. break
  56. end
  57. end
  58. else
  59. print("Access denied")
  60. sleep(2)
  61. end
  62. end
  63. end
  64.  
  65. getPass()
Add Comment
Please, Sign In to add comment