Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local robot = require("robot")
- local term = require("term")
- local computer = require("computer")
- local component = require("component")
- local sides = require("sides")
- local keyboard = require("keyboard")
- local function safeForward(x)
- if (x ~= 0) then
- for i = 1, x do
- local canmoveF = nil
- while (canmoveF == nil) do
- canmoveF = robot.forward()
- end
- end
- end
- end
- local function doStuff()
- robot.select(1)
- local compared = robot.compareDown()
- if compared == true then
- robot.swingDown()
- for i = 1, robot.inventorySize() do
- local itemInSlot = component.inventory_controller.getStackInInternalSlot(i)
- if itemInSlot ~= nil then
- if itemInSlot.label == "Stone" then
- robot.select(i)
- end
- end
- end
- robot.placeDown()
- end
- end
- while true do
- safeForward(1)
- robot.turnRight()
- safeForward(1)
- robot.select(2)
- robot.swingDown()
- robot.placeDown()
- robot.turnRight()
- safeForward(1)
- robot.turnRight()
- safeForward(1)
- robot.turnRight()
- for x = 1, 7 do
- robot.swingDown()
- for i = 1, robot.inventorySize() do
- local itemInSlot = component.inventory_controller.getStackInInternalSlot(i)
- if itemInSlot ~= nil then
- if itemInSlot.label == "Stone" then
- robot.select(i)
- end
- end
- end
- robot.placeDown()
- for z = 1, 17 do
- os.sleep(10)
- doStuff()
- safeForward(1)
- os.sleep(10)
- doStuff()
- safeForward(1)
- robot.turnRight()
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement