Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print("Laenge?")
- l = tonumber(read())
- i = 20
- local list =
- {
- ["minecraft:diamond_ore"] = true,
- ["minecraft:gold_ore"] = true,
- ["minecraft:iron_ore"] = true,
- ["minecraft:emerald_ore"] = true,
- ["minecraft:lapis_ore"] = true,
- ["denseores:block0:3"] = true,
- ["denseores:block0:1"] = true,
- ["denseores:block0"] = true,
- ["denseores:block0:2"] = true
- }
- function forward()
- while(not turtle.forward()) do
- turtle.dig()
- end
- end
- function down()
- while(not turtle.down()) do
- turtle.digDown()
- end
- end
- function up()
- while(not turtle.up()) do
- turtle.digUp()
- end
- end
- function back()
- while(not turtle.back()) do
- turtle.turnRight()
- turtle.turnRight()
- forward()
- turtle.turnRight()
- turtle.turnRight()
- end
- end
- function small()
- for y=1,i do
- search()
- forward()
- end
- end
- function large()
- for y=1,(2*i) do
- search()
- forward()
- end
- end
- function sDown()
- turtle.turnRight()
- search()
- down()
- search()
- down()
- search()
- down()
- search()
- forward()
- search()
- forward()
- search()
- turtle.turnRight()
- end
- function sUp()
- turtle.turnRight()
- search()
- up()
- search()
- up()
- search()
- up()
- search()
- forward()
- search()
- forward()
- search()
- turtle.turnRight()
- end
- function coal()
- turtle.select(1)
- a = turtle.getItemCount(1)
- while(a >= 2) do
- turtle.refuel(1)
- a = turtle.getItemCount(1)
- end
- end
- function walk()
- for w=1,4 do
- turtle.digUp()
- forward()
- search()
- end
- end
- function searchFront()
- success, data = turtle.inspect()
- if success and list[data.name] then
- forward()
- search()
- back()
- end
- end
- function searchUp()
- success, data = turtle.inspectUp()
- if success and list[data.name] then
- up()
- search()
- down()
- end
- end
- function searchDown()
- success, data = turtle.inspectDown()
- if success and list[data.name] then
- down()
- search()
- up()
- end
- end
- function search()
- for s=1,4 do
- searchFront()
- turtle.turnRight()
- end
- searchUp()
- searchDown()
- end
- for x=1,l do
- coal()
- search()
- turtle.turnRight()
- small()
- sDown()
- large()
- sUp()
- small()
- turtle.turnLeft()
- walk()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement