Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local robot = require("robot")
- local comp = require("computer")
- function harvest()
- robot.forward()
- for y=1, 15 do
- -- harvest one line
- robot.useDown()
- robot.useUp()
- robot.suck()
- robot.suck()
- for x=1, 15 do
- robot.forward()
- robot.useDown()
- robot.useUp()
- robot.suck()
- robot.suck()
- end
- -- povorot
- --esli y nechetnoe to
- if y%2 == 1 then
- robot.turnLeft()
- robot.forward()
- robot.turnLeft()
- else
- robot.turnRight()
- robot.forward()
- robot.turnRight()
- end
- end
- -- na posledneij linii
- robot.useDown()
- robot.useUp()
- robot.suck()
- robot.suck()
- for x=1, 15 do
- robot.forward()
- robot.useDown()
- robot.useUp()
- robot.suck()
- robot.suck()
- end
- -- vozvrat
- robot.turnLeft()
- while robot.detect()==false do
- robot.forward()
- end
- robot.turnLeft()
- end
- end
- function unload()
- for c = 1, 32 do
- robot.select(c)
- robot.dropDown()
- end
- end
- end
- while true do
- harvest()
- unload()
- print('sleep')
- os.sleep(1800)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement