Advertisement
meuced

grinder_ctrl

May 27th, 2013
296
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.49 KB | None | 0 0
  1. local x, y
  2. local idChannel = 124
  3. clear()
  4.  
  5. for x=1,3 do
  6.     for y=1,5 do
  7.         paintutils.drawPixel(x, y, colors.red)
  8.     end
  9. end
  10.  
  11. for x=5,7 do
  12.     for y=1,5 do
  13.         paintutils.drawPixel(x, y, colors.green)
  14.     end
  15. end
  16.  
  17. modem = peripheral.wrap("left")
  18.  
  19. while true do
  20.    
  21.     event, side, xpos, ypos = os.pullEvent("monitor_touch")
  22.    
  23.     if xpos >= 1 and xpos<=3 then
  24.         modem.transmit(idChannel,idChannel,"grinder")
  25.     elseif xpos >= 5 and xpos<=7 then
  26.         modem.transmit(idChannel,idChannel,"ouvre")
  27.     end
  28.    
  29. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement