;Whois start, nick/ident/host/realname
raw 311:*:{
;<me> <nick> <ident> <host> <mode> <realname>
if (!$hget(whois)) hmake whois 5
hdel whois $+($cid,*)
hadd whois $+($cid,.,whois) $2
w.disp $2 $+(,$2,) is $+($3,@,$4)
w.disp $2 $w.i($2) is $6-
halt
}
;Whowas start, nick/ident/host/realname
raw 314:*:{
;<me> <nick> <ident> <host> <mode> <realname>
if (!$hget(whois)) hmake whois 5
hdel whois $+($cid,*)
hadd whois $+($cid,.,whowas) $2
w.disp $2 $+(,$2,) was $+($3,@,$4)
w.disp $2 $w.i($2) was $6-
halt
}
; Whois registered nick
raw 307:*:{
;<me> <nick> is a registered nick
w.disp $2 $w.i($2) is using a registered nick
halt
}
; Whois/whowas on server
raw 312:*:{
;<me> <nick> <server> <description/signoff>
if ($hget(whois,$+($cid,.,whois))) {
w.disp $2 $w.i($2) on $3 $+([,$4-,])
}
else {
w.disp $2 $w.i($2) was on $3
w.disp $2 $w.i($2) signed off: $asctime($4, h:nn:sstt mmm doo yyyy)
}
halt
}
; Whois is IRCop
raw 313:*:{
;<me> <nick> <IRCop Description>
w.disp $2 $w.i($2) $iif(Beyondirc isin $network,$remove($3-,(is an IRC Operator)),$3-)
halt
}
; Whois using modes (ircop)
raw 379:*:{
;<me> <nick> is using modes <modes>
w.disp $2 $w.i($2) is using modes: $6
halt
}
; Whois connecting from (ircop)
raw 378:*:{
;<me> <nick> is connecting from <host>
w.disp $2 $w.i($2) is connecting from: $6
halt
}
; Whois available for help (ircop)
raw 310:*:{
;<me> <nick> is available for help.
w.disp $2 $w.i($2) is available for help
halt
}
; Whois channel list
raw 319:*:{
;<me> <nick> <channel> <channel> ...
var %w.cur, %w.pre, %w.chan, %w.four
var %w.chans = $3-
while (%w.chans) {
%w.cur = $gettok(%w.chans,1,032)
%w.chans = $deltok(%w.chans,1,032)
var %regex = $regex(whois,%w.cur,/^([^\s#]?)(#.*)$/)
%w.four = %w.four $+ $iif(%w.four,$chr(044)) $iif($regml(whois,1),$ifmatch) $iif($me ison $regml(whois,2), $+ $regml(whois,2) $+ , $regml(whois,2))
if (($gettok(%w.chans,1,032) == $null) || ($numtok(%w.four,044) >= 4)) {
w.disp $2 $w.i($2) on %w.four
%w.four = $null
}
}
halt
}
; Whois connection time
raw 317:*:{
;<me> <nick> <idletime> <connecttime> seconds idle, signon time
w.disp $2 $w.i($2) idle: $duration($3) $+ , signed on: $asctime($4, h:nn:sstt mmm doo yyyy)
halt
}
; Who
raw 352:*:{
; <me> <channel> <ident> <host> <server> <nick> <modes> <hops> <realname->
; H = here; G = away; r = registered; * = IRCop; % = bot; @ = op on channel; + = voice on channel
var %w.cmodes = $remove($7,G,H,r,*,%)
var %w.desc = $addtok(%w.desc,$iif(G isin $7, Away, Here),032)
if (r isin $7) %w.desc = $addtok(%w.desc,Reg'd,032)
if (* isin $7) %w.desc = $addtok(%w.desc,IRCop,032)
if (% isin $7) %w.desc = $addtok(%w.desc,Bot,032)
w.disp $2 $+(,$6,) is $+($3,@,$4) $+ , on $+(%w.cmodes,$2) ( $+ $replace(%w.desc,$chr(032),$chr(044) $+ $chr(032)) $+ )
w.disp $2 $w.i($6) is $9 on $5 ( $+ $8 hops)
hinc whois $+($cid,.who.count) 1
halt
}
; No such whois/whowas
raw 401:*:{
;<me> <nick> No such nick/channel
echo -s $+([,$2,]) No such user or channel
halt
}
; End of whois
raw 318:*:{
;<me> <nick> End of /WHOIS list.
hdel whois $+($cid,.,whois)
halt
}
; End of whowas
raw 369:*:{
;<me> <nick> End of /WHOWAS
hdel whois $+($cid,.,whowas)
halt
}
; End of who
raw 315:*:{
;<me> <nick> End of /WHO list.
w.disp $2 End of WHO matching $2 - $iif($hget(whois,$+($cid,.who.count)),$v1,0) user $+ $iif($hget(whois,$+($cid,.who.count)) != 1,s) found
hdel whois $+($cid,.who.count)
halt
}
raw *:*:{
if ((!$hget(whois,$+($cid,.,whois))) && (!$hget(whois,$+($cid,.,whowas)))) return
w.disp $2 $w.i($2) $3-
halt
}
alias w.i return $+(,$color(background),$chr(044),$color(background),$1-,)
alias w.disp {
;1=nick, 2-=display message
if ($query($1)) echo -t $1 $2-
else {
if (!$window(@whois)) window -eniz @Whois -1 -1 -1 -1 /whois
aline -hp $color(whois) @Whois $timestamp $2-
}
}
;Whois Display by genius_at_work, 2006