Machica38

Monitor touch

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