Advertisement
geremy44

Bouton_Em

Feb 9th, 2022
711
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.45 KB | None | 0 0
  1. --ID : 4
  2. local mon = peripheral.wrap("back")
  3. rednet.open("right")
  4. while true do
  5.   local event, button, xPos, yPos = os.pullEvent("monitor_touch")
  6.   --print(xPos..yPos)
  7.   if (xPos > 2 and xPos < 8) and (yPos > 4 and yPos < 7) then
  8.     print("> On")
  9.     rednet.send(5,"On")
  10.     rednet.send(2,"Man")
  11.   elseif (xPos > 10 and xPos < 18) and (yPos > 4 and yPos < 7) then
  12.     print("> Auto")
  13.     rednet.send(5,"Off")
  14.     rednet.send(2,"Auto")
  15.   end
  16. end
  17.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement