Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- robot = require('robot')
- component = require('component')
- local slot = robot.inventorySize()
- local item = component.inventory_controller.getStackInInternalSlot(slot)
- function charge()
- robot.select(slot)
- component.inventory_controller.equip()
- robot.turnRight()
- os.sleep(3)
- robot.drop()
- os.sleep(10)
- robot.suck()
- component.inventory_controller.equip()
- robot.select(1)
- robot.turnLeft()
- end
- function empty()
- for j=2,robot.inventorySize()-1 do
- robot.select(j)
- if robot.count()>0 then
- robot.drop()
- end
- end
- robot.select(1)
- os.sleep(10)
- end
- i=0
- charge()
- while true do
- i=0
- while i<700 do
- robot.select(1)
- if robot.count()>0 then
- robot.place()
- else
- break
- end
- while select(2, robot.detect())=="passable" do
- if i>700 then
- break
- else
- robot.use()
- i=i+1
- print(700-i)
- end
- end
- robot.select(slot)
- component.inventory_controller.equip()
- robot.swing()
- component.inventory_controller.equip()
- end
- empty()
- charge()
- end
Add Comment
Please, Sign In to add comment