mIRC Home    About    Download    Register    News    Help

Print Thread
#199148 09/05/08 05:20 PM
Joined: Feb 2005
Posts: 344
B
Fjord artisan
OP Offline
Fjord artisan
B
Joined: Feb 2005
Posts: 344
i found this script to se if anyone joins with another nick.
but after a sertain amount of names it stop saving the names and returns a error( hadd line to long )
anyway to let it remeber all the nicks a person uses ?
this is the code:
Code:
ON *:START: {
  hmake trackusers 10
  if ($isfile(trackusers.dat)) {
    hload trackusers trackusers.dat
  }
}
on *:JOIN:#: {
  if ($hget(trackusers,$address($nick,3))) {
    var %n = $ifmatch
    if ($istok(%n,$nick,32)) { var %d = $deltok(%n,$findtok(%n,$nick,1,32),32) }
    else { var %d = %n }
    if (!%d) { return }
    echo $colour(info) -ti2 $chan * $nick has also used the nickname $+ $iif($numtok(%d,32) > 1,s:,:) %d
    if (!$istok(%n,$nick,32)) {
      hadd trackusers $address($nick,3) %n $nick
    }
  }
  else {
    hadd trackusers $address($nick,3) $nick
  }
}
on *:NICK: {
  if ($hget(trackusers,$address($newnick,3))) {
    var %n = $ifmatch
    if (!$istok(%n,$newnick,32)) {
      hadd trackusers $address($newnick,3) %n $newnick
    }
  }
  else {
    hadd trackusers $address($nick,3) $newnick
  }
}
menu nicklist {
  Track Users
  .View Other Nicknames:{
    if (!$address($$1,3)) { echo $colour(info) -ti2 # * IAL not updated for $$1 $+ , performing userhost lookup | userhost $$1 | return }
    if ($hget(trackusers,$address($$1,3))) {
      var %n = $ifmatch
      if ($istok(%n,$$1,32)) { var %d = $deltok(%n,$findtok(%n,$$1,1,32),32) }
      else { var %d = %n }
      if (!%d) { goto notknown }
      echo $colour(info) -ti2 # * $$1 has also used the nickname $+ $iif($numtok(%d,32) > 1,s:,:) %d
    }
    else {
      :notknown
      echo $colour(info) -ti2 # * $$1 has not been known by any other nickname
    }
  }
  .Reset:hdel trackusers $address($$1,3)
}
ON *:EXIT: {
  if ($hget(trackusers)) { hsave -o trackusers trackusers.dat }
} 


hope you can help.

Bullseye #199154 09/05/08 07:29 PM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
You will have to use binary commands to handle long lines. Otherwise, you'll have to make it create a new item in the table whenever the length of nicks gets too long. Although possible, that can be challenging to make work correctly.


Invision Support
#Invision on irc.irchighway.net
Bullseye #199155 09/05/08 07:57 PM
Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
Don't store them all in one line. Use NICK!N as the item name where NICK is the nick and N is the Nth line of nickname.. Loop over %i=1 to N to get all the lines.

Alternatively you can make the itemname NICK.AKANICK (like argv[0].argv[1]) so you could loop over $hfind of all items with argv[0].* to get the AKA nicks like that.

You wouldnt be able to list all the nicks in one line even if you made either of these changes, though, so at some point they'd have to be split into multiple lines.


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"

Link Copied to Clipboard