Advertisement
Guest User

reactor

a guest
Sep 17th, 2014
230
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.53 KB | None | 0 0
  1. term.setCursorPos(1,1)
  2. print("Reactor CONTROL")
  3. term.setCursorPos(1,2)
  4. term.setTextColor(colors.white)
  5. term.setBackgroundColor(colors.red)
  6. print("ON")
  7. term.setCursorPos(1,4)
  8. print("OFF")
  9.  
  10.  
  11. while true do --loop for the button
  12.   local event, button, X, Y = os.pullEventRaw()
  13.     if(event == "mouse_click") then
  14.       if(X >=1 and X <=2 and Y==2 and button ==1) then
  15.         rs.setOutput("back",true)
  16.      
  17.       elseif(X >=1 and X <=3 and Y==4 and button ==1) then
  18.         rs.setOutput("back",false)
  19.       end
  20.     end
  21. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement