Jeyjey0

MINEE4

Nov 12th, 2016
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.33 KB | None | 0 0
  1. function refuel()
  2. term.clear()
  3. term.setCursorPos(1, 1)
  4. text = 1
  5. fuel = turtle.getFuelLevel()
  6. if fuel < 500 == true then
  7. turtle.turnLeft()
  8. turtle.turnLeft()
  9. turtle.up()
  10. h = fs.open("/stripmineprogramm/number","r")
  11. distance3 = h.readAll()
  12. h.close()
  13. distance2 = distance3 * 3
  14. for i=1,distance2 do
  15. mine2.mine2()
  16. end
  17. if turtle.detectDown() == true then
  18. turtle.digDown()
  19. turtle.down()
  20. elseif turtle.detectDown() == false then
  21. turtle.down()
  22. end
  23. while true do
  24. fuel = turtle.getFuelLevel()
  25. if text == 1 == true then
  26. print("Need Fuel")
  27. print("Searching fuel")
  28. text = 0
  29. end
  30. drop = 0
  31. if fuel < 500 == true then
  32. for i=1,16 do
  33. if drop > 16 == true then
  34. drop = 0
  35. end
  36. drop = drop + 1
  37. turtle.select(drop)
  38. count = turtle.getItemCount()
  39. if count >= 1 == true then
  40. item = turtle.getItemDetail()
  41. if item.name == "minecraft:coal" == true then
  42. turtle.refuel()
  43. end
  44. end
  45. end
  46. else
  47. print("Go to last Position")
  48. turtle.turnLeft()
  49. turtle.turnLeft()
  50. if turtle.detectUp() == true then
  51. turtle.digUp()
  52. end
  53. turtle.up()
  54. h = fs.open("/stripmineprogramm/number","r")
  55. distance3 = h.readAll()
  56. h.close()
  57. distance2 = distance3 * 3
  58. for i=1,distance2 do
  59. mine2.mine2()
  60. end
  61. if turtle.detectDown() == true then
  62. turtle.digDown()
  63. turtle.down()
  64. elseif turtle.detectDown() == false then
  65. turtle.down()
  66. end
  67. break
  68. end
  69. end
  70. else
  71. print("Full")
  72. end
  73. end
Add Comment
Please, Sign In to add comment