Drakaxx

Craft charcoal

May 6th, 2019
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.52 KB | None | 0 0
  1. numberCharcoal = 64
  2.  
  3. function resetAll()
  4. for n=1,16 do
  5. turtle.select(n)
  6. turtle.dropUp()
  7. end
  8. end
  9.  
  10. function suckToDEATHifNeeded()
  11.  
  12. local data = turtle.getItemDetail()
  13.  
  14. if data then
  15. if data.count ~= numberCharcoal then
  16. local restant = numberCharcoal - data.count
  17. os.sleep(10)
  18. turtle.suck(restant)
  19. suckToDEATHifNeeded()
  20. end
  21. else
  22. os.sleep(10)
  23. turtle.suck(numberCharcoal)
  24. suckToDEATHifNeeded()
  25. end
  26.  
  27.  
  28.  
  29. end
  30.  
  31. function run ()
  32. while true do
  33.  
  34. local data2 = turtle.getItemDetail(1)
  35.  
  36. if data2 then
  37. if data2.name == 'chisel:block_charcoal2' then
  38. resetAll()
  39. os.sleep(7200)
  40. end
  41. end
  42.  
  43. local selectNum = {1,2,3,5,6,7,9,10,11}
  44. for i,v in ipairs(selectNum) do
  45. turtle.select(v)
  46. turtle.suck(numberCharcoal)
  47. suckToDEATHifNeeded()
  48. end
  49.  
  50. turtle.select(1)
  51. turtle.craft()
  52. turtle.turnRight()
  53. turtle.turnRight()
  54. turtle.drop()
  55. turtle.turnRight()
  56. turtle.turnRight()
  57.  
  58. local dataCheck = turtle.getItemDetail(16)
  59. if dataCheck then
  60. resetAll()
  61. end
  62. end
  63. end
  64.  
  65.  
  66. function remettre()
  67. local success, data = turtle.inspect()
  68. if success then
  69. if data.name == 'minecraft:log' then
  70. turtle.turnLeft()
  71.  
  72. resetAll()
  73.  
  74. run()
  75. end
  76. if data.name == 'minecraft:glowstone' then
  77. turtle.turnRight()
  78.  
  79. resetAll()
  80. run()
  81. end
  82. if data.name == 'minecraft:chest' then
  83. turtle.turnRight()
  84. remettre()
  85. else
  86. run()
  87. end
  88. turtle.select(1)
  89. end
  90. end
  91.  
  92. remettre()
Advertisement
Add Comment
Please, Sign In to add comment