这个mod使得开放式电脑的适配器可以读取格雷科技社区版电池箱的信息。
他提供了以下函数:
local component = require("component")
local b = component.battery_buffer
-- Returns the charge of the buffer or of a single battery (indexed starting from 0)
b.getCharge()
b.getSingleCharge(0)
b.getCapacity()
b.getSingleCapacity(0)
-- Returns the Input/Output Voltage/Amperage of the buffer
b.getInputVoltage()
b.getInputAmperage()
b.getOutputVoltage()
b.getOutputAmperage()
-- Returns the number of batteries that are actually in the buffer right now
b.getBatteryCount()
-- Returns the number of slots the buffer has
b.getBatterySlots()