Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Peripherals
- chest = peripheral.wrap("back")
- -- Functions
- function Condense()
- return chest.condenseItems()
- end
- function Condenser(x)
- return chest.pushItem("south",x)
- end
- function Disenchanter(x)
- return chest.pushItem("up",x)
- end
- function isEnchanted(x)
- item=chest.getStackInSlot(x)
- if (type(item["ench"])=="table") then return true else return false end
- end
- function maxSlots()
- return chest.getInventorySize()-1
- end
- function isNotDamaged(x)
- item=chest.getStackInSlot(x)
- if(item["dmg"]==0) then return true else return false end
- end
- while true do
- Condense()
- for count=1, maxSlots(), 1 do
- item=chest.getStackInSlot(count)
- if(type(item)=='table') then
- if (isNotDamaged(count) or item["name"]=='skull') then
- print ("Item #"..count.." is NOT damaged")
- if (isEnchanted(count)) then
- print ("Item #"..count.." is Enchanted")
- Disenchanter(count)
- elseif (item["name"] ~= "item.pe_repair_talisman") then
- Condenser(count)
- end
- else
- print("Item #"..count.." IS damaged")
- end
- end
- end
- sleep(5)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement