Advertisement
Justin_P69

client computer 1

Aug 27th, 2023 (edited)
1,523
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.49 KB | None | 0 0
  1. -- Replace with the appropriate modem address and main computer ID
  2. local modemAddress = "left"
  3. local mainComputerID = 16
  4.  
  5. while true do
  6.     local energyInfo = peripheral.call("modem_", os.getComputerID, "getEnergyInfo")
  7.     if energyInfo then
  8.         local rfPercentage = math.floor((energyInfo.energyStored / energyInfo.maxEnergyStored) * 100)
  9.         rednet.open(modemAddress)
  10.         rednet.send(mainComputerID, rfPercentage)
  11.         rednet.close(modemAddress)
  12.     end
  13.     sleep(5)
  14. end
  15.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement