Teens Script — File Browser
TeensScriptv4.0 / TeensScriptv4.0 / remotes / lag-meter.ini
lag-meter.ini — 3.64 KB — Download this file
[script]
n0=alias lag.meter.on {
n1= if ($window(@LMeter) != $null) halt
n2= %lag.wh = $window(-3).x $window(-3).y
n3= window -adophk0 +L @LMeter %lag.wh 174 105
n4= drawpic -c @LMeter 0 0 images\lag-meter.bmp
n5= %lag.meter = on
n6= %lag.me = $me
n7= lag.pchk
n8= .enable #lag.ping
n9= .ctcp %lag.me ping
n10= lag.update
n11= .timerLagCheck -o 0 %lag+ping .ctcp %lag.me ping
n12= .timerLagUpdate -om 0 500 lag.update
n13=}
n14=alias lag.meter.off { unset %lag.* | .timerLagCheck off | .timerLagUpdate off | .disable #lag.ping }
n15=alias -l lag.pchk { if (%lag+ping = $null) || (%lag+ping !isnum) || (%lag+ping < 4) || (%lag+ping > 30) %lag+ping = 5 }
n16=alias -l lag.refresh { drawpic -c @LMeter 0 0 images\lag-meter.bmp | drawtext @LMeter 0 arial 12 95 66 Lag: %lag.time | unset %lag.inc* }
n17=alias -l lag.update {
n18= if ($window(@LMeter) = $null) || ($server = $null) { lag.meter.off | halt }
n19= lag.pchk
n20= if (%lag.wh != $window(-3).x $window(-3).y) { %lag.wh = $window(-3).x $window(-3).y | window @LMeter %lag.wh 174 105 }
n21= if ($active ischan) || ($active = Status Window) {
n22= if ($window(@LMeter).state == hidden) window -a @LMeter
n23= }
n24= elseif ($appactive = $false) && ($window(@LMeter).state == normal) window -h @LMeter
n25= if (%lag.me != $me) { %lag.me = $me | .timerLagCheck -o 0 %lag+ping .ctcp %lag.me ping }
n26= if (%lag.time != $null) {
n27= if (%lag.time3 != %lag.time) {
n28= drawcopy @LMeter 17 64 75 15 @LMeter 87 64
n29= drawtext @LMeter 0 arial 12 95 66 Lag: %lag.time
n30= }
n31= %lag.time3 = %lag.time
n32= if (%lag.inc = $null) %lag.inc = 13
n33= inc %lag.inc 1
n34= %lag.inc2 = %lag.inc + 1
n35= if (%lag.timet = $null) %lag.timet = 0
n36= if (%lag.s1 > 45) %lag.show = Extreme Bad
n37= if (%lag.s1 < 46) %lag.show = Very Bad
n38= if (%lag.s1 < 31) %lag.show = Bad
n39= if (%lag.s1 < 16) %lag.show = Just Little
n40= if (%lag.s1 = 0) %lag.show = No
n41= titlebar @LMeter - %lag.show lag
n42= if (%lag.last != %lag.timet) {
n43= if (%lag.timet = 0) { %lag.timet = 63 }
n44= else { %lag.timet = 63 - %lag.timet }
n45= }
n46= if (%lag.inc > 162) lag.refresh
n47= if (%lag.last = $null) %lag.last = 63
n48= drawline @LMeter 8 1 %lag.inc %lag.last %lag.inc2 %lag.timet
n49= %lag.last = %lag.timet
n50= }
n51=}
n52=#lag.ping off
n53=on *:ctcpreply:ping*:{
n54= if ($nick = $me) && (%lag.meter = on) {
n55= %lag.time = $duration($calc($ctime - $2))
n56= if (sec isin %lag.time) { %lag.time = $remove(%lag.time,s,ec,in,r,ay,k) $+ s }
n57= else { %lag.time = $remove(%lag.time,s,ec,in,r,ay,k) }
n58= %lag.timet = $remove(%lag.time,ec,s)
n59= %lag.s1 = $remove(%lag.time,ec,min,s)
n60= if (m isin %lag.time) %lag.timet = 60
n61= halt
n62= }
n63=}
n64=#lag.ping off end
n65=menu @LMeter {
n66= $iif($timer(LagCheck),&Pause,&Continue):{
n67= if ($timer(LagCheck) = 1) { .timerLagCheck off | .timerLagUpdate off }
n68= else { .timerLagCheck -o 0 5 .ctcp $me ping | .timerLagUpdate -om 0 500 lag.update }
n69= }
n70= -
n71= &Settings
n72= .&Ping Speed ( $+ %lag+ping $+ ):{
n73= %lag+ping = $$?="Enter numbers of secs between pings. $+ $crlf $+ (Only numbers 4-30 are valid) $+ $crlf $+ Default: 10 $+ $crlf $+ Current: %lag+ping "
n74= .timerLagCheck -o 0 %lag+ping .ctcp $me ping
n75= }
n76= .-
n77= .&Refresh:lag.refresh
n78= .&Win Default:window @LMeter %lag.wh 174 105
n79= -
n80= &Exit:window -c @LMeter
n81=}
n82=menu menubar,channel {
n83=-
n84=» &LagMeter
n85= .» &Coloured:lag.meterc.on
n86= .-
n87= .» &No colour:lag.meter.on
n88=}