Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- term.clear()
- term.setCursorPos(1,1)
- repeat
- print("Tunnellänge (/2) : ")
- tlength=read()
- until tlength % 2 == 0
- repeat
- print("Fakelabstand (/2) : ")
- fabstand=read()
- until fabstand % 2 == 0
- term.clear()
- term.setCursorPos(1,1)
- tstoff=turtle.getItemCount(16)
- fcount=turtle.getItemCount(15)
- bcount=turtle.getItemCount(14)
- baseLayerx,baseLayery,baseLayerz = gps.locate()
- orientation="front"
- s13count=0
- fabstandcount=fabstand
- term.setCursorPos(1,1)
- print("Slot 13 Count : " .. s13count)
- print("Treibstoff in Slot 16 : " .. tstoff)
- print("Fackeln in Slot 15 : " .. fcount)
- print("Kisten in Slot 14 : " .. bcount)
- term.setCursorPos(1,5)
- print("Treibstofflevel : ")
- print("Fakelweg : " .. fabstand)
- print("Tunelweg : " .. tlength)
- term.setCursorPos(1,8)
- print("Abgebautes Material : ")
- function checkfuel()
- term.setCursorPos(1,5)
- print("Treibstofflevel : " .. turtle.getFuelLevel())
- if turtle.getFuelLevel() <= 0.25 then
- if turtle.getItemCount(16) > 0 then
- turtle.select(16)
- turtle.refuel(1)
- end
- end
- end
- function gotoBaseLayer()
- local actlayerx,actlayery,actlayerz = gps.locate()
- while actlayery>baseLayery do
- turtle.down()
- local actlayerx,actlayery,actlayerz = gps.locate()
- end
- end
- function goup()
- checkfuel()
- if not turtle.up() then
- if not turtle.up() then
- if not turtle.up() then
- if not turtle.up() then
- gotoBaseLayer()
- end
- end
- end
- end
- end
- function godown()
- checkfuel()
- if not turtle.down() then
- if not turtle.down() then
- if not turtle.down() then
- exit()
- end
- end
- end
- end
- function breakplane()
- turtle.dig()
- turtle.forward()
- turtle.turnLeft()
- turtle.dig()
- turtle.turnRight()
- turtle.turnRight()
- turtle.dig()
- turtle.turnLeft()
- turtle.digUp()
- goup()
- turtle.turnLeft()
- turtle.dig()
- turtle.turnRight()
- turtle.turnRight()
- turtle.dig()
- turtle.turnLeft()
- turtle.digUp()
- goup()
- turtle.turnLeft()
- turtle.dig()
- turtle.turnRight()
- turtle.turnRight()
- turtle.dig()
- turtle.turnLeft()
- godown()
- godown()
- end
- function placetorch()
- if fabstandcount == 0 then
- turtle.turnLeft()
- goup()
- goup()
- turtle.select(15)
- turtle.place()
- godown()
- godown()
- turtle.turnRight()
- fabstandcount = fabstand
- else
- fabstandcount = fabstandcount - 1
- end
- end
- function checkfullinventory()
- slot13count = turtle.getItemCount(13)
- term.setCursorPos(1,1)
- print(" Slot 13 : " .. slot13count)
- if slot13count > 1 then
- turtle.back()
- turtle.back()
- turtle.turnLeft()
- turtle.select(14)
- turtle.place()
- for i=13,1,-1 do
- turtle.select(i)
- turtle.drop()
- end
- turtle.turnRight()
- turtle.forward()
- turtle.forward()
- end
- end
- function starttunnel()
- repeat
- blockinFront, blockdata=turtle.inspect()
- term.setCursorPos(1,6)
- print("Fakelweg : " .. fabstandcount .. "/" .. fabstand)
- print("Tunnelweg : " .. tlength)
- term.setCursorPos(1,8)
- print("Block in front : " .. blockdata.name)
- checkfuel()
- breakplane()
- checkfullinventory()
- placetorch()
- tlength=tlength-1
- until tlength <= 0
- end
- if tstoff < 1 then
- term.clear()
- term.setCursorPos(1,1)
- print("Ohne Treibstoff geht es nicht ! Bitte in Slot 16 laden")
- else
- print("Begin")
- starttunnel()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement