Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Replace with the appropriate modem address and main computer ID
- local modemAddress = "left"
- local mainComputerID = 16
- while true do
- local energyInfo = peripheral.call("modem_", os.getComputerID, "getEnergyInfo")
- if energyInfo then
- local rfPercentage = math.floor((energyInfo.energyStored / energyInfo.maxEnergyStored) * 100)
- rednet.open(modemAddress)
- rednet.send(mainComputerID, rfPercentage)
- rednet.close(modemAddress)
- end
- sleep(5)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement