Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local args = {...}
- local stripLength = 35
- local count = 0
- local line = 0
- if not #args == 1 then
- print("Usage: smine <mines>")
- return
- end
- function strip()
- count = 0
- for i=1,stripLength do
- count = count + 1
- 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
- end
- turtle.turnLeft()
- turtle.turnLeft()
- for i=1,stripLength do
- while not turtle.forward() do turtle.dig() end
- 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
- turtle.select(15)
- turtle.digDown()
- sleep(0.2)
- turtle.select(1)
- end
- end
- function emptyInv()
- turtle.select(15)
- while not turtle.placeDown() do turtle.digDown() end
- for i=1,14 do
- turtle.select(i)
- turtle.dropDown()
- end
- turtle.select(15)
- turtle.digDown()
- sleep(0.2)
- turtle.select(1)
- end
- for x=1,args[1] do
- turtle.turnLeft()
- strip()
- strip()
- turtle.turnRight()
- while not turtle.forward() do turtle.dig() end
- while turtle.detectUp() do
- turtle.digUp()
- sleep(0.2)
- end
- while turtle.detectDown() do
- turtle.digDown()
- end
- line = line + 1
- print("Mined " .. x .. ", " .. args[1]-x .. " left to go.")
- end
- emptyInv()
Advertisement
Add Comment
Please, Sign In to add comment