kolya5544

controller

Feb 27th, 2017
510
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.65 KB | None | 0 0
  1. local screen = paintutils.loadImage('controlling')
  2. paintutils.drawImage(screen, 1, 1)
  3. while true do
  4. local event, button, x, y = os.pullEvent('mouse_click')
  5. --print('X: ', x, " ", "Y: ", y)
  6. if x>8 and x<15 and y>1 and y<6 then
  7. rednet.send(7,"forward")
  8. elseif x>8 and x<15 and y>13 and y<19 then
  9. rednet.send(7,"back")
  10. elseif x>1 and x<7 and y>7 and y<12 then
  11. rednet.send(7,"left")
  12. elseif x>14 and x<24 and y>7 and y<12 then
  13. rednet.send(7,"right")
  14. elseif x>8 and x<15 and y>7 and y<12 then
  15. rednet.send(7,"fuel")
  16. elseif x>1 and x<7 and y>13 and y<19 then
  17. rednet.send(7,"up")
  18. elseif x>16 and x<24 and y>13 and y<19 then
  19. rednet.send(7,"down")
  20. end
  21. end
Add Comment
Please, Sign In to add comment