Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function mine(dir,mode) --mode: 1(normal) 0(ore-only) |dir: 0(d) 1(f) 2(u)
- print("direction:" .. dir .. " / mode: " .. mode)
- local success, data
- if dir == 0 then --up
- success, data = turtle.inspectUp()
- elseif dir==1 then --foward
- success, data = turtle.inspect()
- else --down
- success, data = turtle.inspectDown()
- end
- if success==true then
- print("block gefunden!")
- else
- print("kein block gefunden")
- end
- if mode==1 then
- if dir == 0 then --up
- turtle.digUp()
- elseif dir==1 then --foward
- print("buddle nach vorne")
- turtle.dig()
- else --do
- turtle.digDown()
- end
- end
- if success then
- if data.name == "minecraft:stone" then --Found Ore
- print("I found stone!")
- if mode==1 then
- if dir == 0 then --up
- turtle.digUp()
- elseif dir==1 then --foward
- turtle.dig()
- else --down
- turtle.digDown()
- end
- end
- if dir == 0 then --up
- turtle.up()
- elseif dir==1 then --foward
- turtle.forward()
- else --down
- turtle.down()
- end
- mine(1,0)
- turtle.turnLeft()
- mine(1,0)
- turtle.turnRight()
- turtle.turnRight()
- mine(1,0)
- turtle.turnLeft()
- mine(0,0)
- mine(2,0)
- if dir == 0 then --up
- turtle.down()
- elseif dir==1 then --foward
- turtle.back()
- else --down
- turtle.up()
- end
- end
- end
- end
- mine(1,1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement