Advertisement
fleft17

Untitled

Oct 4th, 2014
227
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.44 KB | None | 0 0
  1. command /tpstest [<integer=5>] [<text>]:
  2. permission: skript.tpstest
  3. trigger:
  4. if arg 1 is less than 1:
  5. stop
  6.  
  7. if arg 2 is equal to "bc" or "broadcast":
  8. broadcast "&cTesting Ticks per Second [TPS] over %arg 1% seconds..."
  9. else:
  10. message "&cTesting Ticks per Second [TPS] over %arg 1% seconds..." to command sender
  11.  
  12. wait 1 tick
  13.  
  14. set {_Timespan} to "%arg 1% seconds" parsed as timespan
  15. set {_StartTime} to now
  16. set {_Ticks} to 0
  17. while (difference between {_StartTime} and now) is less than {_Timespan}:
  18. set {_Ticks} to {_Ticks}+1
  19. wait 1 tick
  20.  
  21. set {_TPS} to {_Ticks}/(arg 1)
  22.  
  23. if {_TPS} is more than 17:
  24. set {_Outcome} to "&aRunning fine!"
  25. else if {_TPS} is more than 13:
  26. set {_Outcome} to "&eRunning decent."
  27. else if {_TPS} is more than 8:
  28. set {_Outcome} to "&cRunning bad."
  29. else:
  30. set {_Outcome} to "&4&lExtremely laggy!"
  31.  
  32. if arg 2 is equal to "bc" or "broadcast":
  33. broadcast "&e------------------>>>>&9TEST RESULT&e<<<<------------------"
  34. broadcast "&7%{_TPS}% TPS &3| %{_Outcome}% &3| &7Counted: &9%{_Ticks}% &3| &7Expected: &9%(arg 1)*20%"
  35. broadcast "&e-----------------------------------------------------"
  36. else:
  37. message "&e------------------>>>>&9TEST RESULT&e<<<<------------------"
  38. message "&7%{_TPS}% TPS &3| %{_Outcome}% &3| &7Counted: &9%{_Ticks}% &3| &7Expected: &9%(arg 1)*20%"
  39. message "&e-----------------------------------------------------"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement