Skip to content

Instantly share code, notes, and snippets.

@dreness
Last active October 14, 2019 03:49
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save dreness/062eeb21d1bd6092dbb3686eabee8de7 to your computer and use it in GitHub Desktop.
Displays overwatch instance stats: ticks dropped, ticks counted, ticks expected
#!define TICKS A
#!define COUNTING B
#!define NOW C
#!define STARTLAG D
#!define DROPPED E
#!define EXPECTED F
@Rule "fast assemble"
@Event global
if isAssemblingHeroes():
setMatchTime(5)
@Rule "fast setup"
@Event global
if isInSetup():
setMatchTime(5)
@Rule "fast interim"
@Event global
if isMatchBetweenRounds():
setMatchTime(5)
@Rule "init variables"
@Event global
if COUNTING == 0:
COUNTING = 1
TICKS = 0.0
EXPECTED = 0.0
STARTLAG = getTotalTimeElapsed
NOW = getTotalTimeElapsed
@Rule "hud"
@Event global
if isGameInProgress():
hudSubtext(hostPlayer, "{}".format(TICKS), Position.LEFT, 0, Color.WHITE, HudReeval.VISIBILITY_AND_STRING)
hudSubtext(hostPlayer, "{}".format(EXPECTED), Position.LEFT, 1, Color.WHITE, HudReeval.VISIBILITY_AND_STRING)
hudSubtext(hostPlayer, "{}".format(DROPPED), Position.LEFT, 2, Color.WHITE, HudReeval.VISIBILITY_AND_STRING)
hudSubtext(hostPlayer, "{}".format(NOW), Position.LEFT, 2, Color.WHITE, HudReeval.VISIBILITY_AND_STRING)
@Rule "count ticks"
@Event global
if COUNTING == 1:
do :
NOW = getTotalTimeElapsed
TICKS++
EXPECTED = (NOW-STARTLAG)*62.5
wait()
while 1
@Rule "report dropped ticks"
@Event global
if COUNTING == 1:
do :
# NOW = getTotalTimeElapsed
# EXPECTED = (getTotalTimeElapsed-STARTLAG)*62.5
DROPPED = EXPECTED-TICKS
wait(1.0)
while 1
@Rule "server stats for host and spectators"
@Event global
if isGameInProgress():
hudSubtext(hostPlayer, "Server Load: {}% {}% {}%".format(getServerLoad(), getAverageServerLoad(), getPeakServerLoad()), Position.TOP, 0, Color.ORANGE, HudReeval.VISIBILITY_AND_STRING)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment