Alix_the_Alicorn commented on a Page, (LUA) ComputerCraft API ProgressBar  -  Feb 15, 2014

Could you post the code for your AE monitor? Also, nice API I am using it for a Redstone Flux monitor. It shows percentage and amount for each cell and all of them put together.

Sorasyn  -  Feb 16, 2014

Yeah, I'd be happy to upload my AE network code. I'll upload it later today when I get back home, and am able to pull the appropriate files.

I'd be curious to find out how you managed to pull information from RF battery cells. I have 4 Redstone Energy Cells (stores, and outputs RF/MJ), but I cannot seem to find the appropriate methods to pull charge information.

EDIT: This snippet is run on an independent Advanced Computer block, which is placed just underneath the ME network's controller block (in my world at least), and wraps the controller as a peripheral. It should work well enough to report basic information, with minuscule changes.

local ctrl = peripheral.wrap("top")

function ParseMsg(id, msg)
  --if (id == 4) then
    if (msg == "Query_BYTES_TOTAL") then
      rednet.send(id, ctrl.getTotalBytes())
    end
    if (msg == "Query_BYTES_FREE") then
      rednet.send(id, ctrl.getFreeBytes())
    end
    if (msg == "Query_BYTES_USED") then
      rednet.send(id, ctrl.getUnusedBytes())
    end
    if (msg == "Query_SLOTS_TOTAL") then
      rednet.send(id, ctrl.getTotalItemTypes())
    end
    if (msg == "Query_SLOTS_FREE") then
      rednet.send(id, ctrl.getRemainingItemTypes())
    end
    if (msg == "Query_SLOTS_USED") then
      rednet.send(id, ctrl.getTotalItemTypes() - ctrl.getRemainingItemTypes())
    end
  --end
end

function ReceiveAsync()
  while true do
    id, msg, time = rednet.receive()
    print(msg)
    print(id)
    ParseMsg(id, msg)
  end
end

rednet.open("left")
ReceiveAsync()
rednet.close("left")
Alix_the_Alicorn  -  Feb 27, 2014

Thanks :P btw, to read the RF you have to have OpenPeripheral installed, and I used wired modems to connect to my cells. the methods are something like getMaxEnergyStored("string") and getEnergyStored("string") and the string isn't used for anything, I usually just pass in "nil".

Alix_the_Alicorn  -  Feb 27, 2014

Sorry about the late reply

Sorasyn  -  Feb 27, 2014

Thanks, I'll give it a shot whenever I get on next. I didn't think the RF/MJ cells were even supported in the newest mod version releases (1.6.2 I believe it is).

No worries. I've been somewhat busy myself so I've not even had time to play around on Minecraft.

Sign in to comment

Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.