AnonymusHochgenuss

digup

Mar 20th, 2026
40
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. -- Programm zum Graben nach oben
  2. local args = { ... }
  3. local distance = tonumber(args[1])
  4.  
  5. if not distance then
  6. print("Nutzung: digup <anzahl>")
  7. return
  8. end
  9.  
  10. print("Grabe " .. distance .. " Bloecke hoch...")
  11.  
  12. for i = 1, distance do
  13. -- 1. Checke Treibstoff
  14. if turtle.getFuelLevel() == 0 then
  15. print("Fehler: Kein Treibstoff!")
  16. break
  17. end
  18.  
  19. -- 2. Graben, bis der Weg frei ist (wichtig fuer Kies/Sand)
  20. while turtle.detectUp() do
  21. turtle.digUp()
  22. sleep(0.5)
  23. end
  24.  
  25. -- 3. Nach oben bewegen
  26. if not turtle.up() then
  27. -- Falls ein unzerstoerbarer Block (Bedrock) oder Mob im Weg ist
  28. print("Blockiert bei Schritt " .. i)
  29. break
  30. end
  31.  
  32. print("Fortschritt: " .. i .. "/" .. distance)
  33. end
  34.  
  35. print("Fertig!")
Advertisement
Add Comment
Please, Sign In to add comment