; whon.mrc v0.4 by JesseR (Jesse Ruderman) Jan 1 99 ; http://angelfire.com/ca/jesser/scripts.html ; first public release version - probably buggy - please memo bugs you find to JesseR (DALnet) ; ; lets you put a mask, such as *!someone@*.earthlink.net, in a notify-like list ; i don't suggest that you use this script for specific nicks. use watch (see my website) for that. ; ; this script mainly uses the /who command, so you should be familiar with it... ; /who lists people matching some mask, but won't show people who are both "invisible" and not on any channels with you ; /who tries to match your mask with: {nick,user,host,server,ircname,channel}. (it doesn't use *!*@* - type masks) ; /who sonic* would return users with sonic starting their nick (etc.), and also everyone using the server sonic.ca.us.dal.net ; ; you should know how to use *!*@* masks... ; nick!username@host - for example i might be JesseR!jesse@bn1-la12.linkline.com ; * means "any or no characters" (you can also use ?, which means "any one character") ; *!*@* would match anyone ; jesse*!*@* would match anyone whose nick begins with jesse ; *!jesse@*.linkline.com would match anyone using the linkline internet provider with a username of "jesse" ; ; btw, you can change the color the script uses. just scroll down a little bit. ; ; likely conflict - lots of scripts display /who replies differently. this may prevent this addon from filtering out the /who replies ; from the commands it sends. ; ; to load this script, type /load -rs whon.mrc ; then type /whonhelp for instructions ; ;------------- ;change the color if you want. (3 = green. just hit ctrl-k right here for a color map, and be sure to delete the  it makes) alias -l e { echo 3 -s Whon: $1- } ; /whonhelp alias whonhelp { e Commands e /whonadd fullmask (type /whonadd with no parameters for more help on this) e /whondel fullmask e /whonclear (deletes everyone on your list) e /whonlist (shows masks in your list) e /whonch (shows everyone online) e /whoncheck (shows changes in who's online) (automatic every 40 secs) e /whonhelp } ON 1:CONNECT: whonclean | .whoncheck ON 1:DISCONNECT: whonclean ; halts any alias if i'm in the middle of doing a /whoncheck alias -l makesure { if ( %whon.going == $true ) { beep | halt } } alias whonclean { unset %whon.* | .disable #whoncatch } alias whonclear { makesure | unset %whon* | .disable #whoncatch | e Whon list cleared } alias whonch { makesure | whonclean | whoncheck } ; /whonadd fullmask [whoparam] alias whonadd { if ( $1 == $null ) { e /whonadd fullmask (the script will try to figure out what parameter to use for /who) e Example: /whonadd Jesse*!*@* e /whonadd fullmask whoparam e Example: /whonadd *!person@*.earthink.net person e Example: /whonadd *!person@*.earthlink.net *.earthlink.net e The first example was "better" because /who person generally returns less results than /who *.earthlink.net. halt } if (( ! !isin $1 ) || ( @ !isin $1 )) { e The first parameter should be a *!*@* - type mask. Type "/whonadd" for more help. halt } if ( $$1 isin %whonlistm ) { e That mask ( $+ $1 $+ ) is already in your list. e If you want to change the /who param, remove it and re-add it. halt } set %w $2 if ( %w == $null ) { set %a $gettok($1,1,$asc(!)) set %b $gettok($gettok($1,2,$asc(!)),1,$asc(@)) set %c $gettok($1,2,$asc(@)) unset %z if ( %a != * ) inc %z if ( %b != * ) inc %z if ( %c != * ) inc %z if ( %z > 1 ) { e Couldn't figure out which mask to use with /who. Use one of these: if ( %a != * ) e /whonadd $1 %a if ( %b != * ) e /whonadd $1 %b if ( %c != * ) e /whonadd $1 %c halt } if ( %a != * ) set %w %a if ( %b != * ) set %w %b if ( %c != * ) set %w %c if ( %w == $null ) set %w * } set %whonlistm %whonlistm $$1 set %whonlisth %whonlisth %w e Added $1 to list (using /who %w $+ ) .whoncheck } ; /whondel fullmask alias whondel { if ( $1 == $null ) { e /whondel fullmask. Type /whonlist for a list of masks | halt } set %i $findtok(%whonlistm,$1,1,32) if ( %i == $null ) { e Couldn't find $1 | return } set %whonlistm $deltok(%whonlistm,%i,32) set %whonlisth $deltok(%whonlisth,%i,32) e Removed $1 from list .whonch } ; /whonlist alias whonlist { e list set %i 1 :loop set %m $gettok(%whonlistm,%i,32) set %h $gettok(%whonlisth,%i,32) if ( %m == $null ) return e %m (/who %h $+ ) inc %i goto loop } ; /whoncheck alias whoncheck { .timerwhon off .timerwhon 1 40 .whoncheck makesure if ( %whonlistm == $null ) { if ( $show ) e Empty whon list return } if ( $show ) e Checking.. .notice $me whonstart unset %whon.newonn %whon.newonm set %i 1 :loop set %h $gettok(%whonlisth,%i,32) if ( %h == $null ) goto done .who %h inc %i goto loop :done .notice $me whonend set %whon.going $true } alias whoncheckdone { ; go through remains of old list set %i 1 :loop set %n $gettok(%whon.onn,%i,32) if ( %n == $null ) goto out2 e No longer online: %n inc %i goto loop :out2 ; replace old list with new list set %whon.onn %whon.newonn unset %whon.newonn unset %whon.going } on ^*:NOTICE:whonstart:?:if ( $nick == $me ) { .enable #whoncatch | halt } on ^*:NOTICE:whonend:?:if ( $nick == $me ) { .disable #whoncatch | whoncheckdone | halt } ; says whether a specific *!*@* - type mask matches any mask in the whon list alias iswn { set %x 1 :loop set %y $gettok(%whonlistm,%x,32) if ( %y == $null ) return $false if ( %y iswm $$1 ) return $true inc %x goto loop } ; #whoncatch (when on) filters /who replies #whoncatch off raw 352 :*:{ set %m $6 $+ ! $+ $3 $+ @ $+ $4 set %n $6 if ( $iswn(%m) ) { if ( $findtok(%whon.newonn,%n,1,32) == $null ) { set %whon.newonn %whon.newonn %n set %a $findtok(%whon.onn,%n,1,32) if ( %a != $null ) { set %whon.onn $deltok(%whon.onn,%a,32) set %whon.onm $deltok(%whon.onm,%a,32) } if ( %a == $null ) { e Now online:  $+ %n $+  ( $+ $gettok(%m,2,$asc(!)) $+ ) } } } halt } raw 315 :*: halt #whoncatch end