Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local autoAnvil=peripheral.wrap("powered_tile_3")
- local filingCabinet=peripheral.wrap("bottom")
- while true do
- local breakloop=0
- for cnt = 1, filingCabinet.getInventorySize()-1, 1 do
- local item=filingCabinet.getStackInSlot(cnt)
- print(item["enchanted_book"][1]["fullName"])
- if (item["enchanted_book"][1]["fullName"] == "Punch II") then
- print("Max Enchantment level. Storing book\n")
- filingCabinet.pushItem("down",cnt,item["qty"])
- breakloop=1
- break
- end
- if (item["enchanted_book"][1]["fullName"] == "Luck of the Sea III") then
- print("Max Enchantment level. Storing book\n")
- filingCabinet.pushItem("down",cnt,item["qty"])
- breakloop=1
- break
- end
- if (item["enchanted_book"][1]["fullName"] == "Haste III") then
- print("Max Enchantment level. Storing book\n")
- filingCabinet.pushItem("down",cnt,item["qty"])
- breakloop=1
- break
- end
- if (item["enchanted_book"][1]["fullName"] == "Unstable III") then
- print("Max Enchantment level. Storing book\n")
- filingCabinet.pushItem("down",cnt,item["qty"])
- breakloop=1
- break
- end
- if (item["enchanted_book"][1]["fullName"] == "Flaming Spikes III") then
- print("Max Enchantment level. Storing book\n")
- filingCabinet.pushItem("down",cnt,item["qty"])
- breakloop=1
- break
- end
- if (item["enchanted_book"][1]["fullName"] == "Knockback II") then
- print("Max Enchantment level. Storing book\n")
- filingCabinet.pushItem("down",cnt,item["qty"])
- breakloop=1
- break
- end
- if (item["enchanted_book"][1]["fullName"] == "Retaliatory Kick IV") then
- print("Max Enchantment level. Storing book\n")
- filingCabinet.pushItem("down",cnt,item["qty"])
- breakloop=1
- break
- end
- if (item["enchanted_book"][1]["fullName"] == "enchantment.magicresist V") then
- print("Max Enchantment level. Storing book\n")
- filingCabinet.pushItem("down",cnt,item["qty"])
- breakloop=1
- break
- end
- if (item["enchanted_book"][1]["fullName"] == "Respiration III") then
- print("Max Enchantment level. Storing book\n")
- filingCabinet.pushItem("down",cnt,item["qty"])
- breakloop=1
- break
- end
- if (item["enchanted_book"][1]["fullName"] == "Thorns III") then
- print("Max Enchantment level. Storing book\n")
- filingCabinet.pushItem("down",cnt,item["qty"])
- breakloop=1
- break
- end
- if (item["enchanted_book"][1]["fullName"] == "Power V") then
- print("Max Enchantment level. Storing book\n")
- filingCabinet.pushItem("down",cnt,item["qty"])
- breakloop=1
- break
- end
- if (item["enchanted_book"][1]["fullName"] == "Blast Protection IV") then
- print("Max Enchantment level. Storing book\n")
- filingCabinet.pushItem("down",cnt,item["qty"])
- breakloop=1
- break
- end
- if (item["enchanted_book"][1]["fullName"] == "Protection IV") then
- print("Max Enchantment level. Storing book\n")
- filingCabinet.pushItem("down",cnt,item["qty"])
- breakloop=1
- break
- end
- if (item["enchanted_book"][1]["fullName"] == "Magic Protection IV") then
- print("Max Enchantment level. Storing book\n")
- filingCabinet.pushItem("down",cnt,item["qty"])
- breakloop=1
- break
- end
- if (item["enchanted_book"][1]["fullName"] == "Soulbound I" or item["enchanted_book"][1]["fullName"] == "enchantment.soulbound I") then
- print("Max Enchantment level. Storing book\n")
- filingCabinet.pushItem("down",cnt,item["qty"])
- breakloop=1
- break
- end
- if (item["enchanted_book"][1]["fullName"] == "Unbreaking III") then
- print("Max Enchantment level. Storing book\n")
- filingCabinet.pushItem("down",cnt,item["qty"])
- breakloop=1
- break
- end
- if (item["enchanted_book"][1]["fullName"] == "Flame I") then
- print("Max Enchantment level. Storing book\n")
- filingCabinet.pushItem("down",cnt,item["qty"])
- breakloop=1
- break
- end
- if (item["enchanted_book"][1]["fullName"] == "Auto-Smelt I") then
- print("Max Enchantment level. Storing book\n")
- filingCabinet.pushItem("down",cnt,item["qty"])
- breakloop=1
- break
- end
- if (item["enchanted_book"][1]["fullName"] == "Feather Falling IV") then
- print("Max Enchantment level. Storing book\n")
- filingCabinet.pushItem("down",cnt,item["qty"])
- breakloop=1
- break
- end
- if (item["enchanted_book"][1]["fullName"] == "Lure III") then
- print("Max Enchantment level. Storing book\n")
- filingCabinet.pushItem("down",cnt,item["qty"])
- breakloop=1
- break
- end
- if (item["enchanted_book"][1]["fullName"] == "Sharpness V") then
- print("Max Enchantment level. Storing book\n")
- filingCabinet.pushItem("down",cnt,item["qty"])
- breakloop=1
- break
- end
- if (item["enchanted_book"][1]["fullName"] == "Projectile Protection IV") then
- print("Max Enchantment level. Storing book\n")
- filingCabinet.pushItem("down",cnt,item["qty"])
- breakloop=1
- break
- end
- if (item["enchanted_book"][1]["fullName"] == "Fire Protection IV") then
- print("Max Enchantment level. Storing book\n")
- filingCabinet.pushItem("down",cnt,item["qty"])
- breakloop=1
- break
- end
- if (item["enchanted_book"][1]["fullName"] == "Aqua Affinity I") then
- print("Max Enchantment level. Storing book\n")
- filingCabinet.pushItem("down",cnt,item["qty"])
- breakloop=1
- break
- end
- if (item["enchanted_book"][1]["fullName"] == "Withering I" or item["enchanted_book"][1]["fullName"] == "Withering I") then
- print("Max Enchantment level. Storing book\n")
- filingCabinet.pushItem("down",cnt,item["qty"])
- breakloop=1
- break
- end
- if (item["enchanted_book"][1]["fullName"] == "Poisonous Barbs I") then
- print("Max Enchantment level. Storing book\n")
- filingCabinet.pushItem("down",cnt,item["qty"])
- breakloop=1
- break
- end
- if (item["enchanted_book"][1]["fullName"] == "Infinity I") then
- print("Max Enchantment level. Storing book\n")
- filingCabinet.pushItem("down",cnt,item["qty"])
- breakloop=1
- break
- end
- if (item["enchanted_book"][1]["fullName"] == "XP Boost III") then
- print("Max Enchantment level. Storing book\n")
- filingCabinet.pushItem("down",cnt,item["qty"])
- breakloop=1
- break
- end
- if (item["enchanted_book"][1]["fullName"] == "Last Stand II") then
- print("Max Enchantment level. Storing book\n")
- filingCabinet.pushItem("down",cnt,item["qty"])
- breakloop=1
- break
- end
- if (item["qty"] >1 ) then
- print("Sending item to auto-anvil to combine.")
- filingCabinet.pushItemIntoSlot("west",cnt,1,1)
- filingCabinet.pushItemIntoSlot("west",cnt,1,2)
- while( autoAnvil.getStackInSlot(1) ~= nil and autoAnvil.getStackInSlot(2) ~=nil ) do
- sleep(0)
- end
- autoAnvil.pushItem("east",3)
- print("Success. Restarting process.\n\n")
- breakloop=1
- end
- if (item['qty']<2 and breakloop==1) then sleep(3) end
- if (breakloop==1) then break end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement