alias xwhois {
if ($isid) return
if (($1 == $null) && (#* !iswm $active)) {
echo -ac info * /xwhois: insufficient parameters
return
}
if (($1 != $null) && (#* !iswm $1)) {
echo -ac info * /xwhois: invalid parameters
return
}
if ($hget(xwhois)) {
echo -ac info * /xwhois: operation already in progress $+($chr(40),$gettok($timer(xwhois).com,2,32),$chr(41))
echo -ac info * /xwhois: type /xwhoisabort to cancel /xwhois.
return
}
var %chan = $iif($1 != $null,$1,$active), %y = $nick(%chan,0)
echo -ac info * Performing /whois on all users in %chan $+ . $+($chr(40),%y users total,$chr(41))
hmake xwhois 1
while (%y) {
hadd xwhois $nick(%chan,%y)
dec %y
}
.timerxwhois 0 2 xwhoistimer %chan
}
raw 319:*: {
;remove line below to do this to anyone you whois
if ($2 == %xwhois.nick) {
; seperate channel names with '|' characters, if a channel has any of the following characters: []\^$.|?*+()
; it needs to be preceded with a \: #channel| becomes #channel\| #|^^\ becomes #\|\^\^\\
if ($regex($3-,/(^|\s)[^#]?(<------- channels -------->)($|\s)/)) {
echo -ac info * /xwhois: $2 is on channels: $3-
; add kick/ban here, however this could potentialy flood you off, or cause lag. Below will kick them and ban after whoising the whole channel
.timer 1 $calc($hget(xwhois,0) + $timer(0) * 2) echo -a ban -k %xwhois.chan $2 2 <---reason here--->
;remove the } here if you removed the "if ($2 == %xwhois.nick) {"
}
}
}
alias xwhoistimer {
if ($1 == halt) return
if ($hget(xwhois) == $null) {
.timerxwhois off
return
}
var %x = $hget(xwhois,1).item, %c = $iif($hget(xwhois,2).item == $null,1,0)
set -u3 %xwhois.nick %x
whois %x
hdel xwhois %x
if (%c) {
echo -ac info * /xwhois: Done doing /xwhois on $1 $+ .
hfree xwhois
.timerxwhois off
.disable #xwhois
}
set -u3 %xwhois.chan $1
}
alias xwhoisabort {
var %x = $timer(xwhois).com
.timerxwhois off
hfree xwhois
echo -ac info * /xwhoisabort: /xwhois on $gettok(%x,2,32) has been canceled.
}