Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local aeStorage = peripheral.wrap("appeng_me_tilecraftingterminal_0")
- local analyzerDirection = "west"
- local trashDirection = "east"
- local memoryDirection = "down"
- local aeDirection = "up"
- local memoryChest = peripheral.wrap("back")
- function printDebug(textString)
- print(textString)
- end
- while true do
- local allItems = aeStorage.getAvailableItems()
- printDebug("Gotten ae data")
- for key, value in pairs (allItems) do
- printDebug("Working on item #"..tostring(key))
- if value.id == 13340 then
- printDebug("Found a drone: "..value.name)
- local thisBee = {
- id = value.id;
- name = value.name;
- qty = value.qty;
- }
- printDebug("Grabbing: "..textutils.serialize(thisBee))
- while aeStorage.extractItem( thisBee , memoryDirection ) ~= 0 do
- for i = 1, memoryChest.getInventorySize() do
- printDebug("Grabbed a stack from the network: "..textutils.serialize(memoryChest.getStackInSlot(i)))
- if memoryChest.getStackInSlot( memoryChest.getInventorySize() ) then
- printDebug("Inventory full, dumping to trash")
- while memoryChest.pushItem(trashDirection, i, 64, 1) == 0 do sleep(1) end
- else
- local beeData = memoryChest.getStackInSlot(i)
- if not beeData.beeInfo.isAnalyzed then
- printDebug("Bee isn't analyzed, sending")
- memoryChest.pushItem(analyzerDirection, i, 64, 1)
- printDebug("Waiting for analyzer")
- while memoryChest.pullItem(analyzerDirection, 9, 64, i) == 0 do sleep (1) end
- printDebug("Got bee back")
- end
- end
- break
- end
- end
- break
- end
- end
- break
- end
- --[[
- while aeStorage.extractItem( { id = 13340; isAnalyzed = false; qty = 64; }, analyzerDirection ) do
- while aeStorage.insertItem( 9, 64, analyzerDirection) == 0 do sleep(1) end
- break
- end
- break
- ]]--
- --sleep(1200)
Advertisement
Add Comment
Please, Sign In to add comment