a_alien

Strip Mine

Jan 9th, 2021 (edited)
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.03 KB | None | 0 0
  1. print("How long to mine?")
  2. farest = tonumber(read())
  3. print("If i stop at HOME make sure i have fule in the first sloot")
  4. digLenth = 0
  5.  
  6. function GoHome()
  7.     turtle.turnLeft()
  8.     turtle.turnLeft()
  9.     while (digLenth) do
  10.         turtle.forward()
  11.     end
  12. end
  13.  
  14. function Emty()
  15.     for i = 2, 16, 1 do
  16.         turtle.drop(turtle.getItemCount())
  17.     end
  18. end
  19.  
  20. for i = 1, farest, 1 do
  21.     fullSlots = 0
  22.     for j = 1, 16, 1 do
  23.         turtle.select(j)
  24.         if (turtle.getItemCount() >= 64) then
  25.             fullSlots = fullSlots + 1
  26.         end
  27.     end
  28.     if(fullSlots >= 15) then
  29.         GoHome()
  30.         Emty()
  31.     end
  32.  
  33.     if (turtle.getFuelLevel() == 0) then
  34.         for j = 1, 16, 1 do
  35.             turtle.select(j)
  36.             turtle.refuel()
  37.             if (turtle.getFuelLevel() == 0) then
  38.                 break
  39.             end
  40.         end
  41.     end
  42.  
  43.     turtle.dig()
  44.     turtle.forward()
  45.     turtle.digUp()
  46.     digLenth = digLenth + 1
  47. end
  48. print("return home?")
  49. if (read() == "Yes") then
  50.     GoHome()
  51. end
Add Comment
Please, Sign In to add comment