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 leafBlower()
- robot.select(4)
- inv.equip()
- while robot.detectUp() == false do
- robot.up()
- end
- while robot.detectUp() == true do
- robot.swingUp()
- robot.up()
- robot.up()
- end
- while robot.detectDown() == false do
- robot.down()
- end
- os.sleep(1)
- robot.up()
- inv.equip()
- robot.select(2)
- end
- function routine()
- _, det = robot.detect()
- if det == 'solid' then
- while robot.detect() == true do
- robot.swing()
- end
- return "chop"
- elseif det == 'passable' then
- robot.select(2)
- inv.equip()
- for i = 1, 10 do
- robot.use()
- end
- robot.select(2)
- inv.equip()
- return "grow"
- else
- robot.select(1)
- robot.place()
- return "plant"
- end
- end
- function lumbMain()
- b = 0
- while robot.durability() ~= 0 do
- if routine() == "chop" then
- leafBlower()
- end
- robot.suckUp()
- b = b + 1
- if b == 100 then
- for i = 5, 16 do
- robot.select(i)
- robot.dropDown()
- end
- b = 0
- end
- robot.select(2)
- end
- robot.select(2)
- inv.equip()
- robot.dropDown()
- while robot.count(2) == 0 do
- comp.beep()
- os.sleep(1)
- end
- robot.select(1)
- lumbMain()
- end
- lumbMain()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement