This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
MultiBrow's profile picture

PO2 ME % Full Monitor

Started by MultiBrow, 05 April 2017 - 10:16 AM
MultiBrow #1
Posted 05 April 2017 - 12:16 PM
Hello,

I know I'm gonna be very annoying to a lot of people here but I have absolutely no clue how to use ComputerCraft. I'm currently playing Project Ozone 2 (1.7.10) and it has both AE2 & CC. I want to spice up my ME system with a monitor reading what percentage full all the drives are overall. Is this possible? Could whoever possibly make a mini video/text tutorial to help me? I'd much much much appreciate it as I don't want to fully learn ComputerCraft till later in the modpack.

I'd really appreciate it;
Thanks, Tom.
SquidDev #2
Posted 05 April 2017 - 03:02 PM
Looking at the mod list for Project Ozone 2, there isn't a way to do it by default. If you don't mind adding extra mods, you could install OpenPeripheral. This allows you to interact with various blocks: such as inventories.

In order to use OpenPeripheral, you'll need to place your computer next to your ME Drive or, if you have multiple ones, use Wired Modems and cables to connect them together. You can then wrap each drive as a peripheral and get some information about it. Please note: this code is totally untested:


local peripherals = {peripheral.find("ae2:drive")} -- It might not actually be ae2:drive. When you connect a modem, you should get a message containing "ae2:drive_0", use everything before the "_".

for _, drive in pairs(peripherals) do -- For every drive on the network
    for _, stack in pairs(drive.getAllStacks(false)) do -- For every stack in each drive
         print((stack.usedBytes / stack.totalBytes * 100) .. "% used") -- Print how full it is.
    end
end