Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function populateCells(cellList)
- local periphList = peripherals.getNames()
- cellList = {}
- for i = 1, #periphList do
- if peripheral.getType(periphList[i]) == "energy_cell" then --This might not actually be the name of the peripheral
- cellList.insert(peripheral.wrap(periphList[i]))
- end
- end
- return cellList
- end
- function queryCells(cellList)
- local power = 0
- for _,v in ipairs(cellList) do
- power = power + v.getEnergyStored() --this might not actually be the right function
- end
- return power
- end
- function mainLoop()
- local cellList
- populateCells(cellList)
- while true do
- local power = queryCells(cellList)
- --Display things on a monitor
- sleep(5)
- end
- end
- mainLoop()
Advertisement
Add Comment
Please, Sign In to add comment