Address and Nick Database

By Pepsi_Man0077 on Jan 16, 2009

This script will store users, and their addresses; and then addresses, and their users.

For example, the address !@DieOrLiveFree.net may have multiple users on the address if it is a vhost, this script will store all the users in a database.

Or, if a Nick uses multiple Addresses, it will store all of them in a database

This script works great for IRCops or operators who moderate a lot, you can then see different nicks that the user has used besides the one that he is currently using.

Right off the bat when you load the script, it will gather all of the nicks in every channel you are in, even multiple networks. It will continue to store them on certain events: Nick changes, Joins, Parts, Quits, etc.

Enjoy and let me know if their are any problems with the script since i haven't tested it much, i mostly tested that it worked and funtioned properly.

Screens:

Image
Image

#####################################
#                                                                               #
#                  Address and Nick Database                      #
#                                                                               #
#####################################

;--- Do not edit below this line ---

alias leetdb {
  if (!$dialog(1337DB)) { dialog -mn ANDB ANDB }
}

menu Status,Channel {
  _-= Address and Nick DataBase =-_ 
  .Open A and N Database { leetdb }
  .Search an Address for Nicks used { 
    var %spec $?="What is the Address you are Searching? ex: *!*@DieOrLiveFree.net (include '*!*')"        
    var %leet.cnt $numtok($hget(Addresses,%spec),32)
    var %leet.tok $hget(Addresses,%spec)
    if (%leet.cnt = 0) { echo -a 4No Nicks were found for %spec | halt }
    echo -a 4Nicks found for %spec $+ :
    while (%leet.cnt > 0) {
      tokenize 32 %leet.tok
      echo -a 7 $+ $gettok(%leet.tok,%leet.cnt,32)
      %leet.tok = $deltok(%leet.tok,%leet.cnt,32)
      dec %leet.cnt
    } 
  }
  .Search a Nick for Addresses Used {
    var %spec $?="What is the Nick you are Searching? ex: PePSiMaN"
    var %leet.cnt $numtok($hget(Nicks,%spec),32)
    var %leet.tok $hget(Nicks,%spec)
    if (%leet.cnt = 0) { echo -a 4No Addresses were found for %spec | halt }
    echo -a 4Addresses found for %spec $+ :
    while (%leet.cnt > 0) {
      tokenize 32 %leet.tok
      echo -a 7 $+ $gettok(%leet.tok,%leet.cnt,32)
      %leet.tok = $deltok(%leet.tok,%leet.cnt,32)
      dec %leet.cnt
    }  
  }
}

menu Nicklist,Query {
  _-= Address and Nick DataBase =-_
  .Open A and N Database { leetdb }
  .List all Nicks used by $1 $+'s Current Address {         
    var %leet.cnt $numtok($hget(Addresses,$address($1,2)),32)
    var %leet.tok $hget(Addresses,$address($1,2))
    while (%leet.cnt > 0) {
      tokenize 32 %leet.tok
      echo -a $gettok(%leet.tok,%leet.cnt,32)
      %leet.tok = $deltok(%leet.tok,%leet.cnt,32)
      dec %leet.cnt
    } 
  }
  .List all Addresses used by $1 $+ 's Current Address {
    var %leet.cnt $numtok($hget(Nicks,$1),32)
    var %leet.tok $hget(Nicks,$1)
    while (%leet.cnt > 0) {
      tokenize 32 %leet.tok
      echo -a $gettok(%leet.tok,%leet.cnt,32)
      %leet.tok = $deltok(%leet.tok,%leet.cnt,32)
      dec %leet.cnt
    }  
  }
}

dialog ANDB {
  title "Nick and Address DataBase - By PePSiMaN"
  size -1 -1 306 141
  option dbu
  combo 1, 4 8 95 121, size
  combo 2, 106 8 95 121, size
  combo 3, 207 8 95 121, size
  button "Address", 4, 155 132 45 8
  button "Find", 5, 275 132 30 9
  box "Channel List", 6, 2 1 100 130
  box "Nick List", 7, 104 1 100 130
  box "Leet Database", 8, 205 1 100 130
  text "Click a Channel to Start", 9, 2 132 99 8, center
  text "", 10, 202 132 71 8, center
}

alias recieve.add.all {
  var %net.get 1
  while (%net.get <= $scon(0)) {
    var %chan.get 1
    scon %net.get
    while (%chan.get <= $chan(0)) {
      var %nick.get 1
      while (%nick.get <= $nick($chan(%chan.get),%nick.get)) {
        if (!$hget(Addresses)) { hmake Addresses 9999 | hload Addresses Addresses.db }
        if ($nick($chan(%chan.get),%nick.get) !isin $hget(Addresses,$address($nick($chan(%chan.get),%nick.get),2))) && ($hget(Addresses,$address($nick($chan(%chan.get),%nick.get),2))) { hadd Addresses $address($nick($chan(%chan.get),%nick.get),2) $hget(Addresses,$address($nick($chan(%chan.get),%nick.get),2)) $nick($chan(%chan.get),%nick.get) }
        if (!$hget(Addresses,$address($nick($chan(%chan.get),%nick.get),2))) { hadd Addresses $address($nick($chan(%chan.get),%nick.get),2) $nick($chan(%chan.get),%nick.get) }

        if (!$hget(Nicks)) { hmake Nicks 9999 | hload Nicks Nicks.db }
        if ($address($nick($chan(%chan.get),%nick.get),2) !isin $hget(Nicks,$nick($chan(%chan.get),%nick.get))) && ($hget(Nicks,$nick($chan(%chan.get),%nick.get))) { hadd Nicks $nick($chan(%chan.get),%nick.get) $hget(Nicks,$nick($chan(%chan.get),%nick.get)) $address($nick($chan(%chan.get),%nick.get),2) }
        if (!$hget(Nicks,$nick($chan(%chan.get),%nick.get))) { hadd nicks $nick($chan(%chan.get),%nick.get) $address($nick($chan(%chan.get),%nick.get),2) }
        inc %nick.get
      }
      inc %chan.get
    }
    inc %net.get 
  }
}

on *:START: {
  if (!$exists(Addresses.db)) { hmake Addresses 9999 | hsave Addresses Addresses.db | echo -a 7Address Database has been made }
  if (!$exists(Nicks.db)) { hmake Nicks 9999 | hsave Nicks Nicks.db | echo -a 7Nick Database has been made }
  if (!$hget(Addresses)) && ($exists(Addresses.db)) { hmake Addresses 9999 | hload Addresses Addresses.db | echo -a 7Address Database loaded }
  if (!$hget(Nicks)) && ($exists(Nicks.db)) { hmake Nicks 9999 | hload Nicks Nicks.db | echo -a 7Nick database loaded }
  recieve.add.all
}

on *:CONNECT: {
  recieve.add.all
}

on *:JOIN:*: {
  if (!$hget(Addresses)) { hmake Addresses 9999 | hload Addresses Addresses.db }
  if ($nick !isin $hget(Addresses,$address($nick,2))) && ($hget(Addresses,$address($nick,2))) { hadd Addresses $address($nick,2) $hget(Addresses,$address($nick,2)) $nick }
  if (!$hget(Addresses,$address($nick,2))) { hadd Addresses $address($nick,2) $nick }

  if (!$hget(Nicks)) { hmake Nicks 9999 | hload Nicks Nicks.db }
  if ($address($nick,2) !isin $hget(Nicks,$nick)) && ($hget(Nicks,$nick)) { hadd Nicks $nick $hget(Nicks,$nick) $address($nick,2) }
  if (!$hget(Nicks,$nick)) { hadd nicks $nick $address($nick,2) }
}

on *:QUIT: {
  if (!$hget(Addresses)) { hmake Addresses 9999 | hload Addresses Addresses.db }
  if ($nick !isin $hget(Addresses,$address($nick,2))) && ($hget(Addresses,$address($nick,2))) { hadd Addresses $address($nick,2) $hget(Addresses,$address($nick,2)) $nick }
  if (!$hget(Addresses,$address($nick,2))) { hadd Addresses $address($nick,2) $nick }

  if (!$hget(Nicks)) { hmake Nicks 9999 | hload Nicks Nicks.db }
  if ($address($nick,2) !isin $hget(Nicks,$nick)) && ($hget(Nicks,$nick)) { hadd Nicks $nick $hget(Nicks,$nick) $address($nick,2) }
  if (!$hget(Nicks,$nick)) { hadd nicks $nick $address($nick,2) }
}

on *:TEXT:*:*: {
  if (!$hget(Addresses)) { hmake Addresses 9999 | hload Addresses Addresses.db }
  if ($nick !isin $hget(Addresses,$address($nick,2))) && ($hget(Addresses,$address($nick,2))) { hadd Addresses $address($nick,2) $hget(Addresses,$address($nick,2)) $nick }
  if (!$hget(Addresses,$address($nick,2))) { hadd Addresses $address($nick,2) $nick }

  if (!$hget(Nicks)) { hmake Nicks 9999 | hload Nicks Nicks.db }
  if ($address($nick,2) !isin $hget(Nicks,$nick)) && ($hget(Nicks,$nick)) { hadd Nicks $nick $hget(Nicks,$nick) $address($nick,2) }
  if (!$hget(Nicks,$nick)) { hadd nicks $nick $address($nick,2) }
}

on *:ACTION:*:*: {
  if (!$hget(Addresses)) { hmake Addresses 9999 | hload Addresses Addresses.db }
  if ($nick !isin $hget(Addresses,$address($nick,2))) && ($hget(Addresses,$address($nick,2))) { hadd Addresses $address($nick,2) $hget(Addresses,$address($nick,2)) $nick }
  if (!$hget(Addresses,$address($nick,2))) { hadd Addresses $address($nick,2) $nick }

  if (!$hget(Nicks)) { hmake Nicks 9999 | hload Nicks Nicks.db }
  if ($address($nick,2) !isin $hget(Nicks,$nick)) && ($hget(Nicks,$nick)) { hadd Nicks $nick $hget(Nicks,$nick) $address($nick,2) }
  if (!$hget(Nicks,$nick)) { hadd nicks $nick $address($nick,2) }
}

on *:KICK:*: {
  if (!$hget(Addresses)) { hmake Addresses 9999 | hload Addresses Addresses.db }
  if ($nick !isin $hget(Addresses,$address($nick,2))) && ($hget(Addresses,$address($nick,2))) { hadd Addresses $address($nick,2) $hget(Addresses,$address($nick,2)) $nick }
  if (!$hget(Addresses,$address($nick,2))) { hadd Addresses $address($nick,2) $nick }

  if (!$hget(Nicks)) { hmake Nicks 9999 | hload Nicks Nicks.db }
  if ($address($nick,2) !isin $hget(Nicks,$nick)) && ($hget(Nicks,$nick)) { hadd Nicks $nick $hget(Nicks,$nick) $address($nick,2) }
  if (!$hget(Nicks,$nick)) { hadd nicks $nick $address($nick,2) }
}

on *:NICK: {
  if (!$hget(Addresses)) { hmake Addresses 9999 | hload Addresses Addresses.db }
  if ($newnick !isin $hget(Addresses,$address($newnick,2))) && ($hget(Addresses,$address($newnick,2))) { hadd Addresses $address($newnick,2) $hget(Addresses,$address($newnick,2)) $newnick }
  if (!$hget(Addresses,$address($newnick,2))) { hadd Addresses $address($newnick,2) $newnick }

  if (!$hget(Nicks)) { hmake Nicks 9999 | hload Nicks Nicks.db }
  if ($address($newnick,2) !isin $hget(Nicks,$newnick)) && ($hget(Nicks,$newnick)) { hadd Nicks $newnick $hget(Nicks,$newnick) $address($newnick,2) }
  if (!$hget(Nicks,$newnick)) { hadd nicks $newnick $address($newnick,2) }
}

on *:DIALOG:ANDB:init:*: {
  var %chan.cnt 1
  while (%chan.cnt <= $chan(0)) {
    did -a $dname 1 $chan(%chan.cnt)
    inc %chan.cnt
  }
  did -a $dname 10 Type in Leet to Find
}

on *:DIALOG:ANDB:*:*: {
  if ($devent == sclick) {
    if ($did == 1) {
      set %did1 $did(1)
      var %nick.cnt 1
      did -r $dname 2
      while (%nick.cnt <= $nick($did(1),0)) {
        if ($did(4) = Address) {
          did -a $dname 2 $nick($did(1),%nick.cnt))
        }
        if ($did(4) = Nick) {
          did -a $dname 2 $address($nick($did(1),%nick.cnt),2)
        }
        inc %nick.cnt           
      }
    }
    if ($did == 2) {
      set %did2 $did(2)
      did -r $dname 3
      if (%leet.view == Nick) {
        var %leet.cnt $numtok($hget(Nicks,$did(2)),32)
        var %leet.tok $hget(Nicks,$did(2))
        while (%leet.cnt > 0) {
          tokenize 32 %leet.tok
          did -a $dname 3 $gettok(%leet.tok,%leet.cnt,32)
          %leet.tok = $deltok(%leet.tok,%leet.cnt,32)
          dec %leet.cnt
        }
      }
      if (%leet.view == Address) {
        var %leet.cnt $numtok($hget(Addresses,$did(2)),32)
        var %leet.tok $hget(Addresses,$did(2))
        while (%leet.cnt > 0) {
          tokenize 32 %leet.tok
          did -a $dname 3 $gettok(%leet.tok,%leet.cnt,32)
          %leet.tok = $deltok(%leet.tok,%leet.cnt,32)
          dec %leet.cnt
        }
      }
    }
    if ($did == 3) { set %did3 $did(3) }
    if ($did == 4) {
      if ($did(4) = Nick) {
        set %leet.view Nick 
        did -a $dname 4 Address 
        var %nick.cnt 1
        did -r $dname 2
        while (%nick.cnt <= $nick($did(1),0)) {
          did -a $dname 2 $nick($did(1),%nick.cnt))
          inc %nick.cnt
        }           
      }
      elseif ($did(4) = Address) { 
        set %leet.view Address 
        did -a $dname 4 Nick 
        var %nick.cnt 1
        did -r $dname 2
        while (%nick.cnt <= $nick($did(1),0)) {
          did -a $dname 2 $address($nick($did(1),%nick.cnt),2)
          inc %nick.cnt
        }
      }
    }
    if ($did == 5) {
      if (!$did(3)) { halt }
      else {
        set %did3 $did(3)
        if ($hget(Addresses,$did(3))) || ($hget(Nicks,$did(3))) {
          did -r $dname 3
          if ($hget(Nicks,%did3)) {
            var %leet.cnt = $numtok($hget(Nicks,%did3),32)
            var %leet.tok = $hget(Nicks,%did3)
            while (%leet.cnt > 0) {
              tokenize 32 %leet.tok
              did -a $dname 3 $gettok(%leet.tok,%leet.cnt,32)
              %leet.tok = $deltok(%leet.tok,%leet.cnt,32)
              dec %leet.cnt
            }
          }
          if ($hget(Addresses,%did3)) {
            var %leet.cnt = $numtok($hget(Addresses,%did3),32)
            var %leet.tok = $hget(Addresses,%did3)
            while (%leet.cnt > 0) {
              tokenize 32 %leet.tok
              did -a $dname 3 $gettok(%leet.tok,%leet.cnt,32)
              %leet.tok = $deltok(%leet.tok,%leet.cnt,32)
              dec %leet.cnt
            }
          }
        }
      }
    }
  }
  if ($devent == dclick) {
    if ($did == 3) {
      set %did3 $did(3)
      if ($hget(Addresses,$did(3))) || ($hget(Nicks,$did(3))) {
        did -r $dname 3
        if ($hget(Nicks,%did3)) {
          var %leet.cnt = $numtok($hget(Nicks,%did3),32)
          var %leet.tok = $hget(Nicks,%did3)
          while (%leet.cnt > 0) {
            tokenize 32 %leet.tok
            did -a $dname 3 $gettok(%leet.tok,%leet.cnt,32)
            %leet.tok = $deltok(%leet.tok,%leet.cnt,32)
            dec %leet.cnt
          }
        }
        if ($hget(Addresses,%did3)) {
          var %leet.cnt = $numtok($hget(Addresses,%did3),32)
          var %leet.tok = $hget(Addresses,%did3)
          while (%leet.cnt > 0) {
            tokenize 32 %leet.tok
            did -a $dname 3 $gettok(%leet.tok,%leet.cnt,32)
            %leet.tok = $deltok(%leet.tok,%leet.cnt,32)
            dec %leet.cnt
          }
        }
      }
    }
  }
}

Comments

Sign in to comment.
datahawkee   -  Jun 19, 2011

I get this error in win 7 mirc 7.19

  • /hload: unable to open file 'C:\Users\User\AppData\Roaming\mIRC\Addresses.db' (line 382, remote.ini)
  • /hload: unable to open file 'C:\Users\User\AppData\Roaming\mIRC\Nicks.db' (line 386, remote.ini)

right clicking on someone to use script does nothing.

Anyone can fix that ???

 Respond  
datahawkee   -  May 14, 2009

when I use it ,when clicking some (many) nicks no address show on the next window (leet database)and same when clicking an some address (nick window) no nicks show (leet database) , also there are spaces between address, maybe they are addresses with problems and not shown ?
thanks Pepsi_Man0077

also

  • /hload: unable to open file 'C:\Documents and Settings\~mIRC\Nicks.db' (line 659, remote.ini)
 Respond  
datahawkee   -  May 14, 2009

very nice idea , will try it :)

 Respond  
Pepsi_Man0077   -  Feb 05, 2009

Awesome thanks man, can't believe i missed something so simple. Well anyways i updated it. Should be completely working now.

 Respond  
Broken One   -  Feb 05, 2009

I got it, it was quiet simple. You missed some = after var XYZ $numtok. It should look like this var XYZ = $numtok.

It works like charm now, really great work, thank you so much =)

 Respond  
Pepsi_Man0077   -  Feb 04, 2009

You can view nicks by nicks it you get the $numtok error worked out. You search the address by double clicking it, and then you search the nick again. As for the numtok error, i cant get it working right, but its in the correct format which is whats confusing me. But i will try to fix it some more when i get the chance.

 Respond  
Broken One   -  Feb 04, 2009

Looks really nice, would be cool if you could also view nicks by nicks in the dialog.

I also added an ON EXIT hsave to mine so I can collect data between diffrent sessions. It seems that the dialog only shows information about users currently on the channel perhaps it would be nice to optional see all users/addresses that were on the channel in the past.

If got one problem with the searches, they always fail with "* Invalid format: $numtok" I have to study a bit further what is the reason for this, an idea anyone? (mIRC Version is 6.16, I know its very old...)

 Respond  
ChuckNorris   -  Jan 26, 2009

Pretty nice for irc servers

 Respond  
Pepsi_Man0077   -  Jan 16, 2009

That is strange, but seeing that made me notice one of the faults in my script. Try deleting the hash tables, and unloading the script, then grab this script again and replace it, it should be fine then. I just updated, and it should be fixed now

thanks

 Respond  
Aucun50   -  Jan 16, 2009

Most likely my fault but:

  • /hsave: unable to open file 'C:\Documents' (line 111, script18)

mIRC version 6.32

 Respond  
Bluepower10   -  Jan 16, 2009

Oh, ok, thanks.

By the way, this is really good. Nice work. ;)

 Respond  
Pepsi_Man0077   -  Jan 16, 2009

you right click and go to Address and Nick Database. Just right click any channel

 Respond  
Bluepower10   -  Jan 16, 2009

How do you look at all the users and domains?

 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.