Advertisement
GamexLive

Untitled

Nov 27th, 2020
708
0
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 = 0
  31.     end
  32.  
  33.     if turtle.detectDown() == false then
  34.         turtle.select(3)
  35.         turtle.placeDown()
  36.     end
  37.  
  38.     if turtle.detect() then
  39.         turtle.dig()
  40.         turtle.forward()
  41.         turtle.digUp()
  42.         turtle.turnLeft()
  43.         turtle.dig()
  44.         turtle.up()
  45.         turtle.dig()
  46.         turtle.turnRight()
  47.         turtle.turnRight()
  48.         turtle.dig()
  49.         turtle.down()
  50.         turtle.dig()
  51.         turtle.turnLeft()
  52.         torchDistance = torchDistance + 1
  53.     else
  54.         turtle.forward()
  55.         torchDistance = torchDistance + 1
  56.     end
  57.  
  58.     if ivFull() == true then
  59.         if chests > 0 then
  60.             turtle.select(4)
  61.             turtle.digDown()
  62.             turtle.placeDown()
  63.             chest = chest - 1
  64.             for slot = 5,16 do
  65.                 turtle.select(slot)
  66.                 turtle.dropDown()
  67.                 sleep(1.5)
  68.             end
  69.             turtle.select(5)
  70.         else
  71.             print("Keine Kisten vorhanden")
  72.             os.shutdown()
  73.         end
  74.     end
  75. end
  76.  
  77. function check()
  78. local torch = turtle.getItemCount(2)
  79. local fuel = turtle.getItemCount(1)
  80. local error = 0
  81.  
  82. if torch == 0 then
  83.     print("Im Slot 2 fehlen Fackeln")
  84.     error = error + 1
  85.  
  86. else
  87.     print("Fackeln sind vorhanden")
  88. end
  89.  
  90. if fuel == 0 then
  91.     print("Es fehlt brennbares Material")
  92.     error = error + 1
  93. else
  94.     print("Brennbares Material vorhanden")
  95. end
  96.  
  97. if error == 0 then
  98.     return true
  99. else
  100.     return false
  101. end
  102.  
  103. end
  104.  
  105. function Start()
  106.     if check() == true then
  107.         mine()
  108.     else
  109.         print("Slots ueberpruefen")
  110.     end
  111. end
  112.  
  113. Start()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement