A few times one of the operators on my IRC server's #general channel has asked for a way to automatically keep track of abusers nicknames, I designed away of tracking the registered nicknames linked with their host. This script records the hosts on 3 different levels, but relies on performing a /whois or them joining after you.
Often people join with alternate nicknames, this script should show the regular nickname of the user, allowing ops to keep an eye on them.
OK the script might not be perfect as I have to strip responses to see if a nickname is registered, but unless I am told of an easier way this will have to do.
To install the script just drop it into a blank remote.
If you use more than one server you might like to make it use a different file name for each server something like "regnicks [ $+ [ $server ] $+ ] .ini" all the way though. one last note if you see the ns status's something is wrong ether you need to increase the status respond delay or configure it for your services
Killer Hobbits - originally created for Anekili
(thanks to Cestan for the ns status idea)
[last update 00:26 gmt 03/12/04]
raw 307:*: {
if ($readini(regnicksip.ini, n, ip, $address($2,2)) == $null) {
writeini -n regnicksip.ini ip $address($2,2) $2 $+ ,
}
elseif (($2 $+ ,* iswm $readini(regnicksip.ini, n, ip, $address($2,2))) || (, $2 $+ , isin $readini(regnicksip.ini, n, ip, $address($2,2)))) {
}
else {
writeini -n regnicksip.ini ip $address($2,2) $readini(regnicksip.ini, n, ip, $address($2,2)) $2 $+ ,
}
if ($readini(regnicksuh.ini, n, userhost, $address($2,3)) == $null) {
writeini -n regnicksuh.ini userhost $address($2,3) $2 $+ ,
}
elseif (($2 $+ ,* iswm $readini(regnicksuh.ini, n, userhost, $address($2,3))) || (, $2 $+ , isin $readini(regnicksuh.ini, n, userhost, $address($2,3)))) {
}
else {
writeini -n regnicksuh.ini userhost $address($2,3) $readini(regnicksuh.ini, n, userhost, $address($2,3)) $2 $+ ,
}
if ($readini(regnickss.ini, n, server, $address($2,4)) == $null) {
writeini -n regnickss.ini server $address($2,4) $2 $+ ,
}
elseif (($2 $+ ,* iswm $readini(regnickss.ini, n, server, $address($2,4))) || (, $2 $+ , isin $readini(regnickss.ini, n, server, $address($2,4)))) {
}
else {
writeini -n regnickss.ini server $address($2,4) $readini(regnickss.ini, n, server, $address($2,4)) $2 $+ ,
}
}
raw 317:*: {
if ($readini(regnicksip.ini, n, ip, $address($2,2)) != $null) {
echo -a the last registered nickname(s) used were: $readini(regnicksip.ini, n, ip, $address($2,2))
}
elseif ($readini(regnicksuh.ini, n, userhost, $address($2,3)) != $null) {
echo -a the last registered nickname(s) used were: $readini(regnicksuh.ini, n, userhost, $address($2,3))
}
elseif ($readini(regnickss.ini, n, server, $address($2,4)) != $null) {
echo -a the last registered nicknames matching this server were: $readini(regnickss.ini, n, server, $address($2,4))
}
}
alias lastnick {
if ($readini(regnicksip.ini, n, ip, $address($1,2)) != $null) {
say I belive the last registered nickname(s) of $1 used were: $readini(regnicksip.ini, n, ip, $address($1,2))
}
elseif ($readini(regnicksuh.ini, n, userhost, $address($1,3)) != $null) {
say I belive the last registered nickname(s) of $1 used were: $readini(regnicksuh.ini, n, userhost, $address($1,3))
}
elseif ($readini(regnickss.ini, n, server, $address($1,4)) != $null) {
say I belive the last registered nicknames of $1 matching this server were: $readini(regnickss.ini, n, server, $address($1,4))
}
}
on *:TEXT:!lastnick *:*: {
if ($readini(regnicksip.ini, n, ip, $address($2,2)) != $null) {
msg $chan I belive the last registered nickname(s) used were: $readini(regnicksip.ini, n, ip, $address($2,2))
}
elseif ($readini(regnicksuh.ini, n, userhost, $address($2,3)) != $null) {
msg $chan I belive the last registered nickname(s) used were: $readini(regnicksuh.ini, n, userhost, $address($2,3))
}
elseif ($readini(regnickss.ini, n, server, $address($2,4)) != $null) {
msg $chan I belive the last registered nicknames matching this server were: $readini(regnickss.ini, n, server, $address($2,4))
}
}
on *:JOIN:#: {
if (($nick != $me) && ($nick != %lrn.laststatusnick)) {
set -u10 %lrn.doingnsstatus yeah
set %lrn.laststatusnick $nick
.ns status $nick
if ($chan($chan).ial == $false) {
.who $chan
}
}
}
on *:NICK: {
if ($nick != $me) {
set -u10 %lrn.doingnsstatus yeah
set %lrn.laststatusnick $newnick
.ns status $newnick
if ($chan($chan).ial == $false) {
.who $chan
}
}
}
on ^*:NOTICE:STATUS*:?: {
if (($nick == nickserv) && (%lrn.doingnsstatus == yeah)) {
haltdef
if ($3 == 3) {
if ($readini(regnicksip.ini, n, ip, $address($2,2)) == $null) {
writeini -n regnicksip.ini ip $address($2,2) $2 $+ ,
}
elseif (($2 $+ ,* iswm $readini(regnicksip.ini, n, ip, $address($2,2))) || (, $2 $+ , isin $readini(regnicksip.ini, n, ip, $address($2,2)))) {
}
else {
writeini -n regnicksip.ini ip $address($2,2) $readini(regnicksip.ini, n, ip, $address($2,2)) $2 $+ ,
}
if ($readini(regnicksuh.ini, n, userhost, $address($2,3)) == $null) {
writeini -n regnicksuh.ini userhost $address($2,3) $2 $+ ,
}
elseif (($2 $+ ,* iswm $readini(regnicksuh.ini, n, userhost, $address($2,3))) || (, $2 $+ , isin $readini(regnicksuh.ini, n, userhost, $address($2,3)))) {
}
else {
writeini -n regnicksuh.ini userhost $address($2,3) $readini(regnicksuh.ini, n, userhost, $address($2,3)) $2 $+ ,
}
if ($readini(regnickss.ini, n, server, $address($2,4)) == $null) {
writeini -n regnickss.ini server $address($2,4) $2 $+ ,
}
elseif (($2 $+ ,* iswm $readini(regnickss.ini, n, server, $address($2,4))) || (, $2 $+ , isin $readini(regnickss.ini, n, server, $address($2,4)))) {
}
else {
writeini -n regnickss.ini server $address($2,4) $readini(regnickss.ini, n, server, $address($2,4)) $2 $+ ,
}
}
}
}