Advertisement
funnybunnyofdoom

Sorty

Dec 20th, 2017
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.26 KB | None | 0 0
  1. --This program will draw items out
  2. --of an ender chest and sort them.
  3. itemID = 0
  4. itemID = turtle.getItemDetail(1)
  5.  
  6. local directory = "/path/"
  7. function bp(line)
  8. return directory..line
  9. end
  10.  
  11. --item names
  12. planks = "minecraft:planks"
  13. ironore = "minecraft:iron_ore"
  14. goldore = "minecraft:gold_ore"
  15. silverore = "ThermalFoundation:Ore"
  16. copperore = "ThermalFoundation:Ore"
  17. ferrousore = "ThermalFoundation:Ore"
  18. aluminumore = "TConstruct:SearedBrick"
  19. tinore = "ThermalFoundation:Ore"
  20. leadore = "ThermalFoundation:Ore"
  21. cobblestone = "minecraft:cobblestone"
  22. coal = "minecraft:coal"
  23. dirt = "minecraft:dirt"
  24. gravel = "minecraft:gravel"
  25. sand = "minecraft:sand"
  26. redstone = "minecraft:redstone"
  27. diamond = "minecraft:diamond"
  28. lapis = "minecraft:dye"
  29. logs = "minecraft:log"
  30. sapphire = "ProjRed|Core:projectred.core.part"
  31. peridot = "ProjRed|Core:projectred.core.part"
  32. ruby = "ProjRed|Core:projectred.core.part"
  33. certus = "appliedenergistics2:item.ItemMultiMaterial"
  34.  
  35. trash = {
  36. "chisel:andesite",
  37. "chisel:granite",
  38. "chisel:limestone",
  39. "minecraft:dirt",
  40. "minecraft:gravel",
  41. "chisel:marble",
  42. "ProjRed:Exploration:projectred.exploration.stone"
  43. }
  44.  
  45. --utility functions
  46. function tf()
  47. turtle.forward()
  48. turtle.forward()
  49. turtle.forward()
  50. end
  51. function tb()
  52. turtle.back()
  53. turtle.back()
  54. turtle.back()
  55. end
  56. function pg()
  57. turtle.turnRight()
  58. tf()
  59. turtle.turnLeft()
  60. turtle.forward()
  61. turtle.drop()
  62. turtle.back()
  63. turtle.turnLeft()
  64. tf()
  65. turtle.turnRight()
  66. end
  67. --item storage functions
  68. function Certus()
  69. shell.run(bp("certus"))
  70. end
  71. function LeadOre()
  72. shell.run(bp("leadore"))
  73. end
  74. function TinOre()
  75. shell.run(bp("tinore"))
  76. end
  77. function Ruby()
  78. shell.run(bp("ruby"))
  79. end
  80. function Peridot()
  81. shell.run(bp("peridot"))
  82. end
  83. function Sapphire()
  84. shell.run(bp("sapphire"))
  85. end
  86. function Redstone()
  87. shell.run(bp("redstone"))
  88. end
  89. function Coal()
  90. shell.run(bp("coal"))
  91. end
  92. function Lapis()
  93. shell.run(bp("lapis"))
  94. end
  95. function Diamond()
  96. shell.run(bp("diamond"))
  97. end
  98. function Trash()
  99. turtle.turnLeft()
  100. for i=1,7 do
  101. turtle.forward()
  102. end
  103. turtle.drop()
  104. turtle.turnRight()
  105. turtle.turnRight()
  106. for i=1,7 do
  107. turtle.forward()
  108. end
  109. turtle.turnLeft()
  110. end
  111. function Planks()
  112. shell.run(bp("oakplanks"))
  113. end
  114. function IronOre()
  115. shell.run(bp("ironore"))
  116. end
  117. function GoldOre()
  118. shell.run(bp("goldore"))
  119. end
  120. function SilverOre()
  121. shell.run(bp("silverore"))
  122. end
  123. function CopperOre()
  124. shell.run(bp("copperore"))
  125. end
  126. function FerrousOre()
  127. shell.run(bp("ferrousore"))
  128. end
  129. function AluminumOre()
  130. shell.run(bp("aluminumore"))
  131. end
  132. function Cobblestone()
  133. shell.run(bp("cobblestone"))
  134. end
  135. function Logs()
  136. shell.run(bp("logs"))
  137. end
  138.  
  139.  
  140. while true do
  141. shell.run("itemcheck")
  142. for i=1,#trash do
  143. if itemID.name == trash[i] then
  144. Trash()
  145. end
  146. end
  147. turtle.turnRight()
  148. turtle.forward()
  149. turtle.forward()
  150. turtle.forward()
  151. turtle.turnLeft()
  152. turtle.forward()
  153. turtle.turnRight()
  154. turtle.drop()
  155. turtle.turnRight()
  156. turtle.forward()
  157. turtle.turnRight()
  158. turtle.forward()
  159. turtle.forward()
  160. turtle.forward()
  161. turtle.turnRight()
  162. end
  163. T = ""
  164.  
  165. end
  166. os.sleep(0.1)
  167. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement