Advertisement
Guest User

tps.lua

a guest
Aug 13th, 2018
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.42 KB | None | 0 0
  1. sleep(1)
  2.  
  3. local c = peripheral.wrap "back".canvas()
  4. local w,h = c.getSize()
  5. local out = c.addText({9, h - 16}, "NO TPS")
  6.  
  7. while true do
  8.     local tps = switchcraft.tps()
  9.     out.setText(string.format("TPS: %.2f", tps))
  10.     local c
  11.     if tps > 19 then c = 0x00FF00FF
  12.     elseif tps > 15 then c = 0xFFFF00FF
  13.     elseif tps > 10 then c = 0xFF8800FF
  14.     else c = 0xFF0000FF end
  15.     out.setColor(c)
  16.    
  17.     sleep(1)
  18. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement