Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local aeinterface = peripheral.wrap('meBridge_1')
- local voidchest = peripheral.wrap('void_chest_1')
- local slotStart = 0
- local slotEnd = 26
- local slotTimeOut = 10
- local defaultamount = 50000
- local outputDirection = 1
- function selectSlot()
- while true do
- for i=slotStart,slotEnd do
- slotinfo = voidchest.getStackInSlot(i)
- --print('Checking space in slot: '.. i)
- if slotinfo == nil then
- print('Slot '.. i ..' is empty.')
- return i
- end
- end
- sleep(slotTimeOut)
- end
- end
- function removeItems(id)
- print('Removing item: '.. id)
- selectSlot()
- aeinterface.retrieve(id,64,outputDirection)
- end
- while true do
- local aeitems = aeinterface.listAll()
- if aeitems ~= nil then
- for id,amount in pairs(aeitems) do
- --print(id..": "..amount)
- if amount>defaultamount then
- sleep(0.5)
- removeItems(id)
- end
- end
- end
- sleep(10)
- end
Advertisement
Add Comment
Please, Sign In to add comment