Advertisement
Guest User

test

a guest
Apr 22nd, 2019
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.52 KB | None | 0 0
  1. core = peripheral.wrap("draconic_rf_storage_5")
  2. flux = peripheral.wrap("flux_gate_3")
  3. mon = peripheral.wrap("monitor_2")
  4.  
  5. local maxPower = 0
  6. local curPower = 0
  7. local prevPower = 0
  8. local percPower = 0
  9.  
  10. monX,monY = mon.getSize()
  11.  
  12. function checkPower()
  13.  
  14.   maxPower = core.getMaxEnergyStored()
  15.   curPower = core.getEnergyStored()
  16.   percPower = math.floor((curPower/maxPower)*100)
  17.  
  18. end
  19.  
  20. while true do
  21.   checkPower()
  22.   print(curPower .. "/" .. maxPower)
  23.   prevPower = curPower
  24.   print(prevPower)
  25.   sleep(1)
  26. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement