Runnetty

getPower

May 16th, 2021 (edited)
103
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. os.loadAPI("accounts.lua")
  2.  
  3. local a = accounts.getAccounts()
  4.  
  5. local d = {}
  6.  
  7. function init()
  8.     for i =1, #a do
  9.         table.insert(d,#d+1,peripheral.wrap("energyDetector_"..a[i].modem))
  10.     end
  11. end
  12.  
  13. function tick()
  14.     for i = 1, #d do
  15.         a[i].FPT=d[i].getTransferRate()
  16.     end
  17.     accounts.saveAccounts(a)
  18.     sleep(0.5)
  19. end
  20.  
  21.  
RAW Paste Data