Advertisement
fishy07x

quarry

Nov 25th, 2014
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.62 KB | None | 0 0
  1.  
  2. local function checkFuel()
  3.     if turtle.getFuelLevel() < 1 then
  4.         turtle.select(1)
  5.         turtle.refuel(1)
  6.     end
  7. end
  8.  
  9. local function invCheck()
  10.     if turtle.getItemCount(16) ~= 0 then
  11.         turtle.select(2)
  12.         while turtle.detectUp() do
  13.             turtle.digUp()
  14.         end
  15.         turtle.placeUp()
  16.        
  17.         for i=3, 16 do
  18.             turtle.select(i)
  19.             turtle.dropUp()
  20.         end
  21.         turtle.select(3)
  22.     end
  23. end
  24.  
  25. local function moveForward()
  26.     checkFuel()
  27.     turtle.digUp()
  28.     turtle.digDown()
  29.     while turtle.forward() == false do
  30.         turtle.dig()
  31.         turtle.attack()
  32.         invCheck()
  33.     end
  34. end
  35.  
  36. print("Welcome at the program for easy ores and minerals!")
  37. print("Go stand on y = 14 when F3 is pressed.")
  38. print("Jump up and place turtle under you.")
  39. print("Put a stack of fuel in the first slot, put the output enderchest in the second slot and put the fuel input chest in the third slot.")
  40. print(" ")
  41. print("The turtle will stop when you unload the chunks, when you logout and when the turtle is terminated.")
  42. print("After you put in all the slots that are described earlier, press ENTER to start.")
  43. while read()=="" do
  44.  
  45.     while true do
  46.         for i=1, 4 do
  47.             for j=1, 15 do
  48.                 moveForward()
  49.             end
  50.             if i~= 4 then
  51.                 turtle.turnLeft()
  52.                 turtle.turnLeft()
  53.                 turtle.digUp()
  54.            
  55.                 for k=1, 3 do
  56.                     checkFuel()
  57.                     while turtle.down() == false do
  58.                         turtle.digDown()
  59.                         turtle.attackDown()
  60.                         invCheck()
  61.                     end    
  62.                 end
  63.             end
  64.         end
  65.         turtle.turnLeft()
  66.         moveForward()
  67.         turtle.turnLeft()
  68.         for l=1, 9 do
  69.             checkFuel()
  70.             while turtle.up() == false do
  71.                 turtle.digUp()
  72.                 turtle.attackUp()
  73.                 invCheck()
  74.             end
  75.         end
  76.     end
  77. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement