Advertisement
DragonSkyMine

Bouton

Mar 4th, 2015
259
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.47 KB | None | 0 0
  1. local x, y, xsize, ysize
  2. local msg = "open"
  3. local mon = peripheral.wrap("top")
  4.  
  5. mon.setBackgroundColor(colors.green)
  6. mon.clear()
  7.  
  8.  
  9. while true do
  10.    
  11.     event, side, xpos, ypos = os.pullEvent("monitor_touch")
  12.    
  13.     if msg == "close" then
  14.         msg = "open"
  15.         mon.setBackgroundColor(colors.green)
  16.         mon.clear()
  17.   rs.setOutput("right", false)
  18.     elseif msg == "open" then
  19.         msg = "close"
  20.      mon.setBackgroundColor(colors.red)
  21.         mon.clear()
  22.   rs.setOutput("right", true)
  23.  end   
  24. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement