Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function Fuel()
- if turtle.getFuelLevel() == 0 then
- turtle.refuel(1)
- end
- end
- function Forward()
- Fuel()
- for i=1,5 do
- if turtle.detect() then
- turtle.dig()
- end
- end
- return turtle.forward()
- end
- function FForward()
- while Forward() == false do
- end
- end
- function FBack()
- Fuel()
- if turtle.back() == false then
- turtle.turnLeft()
- turtle.turnLeft()
- FForward()
- turtle.turnLeft()
- turtle.turnLeft()
- end
- end
- function Up()
- Fuel()
- for i=1,5 do
- if turtle.detectUp() then
- turtle.digUp()
- end
- end
- return turtle.up()
- end
- function FUp()
- while Up() == false do
- end
- end
- function Down()
- Fuel()
- for i=1,5 do
- if turtle.detectDown() then
- turtle.digDown()
- end
- end
- return turtle.down()
- end
- function FDown()
- while Down() == false do
- end
- end
- function InfUp()
- local x = 0
- while (turtle.detectUp()) and (Up()) do
- x = x+1
- end
- for i=1,x do
- FDown()
- end
- end
- function InfDown()
- local x = 0
- while Down() do
- x = x+1
- end
- for i=1,x do
- FUp()
- end
- end
- function CleanInventory()
- for i=2,16 do
- turtle.select(i)
- turtle.drop(64)
- end
- turtle.select(1)
- end
- function Refuel()
- turtle.suck(64)
- for i=2,16 do
- if turtle.getItemCount(i) > 0 then
- data = turtle.getItemDetail(i)
- if (data.name == 'minecraft:coal') then
- turtle.select(i)
- turtle.drop(64)
- turtle.select(1)
- end
- end
- end
- end
- function ThrowAway()
- for i=2,16 do
- if turtle.getItemCount(i) > 0 then
- data = turtle.getItemDetail(i)
- if isBlackListed(data) then
- turtle.select(i)
- turtle.dropDown(64)
- end
- end
- end
- turtle.select(1)
- end
- function isBlackListed(data)
- if data.name == 'minecraft:stone' then
- return true
- end
- if data.name == 'minecraft:cobblestone' then
- return true
- end
- if data.name == 'minecraft:dirt' then
- return true
- end
- if data.name == 'minecraft:grass' then
- return true
- end
- if data.name == 'minecraft:sand' then
- return true
- end
- if data.name == 'minecraft:gravel' then
- return true
- end
- if data.name == 'minecraft:bedrock' then
- return true
- end
- if data.name == 'minecraft:water' then
- return true
- end
- if data.name == 'minecraft:flowing_water' then
- return true
- end
- if data.name == 'minecraft:lava' then
- return true
- end
- if data.name == 'minecraft:flowing_lava' then
- return true
- end
- if data.name == 'chisel:limestone2' then
- return true
- end
- if data.name == 'chisel:marble2' then
- return true
- end
- if data.name == 'buildcraftenergy:fluid_block_oil_heat_0' then
- return true
- end
- return false
- end
- MAXDEPTH = 50
- function filon(depth)
- if depth >= MAXDEPTH then
- return true
- end
- local success,data = turtle.inspectUp()
- if success and (isBlackListed(data) == false) then
- FUp()
- filon(depth+1)
- FDown()
- end
- success,data = turtle.inspectDown()
- if success and (isBlackListed(data) == false) then
- FDown()
- filon(depth+1)
- FUp()
- end
- for i=1,4 do
- success,data = turtle.inspect()
- if success and (isBlackListed(data) == false) then
- FForward()
- filon(depth+1)
- FBack()
- end
- turtle.turnRight()
- end
- end
- function goBack(X,Y,Z)
- for i=1,Z do
- FUp()
- end
- for i=1,Y do
- FBack()
- end
- turtle.turnLeft()
- for i=1,X do
- FBack()
- end
- end
- function goForward(X,Y,Z)
- for i=1,X do
- FForward()
- end
- turtle.turnRight()
- for i=1,Y do
- FForward()
- end
- for i=1,Z do
- FDown()
- end
- end
- function verFilon()
- local z = 0
- while Down() do
- z = z+1
- ThrowAway()
- filon(0)
- end
- for i=1,z do
- FUp()
- end
- end
- wid,iX,iY = ...
- wid = tonumber(wid)
- iX = tonumber(iX)
- iY = tonumber(iY)
- while (iX < wid) or (iY < wid) do
- x = 4*iX+2
- y = 4*iY+2
- goForward(x,y,0)
- Z=0
- while Down() do
- Z = Z+1
- if (Z%4 == 0) then
- ThrowAway()
- end
- filon(0)
- if turtle.getItemCount(16) > 0 then
- goBack(x,y,Z)
- turtle.turnLeft()
- Refuel()
- turtle.turnLeft()
- CleanInventory()
- turtle.turnLeft()
- turtle.turnLeft()
- goForward(x,y,Z)
- end
- end
- goBack(x,y,Z)
- turtle.turnLeft()
- Refuel()
- turtle.turnLeft()
- CleanInventory()
- turtle.turnLeft()
- turtle.turnLeft()
- iY = iY +1
- if iY >= wid then
- iX = iX +1
- iY = 0
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement