SHARE
TWEET

Untitled

a guest Aug 17th, 2019 72 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. aantalTunnels = 10 --altijd even!!!! anders is stopt die op bedrock
  2. laag = 0
  3. bezig = true
  4. richting = "down"
  5. tunnel = 0
  6.  
  7. function doeLaag()
  8.     for i = 1, 4, 1 do
  9.             succes, data = turtle.inspect()
  10.             if data.name  ~= "minecraft:stone" and data.name ~= "minecraft:dirt" and data.name ~= "minecraft:gravel" then
  11.                 checkInventory()
  12.                 turtle.select(3)
  13.                 turtle.dig()
  14.             end
  15.             turtle.turnLeft()
  16.     end
  17. end
  18.  
  19. function volgendeLaag()
  20.     if richting == "down" then
  21.         turtle.digDown()
  22.         if turtle.down() then
  23.             laag = laag + 1
  24.             return true
  25.         else
  26.             return false
  27.         end
  28.     else
  29.         while turtle.up() == false do
  30.         turtle.digUp()
  31.         end
  32.         laag = laag - 1
  33.         if laag == 0 then
  34.             return false
  35.         else
  36.             return true
  37.         end
  38.     end
  39. end
  40.  
  41. function checkInventory()
  42.     turtle.select(16)
  43.     if turtle.getItemCount() ~= 0 then
  44.         turtle.select(1)
  45.         if richting == "up" then turtle.placeDown() else turtle.placeUp() end
  46.         for i =3, 16, 1 do
  47.             turtle.select(i)
  48.              if richting == "up" then turtle.dropDown() else turtle.dropUp() end
  49.         end
  50.         turtle.select(1)
  51.          if richting == "up" then turtle.digDown() else turtle.digUp() end
  52.     end
  53. end
  54.  
  55. function gaTerug()
  56.     for i = 1, laag, 1 do
  57.         turtle.up()
  58.     end
  59. end
  60.  
  61. function main()
  62.     checkBrandstof()
  63.     if volgendeLaag() then doeLaag() else
  64.             turtle.dig()
  65.             turtle.forward()
  66.             turtle.dig()
  67.             turtle.forward()
  68.             turtle.turnLeft()
  69.             turtle.dig()
  70.             turtle.forward()
  71.             turtle.turnRight()
  72.             if richting == "down" then richting = "up" else richting = "down" end
  73.             tunnel = tunnel + 1
  74.            
  75.             if tunnel == aantalTunnels then bezig = false end
  76.     end
  77. end
  78.  
  79. function checkBrandstof()
  80.     if turtle.getFuelLevel() < 1500 then
  81.         turtle.select(2)
  82.         turtle.refuel(1)
  83.     else
  84.         print("Nog voldoende brandstof")
  85.     end
  86. end
  87.  
  88. while bezig == true do main() end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top