Advertisement
Darknio

Dig

Jun 26th, 2022
701
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.82 KB | None
  1. function Text()
  2. term.clear()
  3. term.setCursorPos(1,1)
  4.  
  5. end
  6. fuel = turtle.getFuelLevel()
  7.  
  8. function Start()
  9.     Text()
  10.         term.write("Treibstoffanzeige: "..fuel)
  11.         term.setCursorPos(1,2)
  12.         term.write("Wie tief soll ich graben? ")
  13.         down = tonumber(read())
  14.         downTwo = down * 2
  15.        
  16. end
  17.  
  18. function Fuel()
  19.     fuel = turtle.getFuelLevel()
  20.         if fuel > downTwo then
  21.             for i = 1,down do
  22.        
  23.             turtle.digDown()
  24.             turtle.down()
  25.             turtle.dig()
  26.             turtle.turnLeft()
  27.             turtle.turnLeft()
  28.             turtle.dig()
  29.             end
  30.             for i = 1,down do
  31.                 turtle.up()
  32.             end
  33.         else
  34.         Text()
  35.         term.write("Ich habe zuwenig Sprint!")
  36.         term.setCursorPos(1,2)
  37.         term.write("Bitte nachfüllen in Slot 1: ")
  38.         term.setCursorPos(1,3)
  39.         term.write(fuel .. "/"..downTwo)
  40.         turtle.refuel()
  41.         sleep(0.5)
  42.         Fuel()
  43.         end
  44. end
  45.  
  46.  
  47.  
  48. Start()
  49. Fuel()
Advertisement
RAW Paste Data Copied
Advertisement