Advertisement
Chaos_Cash

Reactor Control

Jul 18th, 2024 (edited)
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. function startup()
  2.  
  3. mon=peripheral.wrap("left")
  4.  
  5. mon.setTextScale(0.5)
  6. end
  7.  
  8.  
  9.  
  10. function menu()
  11. mon.clear()
  12.  
  13. mon.setTextColor(colors.white)
  14. mon.setCursorPos(1,3)
  15. mon.write("Redstone status: ")
  16.  
  17. if redstone.getInput("back") then
  18. mon.setTextColor(colors.green)
  19. mon.write("On")
  20. else
  21. mon.setTextColor(colors.red)
  22. mon.write("Off")
  23. end
  24.  
  25. mon.setTextColor(colors.white)
  26. mon.setCursorPos(1,4)
  27. mon.write("Reactor status: ")
  28.  
  29. if redstone.getInput("bottom") then
  30. mon.setTextColor(colors.green)
  31. mon.write("On")
  32. else
  33. mon.setTextColor(colors.red)
  34. mon.write("Off")
  35. end
  36. end
  37.  
  38.  
  39.  
  40. function main()
  41.  
  42. while true do
  43.  
  44. timer=os.startTimer(0.2)
  45. info1,info2,info3,info4=os.pullEvent()
  46. os.cancelTimer(timer)
  47.  
  48. menu()
  49.  
  50. end
  51.  
  52. end
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59. startup()
  60. menu()
  61. main()
  62.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement