/usr/share/epic4/script/status_lag is in epic4 1:2.10.6-1build3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 | # Adds a STATUS_LAG set, following the regular STATUS_* conventions.
# By default, this will be assigned to %2.
# To change the format of the lag indicator, use /set status_lag.
# To change how often the lag figure is updated, use /set status_lag_update.
@ status_lag = [\[Lag: %2\]]
@ status_lag_update = 30
# isnumber() is wc's code.
# epic4pre1.047 and up has a built in $isnumber().
#alias isnumber {
# ^local isnum 1
# if (![$0])
# { @ isnum = 0 }
#
# fec ($0) ii {
# if (!isdigit($ii) && ii != [-])
# { @ isnum = 0 }
# }
# @ function_return = isnum
#}
^on ^set "status_lag *" {
if ([$1]) {
@ status_lag = [$1-]
echo $banner Value of STATUS_LAG set to $1-
} else {
echo $banner Current value of STATUS_LAG is $(status_lag)
}
}
^on ^set "status_lag_update *" {
if ([$1]) {
if (isnumber($1)) {
@ status_lag_update = [$1]
echo $banner Value of STATUS_LAG_UPDATE set to $1
} else {
echo $banner Value of STATUS_LAG_UPDATE must be a number
}
} else {
echo $banner Current value of STATUS_LAG_UPDATE is $(status_lag_update)
}
}
alias checklag {
setstatuslag ??
^on ^raw_irc "$S PONG $S :$N" {
^on ^raw_irc -"$S PONG $S :$N"
setstatuslag ${time()-checktime}
timer -refnum lag $(status_lag_update) checklag
}
@ checktime = time()
^quote ping $S
}
alias setstatuslag {
^set status_user2 $sar(/%2/$[-2]*/$status_lag)
}
^timer -delete lag
checklag
#psykotyk- nov 23/97
|