Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local component = require("component")
- local os = require("os")
- local robot = require("robot")
- local LENGTH = 12
- local SLEEP_TIME = 40
- function forward()
- while not robot.forward() do
- os.sleep(1)
- end
- end
- function replaceStone()
- robot.swingDown()
- robot.placeDown()
- end
- while true do
- forward()
- --Row 1
- for i=1,LENGTH do
- replaceStone()
- if i ~=LENGTH then forward() end
- end
- --Row 2
- robot.turnRight()
- forward()
- robot.turnRight()
- for i=1,LENGTH/3 do
- replaceStone()
- forward()
- forward()
- replaceStone()
- if i ~= LENGTH/3 then forward() end
- end
- --Row 3
- robot.turnLeft()
- forward()
- robot.turnLeft()
- for i=1,LENGTH do
- replaceStone()
- if i ~= LENGTH then forward() end
- end
- -- Return
- robot.turnLeft()
- for i=1,2 do forward() end
- robot.turnLeft()
- for i=1,LENGTH do forward() end
- robot.turnRight()
- robot.turnRight()
- os.sleep(SLEEP_TIME)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement