Advertisement
Plazter

asda

Jun 18th, 2013
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.01 KB | None | 0 0
  1. rednet.open("right")
  2. term.clear()
  3. w, h = term.getSize()
  4. term.setCursorPos(1,2)
  5. print("ON")
  6. term.setCursorPos(1,3)
  7. print("OFF")
  8. while true do
  9.  
  10. term.setCursorPos(1,1)
  11. term.setTextColor(colors.white)
  12. print("ForceField:")
  13.  
  14. local event, buttom, w, h = os.pullEvent("mouse_click")
  15. -- ForceField
  16. if buttom == 1 and w == 1 and h == 2 then
  17. term.clear()
  18. term.setCursorPos(1,2)
  19. term.setTextColor(colors.orange)
  20. term.write(">>ON<<")
  21. term.setCursorPos(1,3)
  22. term.setTextColor(colors.white)
  23. term.write("OFF")
  24. rs.setOutput("right",true)
  25. rednet.broadcast("forcefield on")
  26.  
  27. end
  28.  
  29. if buttom == 1 and w == 1 and h == 3 then
  30. rednet.broadcast("forcefield off")
  31. term.clear()
  32. term.setCursorPos(1,2)
  33. term.setTextColor(colors.white)
  34. term.write("ON")
  35. term.setCursorPos(1,3)
  36. term.setTextColor(colors.orange)
  37. term.write(">>OFF<<")
  38. end
  39.  
  40. -- Engines
  41. print("Engines:")
  42.  
  43. if buttom == 1 and w == 1 and h == 5 then --// Engines ON
  44. term.clear()
  45. term.setCursorPos(1,2)
  46. term.setTextColor(colors.orange)
  47. term.write(">>ON<<")
  48. term.setCursorPos(1,3)
  49. term.setTextColor(colors.white)
  50. term.write("OFF")
  51. rs.setOutput("right",true)
  52. rednet.broadcast("engines on")
  53. end
  54.  
  55. if buttom == 1 and w == 1 and h == 6 then
  56. rednet.broadcast("engines off")
  57. term.clear()
  58. term.setCursorPos(1,2)
  59. term.setTextColor(colors.white)
  60. term.write("ON")
  61. term.setCursorPos(1,3)
  62. term.setTextColor(colors.orange)
  63. term.write(">>OFF<<")
  64. end
  65.  
  66. -- Machine
  67. term.setCursorPos(1,8)
  68. print("Machine:")
  69. if buttom == 1 and w == 1 and h == 9 then
  70. term.clear()
  71. term.setCursorPos(1,2)
  72. term.setTextColor(colors.orange)
  73. term.write(">>ON<<")
  74. term.setCursorPos(1,3)
  75. term.setTextColor(colors.white)
  76. term.write("OFF")
  77. rs.setOutput("right",true)
  78. rednet.broadcast("machine on")
  79.  
  80. end
  81.  
  82. if buttom == 1 and w == 1 and h == 10 then
  83. rednet.broadcast("machine off")
  84. term.clear()
  85. term.setCursorPos(1,2)
  86. term.setTextColor(colors.white)
  87. term.write("ON")
  88. term.setCursorPos(1,3)
  89. term.setTextColor(colors.orange)
  90. term.write(">>OFF<<")
  91. end
  92.  
  93.  
  94. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement