Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local component = require("component")
- local robot = component.proxy(component.list("robot")() or error("No robot component"))
- local sides = require("sides")
- local length = 10
- local width = 3
- function move(right)
- robot.turn(right)
- robot.move(sides.front)
- robot.turn(not right)
- robot.move(sides.back)
- end
- function select(direction)
- while not robot.compare(sides.down) do
- robot.select(robot.select() % robot.inventorySize() + direction)
- end
- end
- function start()
- right = true
- direction = 1
- for y = 1, length-1 do
- for x = 1, width do
- select(direction)
- robot.move(sides.front)
- robot.place(sides.down)
- if x < width then
- move(right)
- end
- end
- right = not right
- direction = -direction
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement