- alias -l dr drawrect $1-
- alias -l f return $rgb(210,210,210) | ;couleur de fond
- alias -l lb return @lagbar
- alias lag {
- if (!$hget(lagbar)) { mhlb | lhlb }
- $iif($scid($activecid).status == connected,scid $activecid .ctcpreply $me lag $ticks,.vt non connecté)
- }
- alias lag.off .timerlag off | window -c $lb
-
- ;degradé
- alias dgd {
- var %t = 0,%x = 0,%z = 0,%y = 255,%c = $calc($1 * 51)
- while (%t < %c) {
- dr -nfr $lb $rgb(%x,%y,0) 1 %z $2 1 $3
- $iif(%t > 255,dec %y 4,$iif(%x = 252,%x = 255,inc %x 4))
- inc %z | inc %t 4
- }
- return
- }
-
- alias -l vt {
- if (!$window($lb)) window -poBdh +dL $lb 0 0 127 20 ; -hopidkdCB +dL | window $lb $hget(lagbar,pos)
- dr -nfr $lb $f 0 0 0 127 20
- if (!$hget(lagbar,time)) hadd -m lagbar time 1
- dgd 10 0 4
- dgd $calc($1 * $hget(lagbar,time)) 4 12
- dgd 10 16 4
- if ($scid($activecid).status == connected) drawtext -nr $lb $rgb(0,0,0) small 11 $calc(36 - $calc($len($1) /2 )) 3 Lag $1 sec | ;text
- else drawtext -nr $lb $rgb(0,0,0) small 11 $calc(36 - $calc($len($1-) /2 )) 3 Non connecté
- ; dr -nrc $lb $rgb(127,127,127) 1 0 0 127 20 | ;pontillé
- drawdot $lb
- if ($scid($activecid).status == connected) .timerlag 1 5 .lag
- }
- on 1:active:*:if ($window($lb)) .lag
- on *:ctcpreply:lag &:{
- if ($nick == $me) && ($2 isnum) {
- haltdef
- var %x = $calc(($ticks - $2) / 1000)
- }
- vt %x
- }
- menu @lagbar {
- sclick { deplace $active $calc($mouse.dx - $window($active).x) $calc($mouse.dy - $window($active).y) }
- $iif($group(#lagbar) == on,Ne pas lancer à la connexion,Lancer à la connexion):$iif($group(#lagbar) == on,.disable #lagbar,.enable #lagbar)
- -
- Base Temps
- .1 seconde: hadd -m lagbar time 10
- .2 secondes: hadd -m lagbar time 9
- .3 secondes: hadd -m lagbar time 8
- .4 secondes: hadd -m lagbar time 7
- .5 secondes: hadd -m lagbar time 6
- .6 secondes: hadd -m lagbar time 5
- .7 secondes: hadd -m lagbar time 4
- .8 secondes: hadd -m lagbar time 3
- .9 secondes: hadd -m lagbar time 2
- .10 secondes:hadd -m lagbar time 1
- -
- Sauver Position:$savehlb
- -
- Quitter:hfree lagbar | unset %dx %dy | lag.off
- }
- alias -l mhlb if (!$hget(lagbar)) hmake lagbar 100
- alias -l lhlb if ($isfile($hdlb)) hload lagbar $hdlb
- alias -l savehlb hsave -o lagbar $hdlb
- alias -l hdlb return $scriptdirlagbar.hsh
- alias -l deplace {
- set %dx $calc($mouse.dx - $2)
- set %dy $calc($mouse.dy - $3)
- window $1 %dx %dy
- if ($mouse.key & 1) { .timer 1 0 deplace $1- | .timerlag off }
- else { hadd -m lagbar pos %dx %dy | lag }
- }
-
-
- on 1:APPACTIVE:if ($window($lb)) $iif($appactive,window -o $lb,window -u $lb)
- menu status,query,channel,menubar {
- $iif(($status == connected) && (!$window($lb)),[LagBar],$style(2) [LagBar]):.lag
- }
- #lagbar off
- on 1:connect:{ if (!$window($lb)) .lag }
- #lagbar end
alias -l dr drawrect $1-
alias -l f return $rgb(210,210,210) | ;couleur de fond
alias -l lb return @lagbar
alias lag {
if (!$hget(lagbar)) { mhlb | lhlb }
$iif($scid($activecid).status == connected,scid $activecid .ctcpreply $me lag $ticks,.vt non connecté)
}
alias lag.off .timerlag off | window -c $lb
;degradé
alias dgd {
var %t = 0,%x = 0,%z = 0,%y = 255,%c = $calc($1 * 51)
while (%t < %c) {
dr -nfr $lb $rgb(%x,%y,0) 1 %z $2 1 $3
$iif(%t > 255,dec %y 4,$iif(%x = 252,%x = 255,inc %x 4))
inc %z | inc %t 4
}
return
}
alias -l vt {
if (!$window($lb)) window -poBdh +dL $lb 0 0 127 20 ; -hopidkdCB +dL | window $lb $hget(lagbar,pos)
dr -nfr $lb $f 0 0 0 127 20
if (!$hget(lagbar,time)) hadd -m lagbar time 1
dgd 10 0 4
dgd $calc($1 * $hget(lagbar,time)) 4 12
dgd 10 16 4
if ($scid($activecid).status == connected) drawtext -nr $lb $rgb(0,0,0) small 11 $calc(36 - $calc($len($1) /2 )) 3 Lag $1 sec | ;text
else drawtext -nr $lb $rgb(0,0,0) small 11 $calc(36 - $calc($len($1-) /2 )) 3 Non connecté
; dr -nrc $lb $rgb(127,127,127) 1 0 0 127 20 | ;pontillé
drawdot $lb
if ($scid($activecid).status == connected) .timerlag 1 5 .lag
}
on 1:active:*:if ($window($lb)) .lag
on *:ctcpreply:lag &:{
if ($nick == $me) && ($2 isnum) {
haltdef
var %x = $calc(($ticks - $2) / 1000)
}
vt %x
}
menu @lagbar {
sclick { deplace $active $calc($mouse.dx - $window($active).x) $calc($mouse.dy - $window($active).y) }
$iif($group(#lagbar) == on,Ne pas lancer à la connexion,Lancer à la connexion):$iif($group(#lagbar) == on,.disable #lagbar,.enable #lagbar)
-
Base Temps
.1 seconde: hadd -m lagbar time 10
.2 secondes: hadd -m lagbar time 9
.3 secondes: hadd -m lagbar time 8
.4 secondes: hadd -m lagbar time 7
.5 secondes: hadd -m lagbar time 6
.6 secondes: hadd -m lagbar time 5
.7 secondes: hadd -m lagbar time 4
.8 secondes: hadd -m lagbar time 3
.9 secondes: hadd -m lagbar time 2
.10 secondes:hadd -m lagbar time 1
-
Sauver Position:$savehlb
-
Quitter:hfree lagbar | unset %dx %dy | lag.off
}
alias -l mhlb if (!$hget(lagbar)) hmake lagbar 100
alias -l lhlb if ($isfile($hdlb)) hload lagbar $hdlb
alias -l savehlb hsave -o lagbar $hdlb
alias -l hdlb return $scriptdirlagbar.hsh
alias -l deplace {
set %dx $calc($mouse.dx - $2)
set %dy $calc($mouse.dy - $3)
window $1 %dx %dy
if ($mouse.key & 1) { .timer 1 0 deplace $1- | .timerlag off }
else { hadd -m lagbar pos %dx %dy | lag }
}
on 1:APPACTIVE:if ($window($lb)) $iif($appactive,window -o $lb,window -u $lb)
menu status,query,channel,menubar {
$iif(($status == connected) && (!$window($lb)),[LagBar],$style(2) [LagBar]):.lag
}
#lagbar off
on 1:connect:{ if (!$window($lb)) .lag }
#lagbar end