Created
July 2, 2025 19:35
-
-
Save JIBSIL/c117f881a88e9c28568b89b2f4bb7f7a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on load: | |
if {-profiler::*} is set: | |
delete {-profiler::*} | |
delete {-stopprofiler} | |
command /startprofiler: | |
permission: profiler.start | |
trigger: | |
delete {-profiler::*} | |
set {-stopprofiler} to false | |
send "&cProfiler &rStarted profiler and deleted results of last profile session." | |
command /stopprofiler: | |
permission: profiler.stop | |
trigger: | |
set {-stopprofiler} to true | |
send "&cProfiler &rStopped profiler. View results with /getprofiler." | |
command /getprofiler [<number>]: | |
permission: profiler.getresults | |
trigger: | |
set {_numresults} to (arg-1 ? 10) | |
send "&cProfiler &rShowing top %{_numresults}% results..." | |
set {_sorted::*} to sorted indices of {-profiler::*} in descending order | |
set {_num} to 1 | |
loop {_sorted::*}: | |
if {_num} > {_numresults}: | |
stop | |
send "&cProfiler #%{_num}%&r: %loop-value% took a combined %loop-index%ms" | |
add 1 to {_num} | |
on profile complete: | |
if {-stopprofiler} is false: | |
#send "%event-string% took %event-number%ms" to all players | |
if {-profiler::%event-string%} is not set: | |
set {-profiler::%event-string%} to event-number | |
else: | |
add event-number to {-profiler::%event-string%} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment