Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local args = {...}
- local stripLength = 32
- if not #args == 1 then
- print("Usage: smine <mines>")
- return
- end
- function strip()
- for i=1,stripLength do
- checkFuel()
- checkInv()
- while not turtle.forward() do turtle.dig() end
- while turtle.detectUp() do
- turtle.digUp()
- sleep(0.2)
- end
- while turtle.detectDown() do
- turtle.digDown()
- sleep(0.2)
- end
- if i%8 == 0 then
- turtle.select(16)
- while not turtle.forward() do turtle.dig() end
- while turtle.detectUp() do
- turtle.digUp()
- sleep(0.2)
- end
- if not turtle.back() then
- turtle.turnLeft()
- turtle.turnLeft()
- while not turtle.forward do turtle.dig() end
- turtle.turnLeft()
- turtle.turnLeft()
- end
- turtle.placeUp()
- turtle.select(1)
- end
- end
- turtle.turnLeft()
- turtle.turnLeft()
- for i=1,stripLength do
- while not turtle.forward() do turtle.dig() end
- end
- end
- function checkFuel()
- if turtle.getFuelLevel() <= 64 then
- print("Error: Low fuel")
- for i=1,14 do
- turtle.select(i)
- turtle.refuel()
- end
- end
- end
- function advance()
- print("Moving to next stripmine")
- for y=1,3 do
- turtle.dig() -- Digs first Block in front
- turtle.forward()
- turtle.digUp()
- turtle.up()
- turtle.digUp()
- turtle.down()
- end
- end
- function checkInv()
- isFull = true
- for i=1,14 do
- if turtle.getItemCount(i) == 0 then
- isFull = false
- end
- end
- if isFull == true then
- turtle.select(15)
- while not turtle.placeDown() do turtle.digDown() end
- for i=1,14 do
- turtle.select(i)
- turtle.dropDown()
- end
- end
- end
- print("Place torches in slot 16")
- print("Place chest/s in slot 15 (will be automatically placed and filled when inventory is full)")
- for x=1,args[1] do
- turtle.turnLeft()
- strip()
- strip()
- turtle.turnRight()
- advance()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement