Advertisement
MigasRocha

Reactor Button On/Off (Rafa) New

Jan 7th, 2024 (edited)
988
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.31 KB | None | 0 0
  1. while true do
  2. rednet.open("left")
  3.  
  4. m = peripheral.wrap("front")
  5.  
  6. term.redirect(m)
  7.  
  8. m.clear()
  9.  
  10. function Normal()
  11.  
  12. m.clear()        
  13. m.setTextColor(colors.purple)
  14. m.setCursorPos(1,1)
  15. m.write("Reator")
  16. m.setTextColor(colors.green)
  17. m.setCursorPos(1,3)
  18. m.write("On")
  19. m.setTextColor(colors.red)
  20. m.setCursorPos(1,5)
  21. m.write("Off")
  22. end
  23.    
  24. function Danger()
  25.  
  26. m.clear()
  27. m.setTextColor(colors.purple)
  28. m.setCursorPos(1,1)
  29. m.write("Reator")
  30. m.setTextColor(colors.red)
  31. m.setCursorPos(1,3)
  32. m.write("DANGER")
  33. m.setTextColor(colors.red)
  34. m.setCursorPos(1,5)
  35. m.write("Off")
  36. end
  37.  
  38. Normal()
  39.  
  40.  
  41. event, side, x, y = os.pullEvent("monitor_touch")
  42.  
  43. if x > 0 and x < 4 and y == 3 and code == 1 then
  44. m.setTextColor(colors.purple)
  45. m.setCursorPos(1,1)
  46. m.write("Reator")
  47. m.setTextColor(colors.green)
  48. m.setCursorPos(1,3)
  49. m.write("On")
  50. m.setTextColor(colors.red)
  51. m.setCursorPos(1,5)
  52. m.write("Off")
  53. m.setCursorPos(5,3)
  54. m.setTextColor(colors.yellow)
  55. m.write("X")
  56. sleep(0.2)
  57.   end
  58.      
  59. if x > 0 and x < 3 and y == 5 then
  60. m.setTextColor(colors.purple)
  61. m.setCursorPos(1,1)
  62. m.write("Reator")
  63. m.setTextColor(colors.green)
  64. m.setCursorPos(1,3)
  65. m.write("On")
  66. m.setTextColor(colors.red)
  67. m.setCursorPos(1,5)
  68. m.write("Off")
  69. m.setCursorPos(5,5)
  70. m.setTextColor(colors.yellow)
  71. m.write("X")
  72. sleep(0.2)
  73. end
  74.  
  75.     end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement