-[ last used registered nick on whois ]-

By Bobbtyisdead on Aug 17, 2004

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 $+ ,
      }
    }
  }
}

Comments

Sign in to comment.
x1L22   -  Oct 22, 2010

!lastnick Nick

Bot : Nick1,Nick2,Nick3,Nick4 etc.

Such people would be nice

 Respond  
Basillisk   -  Aug 23, 2008

nevermind.... i didnt read the title fully lmfao.

 Respond  
Basillisk   -  Aug 23, 2008

it only seems to work on registered nicks...

 Respond  
Basillisk   -  Aug 19, 2008

it's called a track user script :)

 Respond  
Bobbtyisdead   -  Sep 03, 2004

wouldnt be hard just have to copy the whois bit and make it run that script on a text event just about

 Respond  
Bobbtyisdead   -  Sep 03, 2004

wouldnt be hard just have to copy the whois bit and make it run that script on a text event just about

 Respond  
hitpoint   -  Aug 29, 2004

Is there any way for you to make an addon so that other users can ask you !prevnick*?

 Respond  
Bobbtyisdead   -  Aug 18, 2004

when i orginally posted this, it was more of a snippit but i then built on it so now its more of an addon, but i suppose it still needs customising to your colour scheme and services (on some nw raw 307 should be replaced with 325 and on some others they have a compleatly different set of raw\'s)

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.