Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- inv=peripheral.wrap("bottom")
- recipes={}
- recipes["AWWayofTime:simpleCatalyst0"]={'minecraft:gunpowder0','minecraft:redstone0','minecraft:redstone0','minecraft:glowstone_dust0','minecraft:sugar0'}
- recipes["AWWayofTime:bloodMagicBasicAlchemyItems3"]={'AWWayofTime:simpleCatalyst0','AWWayofTime:simpleCatalyst0','minecraft:nether_wart0','minecraft:dye15'}
- recipes["AWWayofTime:bloodMagicBasicAlchemyItems4"]={'AWWayofTime:bloodMagicBasicAlchemyItems5','AWWayofTime:bloodMagicBasicAlchemyItems4','minecraft:gold_nugget0'}
- recipes["AWWayofTime:bloodMagicBasicAlchemyItems5"]={'minecraft:bone0','minecraft:bone0','minecraft:bone0','minecraft:bone0','minecraft:gunpowder0'}
- recipes["AWWayofTime:bloodMagicBaseItems15"]={'AWWayofTime:imbuedSlate0','AWWayofTime:imbuedSlate0','AWWayofTime:bloodMagicBasicAlchemyItems4'}
- recipes["AWWayofTime:magicales0"]={'minecraft:redstone0','minecraft:gunpowder0','minecraft:glowstone_dust0','minecraft:glowstone_dust0','AWWayofTime:simpleCatalyst0'}
- termXMax,termYMax=term.getSize()
- inv.condenseItems()
- function getPossibleBrews()
- brews={}
- for i=1,16 do
- turtle.select(i)
- if turtle.getItemDetail()~=nil then
- if recipes[turtle.getItemDetail().name..turtle.getItemDetail().damage]~=nil then
- recipe=recipes[turtle.getItemDetail().name..turtle.getItemDetail().damage]
- brewPossible=true
- for i2=1,#recipe do
- if itemByIdDmg[recipe[i2]]==nil then
- brewPossible=false
- end
- end
- if brewPossible then
- print("debug5")
- turtle.suck()
- turtle.drop()
- end
- end
- end
- end
- end
- function scanItems()
- slots=inv.getInventorySize()
- itemInSlot={}
- itemByName={}
- itemByNum={}
- itemById={}
- itemByIdDmg={}
- itemByAmount={}
- itemListed={}
- i2=1
- for i=1,slots do
- term.clear()
- term.setCursorPos(1,1)
- term.write("Scan Slot"..tostring(i).." of "..tostring(slots))
- itemInSlot[i]=inv.getStackInSlot(i)
- sleep(0)
- if itemInSlot[i]~=nil then
- itemInSlot[i]["slot"]=i
- itemByName[itemInSlot[i]["name"]]=itemInSlot[i]
- if itemById[itemInSlot[i]["id"]]==nil then
- itemByAmount[itemInSlot[i]["id"]]=itemInSlot[i]
- itemByNum[i2]=itemByAmount[itemInSlot[i]["id"]]
- i2=i2+1
- else
- itemByAmount[itemInSlot[i]["id"]]["qty"]=itemByAmount[itemInSlot[i]["id"]]["qty"]+itemInSlot[i]["qty"]
- end
- itemById[itemInSlot[i]["id"]]=itemInSlot[i]
- itemByIdDmg[itemInSlot[i]["id"]..itemInSlot[i]["dmg"]]=itemInSlot[i]
- end
- end
- i=i2
- for i2=1,i-1 do
- itemByNum[i2]=itemByAmount[itemByNum[i2]["id"]]
- end
- end
- function getItem(id,qty,slot)
- inv.pushIntoSlot("up",id,qty,slot)
- end
- function itemAvarible(id,qty)
- itemAvarible=false
- if itemByAmount[id]~=nil then
- if itemByAmount[id]["qty"]>=qty then
- itemAvarible=true
- end
- end
- return itemAvarible
- end
- while true do
- scanItems()
- getPossibleBrews()
- sleep(5)
- end
Add Comment
Please, Sign In to add comment