MatthewGB

CC LogiPipes GetEMC

Sep 9th, 2017
217
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.62 KB | None | 0 0
  1. NumFormat = function(num)
  2.  if(num > 1000000) then
  3.   return tostring(math.floor(num/10000)/100).."M"
  4.  end
  5.  if(num > 1000) then
  6.   return tostring(math.floor(num/100)/10).."K"
  7.  end
  8.  return tostring(num).."U"
  9. end
  10. r = peripheral.wrap("left")
  11. GetEMC = function(ID)
  12.  return r.getItemAmount(ID)*73728
  13. end
  14. local result = r.getLP().getItemIdentifierBuilder()
  15. result.setItemID(57)
  16. ID_DiamondBlock= result.build()
  17. lastEMC = GetEMC(ID_DiamondBlock)
  18. while 1<2 do
  19.  print(NumFormat(GetEMC(ID_DiamondBlock)).." EMC")
  20.  print(NumFormat((GetEMC(ID_DiamondBlock)-lastEMC)/5).." EMC/s")
  21.  lastEMC = GetEMC(ID_DiamondBlock)
  22.  os.sleep(5)
  23. end
Advertisement
Add Comment
Please, Sign In to add comment