Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local confMainPort = 1000
- local confMyPort = 1002
- local confModemSide = "right"
- local aeData = {}
- local itemMap = nil
- if(not os.loadAPI("hydraApi")) then
- error("Could not load hydraApi")
- end
- local meTerm = hydraApi.getCraftingTerminal()
- local meBridge = hydraApi.getMeBridge()
- local modem = peripheral.wrap(confModemSide)
- local function loadItemMap()
- local handle = fs.open("itemmap.txt", "r")
- if(handle == nil) then
- itemMap = nil
- return
- end
- itemMap = textutil.unserialize(handle.readAll())
- handle.close()
- end
- local function getItemList()
- if(meBridge == nil) then
- return nil
- end
- local idList = meBridge.listItems()
- local count = 0
- local mappedList = {}
- for k,v in pairs(idList) do
- if(itemMap[k] ~= nil) then
- count = count + 1
- mappedList[itemMap[k]] = v
- end
- end
- if(count == 0) then
- return nil
- else
- return mappedList
- end
- end
- loadItemMap()
- while true do
- aeData["powerDrainPerTick"] = meTerm.getPowerDrainPerTick()
- aeData["totalBytes"] = meTerm.getTotalBytes()
- aeData["freeBytes"] = meTerm.getFreeBytes()
- aeData["usedBytes"] = meTerm.getUsedBytes()
- aeData["unusedItemCount"] = meTerm.getUnusedItemCount()
- aeData["canHoldNewItem"] = meTerm.canHoldNewItem()
- aeData["storedItemTypes"] = meTerm.getStoredItemTypes()
- aeData["storedItemCount"] = meTerm.getStoredItemCount()
- aeData["remainingItemCount"] = meTerm.getRemainingItemCount()
- aeData["remainingItemTypes"] = meTerm.getRemainingItemTypes()
- aeData["totalItemTypes"] = meTerm.getTotalItemTypes()
- aeData["itemList"] = getItemList()
- hydraApi.printTable(aeData)
- modem.transmit(confMainPort, confMyPort, aeData)
- os.sleep(2)
- end
Advertisement
Add Comment
Please, Sign In to add comment