# Aliases. Server end extended IRC commands. unload cetk.commands package cetk.commands # Tabkey deltas. load tabkey.ce @aliasctl(alias set tabkey.main $sar(g/echo/xecho -banner -nolog --/$aliasctl(alias get tabkey.main))) alias.t tabkey.default return $tabkey.method.nickchannotify($*) alias.t tabkey.cmd.allgroups tabkey.recurse 1 alias.t tabkey.cmd.allservs tabkey.recurse 1 alias.t tabkey.cmd.allwins tabkey.recurse 1 alias.t tabkey.cmd.allvwins tabkey.recurse 1 alias.t tabkey.cmd.rdelay tabkey.recurse 2 alias.t tabkey.cmd.array.read tabkey.method.filei alias.t tabkey.cmd.load tabkey.method.filei alias.t tabkey.cmd.defer tabkey.recurse 1 alias.t tabkey.cmd.eval tabkey.recurse 1 alias.t tabkey.cmd.call tabkey.recurse 1 alias.t tabkey.cmd.call.trace tabkey.recurse 2 alias.t tabkey.cmd.call.xtrace tabkey.recurse 2 alias.t tabkey.cmd.1cmd tabkey.recurse 2 alias.t tabkey.cmd.q1cmd tabkey.recurse 3 alias.t tabkey.cmd.qcmd tabkey.recurse 2 alias.t tabkey.cmd.scmd tabkey.recurse 2 #alias.t tabkey.cmd.if.chan tabkey.recurse 2 #alias.t tabkey.cmd.if.connected tabkey.recurse 2 #alias.t tabkey.cmd.if.empty tabkey.recurse 2 #alias.t tabkey.cmd.if.net tabkey.recurse 2 #alias.t tabkey.cmd.if.serv tabkey.recurse 2 #alias.t tabkey.cmd.if.rand tabkey.recurse 2 #alias.t tabkey.cmd.if.umode tabkey.recurse 2 #alias.t tabkey.cmd.if.nick tabkey.recurse 2 #alias.t tabkey.cmd.if.nuh tabkey.recurse 2 #alias.t tabkey.cmd.if.uh tabkey.recurse 2 #alias.t tabkey.cmd.unless.chan tabkey.recurse 2 #alias.t tabkey.cmd.unless.connected tabkey.recurse 2 #alias.t tabkey.cmd.unless.empty tabkey.recurse 2 #alias.t tabkey.cmd.unless.net tabkey.recurse 2 #alias.t tabkey.cmd.unless.serv tabkey.recurse 2 #alias.t tabkey.cmd.unless.rand tabkey.recurse 2 #alias.t tabkey.cmd.unless.umode tabkey.recurse 2 #alias.t tabkey.cmd.unless.nick tabkey.recurse 2 #alias.t tabkey.cmd.unless.nuh tabkey.recurse 2 #alias.t tabkey.cmd.unless.uh tabkey.recurse 2 alias.t tabkey.cmd.setm tabkey.cmd.set #alias -tabkey.cmd.m #alias -tabkey.cmd.msg #assign tabkey_max_msg_history 0 #purge tabkey.index #purge tabkey_nickcomp_suffix alias.tt scan.list (chans) { @ :min = isnumber(b10 $chans) ? shift(chans) : 0 @ :max = isnumber(b10 $chans) ? shift(chans) : 0 @ :bold = chr(2) @ :echo = [xecho -banner --] @ :chans = chans ? chans : [*] foreach list.chan chan { @ :nchan = decode($chan) unless (rmatch($nchan $chans)) {continue} foreach list[chan][$chan][nuh] user { @ :nuser = decode($user) unless (isuser($nuser $nchan)) {continue} @ :cl = my[cl] = rightw(1 $numsort($my[cl] $strlen($nchan))) @ :nl = my[nl] = rightw(1 $numsort($my[nl] $strlen($nuser))) $echo $[$cl]nchan $[$nl]nuser [$checkuser($nuser $nchan) $findusers($nuser $nchan)] [$checkshit($nuser $nchan) $findshits($nuser $nchan)] } } foreach list.nuh user { @ :nuser = decode($user) if (isuser($nuser .)) { @ :nl = my[nl] = rightw(1 $numsort($my[nl] $strlen($nuser))) $echo $[$nl]nuser [$checkuser($nuser .) $findusers($nuser .)] [$checkshit($nuser .) $findshits($nuser .)] } } } #fe (scan.chan "fe ($mychannels())" "@:nchan=chan" "fe ($nickuserhost($filter($servernick() $chanusers($chan))))" "@:nuser=user" "fe ($nickuserhost($notify(on)))" "@:nuser=nuh" scan.list "foreach list.chan" "@:nchan=decode($chan)" "foreach list[chan][\$chan][nuh]" "@:nuser=decode($user)" "foreach list.nuh" "@:nuser=decode($nuh)") cmd foo food fook fool bar bard {alias.t $cmd (chans) @:min=isnumber(b10 $chans)?shift(chans):0,:max=isnumber(b10 $chans)?shift(chans):0\;@:chans=#chans?chans:[*]\;$foo chan \{$food\;unless (rmatch($nchan $chans)){continue}\;@:mask=remw($word(0 $rpattern($nchan $chans)) $chans)\;$fook user \{$fool\;unless (matchuser($nuser $nchan $mask)||matchshit($nuser $nchan $mask)){continue}\;xecho -banner -- \$[2]pattern(??$beforr(! $nuser) $channel($nchan))\$[20]nchan \$nuser \$attr.bold([$attr.bold($checkuser($nuser $nchan) $findusers($nuser $nchan))] [$attr.bold($checkshit($nuser $nchan) $findshits($nuser $nchan))])\}\}\;$bar nuh \{$bard\;if (checkuser($nuser .)||checkshit($nuser .)){xecho -banner -- $nuser $attr.bold([$attr.bold($checkuser($nuser .) $findusers($nuser .))] [$attr.bold($checkshit($nuser .) $findshits($nuser .))])}\}} fe (me describe notice notice say msg) foo bar { alias.t a$foo m$foo * alias.t m$foo (dest, ...) $bar \$unsplit(, $pattern("\\[$dest\\]" $mychannels())) \$* } alias.t c mode $C alias.t m msg alias.t nick unless (rmatch($0 $my.nickfilter)) {@ my.nicks = uniq($* $my.nicks)};//nick $* alias.t whittle (args) wit $shift(args) $shift(args) $shift(args) $args;widle $args alias.t wilca (args) { @ :age = time() @ :age-= isnumber(b10 $args) ? shift(args) : 60 @ :cnt = isnumber(b10 $args) ? shift(args) : 0 @ :args = #args ? args : mychannels() unless (args) { echo Usage: ${t} {time} {max-at-a-time} #channel ... } fe ($args) chan { @ :echan = encodel($chan) foreach list[chan][$echan][nuh] nuh { if (age < list[chan][$echan][nuh][$nuh]) { wiq $cnt $before(! $decode($nuh)) } } } } alias.t wilf wi $before(! $last[$serversrefe()][from]) alias.t wilj wi $: alias.t wilm wi $, alias.t wils wi $D alias.t widle (args) who -line {xecho -- $0$chr(9)$[$max(9 $@1)]1 $[4]2 $[-6]{time()-list[chan][$encodel($0)][nuh][$encodel($1!$3@$4)]} $[-6]{time()-list[nuh][$encodel($1!$3@$4)]} $3@$4 $attr.bold(\($attr.bold($checkuser($1!$3@$4 $0))\)\($attr.bold($checkshit($1!$3@$4 $0))\))\($6 $7-\)} $unsplit(, ${args ? shift(args) : mychannels()}) $args alias.t wit (a0,a1,a2,a3) who -line \{if \(${!strlen($strip(- $a0))?1:[0<=index\($a0 \$2\)]}&&${!strlen($strip(- $a1))?1:[0>index\($a1 \$2\)]}\) \{wiq $a2 \$1\}\} $unsplit(, ${a3 ? shift(a3) : mychannels()}) $a3 alias.t wit.joiners (args) { fe ($args) arg { on #-join - "$arg" { if ([$0] == servernick()) { ^wit - d 40 $1 } else { ^wiq $0 } } } } # Aliases. CTCP extended commands. fe (x c e) foo {alias.t ${foo}offers (args) ctcp \${#args?shift(args):T} ${foo}dcc \${#args?shift(args):[list]} \$args} fe (ver version) cmd ctcp {alias.t $cmd ctcp \${[$*]?[$*]:T} $ctcp} alias.t chat dcc chat # Client end extended IRC debugging stuff. alias.t call.ticks { @:t1=ticks.read() $* @:t2=ticks.read() @:run=shift(t2)-shift(t1) @:up=shift(t2)-shift(t1) if (functioncall()) { return $run $up } else { @:ofp=setset(floating_point_math on) @:pc=trunc(8 ${run/up}) ^set $ofp xecho -banner -nolog -- $run / $up = ${1>=pc?pc:attr.bold($pc)}: $* } } alias.t coredump @:onoff=[$0]==[off]?0:1;if (perl(require "syscall.ph";local \$foo="x"x16;syscall &SYS_getrlimit, 4, \$foo;(undef,$foo)=unpack "II",\$foo;syscall&SYS_setrlimit, 4, pack "II",\(\$foo*$onoff\),\$foo)) {echo System call failed: $perl(\$!)} elsif ([$0]==[abort]){abort $1-} elsif ([$0]==[perl]){@perl(dump)} alias.t debughook fe (10000 pop -10000 push) foo bar \{on #$1 \$foo ${[$0]?[]:[-]}"${2<#?[$2-]:[*]}" stack \$bar set debug\\\;\${0>foo?[^set debug $0]:}\} # Aliases. Variable handling functions. alias.t assign.rem if (strlen(${:foo=remws($1- / $($0))})){assign $0 $foo}{assign -$0} alias.t 005.dump { @ :sn = servernum() @ :sv = servername() @ :sg = servergroup($sn) fe ($serverctl(get $sn 005s)) five { @ :v5 = serverctl(get $sn 005 $five) unless (rmatch("$sn $sv $sg $five $v5" $*)) {continue} xecho -banner -nolog -- $[-4]sn $[-40]sv $[10]sg $[20]five $v5 } } # Aliases. Client end extended IRC commands. call.xtrace dword fe (nick \$servernick() ircuser "\$beforr(@_$X)") bard bark { fe (rand \$word.rand($*) dict "\$pass($jotc(AZaz) $word.dict($*))" shuffle "\$shufflec\($bark\)" rev "\$reverse\($bark\)" roll "\$rollc\(\${#?[$*]:1} $bark\)" rot13 "\$rot13\($bark\)" unroll "\$after(-1 _ $servernick())\$before(_ $servernick())") foo bar { alias.t ${bard}.${foo} ${bard} ${bar} } } alias.t ircuser ircinfo $* alias.t irchost ircinfo "" $* alias.t ircserv ircinfo "" "" $* alias.t ircname ircinfo "" "" "" $* alias.t ircinfo (args) { @ :nuser = [] @ :sv = isnumber(b10 $args) ? shift(args) : servernum() @ :user = serv[$sv][user] ? serv[$sv][user] : my.user repeat 3 { @ :x1 = shift(args) @ :x2 = shift(user) @ :x3 = x1 ? x1 : x2 ? x2 : [.] @ push(nuser $x3) } @ :x3 = args ? [\:]##args : user ? user : [\:.] @ push(nuser $x3) @ serv[$sv][user] = nuser } alias.t allmodes redirect 0 mode ${[]==[$1]?servernick():[$1]} $0$shufflec($jotc(AZaz09))$serverctl(get $servernum() umodes) #alias.t allservs fe ($myservers(,)) serv {xeval -server $serv -window $serverwin($serv) {$*}} #alias.t allvwins fe ($revw($winrefs())) win {window swap $win;$*} #alias.t allwins fe ($revw($winrefs())) win {xeval -window $win -server $winserv($win) {$*}} alias.t rdelay timer $rand($0) $1- alias.t beeper cbeep $repeat(59 0.1 0.1 10 ) 0.1 0.1 alias.t blast (args) { @ :rep = isnumber(b10 $args) ? shift(args) : 1 @ :targ = unsplit(, $shift(args)) repeat $rep {^msg $targ ${args ? args : chr($randcnf(128 0 10 13))}} } alias.t channums (mode) fe ($mychannels()) foo {xecho -banner -nolog -- $[-4]winchan($foo $servernum()) $[-4]numwords($chops($foo)) / \($[-5]{numwords($filter(${:cuh=userhost($foo $chanusers($foo))}))} + $[5]{numwords($pattern($cuh))}\) $left(2 $pattern(??$servernick() $channel($foo)))$colorise($foo) \($chanmode($foo)\) \(b:$#filter(0 $chanbans(b $foo))\)};xecho -banner -nolog -- $#mychannels():$#chanusersa():$bcalc($unsplit(+ $replacex(\$#chanusersa(,) , $mychannels()))) chans:users:nicks. Known: $numwords($filter(${:cuh=userhost(, $chanusersa())})) Unknown: $numwords($pattern($cuh)) alias.t chart.ascii fe ($jot(0 15)) foo {@:baz=[];@foo*=16;fe ($jot(0 15)) bar {@baz#=chr(${foo+bar})};xecho -banner -nolog -- $[20]baz$chr(5)$[20]baz} alias.t chart.color { fe (epic mirc) foo bar { xecho -banner -nolog -- $[33]foo$[33]bar } fe ($jot(0 15)) back { @:mirc=[] @:epic=[] fe ($jot(0 15)) fore { @epic#=[$chr(3)${~7&fore?5:3}${7&fore},4${7&back}${~7&back?chr(6):[]}${7&fore}${7&back}] @mirc#=[$chr(3)$fore,$tr(/ /0/$[-2]back)${7&fore}${7&back}] } xecho -banner -nolog -- $epic$chr(15) $mirc } } alias.t checkdoc @:funcs=tolower($getfunctions());fe funcs func {@func=word(7 $stat($globi($getset(help_path)/6*/$func)))?[]:func};if (#funcs){echo $funcs} alias.t cloak set auto_away off;set auto_rejoin 0;cset * auto_rejoin 1;if (0==cloak||[]!=[$0]){set cloak ${[]==[$0]?2:[$0]}};set command_mode on;set dcc_autoget off;notify -;cdcc doffer *;timer -d all alias.t cps { @ :totalreceived = :totalconnect = :connected = :totalcps = totnicks = [] fe ($myservers(,)) serv { xeval -s $serv { xecho -banner -nolog -window crap -level crap -- $[10]{serv##servergroup()} $[-30]servername() $[-40]X $[10]servernick()$[-5]{totnicks+=:nicks=numwords($chanusersa()),nicks}/$#mychannels() $mychflags($mychannels()) } } fe ($serverctl(gmatch *)) serv { push :mychans $mychannels($serv) @ :eserv=serversrefe($serv) @ totalreceived+=lag[$serv][received] @ totalconnect+=time()-lag[$serv][connected] @ connected++ @ totalcps+=lag[$serv][received]/(time()-lag[$serv][connected]) @ :tags = beforew(005 $* 005) @ :s005 = afterw(005 $*) fe tags tags {@tags = serverctl(get $serv $tags)} fe s005 s005 {@s005 = serverctl(get $serv 005 $s005)} xecho -banner -nolog -window crap -level crap $[10]{serv##servergroup($serv)} $status.lag($serv) =$[-10]lag[$serv][received] /$[-10]{time()-lag[$serv][connected]} $tags $s005 } xecho -banner -nolog -window crap -level crap AvCPS:${totalcps/connected} CuCPS:${totalreceived/totalconnect} TtCPS:$totalcps AvRec:${totalreceived/connected} TtRec:$totalreceived AvCon:${totalconnect/connected} TtCon:$totalconnect TtServs:$connected TtChans:$#mychans TtNicks:$totnicks @totnicks=[] } alias.t ctcp.clone ^on ctcp_reply "*" if ([]==ctcpreply[all][$1])\{@ctcpreply[all][\$1]=[\$1-]\};if ([]!=[$1-]){ctcp $*} if ([]==ctcpreply.all.clientinfo){ctcp $0 clientinfo}{@:replies=before(: $ctcpreply.all.clientinfo);@:wanted=[];fe ($replies) reply {if ([]==ctcpreply[all][$reply]){@:wanted#=[ $reply]}};if ([]==wanted){xecho -banner -nolog -- Complete;^on ctcp_reply -"*"}{xecho -banner -- Remaining: $wanted;ctcp $0 $word($rand($numwords($wanted)) $wanted)}} alias.t ctcp.clone { stack push on ctcp_reply ^on ctcp_reply "% % ping 1" { stack pop on ctcp_reply stack push on ctcp_reply ^on ctcp_reply "% % ping 2" { stack pop on ctcp_reply } ^on ctcp_reply "*" { @ :req = shift(ctcpreply[$encodel($0)]) @ ctcpreply[$encodel($0)][$encodel($2)] = [$3-] } } push ctcpreply[$encodel($0)] $1- ctcp $0 ping 1 ctcp $* ctcp $0 ping 2 } alias.t dcc.flood (args) { fe ($common($dccctl(typematch raw) / $dccctl(writables))) id { @ :count = 0 @ :fd = dccctl(get $id user) while (args && ++count && dccctl(get $id writable)) { msg =$fd $args } echo $id =$fd $count $dccctl(get $id sent) } } alias.t dnotify @:on=setset(do_notify_immediately off);//notify $*;^set $on alias.t dopme (msk default *) { @ :sn = servernick() @ :chans = pattern("\\[$msk\\]" $mychannels()) fe ($chans) chan { if (ischanop($sn $chan)) { qmode $chan -o $sn } } } alias.t echo xecho -banner -nolog -window crap -- alias.t fake foreach -fake foo {fake.${foo} $*} fe (names 366 who 315) bar baz {alias.t fake.$bar fe (${[$1]?[$1-]:mychannels()}) foo \{timer -rep \${#?[$0]:0} 0 ^pretend :\$S $baz \$servernick() \$foo :End of /$toupper($bar) list.\;repeat ${!![$0]} who -flush\}} fe (whois 318 whowas 369) bar baz {alias.t fake.$bar timer -rep \${#?[$0]:0} 0 ^pretend :\$S $baz \$servernick() \$foo :End of /$toupper($bar)} alias.t fake.ison timer -rep ${#?[$0]:1} 0 ^pretend :$S 303 $servernick() :$1-;allservs dnotify $notify() alias.t fake.pong timer -rep ${#?[$0]:1} 0 ^pretend :$S PONG $S :\${[]==[$1]?time():[$1-]} alias.t fake.uh timer -rep ${#?[$0]:1} 0 ^pretend :$S 302 $servernick() :$1- alias.t fake.wait timer -rep ${#?[$0]:1} 0 ^pretend :$S 421 $servernick() ***LW*** :Unknown command alias.t guardchan if ([$0]>999999||[$0]<10){xecho -banner -nolog -- ${t}: A number greater than 10 is needed}{join $1 $3;timer -rep -1 $0 {if (!match($1 $mychannels())){^timer -ref gcqb 0 {^timer -ref gcqb 1800 {};quote PART $1,$2};timer 1 join $1 $3;if ([$2]!=[-]&&[$2]!=[]){ctcp $2 invite $1 $4}} if (!match($N $chops($1))]){if ([$2]!=[-]&&[$2]!=[]){ctcp $2 op $1 $4};opme 0 $1 $4;opme 0 $1} if ([$2]!=[-]&&[$2]!=[]){join $2 $3}} \# ${t} $*} alias.t huncit (args) { @ :fd = open("$shift(args)" w) fe (onuh " *" nuh "") sp pr { foreach list[$sp] nuh { @ write($fd $nuhnorm($decode($nuh))$pr) foreach list[$sp][$nuh] foo { @ write($fd $nuhnorm($decode($nuh)) $list[$sp][$nuh][$foo]) } } } foreach list.chan chan { fe (onuh @ nuh "") sp pr { @ :echan = decode($chan) foreach list[chan][$chan][$sp] nuh { @ write($fd $nuhnorm($decode($nuh)) $pr$echan) } } } @ close($fd) } alias.t icb { ^exec -window -name icb -line { echo $strip("$chr(10 13)" $*) } -error { echo $attr.bold(ICB): $strip("$chr(10 13)" $*) } icb -color -nick $N -group $N ^exec -in %icb $* } alias.t lc lastlog $C $* alias.t list.chan.list (args) { @ :min = isnumber(b10 $args) ? shift(args) : 0 @ :max = isnumber(b10 $args) ? shift(args) : 999999 @ :total = 0 @ :counted = 0 unless (#args) { echo ${t} [min] [max] netmask chanmask ... return } foreach list[chan] chan { foreach list[chan][$chan][net] net { @ total++ @ :num = word(1 $list[chan][$chan][net][$net][list]) if (min > num || num > max) { continue } elsif ([$decode($net) $list[chan][$chan][net][$net][list]] !~ args) { continue } @ counted++ xecho -banner -nolog -- $[10]decode($net) $list[chan][$chan][net][$net][list] } } xecho -banner -nolog -- $counted/$total $after(. ${t})s for $args listed. } alias.t list.chan.stat (args) { @ :min = isnumber($args) ? shift(args) : 0 @ :max = isnumber($args) ? shift(args) : 999999 unless (#args) { echo ${t} [min] [max] chanmask ... return } foreach list.chan chan { @ :stat = [] if (rmatch($decode($chan) $args)) { @ :total = 0 fe (onuh nuh) foo { @ :count = 0 foreach list[chan][$chan][$foo] nuh {@count++} @ :stat #= [$[-6]count ${foo}s] @ :total = count } @ :stat #= [$chr(9)$attr.bold(\($attr.bold($decode($chan))\))] if (min <= total && total <= max) { xecho -banner -level crap -window crap $stat } } } } stack push alias alias.tt alias alias.tt { fe (nuh onuh) type { alias.t $sar(g/\$type/$type/$*) } } alias.tt list.chan.$type (args) { @ :age = isnumber(b10 $args) ? time() - shift(args) : [] @ :rng = isnumber(b10 $args) ? shift(args) + age : [] @ :cmask = args fe cmask foo {@ foo = before(, $foo,)} foreach list[chan] chan { @ :chn = decode($chan) @ :ctotal++ unless (rmatch($chn $cmask)) {continue} @ :ccounted++ foreach list[chan][$chan][$type] nuh { @ :utotal++ unless (rmatch($chn,$decode($nuh) $args)) {continue} @ :ucounted++ @ :baz = list[chan][$chan][$type][$nuh] if (age && age > baz) { } elsif (rng && rng < baz) { } elsif (functioncall()) { push :ret $chn,$decode($nuh) } else { @ nuh = decode($nuh) @ my.cl = rightw(1 $numsort($my.cl $strlen($chn))) @ my.nl = rightw(1 $numsort($my.nl $strlen($nuh))) xecho -banner -nolog -- $[$my.cl]chn $[$my.nl]nuh ${isnumber($baz)?stime($baz):baz} } } } if (functioncall()) { return $ret } else { xecho -banner -nolog -- $ccounted/$ctotal chans scanned and $ucounted/$utotal nuhs listed. } } fe (chan nick nuh onuh) type {alias.t list.$type @:ret=[]\;@:total=0\;@:counted=0\;foreach \${t} foo \{@total++\;if (rmatch($decode($foo) $*))\{@counted++\;@:baz=[\$(${t}.${foo})]\;if (functioncall()){@push(ret $decode($foo))}\{xecho -banner -nolog -- \$decode($foo)$chr(9)\${isnumber($baz)?stime($baz):baz}$chr(9)\$list[${type=~[*nuh]?[nuh]:type}][\$foo][${type=~[chan*]?[keys]:[servers]}]\}\}\}\;if (functioncall()){return $ret}\{xecho -banner -nolog -- \$counted/\$total \$after(. ${t})s listed.\}} stack pop alias alias.tt alias.t list.reap { @:win=winnum() @:args=[$*] @:time=isnumber(b10 $args)?time()-shift(args):time() @:count=0 @:total=0 @:utime=utime() foreach list[nuh] nuh { if (++total&&time>list[nuh][$nuh]&&rmatch($decode($nuh) $args)&&++count) { purge list[nuh][$nuh] } } xecho -banner -nolog -window $win $count/$total ${(100*count)/total}% nuhs purged in $tdiffu($utime) seconds. @:count=0 @:total=0 @:utime=utime() foreach list[chan] chan { foreach list[chan][$chan][nuh] nuh { if (++total&&time>list[chan][$chan][nuh][$nuh]&&rmatch($decode($chan),$decode($nuh) $args)&&++count) { purge list[chan][$chan][nuh][$nuh] } } } xecho -banner -nolog -window $win $count/$total ${(100*count)/total}% chan nuhs purged in $tdiffu($utime) seconds. } alias.t list.comchan (echans) { @ :max = isnumber(b10 $echans) ? shift(echans) : numwords($echans) fe echans chan {@ chan = encode($tolower($chan))} foreach list[chan] echan { if (match($echan $echans)) {continue} @ :chan = decode($echan) foreach list[chan][$echan][nuh] enuh { @ :matches = 0 fe ($echans) snach { @ :matches += list[chan][$snach][nuh][$enuh] ? 1 : 0 } if (max <= matches) { @ enuh = decode($enuh) @ my.cl = rightw(1 $numsort($my.cl $strlen($chan))) @ my.nl = rightw(1 $numsort($my.nl $strlen($enuh))) xecho -banner -nolog -- $[-2]matches $[$my.cl]chan $[$my.nl]enuh ${isnumber($baz)?stime($baz):baz} } } } } alias.t load.grep (args) @:ln=[];@:fd=open($shift(args) r);@:reg=regcomp($args);while ((ln=read($fd))||!eof($fd)){unless (regexec($reg $ln)){^$ln}};@regfree($reg) alias.t load.ircservs { @ :oxd = xdebug() xdebug dword @ :fh = open(${[] == [$0] || [.] == [$0] ? [~/.ircservers] : [$0]} R) while (!eof($fh)) { @ :serv = read($fh) @ :host = cut(0 : $serv) @ :port = cut(1 : $serv) @ :port = port ? port : 6667 if (@serv && rmatch($serv ${# ? [$1-] : [*]})) { @ :eserv = encodel($host:$port) @ my[serversgroup][$eserv] = after(4 : $serv) push my[servergroups][$cut(4 : $serv)] $serv } } @ close($fh) xdebug $oxd } alias.t load.mircservs { @ :pass = jotc(azAZ09__) @ :fh = open(${[] == [$0] || [.] == [$0] ? [servers.ini] : [$0]} R) while (read($fh) != [\[servers\]]) {} while (:serv = read($fh)) { @ :host = cut(2 : $serv) @ :port = cut(3 : $serv) @ :port = port ? port : 6667 @ :port = split(, $port) fe port port { if (port =~ [*-*]) { @ port = split(- $port) @ port = jot($port) } else { @ port += 0 } } if (rmatch($serv ${# ? [$1-] : [*]})) { @ :group = cut(4 : $serv) @ :group = pass($pass $group) fe port port { @ :eserv = encodel($host:$port) @ my[serversgroup][$eserv] = after(4 : $serv) @ :port = [$host:$port:::$group] } ^assign.add my[servergroups][$group] $port } } @ close($fh) } alias.t notify.files (args) {@ time = isnumber(b10 $args) ? shift(args) : 600;ison -oncmd {^notify : $*} -end \{timer -update -ref ${t} $time ${t} $time $args\} $readlineall($args)} alias.t on.1 (args) @:hook=splice(args 0 ${word(0 $args)=~[*#*]?2:1});@:mask=["$shift(args)"];on $hook $mask on $hook -$mask\;$args alias.t on.1 (hook,args qwords 1) @hook=~[%#*]&&push(hook $shift(args)),:mask=shift(args);on $hook "$mask" on $hook -"$mask"\;$args alias.t ping if.connected eval ^ctcp.request ${#?unsplit(, $*):servernick()} PING $utime() alias.t ping.me if.connected eval ^ctcp.reply ${#?unsplit(, $*):servernick()} PING $utime() alias.t pppip @:fh=open(~/.ppp.ip R T);@pppip=read($fh);@close($fh) alias.t pubfilt on ^public \"% % *$0-*\" {} alias.t qchat query =$word(${#-1} $*);chat $* alias.t quit.pingtimeout eval quote QUIT :${[]!=quiterror.ping?quiterror.ping:[Ping timeout for $servernick()\[${after(@ $userhost($servernick()))}\]]} alias.t resync fe (${strlen($*)?[$*]:mychannels()}) foo {qcmd 9 mode $foo;qcmd 9 mode $foo b;qcmd 9 who $foo} alias.t roll @:args=[$*];@:num=isnumber($args)?shift(args):1;@:len=#args;if (0num){@unshift(args $splice(args ${len+num} ${0-num}))};if (functioncall()){return $args}{xecho -banner -- $args} alias.t rollc @:args=[$*];@:num=isnumber($args)?shift(args):1;@:function_return=chr($roll($num $ascii($1-))) alias.t rot13 @:rot=tr(/$jotc(azAZ)/$jotc(nzamNZAM)/$*);if (functioncall()){return $rot}{xecho -banner -- $rot} alias.t serv.lock timer -ref ${t} -rep -1 $0 {if ((S!=[$1])&&([\[$serversgroup($S)\]]!=[$1])){^server $1}} \# ${t} $0- alias.t serv.watch timer -ref ${t} -rep -1 $0 {if ([$0]*3index(\{\(\[ $VAR)&&[]!=[$($VAR)]) { xecho -banner -nolog -- \$$VAR==$($VAR) } } } alias.t winall fe ($revw($winrefs())) foo {window $foo $*} alias.t winstable @:wins;fe ($winrefs()) foo {if (winchan($foo)){@push(wins $foo chan $winchan($foo))}};window $* $wins # Aliases. Miscelaneous extended commands. alias.t nwi nwhois alias.t nww nwhowas alias.t perftest.servproc { on #-raw_irc ${1<<31} $0* { @ :cookie = rand(0) queue perf$cookie { @ :ut = utime() @ :lf = setset(floating_point_math on) @ :cnt = ++debug[perf][cnt][$debug.perf.serv][$debug.perf.cmd] @ :ttl = debug[perf][ttl][$debug.perf.serv][$debug.perf.cmd] += tdiffu($debug.perf.start $ut) @ debug[perf][avg][$debug.perf.serv][$debug.perf.cmd] = ttl / cnt ^set $lf } defer queue -do perf$cookie @ debug.perf.cmd = [$1] @ debug.perf.serv = lastserver() @ debug.perf.start = utime() } } alias.t perftest.msg (args) { @:a0=#args?shift(args):250 @:a1=#args?shift(args):0 call.time call.ticks repeat $a0 pretend :foo\$rand(10000)!\$rand\($a1\)@bar.com PRIVMSG ${C?C:N} :Testing. } alias.t perftest.fillstruct (arg,dep,wid,args) { if (0 > --dep) { return } for foo from 0 to $wid { ^assign ${arg}.${foo} $args ${t} ${arg}.${foo} $dep $wid $args } } alias.t remlog ^//${t};^set msgcount 0;reinitstat alias.t plm ping $, alias.t pm ping.me alias.t raw quote alias.t trace.route userhost $* -cmd {exec -window -line \{xecho -banner -- $0$attr.bold(:) \$*\} traceroute-nanog -q 1 -m 255 $4 2>&1 | perl -lpe 'BEGIN{$|=1}'} alias.t winorder { @:winnum=winnum() stack push set beep ^set beep off ^parsekey unstop_all_windows fe ($revw($numsort($filter($winnum $winrefs())))) foo { if (foo!=winnum()) { ^window swap $foo parsekey scroll_end } } window swap $winnum stack pop set beep } alias.t wn window new