Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print("How far do i strip oni-chan?")
- num1 = tonumber(read())
- print("How many times?")
- num2 = tonumber(read())
- print("How deep?")
- num3 = tonumber(read())
- loc = {1,1}
- face = "north"
- resumeloc = {1,0,"north"}
- function search(x)
- for i=1,16,1 do
- if turtle.getItemDetail(i) ~= nil then
- if turtle.getItemDetail(i).name == x then
- return i
- end
- end
- end
- end
- function fuelCheck()
- local a = num1*num2
- local b = turtle.getFuelLevel()
- if a>b then
- return false
- else
- return true
- end
- end
- function refuel()
- local slot = search("minecraft:coal")
- if slot == nil then
- print("i got no fuel")
- turtle.select(1)
- return false
- else
- turtle.select(slot)
- turtle.refuel(turtle.getItemCount())
- turtle.select(1)
- return true
- end
- end
- function locUpdate()
- if face == "north" then
- loc[2] = loc[2] + 1
- elseif face == "south" then
- loc[2] = loc[2] - 1
- elseif face == "east" then
- loc[1] = loc[1] + 1
- elseif face == "west" then
- loc[1] = loc[1] - 1
- end
- end
- function dig(x)
- for i=2, x, 1 do
- turtle.dig()
- while turtle.detect() do
- turtle.dig()
- end
- turtle.forward()
- locUpdate()
- turtle.digUp()
- turtle.digDown()
- if turtle.getItemDetail(16) ~= nil then
- refuel()
- dump()
- end
- end
- end
- function bigDig(x,y)
- for i=1, x , 1 do
- dig(y)
- if i~=x then
- if face == "north" then
- turtle.turnRight()
- face = "east"
- dig(2)
- turtle.turnRight()
- face = "south"
- elseif face == "south" then
- turtle.turnLeft()
- face = "east"
- dig(2)
- turtle.turnLeft()
- face = "north"
- end
- end
- end
- goHome(loc)
- dump()
- end
- function resume(x)
- for i=1 , x[2], 1 do
- turtle.forward()
- locUpdate()
- end
- turtle.turnRight()
- face = "east"
- for i=2 , x[1], 1 do
- turtle.forward()
- locUpdate()
- end
- if resumeloc[3] == "south" then
- turtle.turnRight()
- face = "south"
- elseif resumeloc[3] == "north" then
- turtle.turnLeft()
- face = "north"
- end
- end
- function goHome(x)
- if face == "south" then
- turtle.turnRight()
- elseif face == "north" then
- turtle.turnLeft()
- elseif face == "east" then
- turtle.turnLeft()
- turtle.turnLeft()
- end
- face = "west"
- if x[1] ~= 1 then
- for i=2,x[1],1 do
- turtle.forward()
- locUpdate()
- end
- end
- turtle.turnLeft()
- face = "south"
- for i=2, x[2], 1 do
- turtle.forward()
- locUpdate()
- end
- turtle.turnLeft()
- turtle.turnLeft()
- face = "north"
- end
- function dump()
- turtle.select(1)
- turtle.placeDown()
- for i=1, 16, 1 do
- turtle.select(i)
- turtle.dropDown()
- end
- turtle.select(1)
- turtle.digDown()
- end
- function setup()
- a = num1*num2*1.75
- if turtle.getFuelLevel()<a then
- return(refuel())
- else
- return true
- end
- end
- if setup() then
- for i=1 ,num3 ,1 do
- bigDig(num2,num1)
- if i~=num3 then
- turtle.digDown()
- turtle.down()
- turtle.digDown()
- turtle.down()
- turtle.digDown()
- turtle.down()
- turtle.digDown()
- end
- end
- for j=2, num3, 1 do
- turtle.up()
- turtle.up()
- turtle.up()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement