Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- This program sends the data from these 2 power
- -- units and displays it in my base
- -- Author: moomoocat28
- -- Pre Initialization
- modem = peripheral.wrap("back")
- modem.open(250)
- -- Initialization
- local outputEU = ""
- local outputRF = ""
- local maxEU = 0
- local maxRF = 0
- local curEU = 0
- local curRF = 0
- local perEU = 0
- local perRF = 0
- eu = peripheral.wrap("ic2:oldmfsu_12")
- rf = peripheral.wrap("thermalexpansion:storage_cell_23")
- -- Program
- function checkPower()
- maxEU = eu.getEUCapacity()
- maxRF = rf.getRFCapacity()
- curEU = eu.getEUStored()
- curRF = rf.getRFStored()
- perEU = math.floor(((curEU/maxEU)*100)+0.5)
- perRF = math.floor(((curRF/maxRF)*100)+0.5)
- end
- while true do
- checkPower()
- outputEU = curEU .. "/" .. maxEU .. " EU (" .. perEU .. "%) "
- outputRF = curRF .. "/" .. maxRF .. " RF (" .. perRF .. "%) "
- modem.transmit(250, 250, {outputEU, outputRF})
- sleep(1)
- end
Advertisement
Add Comment
Please, Sign In to add comment