Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local component = require("component")
- local robot = component.proxy(component.list("robot")())
- local square = 5
- local depth = 0
- local good = true
- function dumpInventory()
- print("Inventory Full. Dumping to Chest")
- robot.select(1)
- robot.place(1)
- for i = 2, 16 do
- robot.select(i)
- robot.drop(1)
- end
- robot.select(1)
- robot.swing(1)
- robot.select(2)
- end
- function checkInventory()
- if robot.space(16) < 64 then
- dumpInventory()
- end
- end
- -- strip mine down
- while good do
- for i=1, square do
- for j=1, square-1 do
- robot.swing(3)
- robot.move(3)
- checkInventory() -- Check every swing to make sure nothing is lost
- end
- robot.turn(i % 2 == 0)
- if i < 5 then
- robot.swing(3)
- robot.move(3)
- end
- robot.turn(i % 2 == 0)
- end
- robot.swing(0)
- if robot.detect(0) then -- if it hit bedrock
- good = false
- else
- robot.move(0)
- depth = depth+1
- end
- end
- if depth % 2 == 0 then -- If on the opposite corner
- for i = 1, square-1 do
- robot.move(3)
- end
- robot.turn(false)
- for i = 1, square-1 do
- robot.move(3)
- end
- end
- -- Move back up
- for i = 1, depth do
- robot.move(1)
- end
- robot.turn(false) -- Final left turn to face original
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement