Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Programm zum Graben nach oben
- local args = { ... }
- local distance = tonumber(args[1])
- if not distance then
- print("Nutzung: digup <anzahl>")
- return
- end
- print("Grabe " .. distance .. " Bloecke hoch...")
- for i = 1, distance do
- -- 1. Checke Treibstoff
- if turtle.getFuelLevel() == 0 then
- print("Fehler: Kein Treibstoff!")
- break
- end
- -- 2. Graben, bis der Weg frei ist (wichtig fuer Kies/Sand)
- while turtle.detectUp() do
- turtle.digUp()
- sleep(0.5)
- end
- -- 3. Nach oben bewegen
- if not turtle.up() then
- -- Falls ein unzerstoerbarer Block (Bedrock) oder Mob im Weg ist
- print("Blockiert bei Schritt " .. i)
- break
- end
- print("Fortschritt: " .. i .. "/" .. distance)
- end
- print("Fertig!")
Advertisement
Add Comment
Please, Sign In to add comment