Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local robot = require("robot")
- local comp = require("computer")
- local component = require("component")
- local inv = component.inventory_controller
- local term = require("term")
- local sides = require("sides")
- function rechTool()
- robot.select(2)
- robot.turnRight()
- robot.drop()
- os.sleep(2)
- robot.suck()
- robot.turnLeft()
- end
- function checkTool()
- robot.select(2)
- inv.equip()
- dur = robot.durability()
- inv.equip()
- return dur
- end
- function routine()
- _, det = robot.detect()
- if det == 'solid' then
- robot.swing()
- robot.use(1, true)
- robot.use(1, true)
- for i = 1, 4 do
- robot.swingUp()
- robot.up()
- end
- while robot.detectDown() == 0 do
- robot.down()
- end
- robot.use(1, true)
- robot.suckUp()
- elseif det == 'passable' then
- robot.select(2)
- inv.equip()
- for i = 1, 10 do
- robot.use()
- end
- robot.select(2)
- inv.equip()
- else
- robot.select(1)
- robot.place()
- end
- end
- function lumbMain()
- b = 0
- while robot.count(16) < 63 do
- routine()
- robot.suckUp()
- b = b + 1
- if b == 100 then
- if checkTool() == 0 then
- break
- rechTool()
- end
- b = 0
- end
- end
- for i = 4, 16 do
- robot.select(i)
- robot.dropDown()
- end
- robot.select(1)
- lumbMain()
- end
- lumbMain()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement