Advertisement
meuced

Porte3x3_bouton

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