ctcp *:version:*:{
ctcpreply $nick Version Scrolling Titlebar 06.13.2007 by Russel Bairstow
}
menu channel,nicklist {
Titlebar scrolling speed : set %scroll $$input(Scrolling Speed,e,number of milliseconds,$iif(%scroll,$v1,250)) | .timer.sb -m 0 $iif(%scroll,$v1,250) sb.disp $chan
}
on *:start:{
.titlebar $me
}
alias sb.title {
return $chan($1).topic
}
alias sb.break {
return ***
}
alias sb.pre {
return $1 $chan($1).mode $nickcount($1)
}
alias sb.suf {
return
}
alias sb.stop {
unset %sb.*
.timer.sb off
}
alias sb.start {
unset %sb.*
set %sb.point 0
.timer.sb -m 0 $iif(%scroll,$v1,250) sb.disp $1
}
alias sb.disp {
if $1 ischan {
var %sb.title = $sb.break $strip($sb.title($1))
inc %sb.point 1
if (%sb.point > $len(%sb.title)) set %sb.point 1
var %sb.disp = $right(%sb.title,$calc($len(%sb.title) - %sb.point)) $left(%sb.title,%sb.point)
titlebar $sb.pre($1) %sb.disp $sb.suf
}
else {
titlebar $pm.time($network,$1)
}
}
alias -l nickcount {
var %a = 1, %b = $len($prefix), %nick.count
while %a <= %b {
%nick.count = $+(%nick.count,$nick($1,0,$mid($prefix,%a,1)),$mid($prefix,%a,1),$chr(44))
inc %a
}
return $replace(%nick.count $+ $nick($1,0,r) $+ ΓΈ,$chr(44),$+($chr(44),$chr(32)))
}
on *:active:*:{
sb.start $active
}
on *:close:?:{
unset $+(%,time,.,$network,.,$nick)
}
on *:open:?:*:{
set $+(%,time,.,$network,.,$nick) $ticks
}
alias -l pm.time {
return $1 $2 $elapsed($($+(%,time,.,$1,.,$2),2))
}
alias -l elapsed {
return $+($duration($int($calc(($ticks - $1) / 1000)),3),.,$calc(($ticks - $1) % 1000))
}