Paste to remote (ALT + R)
Seen nick script uses hash table to store nicks used by certain address. When user joins, script returns nicks used before with that address. If nick is already added in table, it will remove it, than overwrite it again, to avoid duplicated items.
Can be used with all versions of mIRC which supports hash tables.
Script suggested by: jecket
Thanks on your suggestions.
Written at: 11 March 2010 00:45
Update 1#: 11 March 2010 13:36
Update 2#: 13 March 2010 23:03
Update 3#: 14 March 2010 14:56
Update 4#: 22 March 2010 01:53
on *:JOIN:#: {
if $hget(seen_nick) == $null { hmake seen_nick 10000 }
hadd seen_nick $address($nick,0) $+($remtok($hget(seen_nick, $address($nick,0)), $nick, 32), $chr(32), $nick)
if $numtok($hget(seen_nick, $address($nick,0)), 32) > 1 && $numtok($hget(seen_nick, $address($nick,0)), 32) =< 30 {
echo $chan $timestamp -- $nick used these nicks earlier: $remtok($hget(seen_nick, $address($nick,0)), $nick, 32) - Nicks: $calc($numtok($hget(seen_nick, $address($nick,0)), 32) - 1)
}
}
on *:NICK: {
if $address($newnick,0) != $null {
hadd seen_nick $address($newnick,0) $+($remtok($hget(seen_nick, $address($newnick,0)), $newnick, 32), $chr(32), $newnick)
}
if $numtok($hget(seen_nick, $address($newnick,0)), 32) > 2 && $numtok($hget(seen_nick, $address($newnick,0)), 32) =< 30 && $address($newnick,0) != $null && $newnick != $me {
var %.c 1
while $comchan($newnick,0) >= %.c {
echo $comchan($newnick,%.c) $timestamp -- $newnick used these nicks earlier: $remtok($remtok($hget(seen_nick, $address($newnick,0)), $newnick, 32), $nick, 32) - Nicks: $calc($numtok($hget(seen_nick, $address($newnick,0)), 32) - 2)
inc %.c
}
}
}
alias seen {
if !$1 { echo $color(action) * /echo: insufficient parameters }
else {
echo $active $timestamp -- $1 used these nicks earlier: $remtok($hget(seen_nick, $address($1,0)), $1, 32) - Nicks: $calc($numtok($hget(seen_nick, $address($1,0)), 32) - 1)
}
}
http://www.hawkee.com/snippet/5773/
Korvin, you're right about hash data being saved on the ram (temporarily, that is), but NOT for when mirc is closed and then all the data gets lost. /hsave is needed as xDaeMoN stated. Please get the facts straight. what was intended was that upon disconnecting hashes aren't saved, i worded that badly, either way, that doesn't account for you being a douchebag, any word on why that's occuring? you seem to know everything about anything and are willing to defend it violently, might as well explain why you're such a faggot.
hi i hope you don't mind me changing it a little.
#seen_nick on
on !*:JOIN:#: {
hadd -m seen_nick $wildsite $+($remtok($hget(seen_nick,$wildsite),$nick,32),$chr(32),$nick)
if ($numtok($hget(seen_nick,$wildsite),32) > 1) {
echo $chan $timestamp -- $nick used these nicks earlier: $remtok($hget(seen_nick,$wildsite),$nick,32)
}
}
on !*:NICK: { hadd -m seen_nick $wildsite $+($remtok($hget(seen_nick,$wildsite),$newnick,32),$chr(32),$newnick) }
alias -l saveseen_nick { .hsave seen_nick $qt($scriptdirseen_nick.hsh) }
alias -l loadseen_nick {
if (!$hget(seen_nick)) { .hmake seen_nick 10000 }
elseif ($exists($scriptdirseen_nick.hsh)) { .hload seen_nick $qt($scriptdirseen_nick.hsh) }
}
on *:disconnect:{ $saveseen_nick }
on *:exit:{ $saveseen_nick }
on *:start:{ $loadseen_nick }
on *:connect:{ $loadseen_nick }
#seen_nick end
menu nicklist {
-
.Turn Seen Nick $iif($group(#seen_nick) = On,Off,On): $iif($group(#seen_nick) = On,.disable,.enable) #seen_nick | echo -a $timestamp -- Seen Nick is $group(#seen_nick)
. $iif($numtok($hget(seen_nick,$address($$1,2)),32) <= 1,$style(2)) Check $$1's Previous Nicks: echo -a $timestamp -- $$1 used these nicks: $remtok($hget(seen_nick,$address($$1,2)),$1,32)
. $iif($numtok($hget(seen_nick,$address($$1,2)),32) <= 1,$style(2)) Delete $$1's Previous Nicks: echo -a $timestamp -- $$1's Previous Nicks Are Now Deleted. | hdel seen_nick $address($$1,2)
-
}
Edit: added the nick event.