NindyBun

creat_aab

Nov 11th, 2021 (edited)
482
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.88 KB | None | 0 0
  1. DUMP_BELT = {
  2.     "minecraft:coal",
  3.     "thermal:cinnabar",
  4.     "minecraft:quartz",
  5.     "thermal:ruby",
  6.     "thermal:sulfur",
  7.     "thermal:niter",
  8.     "appliedenergistics2:certus_quartz_crystal",
  9.     "minecraft:lapis_lazuli",
  10.     "occultism:otherstone",
  11.     "minecraft:glowstone_dust",
  12.     "thermal:sapphire",
  13.     "minecraft:diamond",
  14.     "minecraft:emerald",
  15. }
  16.  
  17. DUMP_HOPPER = {
  18.     "tconstruct:cobalt_ore",
  19. }
  20.  
  21. DUMP_GRINDER = {
  22.     "create:crushed_nickel_ore",
  23.     "create:crushed_copper_ore",
  24.     "create:crushed_zinc_ore",
  25.     "create:crushed_lead_ore",
  26.     "create:crushed_gold_ore",
  27.     "create:crushed_iron_ore",
  28. }
  29.  
  30. function search(list, item)
  31.     for index, value in pairs(list) do
  32.         if (item == value) then
  33.             return true
  34.         end
  35.     end
  36.     return false
  37. end
  38.  
  39. function dumpFromList()
  40.     print("Dumping Inventory...")
  41.     local item = turtle.getItemDetail(1)
  42.     if(item ~= nil) then
  43.         if (search(DUMP_BELT, item["name"])) then
  44.             print("Dropping into Belt >> " .. item["name"])
  45.             turtle.turnLeft()
  46.             while (not turtle.drop()) do end
  47.             turtle.turnRight()
  48.             return true
  49.         end
  50.  
  51.         if (search(DUMP_HOPPER, item["name"])) then
  52.             print("Dropping into Hopper >> " .. item["name"])
  53.             turtle.turnLeft()
  54.             turtle.turnLeft()
  55.             while (not turtle.drop()) do end
  56.             turtle.turnLeft()
  57.             turtle.turnLeft()
  58.             return true
  59.         end
  60.  
  61.         if (search(DUMP_GRINDER, item["name"])) then
  62.             print("Dropping into Grinder >> " .. item["name"])
  63.             turtle.turnRight()
  64.             while (not turtle.dropDown()) do end
  65.             turtle.turnLeft()
  66.             return true
  67.         end
  68.     end
  69. end
  70.  
  71. while true do
  72.     while (not turtle.suckUp(1)) do end
  73.     turtle.place()
  74.     turtle.dig()
  75.     dumpFromList()
  76. end
Add Comment
Please, Sign In to add comment