Machica38

On button

Aug 21st, 2013
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.33 KB | None | 0 0
  1. --On button:
  2.  
  3. rednet.open("right")
  4. m = peripheral.wrap("left")
  5. m.setBackgroundColor(colors.lime)
  6. m.clear()
  7. m.setCursorPos(3,2)
  8. m.write("On")
  9. while true do
  10.  event, left, x, y = os.pullEvent("monitor_touch")
  11.   if
  12.    x and y then
  13.     rednet.send(1, "on")
  14.     shell.run("off")
  15.   else
  16.    print("lol")
  17.    shell.run("off")
  18. end
  19. end
Advertisement
Add Comment
Please, Sign In to add comment