Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local robot = require("robot")
- local computer = require("computer")
- local inv = require("component").inventory_controller
- function go()
- if robot.detect() == false then
- robot.forward()
- else
- os.sleep(.1)
- go()
- end
- end
- function down()
- if robot.detectDown() == false then
- robot.down()
- else
- os.sleep(.1)
- down()
- end
- end
- function up()
- if robot.detectUp() == false then
- robot.up()
- else
- os.sleep(.1)
- up()
- end
- end
- while (true) do
- robot.select(2)
- while (robot.count() < 3) do
- computer.beep(2000, 0.1)
- os.sleep(0.5)
- end
- robot.select(1)
- robot.place()
- up()
- robot.place()
- robot.turnLeft()
- go()
- robot.turnRight()
- robot.place()
- robot.turnRight()
- go()
- go()
- robot.turnLeft()
- robot.place()
- up()
- robot.select(2)
- robot.place()
- robot.turnLeft()
- go()
- robot.turnRight()
- robot.place()
- robot.turnLeft()
- go()
- robot.turnRight()
- robot.place()
- robot.turnRight()
- go()
- while robot.detectDown() == false do
- down()
- end
- robot.turnLeft()
- os.sleep(6)
- while robot.swing() do
- robot.swing()
- end
- robot.select(2)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement