Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local robot = require("robot")
- local moving = true
- local invPos = 1
- function verifyInv()
- if(robot.count(invPos) == 0) then
- invPos = invPos + 1
- if(invPos > (robot.inventorySize() - 1) or robot.count(invPos) == 0) then
- return false
- end
- robot.select(invPos)
- end
- return true
- end
- function replaceBlock()
- local check = verifyInv()
- if(check) then
- robot.swingUp()
- robot.placeUp()
- end
- return check
- end
- while moving do
- for move=1,93 do
- moving = robot.forward()
- if(not moving) then
- break
- end
- end
- if(not moving) then
- break
- end
- if(not replaceBlock()) then
- break
- end
- robot.forward()
- robot.turnLeft()
- robot.forward()
- if(not replaceBlock()) then
- break
- end
- robot.forward()
- robot.turnRight()
- robot.forward()
- if(not replaceBlock()) then
- break
- end
- robot.forward()
- robot.turnLeft()
- robot.forward()
- if(not replaceBlock()) then
- break
- end
- robot.forward()
- robot.turnRight()
- robot.forward()
- if(not replaceBlock()) then
- break
- end
- robot.forward()
- robot.turnLeft()
- robot.forward()
- if(not replaceBlock()) then
- break
- end
- robot.forward()
- robot.turnRight()
- robot.forward()
- if(not replaceBlock()) then
- break
- end
- robot.turnRight()
- for move=1,6 do
- moving = robot.forward()
- if(not moving) then
- break
- end
- end
- if(not moving) then
- break
- end
- robot.turnLeft()
- end
Advertisement
Add Comment
Please, Sign In to add comment