toast_account_i_made

miner toch

Jun 24th, 2021 (edited)
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.38 KB | None | 0 0
  1. --pastebin run RLLE5i43
  2.  
  3. local traveled = 0
  4.  
  5. io.write("How far bigman ")
  6.  
  7. local taskdist = tonumber(io.read())
  8.  
  9. local startfuel = turtle.getFuelLevel()
  10.  
  11. turtle.up()
  12.  
  13. local continueforward = true
  14.  
  15. local torchdistcount = 0
  16.  
  17. while ((traveled < taskdist) and continueforward) do
  18.  
  19. turtle.dig()
  20. turtle.digUp()
  21. turtle.digDown()
  22.  
  23. torchdistcount = torchdistcount + 1
  24. if (torchdistcount == 8) then
  25. turtle.placeDown()
  26. torchdistcount = 0
  27. end
  28.  
  29. turtle.forward()
  30.  
  31. local currentfuel = turtle.getFuelLevel()
  32.  
  33. if (currentfuel < startfuel/2) then
  34. continueforward = false
  35. end
  36.  
  37. traveled = traveled + 1
  38.  
  39. local i = 0
  40. while (i < 15) do
  41. if (turtle.getItemDetail(i+1)) then
  42. local item = turtle.getItemDetail(i+1)
  43. if (not (item == nil)) then
  44. if (item["name"] == "minecraft:cobblestone") then
  45. turtle.select(i+1)
  46. turtle.dropDown()
  47. turtle.select(1)
  48. end
  49. end
  50. end
  51. i = i + 1
  52.  
  53. end
  54. end
  55.  
  56. local backtraveled = 0
  57.  
  58. turtle.turnLeft()
  59. turtle.turnLeft()
  60.  
  61. while (backtraveled < traveled) do
  62. turtle.forward()
  63. backtraveled = backtraveled + 1
  64. end
  65.  
  66. turtle.turnLeft()
  67. turtle.turnLeft()
  68. turtle.down()
  69.  
  70. os.reboot()
Add Comment
Please, Sign In to add comment