Requires at least Computer craft and open peripherals. Misc peripherals is useful to have also.
Here is a picture of my set up
I have wrapped the ME controller as a peripheral to the computer. This computer can monitor the storage in the AE system. I have it checking bytes used and item slots used as a percentage and if either of those goes above 90% full then the computer emits a 2 redstone pulse. This triggers a precision export bus to craft/export and trigger once per pulse to put a storage cell into a router. The router then puts the cell into one of the me drives. I put a machine filter on the router just to be on the safe side. I only tested it with the 1k cell so I don't know how it will do with more complex crafts. However, it worked like a treat for me. The program I wrote to control it is a bit rough and ready and is only really suitable for testing and as a proof of concept. Here are some more screenshots. (There is an ME bridge in my set up. The program will crash without it but it is not actually doing anything essential for this to work.).
Above: Just an example of the computer program output. The data at the top is just the output of the ME bridge and not really important. Below is the data about te storage including the percentages that determine if more storage needs to be made.
Above: From behind you can see the export bus in a position to put the storage cells in the router. Below: Precision Export bus GUI
-----
Like I said, the code is very rudimentary but I will include it anyway.
Code:
local controller = peripheral.wrap("right")
local bridge = peripheral.wrap("back")
function storageDetail()
local storage = controller.getTotalBytes()
local storageUsed = controller.getUsedBytes()
local storageRemaining = controller.getFreeBytes()
local itemTypesInStorage = controller.getStoredItemTypes() - 1
local maxItemTypes = controller.getTotalItemTypes()
print("Total Storage: "..storage)
print("Current Usage: "..storageUsed.."/"..storageRemaining)
print("Item Slots Occupied: "..itemTypesInStorage.."/"..maxItemTypes)
local x = math.ceil(storageUsed/storage*100)
local y = math.ceil(itemTypesInStorage/maxItemTypes*100)
return x,y
end
function getContents()
local list = bridge.listAll()
print("ME Contents")
for i,v in pairs(list) do
print(i..":"..v)
end
print("")
end
local looping = true
while looping do
term.clear()
term.setCursorPos(1,1)
getContents()
local x,y = storageDetail()
print(x.."%")
print(y.."%")
if x >= 90 or y >= 90 then
print("Making extra storage")
redstone.setBundledOutput("top", 1)
sleep(2)
redstone.setBundledOutput("top", 0)
looping = false
end
sleep(10)
end