soulgriever

ic2

Nov 27th, 2018
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.62 KB | None | 0 0
  1. function getEUStored(cell)
  2.  local count = 0
  3.  for i = 1, #cell do
  4.   count = count + cell[i].getEUStored()
  5.  end
  6.  return(count)
  7. end
  8.  
  9. function getEUCapacity(cell)
  10.  local count = 0
  11.  for i = 1, #cell do
  12.   count = count + cell[i].getEUCapacity()
  13.  end
  14.  return(count)
  15. end
  16.  
  17. function getEUOutputPerTick(cell)
  18.  local count = 0
  19.  for i = 1, #cell do
  20.   count = count + cell[i].getEUOutputPerTick()
  21.  end
  22.  return(count)
  23. end
  24.  
  25. function comma(amount)
  26.  local formatted = amount
  27.  while true do
  28.   formatted, k = string.gsub(formatted, "^(-?%d+)(%d%d%d)", '%1,%2')
  29.   if (k==0) then
  30.    break
  31.   end
  32.  end
  33.  return formatted
  34. end
Add Comment
Please, Sign In to add comment