GamexLive

Untitled

Nov 27th, 2020
642
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local torchDistance = 0 -- Distanz für Fackel
  2. local fuelLevel = turtle.getFuelLevel() --FuelLevel
  3. local chests = turtle.getItemCount(4) --Anzahl Chests
  4.  
  5. function ivFull()
  6.     local full = true
  7.         for i = 5,16 do
  8.             if turtle.getItemCount(i) == 0 then
  9.                 full = false
  10.             end
  11.         end
  12.     return full
  13. end
  14.  
  15. function mine()
  16.     if turtle.getFuelLevel() < 100 then
  17.         turtle.refuel(1)
  18.     end
  19. end
  20.  
  21. while ivFull() == false do
  22.  
  23.     if torchDistance == 8 then
  24.         turtle.select(2)
  25.         turtle.turnRight()
  26.         turtle.turnRight()
  27.         turtle.place()
  28.         turtle.turnLeft()
  29.         turtle.turnLeft()
  30.         torchDistance = torchDistance - 8
  31.        
  32.     end
  33.  
  34.     if turtle.detectDown() == false then
  35.         turtle.select(3)
  36.         turtle.placeDown()
  37.     end
  38.  
  39.     if turtle.detect() then
  40.         turtle.dig()
  41.         turtle.forward()
  42.         turtle.digUp()
  43.         turtle.turnLeft()
  44.         turtle.dig()
  45.         turtle.up()
  46.         turtle.dig()
  47.         turtle.turnRight()
  48.         turtle.turnRight()
  49.         turtle.dig()
  50.         turtle.down()
  51.         turtle.dig()
  52.         turtle.turnLeft()
  53.         torchDistance = torchDistance + 1
  54.     else
  55.         turtle.forward()
  56.         torchDistance = torchDistance + 1
  57.     end
  58.    
  59.    
  60.         print(torchDistance)
  61.     end
  62. end
  63.  
  64. function check()
  65. local fuel = turtle.getItemCount(1)
  66. local torch = turtle.getItemCount(2)
  67. local chest = turtle.getItemCount(4)
  68. local error = 0
  69.  
  70. if torch == 0 then
  71.     print("Im Slot 2 fehlen Fackeln")
  72.     error = error + 1
  73.  
  74. else
  75.     print("Fackeln sind vorhanden")
  76. end
  77.  
  78. if fuel == 0 then
  79.     print("Es fehlt brennbares Material")
  80.     error = error + 1
  81. else
  82.     print("Brennbares Material vorhanden")
  83. end
  84.  
  85. if chest == 0 then
  86.         print("Es fehlen Kisten")
  87.         error = error + 1
  88.     else
  89.         print("Kisten vorhanden")
  90. end
  91.    
  92. if error == 0 then
  93.     return true
  94. else
  95.     return false
  96. end
  97.  
  98. end
  99.  
  100. function Start()
  101.     if check() == true then
  102.         mine()
  103.     else
  104.         print("Slots ueberpruefen")
  105.     end
  106. end
  107.  
  108. Start()
RAW Paste Data