; #= P&P -a ; ********************** ; Unsorted routines ; ********************** ;;;###*** Not yet divided ***###;;; ; _series variable token ; can track any number of tokens- first set stored in %variable, next set in %variable1, %variable2, etc. ; %variable0 contains the number of the last set, or is null if only one set in %variable _series { var %where = $1 $+ % [ $+ [ $1 ] $+ [ 0 ] ] :loop if ($calc($len(% [ $+ [ %where ] ] ) + $len($2)) < 400) % [ $+ [ %where ] ] = % [ $+ [ %where ] ] $2 else { inc % [ $+ [ $1 ] $+ [ 0 ] ] %where = $1 $+ % [ $+ [ $1 ] $+ [ 0 ] ] goto loop } } ; $_countseries(variable) counts total tokens from a series generated by _series _countseries { var %where,%total = 0,%new :loop %new = $numtok(% [ $+ [ $1 ] $+ [ %where ] ] ,32) if (%new) { inc %total %new inc %where goto loop } return %total } ; Opposite of wildtok- returns token num that matches given token ; $_searchtok(tokens,tok,chr) _searchtok { var %pos = 1,%total = $numtok($1,$3) :loop if ($gettok($1,%pos,$3) iswm $2) return %pos if (%pos < %total) { inc %pos | goto loop } return 0 } ; Date and time in default formats (current or given) _date return $date($iif($1,$1,$ctime),$_cfgi(format.date)) _time return $time($iif($1,$1,$ctime),$_cfgi(format.time)) _datetime return $date($iif($1,$1,$ctime),$_cfgi(format.datetime)) _poptop var %poptop = $strip($replace($_rec(topic,$1),&&channel&&,#)) | if ($len(%poptop) > 75) return $left(%poptop,71) ... | return %poptop ; prevents reading options n0 thru n5 more than once every X seconds ; usage- $_optn(line,token) etc _optn if (%_opt.n [ $+ [ $1 ] ] == $null) set -u8 %_opt.n [ $+ [ $1 ] ] $readini -n $mircini options n [ $+ [ $1 ] ] | return $gettok(%_opt.n [ $+ [ $1 ] ] ,$2,44) ; Like $_optn but for events-default ; usage- $_edef(token) etc _edef if (%_ev.def == $null) set -u8 %_ev.def $readini -n $mircini events default | return $gettok(%_ev.def,$1,44) ; PW fog _pw.enc var %ret,%size = $len($1) | :loop | %ret = %ret $+ $chr($calc(160 - $asc($mid($1,%size,1)))) | if (%size > 1) { dec %size | goto loop } | return %ret _merge return $remove($1-,$chr(32)) _tf2o return $iif($1,On,Off) _o2tf return $iif($1 == On,1,0) _dur return $iif($1 > 86399, [ $int($calc($1 / 86400)) ] day) $iif($1 > 3599, [ $int($calc($1 % 86400 / 3600)) ] hr) $iif($1 > 59, [ $int($calc($1 % 3600 / 60)) ] min) $calc($1 % 60) s _round if ($len($gettok($1,2,46)) <= $2) return $1 | return $round($1,$2) _p if ($2 == 0) return 0% | return $_round($calc($1 * 100 / $2),2) $+ % :www return $1 $+ http://www.pairc.com/pnp/ $+ $1 :email return $1 $+ pnp@pairc.com $+ $1 _known if ($notify($1)) return 1 | if ($2) return $iif($remtok($level($2),=black,44) != $dlevel,1,0) | return $iif($remtok($level($address($1,5)),=black,44) != $dlevel,1,0) ; Prefixes each char with + or - _fixmode { var %final,%bit = +,%pos = 1 :loop if ($mid($1,%pos,1)) { if ($ifmatch isin -+) %bit = $ifmatch else %final = %final $+ %bit $+ $mid($1,%pos,1) inc %pos | goto loop } return %final } ; $_convmode(modes,char,default) ; Finds char in a fixmoded string and returns 1 or 0 for + or -, or default if not present (0 if not given) _convmode if (- [ $+ [ $2 ] ] isin $1) return 0 | if (+ [ $+ [ $2 ] ] isin $1) return 1 | if ($3- != $null) return $3- | return 0 ; ; Run an URL or e-mail ; http saveini | if ($readini -n $mircini files browser != $null) run $ifmatch $1- | elseif (*://* iswm $1-) run $1- | else run http:// $+ $1- mailto saveini | if ($readini -n $mircini files emailer != $null) run $ifmatch mailto: $+ $1- | else run mailto: $+ $1- ; ; Size in kb/meg/etc ; _size { if ($1 == $null) return (FileNotFound) if ($1 < 10240) return $1bytes if ($1 < 10240000) return $round($calc($1 / 1024),1) $+ k return $round($calc($1 / 1048576 + 0.00001),1) $+ meg } ; ; Recent target trackers (unique to one mirc) ; ; _recseen type value [suffix [max]] (one word; suffix is ignored in duplication searchs and is usually +; tacked on using $chr(127); max is max number to save- defaults to 10) _recseen var %old = $wildtok(%> [ $+ [ $1 ] ] ,$2*,1,32) | %old = $gettok($iif(%old,$remtok(%> [ $+ [ $1 ] ] ,%old,1,32),%> [ $+ [ $1 ] ] ),1- [ $+ [ $calc($iif($4,$4,10) - 1) ] ] ,32) | %> [ $+ [ $1 ] ] = $2 $+ $3 $iif(%old,%old) ; $_getrec(type[,curr]) (if curr is in list, returns next [null if last], otherwise returns first [null if none]) _getrec { if ($wildtok(%> [ $+ [ $1 ] ] ,$2*,1,32)) return $gettok($gettok(%> [ $+ [ $1 ] ] ,$calc($findtok(%> [ $+ [ $1 ] ] ,$ifmatch,1,32) + 1),32),1,127) return $gettok($gettok(%> [ $+ [ $1 ] ] ,1,32),1,127) } ; $_refsufx(type,token) Returns suffix for given token _refsufx return $gettok($wildtok(%> [ $+ [ $1 ] ] ,$2*,1,32),2-,127) ; $_refsufn(type,token) Returns suffix for given number _refsufn return $gettok($gettok(%> [ $+ [ $1 ] ] ,$2,32),2-,127) ; $_grabrec(type,n) Returns by number _grabrec if ($gettok(%> [ $+ [ $1 ] ] ,$2,32)) return $gettok($ifmatch,1,127) | return ; $_poprec(type,n[,x]) Used for popups (x is added to number if present) _poprec if ($_grabrec($1,$2)) return $calc($2 + [ $3 ] ) $+ . $replace($ifmatch,&,&&) | return ; _setrec /cmd /alt type [p] (pops up commands in current window from a recseen list; p adds a space to end of cmd) ; if setting is proper, auto-runs command. (if not a [p] command) /alt is used if nick has + suffix _setrec { if (=* iswm $active) var %editact = $editbox(chat [ $right($active,-1) ] ) else var %editact = $editbox($active) if (($_cfgi(recent.auto)) && ($4 != p)) { if ($_getrec($3)) { %_lastsrec = $ifmatch | if ($_refsufx($3,%_lastsrec) == +) $2 %_lastsrec | else $1 %_lastsrec } } elseif (($gettok(%editact,1,32) == $1) || ($gettok(%editact,1,32) == $2)) { if ($_getrec($3,$gettok(%editact,2,32))) { %_lastsrec = $ifmatch editbox -a $+ $4 $iif($_refsufx($3,$gettok(%_lastsrec,1,44)) == +,$2,$1) %_lastsrec } else { editbox -a | unset %_lastsrec } } elseif ($_getrec($3)) { %_lastsrec = $ifmatch | editbox -a $+ $4 $iif($_refsufx($3,%_lastsrec) == +,$2,$1) %_lastsrec } } ; ; Scheme data ; ; Plays a sound scheme file ; _ssplay code _ssplay { if (($inwave == $false) && ((%!away == $null) || ($2))) { var %line = $calc($findtok(connect disconnect youquit startup - chatreq filereq senddone getdone fileerror - newquery notice opnotice wallop snotice - youkick youop youdeop invite anykick - realnotify realunotify fakenotify fakeunotify - setaway setback setautoaway pager - attacked protection nicktaken selflag cantjoin clones otheralert - othererror complete question confirm,$1,1,32) + 25) %line = $read -tnl [ $+ [ %line ] ] $_cfg(display.dat) if ((%line != .) && ($exists(%line))) .splay " $+ %line $+ " } } ; $_msg(code[,msg]) ; Returns a message from current scheme; default if none; uses msg if present _msg { ; Get message if ($2) return $_premsg($2-) var %line = $read -tns [ $+ [ $1 ] ] script\scheme.dat,%found = $read -tnl [ $+ [ $readn ] ] $_cfg(display.dat) if (%found ==  ) return if (%found == $null) %found = $_p2s($gettok(%line,1,32)) return $_premsg(%found) } ; $_msgwrap(wrap,code[,msg]) ; Used for kick wrappers / etc. _msgwrap { ; Get message if ($3) var %msg = $3- else { var %line = $read -tns [ $+ [ $2 ] ] script\scheme.dat var %msg = $read -tnl [ $+ [ $readn ] ] $_cfg(display.dat) if (%msg == $null) %msg = $_p2s($gettok(%line,1,32)) if (!Random:* iswm %msg) %msg = $read -n $gettok(%msg,2-,58) } var %line = $read -tns [ $+ [ $1 ] ] script\scheme.dat var %wrap = $read -tnl [ $+ [ $readn ] ] $_cfg(display.dat) if (%wrap ==  ) %wrap = &msg& elseif (%wrap == $null) %wrap = $_p2s($gettok(%line,1,32)) if (!Random:* iswm %wrap) %wrap = $read -n $gettok(%wrap,2-,58) if (&msg& !isin %wrap) %wrap = %wrap &msg& return $_premsg($replace(%wrap,&msg&,%msg)) } ; $_premsg(msg) ; Does random files, &col*&, &ver&, &me&, &[&, &]&, and &counters& _premsg { var %tag,%sel,%col = 02 03 04 05 06 07 10 12 13 14 if (!Random:* iswm $1) var %msg = $read -n $gettok($1-,2-,58) else var %msg = $1- ; Replace colors :loopC if (&col isin %msg) { %tag = & $+ $gettok($right(%msg,$calc(- $pos(%msg,&col,1))),1,38) $+ & if (%tag isin %msg) { %sel = $gettok(%col,$_pprand($numtok(%col,32)),32) %col = $remtok(%col,%sel,32) %msg = $replace(%msg,%tag, [  $+ [ %sel ] ] ) if (%col) goto loopC } } ; Replace counters :loopN if (&count isin %msg) { %tag = & $+ $gettok($right(%msg,$calc(- $pos(%msg,&count,1))),1,38) $+ & if (%tag isin %msg) { %sel = $_cfgx($mid(%tag,7,1),%tag) inc %sel _cfgxw $mid(%tag,7,1) %tag %sel %msg = $replace(%msg,%tag,%sel) goto loopN } } ; Replace some codes return $replace(%msg,&ver&,$:ver,&[&,$:[,&]&,$:],&me&,$me) } ; $_finalmsg(msg) ; finishes up a message (doing $identifier stuff) _finalmsg { if ($1 == $null) return if ($ !isin $1-) return $_stripout($1-) var %ret = $replace($1-,$chr(32),$chr(141),!$,$chr(128)) if ($left(%ret,1) == $chr(128)) %ret = $chr(141) $+ %ret var %num = $numtok(%ret,128) if (%num > 1) { var %ret2 = $gettok(%ret,1,128),%cur = 2 :loop %ret2 = %ret2 $+ $ [ $+ [ $gettok($gettok(%ret,%cur,128),1,36) ] ] $+ $gettok($gettok(%ret,%cur,128),2-,36) if (%cur < %num) { inc %cur | goto loop } %ret = %ret2 } if (<$ isin %ret) %ret = $_dofm¹($replace(%ret,<$,$chr(128),>$,$chr(129))) return $_stripout($replace(%ret,$chr(141),$chr(32))) } _dofm¹ if ($chr(128) isin $1-) { var %todo = $chr(141) $+ $mid($1-,$pos($1-,$chr(128),1),$len($1-)),%todo2 = $chr(141) $+ $1- | return $_dofm²($_dofm³(%todo),%todo2) } | if ($1) return $1- | return ;;; old routine- did double eval IE <$upper$ $me>$upper$ ;_dofm² return $gettok($2-,1,128) $+ $replace($ [ $+ [ $gettok($gettok($gettok($2-,2-,128),1,129),1,36) $+ ( [ $replace($_dofm¹($left($gettok($1,2-,36),-1)),$chr(141),$chr(32)) ] ) ] ] ,$chr(32),$chr(141)) $+ [ $_dofm¹($gettok($mid($2-,$calc($pos($2-,$chr(128),1) + $len($1)),$len($2-)),2-,36)) ] ;;; new routine- doesn't do commas IE <$r$1,9>$r$ BUT otherwise is perfect _dofm² return $gettok($2-,1,128) $+ $replace($ [ $+ [ $gettok($gettok($gettok($2-,2-,128),1,129),1,36) $+ ( ] ] $replace($_dofm¹($left($gettok($1,2-,36),-1)),$chr(141),$chr(32)) ),$chr(32),$chr(141)) $+ [ $_dofm¹($gettok($mid($2-,$calc($pos($2-,$chr(128),1) + $len($1)),$len($2-)),2-,36)) ] _dofm³ { var %got,%try = 1 :loop %got = $mid($1-,$pos($1-,$chr(128),1),$calc($pos($1-,$chr(129),%try) - $pos($1-,$chr(128),1) +1)) if ($count(%got,$chr(128)) == $count(%got,$chr(129))) return %got if (%try < $count($1-,$chr(129))) { inc %try | goto loop } return ERR } _stripout if (%`strip.auto) return $strip($1-) | return $1- ; ; Basic commands ; j join $1- join if (-* iswm $1) join $1 $iif($2,$_patch($2)) $3- | elseif ($1 == 0) .raw join 0 | elseif ($1) .raw join $_patch($1) $2- | else _qhelp /join pj jp $1- jp if ($1) { .raw join $_patch($1) $2- | ping $_patch($1) } | else _qhelp /jp p part $1- leave part $1- part { if (($_ischan($1)) || ($gettok($_patch($1),1,44) ischan)) .raw part $_patch($1) : $+ $_finalmsg($replace($_msg(part,$2-),&chan&,$_patch($1))) elseif (#) .raw part # : $+ $_finalmsg($replace($_msg(part,$1-),&chan&,#)) else _error You must specify a channel to /part.(or use /part in a channel window) } rejoin cycle $1- cycle { if ($1 !ischan) { if ($active ischan) tokenize 32 $active else _error You must use /cycle in a channel.(or specify a channel to rejoin) } .raw part $1 :rejoining | .raw join $1 $chan($1).key disprs $1 $:cl($1) Rejoining... } hop { if ($1 == $null) _qhelp /hop | if ($active !ischan) _error You must use /hop in a channel | dispa $:cl($active) Hopping to $:s($1) $+ ... | .part $active $2- | .raw join $_patch($1) } nick { if ($1 == $null) _qhelp /nick nick $1- if ($2 != $null) _recent nick 9 $2 _recent nick 9 $1 } q query $1- query { var %switch,%who,%num = 1 if ($1 == -n) { %switch = -n | tokenize 32 $2- } if ($1 == $null) _qhelp /query var %whom = $_ncs(44,$1) :loop %who = $gettok(%whom,%num,44) query %switch %who if ($2 == /me) describe %who $3- elseif ($2 != $null) msg %who $2- %who = $_renlogfile(%who) if ($exists($logdir [ $+ [ %who ] ] )) _recent log 9 %who if (%num < $numtok($1,44)) { inc %num | goto loop } } w whois $1- whois { if ($1) { if ($1 == $2) { var %who = $_nc($1) .raw whois %who %who } else { var %who = $_ncs(44,$_s2c($1-)) .raw whois %who } _whois.src %who } elseif ($_targ(=?)) { .raw whois $ifmatch %-whois.src. [ $+ [ $ifmatch ] ] = $active } else _qhelp /whois .enable #-whoisno } ; IF you use _Q.whois you MUST unset %-mwho.* in your queued alias! ; also MUST make sure you are queing a single nick (no commas, no wildcards) _Q.whois %-wwq. [ $+ [ $1 ] ] = $2- | .raw whois $1 | .enable #-whoisno ww whowas $1- whowas if ($1 == $null) _qhelp /whowas | .raw whowas $1- | _whois.src $1- ew { if ($1) { var %who = $_ncs(44,$_s2c($1-)) :loop if ($gettok(%who,1,44)) { .raw whois $ifmatch $ifmatch _whois.src $ifmatch %who = $deltok(%who,1,44) goto loop } } elseif ($_targ(=?)) { .raw whois $ifmatch $ifmatch %-whois.src. [ $+ [ $ifmatch ] ] = $active } else _qhelp /ew .enable #-whoisno } _whois.src { if ((* isin $1) || (? isin $1)) return if ($chan) var %src = $chan elseif ($active == Status Window) var %src = -si2 elseif (($chr(32) isin $active) || (@* iswm $active)) var %src = -ai2 else var %src = $active var %num = 1 | :loop | if ($gettok($1,%num,44)) { %-whois.src. [ $+ [ $ifmatch ] ] = %src | inc %num | goto loop } } server { var %server = $1- if ($1 == !) { server | return } elseif ($1 == $null) %server = $_entry(0,$_s2p($_cfgi(lastserv)),Enter server to connect to-(you may also specify a port)) elseif ($2 == ?) { if ($server($1).port) %server = $1 $+  $+ $gettok($ifmatch,$_pprand($numtok($ifmatch,44)),44) else %server = $1 %server = $_entry(0,%server,Enter server and port to connect to-) } if ($server) quit server hop if ((%server isnum) && ($len(%server) >= 4)) { if ($server == $null) server $gettok($_cfgi(lastserv),1,32) %server else server $server %server } else server %server } quit { if ($server == $null) _error Can't quit IRC.(you kind of have to be connected to IRC first) var %quitmsg = $_finalmsg($replace($_msg(quit,$1-),&online&,$duration($online))) inc -u3 %-quithalt if (%quitmsg == $null) { .raw quit : if (%-quithalt < 2) disps Quit message- (none) } else { quit %quitmsg if (%-quithalt < 2) disps Quit message- %quitmsg _recent2 quit 9 %quitmsg } %-quitrequest = 1 return %quitmsg } names { if ($1 == $null) { if ($active ischan) .raw names $active else _error You must use /names in a channel window.(or specify a channel to view a names list for) } elseif (* isin $1-) .raw names $1- else .raw names $_patch($1-) } dns { if ($1 == $null) { dns | return } elseif ($1 == -d) { dns $2- | return } elseif ($1 == -c) { .dns -c | unset %_showdns | return } var %dns,%type if ($1 == -h) { %dns = $2 | %type = -h } elseif (. isin $1) { if (@ isin $1) %dns = $gettok($1,2,64) | else %dns = $1 | %type = -h } else { %dns = $_nc($1) | %type = -n } if ($show) { _Q.dns _dnsshow _dnsfail %type %dns | %dns %type } else _Q.dns halt halt %type %dns } ; _Q.dns command errorcmd -h/-n nick/addr1 nick/addr2 ... ; command is _s2p, run for each resolved ($nick/$raddress/$iaddress/$naddress set) ; errorcmd is _s2p, run if resolve fails (etc. set) halt is ok etc. ; -h for hosts, -n for nicks _Q.dns if (($3 == -n) && ($server == $null)) .dns -d notconnected | :loop | %_dns. [ $+ [ $iif(@ isin $4,$gettok($4,2-,64),$4) ] ] = $1-2 | .dns -d $iif($3 == -h,-h) $4 | if ($5) { tokenize 32 $1-3 $5- | goto loop } ; ; Titlebar junk ; _title.win { var %away = %!away if (%away) { if ($mid(%!title,5,1)) return [[ $+ $gettok(%away,6-,32))) $+ ]] for [[ $+ $_dur($calc($ctime - $gettok(%away,2,32))) $+ ]] - Log[ $+ $iif(%!logging,%_awaylog.^,off) $+ ]] else return [[ $+ $gettok(%away,6-,32))) $+ ]] for [[ $+ $_dur($calc($ctime - $gettok(%away,2,32))) $+ ]] } elseif ($active ischan) return [[ $+ $nick($active,0) @ $+ $nick($active,0,o) + $+ $nick($active,0,v,o) %`popupmark $+ $nick($active,0,r) $+ ]] on [[ $+ $active $+ ]] %-titleavg. [ $+ [ $active ] ] elseif ($_targ(=?)) return [[ $+ $ifmatch $+ ]] on [[ $+ $_title.win²($ifmatch) $+ ]] elseif ($server) return [[ $+ $usermode $+ ]] on [[ $+ $server $port $+ ]] else return [offline] } _title.win² { var %num = $comchan($1,0),%ret :loop if (%num) { %ret = %ret $_stch($1,$comchan($1,%num)) dec %num | goto loop } if (%ret) return %ret return ?? } _upd.title { if (%_in.flash) return if (%`title.bar) { var %title = %!title,%bar = $iif($mid(%title,1,1),%!net) $iif($mid(%title,1,2) == 11,:) $iif($mid(%title,2,1),$me) $iif((%-self.lag) && ($mid(%title,3,1)), [ [[ $+ [ %-self.lag ] $+ ]] ] ) if (%bar) %bar = - %bar if ($mid(%title,4,1)) %bar = %bar - $iif(%_locked.title,%_locked.title,$_title.win) if ($mid(%title,6,1)) { if (%!pager) %bar = %bar - Pager[ $+ %_newpages $+ / $+ %_totalpages $+ ]] | else %bar = %bar - Pager[off] } if ($mid(%title,7,1)) %bar = %bar - $_time if ($mid(%title,8,1)) if ($idle > 90) %bar = %bar - Idle $_dur($idle) if (%_title.note) %bar = - %_title.note %bar titlebar %bar } } _new.active %_last.active = $active | _upd.title | %_timedclose = $remtok(%_timedclose,$active,1,32) | if ($active ischan) window -w " $+ $active $+ " | elseif (($query($active)) || (=* iswm $active) || ($istok(%!@close,$active,32))) window -w $active | elseif ($active == Status Window) window -w "Status Window" _lock.tb %_locked.title = $_title.win | .timer.chktitle off _unlock.tb unset %_locked.title | .timer.chktitle -om 0 100 if ($active != % $+ _last.active) _new.active _title.note %_title.note = $1- | .timer.titlenote -o 1 16 unset % $+ _title.note flash { if (($1 == $null) || ($appactive)) { unset %_in.flash | flash | _upd.title .timer.unflash? off } else { %_in.flash = 1 | titlebar $1- | flash $1- if ($_cfgi($iif(%!away,flash.away,flash.here))) .timer.unflash1 -o 1 $ifmatch flash .timer.unflash2 -om 0 100 if ($appactive) flash } } ; $_stch(nick,#chan) ; Returns #chan, @#chan, or +#chan for on, opped, or voiced on given channel _stch return $_stsym($1,$2) $+ $2 ; $_stsym(nick,#chan) ; Returns nothing, @, or + for on, opped, or voiced on given channel _stsym if ($1 isop $2) return @ | if ($1 isvo $2) return + | return ; ********************** ; Function keys ; ********************** f1 _setrec /notice /onotice notice p sf1 if ($mouse.key & 2) _setrec /chat /whowas user | else _setrec /query /whowas user px cf1 _setrec /whois /whowas user f2 if ($_targ(=?#)) ping $active | else _error You must use F2 in a channel, query, or chat.(F2 pings the current window) cf2 if ($active ischan) avglag $active | elseif (@Ping* iswm $active) { _dowclose $active | window -c $active } | else _error You must use CtrlF2 in a channel.(CtrlF2 views the latest average ping) sf2 if ($mouse.key & 2) sp | elseif (@Ping* iswm $active) window -n $active | elseif ($active ischan) pwin $active | else _error You must use ShiftF2 in a channel.(ShiftF2 views stored pings) sf8 _setrec /ping /ping clones cf9 { if (%_nickrc) { dispa $:n(%_nickrc) Nick retake cancelled .timer.nickretake off | unset %_nickrc } elseif (%_nickretake) { dispa $:n(%_nickretake) You will take this nick as soon as it is available; Press $:s(CtrlF9) again to cancel %_nickrc = %_nickretake _retakecheck } } f11 if ($server) fav j | else server sf11 { if ($mouse.key & 2) _setrec /ign /ign user px else { if ($gettok($editbox($active),1,32) == /join) var %last = $_getrec(chan,$gettok($editbox($active),2,32))) else var %last = $_getrec(chan) :loop if ($me ison %last) { %last = $_getrec(chan,%last) goto loop } if (%last) { if ($_cfgi(recent.auto)) join %lawt else editbox -ap /join %last } else editbox -a } } cf11 _setrec /server /server serv px f12 if (%!away) { if (+q isin $gettok(%!away,3,32)) qb | else back } | else away sf12 { if ($mouse.key & 2) { if (%!away) { if (+q isin $gettok(%!away,3,32)) qb | else back } awaylog } else pager v } cf12 if (@AwayLog* iswm $active) { _dowclose $active | window -c $active } | else awaylog ; ; "Color/talker" identifiers ; _pat.rand { var %num = $numtok($1,46),%pos = $len($2-),%text = $replace($2-,$chr(32),),%tok,%ret :loop | %tok = $gettok($1,$_pprand(%num),46) | if (%tok == $) var %tok | %ret = %tok $+ $mid(%text,%pos,1) $+ %ret | if (%pos > 1) { dec %pos | goto loop } return $replace(%ret,,$chr(32)) } colori return $_pat.rand(02.03.04.05.06.07.09.10.12.13,$1-) color2i return $_pat.rand(01.02.03.04.05.06.07.09.10.12.13.14.15,$1-) funkyi return $_pat.rand(02.03.04.05.06.07.09.10.12.13.02.03.04.05.06.07.09.10.12.13.02.03.04.05.06.07.09.10.12.13,$1-) ulinei _pat.rand .$ $1- | if (2 // $count($result,)) return $result | return $result $+  boldi _pat.rand .$ $1- | if (2 // $count($result,)) return $result | return $result $+  codei _pat.rand ...$ $1- | var %cdi | if (2 \\ $count($result,)) %cdi = %cdi $+  | if (2 \\ $count($result,)) %cdi = %cdi $+  | return $result $+ %cdi uvoweli return $replace($lower($1-),a,A,e,E,i,I,o,O,u,U,y,Y) lvoweli return $replace($upper($1-),A,a,E,e,I,i,O,o,U,u,Y,y) _cfade { var %ret,%tok = 1,%len = $len($2-),%str = $replace($2-,$chr(32),),%sect = $int($calc(%len / $numtok($1,46))) + 1,%extra = $calc(%len % $numtok($1,46)) + 1 :loop dec %extra | if (%extra == 0) dec %sect %ret = %ret $+  $+ $gettok($1,%tok,46) $+ $left(%str,%sect) %str = $right(%str,$calc(- %sect)) if (%tok < $numtok($1,46)) { inc %tok | goto loop } return $replace(%ret,,$chr(32)) } _u return  $+ $1- $+  _b return  $+ $1- $+  _r return  $+ $1- $+  _k return  $+ $1- $+  f10 halt