Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- command /tpstest [<integer=5>] [<text>]:
- permission: skript.tpstest
- trigger:
- if arg 1 is less than 1:
- stop
- if arg 2 is equal to "bc" or "broadcast":
- broadcast "&cTesting Ticks per Second [TPS] over %arg 1% seconds..."
- else:
- message "&cTesting Ticks per Second [TPS] over %arg 1% seconds..." to command sender
- wait 1 tick
- set {_Timespan} to "%arg 1% seconds" parsed as timespan
- set {_StartTime} to now
- set {_Ticks} to 0
- while (difference between {_StartTime} and now) is less than {_Timespan}:
- set {_Ticks} to {_Ticks}+1
- wait 1 tick
- set {_TPS} to {_Ticks}/(arg 1)
- if {_TPS} is more than 17:
- set {_Outcome} to "&aRunning fine!"
- else if {_TPS} is more than 13:
- set {_Outcome} to "&eRunning decent."
- else if {_TPS} is more than 8:
- set {_Outcome} to "&cRunning bad."
- else:
- set {_Outcome} to "&4&lExtremely laggy!"
- if arg 2 is equal to "bc" or "broadcast":
- broadcast "&e------------------>>>>&9TEST RESULT&e<<<<------------------"
- broadcast "&7%{_TPS}% TPS &3| %{_Outcome}% &3| &7Counted: &9%{_Ticks}% &3| &7Expected: &9%(arg 1)*20%"
- broadcast "&e-----------------------------------------------------"
- else:
- message "&e------------------>>>>&9TEST RESULT&e<<<<------------------"
- message "&7%{_TPS}% TPS &3| %{_Outcome}% &3| &7Counted: &9%{_Ticks}% &3| &7Expected: &9%(arg 1)*20%"
- message "&e-----------------------------------------------------"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement