Advertisement
nicx321

OC-Energy broadcast

May 3rd, 2017
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.43 KB | None | 0 0
  1. local component = require("component")
  2. local sides = require("sides")
  3. local term = require("term")
  4. local event = require("event")
  5.  
  6. component.modem.open(123)
  7.  
  8. while true do
  9.  
  10. term.clear()
  11.  
  12. local ecell = component.proxy(component.list("thermalexpansion_cell")())
  13. local x = ecell.getEnergyStored()
  14. local y = ecell.getMaxEnergyStored()
  15. local z = (x/y)*100
  16.  
  17. print(z,"%")
  18.  
  19. component.modem.broadcast(123,z)
  20.  
  21. os.sleep(.1)
  22. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement