nick track

By tank59 on Oct 02, 2005

This is my first script using hash tables. This is similar to a seen system except it keeps track of all nicks used by an ip address. Once you load the script into your remotes you need to either restart mirc or type '/hmake nick 100'. I didn't really have time to test this real good so if you find any bugs let me know and I will try and fix them.
Usage is '/pnicks @host'
ex: /pnicks @undernet.users.net

on *:start:{
  hmake nick 100
  if ($isfile(nick.dat)) { hload nick nick.dat }
}
on *:exit:{
  if ($hget(nick)) { hsave -o nick nick.dat } 
}
on !*:join:#:{ 
  set %ad $address
  if ($len($hget(nick,$ad1)) <= 375) {  
    hadd nick $ad1 $addtok($hget(nick,$ad1),$nick,32) 
  }
  elseif (%nickinc) && ($len($hget(nick,$ad1)) >= 375) && (%nickinc <= $numtok($ad1,32)) {
    inc %nickinc
    hadd nick $ad1 $puttok($hget(nick,$ad1),$nick,%nickinc,32)
  }
  elseif (%nickinc) && ($len($hget(nick,$ad1)) >= 375) && (%nickinc >= $numtok($ad1,32)) {
    set %nickinc 1
    hadd nick $ad1 $puttok($hget(nick,$ad1),$nick,%nickinc,32)
  }
  else {
    set %nickinc 1
    hadd nick $ad1 $puttok($hget(nick,$ad1),$nick,%nickinc,32)
  }
}
on *:nick:{ 
  set %ad $address
  if ($len($hget(nick,$ad1)) <= 375) {  
    hadd nick $ad1 $addtok($hget(nick,$ad1),$newnick,32) 
  }
  elseif (%nickinc) && ($len($hget(nick,$ad1)) >= 375) && (%nickinc <= $numtok($ad1,32)) {
    inc %nickinc
    hadd nick $ad1 $puttok($hget(nick,$ad1),$newnick,%nickinc,32)
  }
  elseif (%nickinc) && ($len($hget(nick,$ad1)) >= 375) && (%nickinc >= $numtok($ad1,32)) {
    set %nickinc 1
    hadd nick $ad1 $puttok($hget(nick,$ad1),$newnick,%nickinc,32)
  }
  else {
    set %nickinc 1
    hadd nick $ad1 $puttok($hget(nick,$ad1),$newnick,%nickinc,32)
  }
}
alias ad1 { 
  var %a = $len(%ad),%g = $pos(%ad,@,1),%b = $calc(%a - %g + 1)  
  return $mid(%ad,%g,%b)
}
alias nn {
  var %n = $hget(nick,$1)
  if (!%n) { return I don't have record of $1 }
  else {
    var %a = $1
    tokenize 32 %n
    return $+($chr(40),%a,$chr(41)) has been known as $1-
  }
}
alias pnicks {
  echo -a $nn($1)
}

Comments

Sign in to comment.
Kurachi   -  Dec 25, 2009

hi can you make a trigger command.. like !track @B82A91.DF83BX2.IP

 Respond  
Joshuaxiong1   -  Jan 14, 2008

Now what about a when Nick join if Nick is in list then shows all nick

 Respond  
Joshuaxiong1   -  Jan 14, 2008

Now what about a when Nick join if Nick is in list then shows all nick

 Respond  
Joshuaxiong1   -  Jan 14, 2008

.Track { pnicks $address($$1,2) }

Yay!

Wow um..That was easy thank you Kol from irc.swiftirc.net

 Respond  
Joshuaxiong1   -  Jan 14, 2008

I suggest making a pop button like

.Track { pnicks }

But how you make it get his host?

 Respond  
tank59   -  Oct 03, 2005

I think I took care of the limit. Once it gets over a certain length it will start overwriting from oldest to newest. Didn\'t have time to test it real good so any bugs let me know.

 Respond  
cooolstar   -  Oct 03, 2005

ohh :)

 Respond  
tank59   -  Oct 03, 2005

The reason I didn\'t use $gettok($address,2,64) or $site is because I wanted to keep the \'@\' in it. I also tested this with 45 nicks in an item and it returned them all. Is there an actual limit on how much a hash can contain?

 Respond  
DarthReven   -  Oct 02, 2005

$gettok($address,2,64) or use $site also i already made something like this awhile ago that is in it\'s thrid version and to give you the heads up the you\'ll only be able to return about 25 nicks so you need to limit the amount of nicks you put in your hash table

 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.