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")
- robot.select(1)
- function chop()
- robot.select(1)
- if robot.compare() == true then do
- robot.swing()
- robot.select(2)
- robot.place()
- robot.select(1)
- os.sleep(30)
- end
- else
- do
- robot.select(15)
- component.inventory_controller.equip()
- robot.use()
- robot.use()
- robot.use()
- component.inventory_controller.equip()
- end
- end
- end
- function unload()
- robot.turnAround()
- for c = 3, 14 do
- robot.select(c)
- if robot.count() > 0 then
- robot.drop()
- end
- end
- robot.select(1)
- robot.turnAround()
- end
- function charge()
- robot.select(16)
- component.inventory_controller.equip()
- robot.dropDown()
- os.sleep(25)
- robot.suckDown()
- component.inventory_controller.equip()
- robot.select(1)
- end
- while true do
- if robot.detect() == true then
- chop()
- end
- if robot.count(3) == 64 then
- unload()
- end
- if robot.count(2) < 2 then
- robot.turnRight()
- robot.suck()
- robot.turnLeft()
- end
- if robot.durability() < 0.2 then do
- break
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement