mIRC Home    About    Download    Register    News    Help

Print Thread
#102101 04/11/04 03:34 PM
Joined: Feb 2003
Posts: 3,432
S
sparta Offline OP
Hoopy frood
OP Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
Im totaly stuck on this one.. i have this code:
Code:
on *:NICK: if ($nick != $me) { seen.add5 }
alias seen.add5 {
  var %x $read(" $+ $mircdirmap/seen.text $+ ", w,* $+ $nick $+ *)
  set %tmp.seen $readn 
  if (%tmp.seen == 1) { goto next }
  else {
    write " $+ $mircmap/seen.text $+ " $nick ( $+ $address $+ ) was last seen changing nick on $chan to $newnick $ctime | halt
  }
  :next
  write -l $+ %tmp.seen " $+ $mircmap/seen.text $+ " $nick ( $+ $address $+ ) was last seen changing nick on $chan to $newnick $ctime
}

and it works, the proble, is that when somone change his nick to newnick, then he get a new entry in the seen.txt .. and the next time he changes nick he get a new entry, that means that if somone change nick 10 times, then i would end up have 10 entrys from the same user.. anyone have a idea on how to solve this? :tongue:


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
#102102 04/11/04 03:51 PM
Joined: Aug 2003
Posts: 314
S
Fjord artisan
Offline
Fjord artisan
S
Joined: Aug 2003
Posts: 314
Have the lines indexed by $address, so perhaps make $address the first word on each line. Then use /write -s $address when adding the line. Because of this index you might actually be better off using a hash table to store these entries, where $hfind can be used to locate nicknames and such

#102103 04/11/04 05:29 PM
Joined: Feb 2003
Posts: 3,432
S
sparta Offline OP
Hoopy frood
OP Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
I have never been using hash table, so i dont have any idea how to use it :tongue:

no other ideas? :tongue:

or somone that can give me an example? i need to get the "nick" first, then the "host" and last the "time last seen"..

Last edited by sparta; 04/11/04 05:44 PM.

if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
#102104 05/11/04 06:02 AM
Joined: Aug 2003
Posts: 314
S
Fjord artisan
Offline
Fjord artisan
S
Joined: Aug 2003
Posts: 314
Try the following

alias seen.add5 {
write -w *( $+ $address $+ )* " $+ $mircdirmap/seen.txt" $nick ( $+ $address $+ ) was last seen changing nick on $chan to $newnick $ctime
}


Link Copied to Clipboard