Advertisement
Guest User

testMFSU.lua

a guest
May 20th, 2019
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.67 KB | None | 0 0
  1. ps = peripheral.getNames()
  2. psTot = table.getn(ps)
  3.  
  4. local mfsuN = 0
  5. local mfsu = {}
  6.  
  7. for i = 1, psTot do
  8.    
  9.     if(string.match(ps[i], "mfsu")) then
  10.         mfsuN = mfsuN + 1
  11.         print(ps[i])
  12.         mfsu[mfsuN] = peripheral.wrap(ps[i])    
  13.     end
  14.    
  15. end
  16. print(mfsuN)
  17. for i = 1, mfsuN do
  18.     print(mfsu[i].getEUCapacity())
  19.     sleep(0.2)
  20. end
  21. while true do
  22.     for i = 1, mfsuN do
  23.         thisStored = mfsu[i].getEUStored()
  24.         thisCapacity = mfsu[i].getEUCapacity()
  25.         thisPercentage = math.floor(thisStored/thisCapacity*100)
  26.         print(thisPercentage)
  27.         print("MFSU_" ..i .."%: "..thisPercentage)
  28.     end
  29. sleep(0.7)
  30. end
  31. sleep(10)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement