Due to the high number of problems people encountered with the updated version of this script, I have deleted that version and reposted the original code. I do plan on bringing the code back to the level of the updated code regarding things like limiting the number of nicks tracked per address, and how/where the information is displayed, but I will be testing the code more thoroughly this time before posting.
Code updated to include a number of features that have been requested, both directly and indirectly.
For those of you who use the original code, the new one is 100% compatable with the storage method of the old code.
Added the following options:
1) Ability to turn on/off the echo when a person joins
2) Menu selection to see the aliased nicks
3) Option to limit number of nicks stored per address
4) Ability to ask in channel or via pm for the aliases for one or more nicks
5) Ability to send the command to show the aliases directly from the bot.
Removed limitation that occasionally did not set a nick to an address.
raw 366:*:{
.who $2
}
raw 352:*:{
.hadd -m AKA $4 $addtok($hget(AKA,$4),$6,32)
if %aka.auto {
echo 4 -t $2 $6 aka $replace($remtok($hget(AKA,$4),$6,1,32),$chr(32),$+($chr(44),$chr(32)))
}
if ($numtok($hget(AKA,$4),32) > $hget(AKA,0)) && ($v2 isnum 1-) {
.hadd -m AKA $4 $gettok($hget(AKA,$4),2-,32)
}
haltdef
}
on *:nick:{
var %a = $ial($nick,0)
while %a {
var %address = $ial($nick,%a)
.hadd -m AKA %address $addtok($hget(AKA,%address),$newnick,32)
if ($numtok($hget(AKA,%address),32) > $hget(AKA,0)) && ($v2 isnum 1-) {
.hadd -m AKA %address $gettok($hget(AKA,%address),2-,32)
}
dec %a
}
}
on *:exit:{
.hsave -o AKA AKA.hsh
}
on *:disconnect:{
.hsave -o AKA AKA.hsh
}
on *:start:{
if !$hget(AKA) { .hmake AKA 100 }
if $exists(AKA.hsh) { .hload AKA AKA.hsh }
}
ctcp *:version:*:{
ctcpreply $nick Version Alias Tracker 01.02.2009 by Russel Bairstow
}
menu * {
Auto-Display on join $iif(%AKA.auto,Off,On) : set %aka.auto $iif(%aka.auto,$false,$true)
Number of nicks per address currently $iif($hget(AKA,0),limited to $v1,Unlimited) : limit
}
menu nicklist {
Show alternative nicks : show $me show $iif($1,$1-,$$input(Space or comma separate multiple nicks,e,Enter nick(s) to be searched for))
}
alias -l limit {
.hadd -m AKA 0 $$input(Use 0 for no limit,e,Maximum number of nicks per address,$iif($hget(0),$v1,0))
var %a = $hget(AKA,0).item
while %a {
var %aka.address = $hget(AKA,%a).item
if ($numtok($hget(AKA,%aka.address),32) > $hget(AKA,0)) && ($v2 isnum 1-) {
.hadd -m AKA %aka.address $gettok($hget(AKA,%aka.address),$+($v1,-),32)
}
dec %a
}
}
on *:text:*:*:{
show $iif($chan,$chan,$nick) $1-
}
on *:input:*:{
show $iif($chan,$chan,$me) $1-
}
alias -l show {
var %aka.display = $1
tokenize 32 $strip($2-)
if !*show* iswm $1 {
if !$2 {
$iif(%aka.display ischan,.notice,.msg) $nick I need a nick to reference to find the known aliases (if any)
}
else {
var %aka.nicks = $replace($2-,$chr(44),$chr(32)), %a = 1, %b = $numtok(%aka.nicks,32)
while %a <= %b {
var %aka.nick = $gettok(%aka.nicks,%a,32), %c = $hfind(AKA,$+(*,%aka.nick,*),0,w).data, %aka
while %c {
var %aka.temp.nicks = $hget(AKA,$hfind(AKA,%aka.nicks,%c,w).data), %e = $numtok(%aka.temp.nicks,32)
while %e {
%aka = $addtok(%aka,$gettok(%aka.temp.nicks,%e,32),32)
dec %e
}
dec %c
}
%aka = $remtok(%aka,%aka.nick,1,32)
.msg %aka.display $iif(%aka,%aka.nick AKA $sorttok(%aka,32),No aliases for %aka.nick found)
}
inc %a
}
}
}
Merkin_Man, if you happen to be using an older version of mirc below 6.16, you need to change > $v1to
$ifmatch
and> $v2to
$ifmatch2
They're the only culprit I can think of that render RusselB's script unworkable for you.
P.S. For whatever reason, there are still people adapting to the old versions of mirc. The old versions are full of unfixed bugs and holes security wise. One thing I do know, however, is that the old ones are easily cracked to bypass the registration.
None. In fact the code that is currently posted here, and at http://www.hawkee.com/snippet/4697/ should be the same, and the same as the original code.
I did have an alternate code that I posted, but due to a lack of testing there were several problems that others encountered. With that information, I reverted back to the original code.
This is an updated code and has been tested to the best of my ability over the past week on 10 - 20 channels over 4 networks.
Please let me know if you run into any difficulties, and please be as precise as you can.
Note: There is a slight chance that one or more nicks may not be stored correctly if there is a lot of people that join a channel very quickly.
People have mentioned that they have had several problems with this code, so I tried to replace it with the original code. However, the software on this forum wouldn\'t allow me to make that large an alteration and forced a new post. Hawkee has been made aware of this situation and has said that he will look into it. If you have trouble with this code, the original can be found at http://www.hawkee.com/snippet/4697/
The on start event has a check built into it to ensure compatability with past/future versions. This version uses a different format for storing the information, which makes it incompatable with previous versions. If you read the pop-up message, and had clicked Yes, then the script would\'ve continued, but any previous nicks/addresses that were stored would\'ve been lost. Clicking No is what causes the script to unload.
BTW: thanks for catching that typo...I\'ll fix the code.
As I kept working on improving this, I kept thinking of other things I could add to improve it, so the update is taking longer than I thought. It\'s the 22nd now, and I don\'t have any plans for the weekend, so (hopefully) I\'ll be able to get everything done and posted for Monday (that\'s my goal at the moment)
The main idea of my code is to track the nicks used by a single person, and let you see what other nick(s) have been used. That being said, events like ON KICK, ON QUIT, etc., are useless. The nicks are tracked in a hash table, so the only time it has to be saved is when the client running the code leaves, which is covered in the ON EXIT and ON DISCONNECT events.
Those other scripts that have been mentioned that are bigger and have more events are usually scripts written for statistics, where you want to have a count of the number of kicks, bans, parts, joins, actions, messages, etc.
Regarding limiting the number of nicks in the list, I can definetely do that.
Watch for an update, probably within the next 24 hours.
Just though of a few stuff, what about making a alias to like /nick_check Nickname
and u get what nicks he used? And a menu, so ur rightclick a nick and check them.
And also, what about making a limit for the nicknames? Cause..
(12:20:36)Soushi AKA test2, test3, Test4, Test5
The list can be made long....
So, what about limiting it to, 5?, when it reaches that, i starts to delete the first one etc. Just, incase someone changes his nickname alot.
but a menu/alias would be perfect <3
There\'s a few of theese, this one doesnt look as \'advanced\' as the other ones,.
I havent tested this one, but the other ones are a little bigger.
But aint u able to make a few more events? like on kick, quit, disconnect, so it saves all users. Iunno, i saw Darth used that in his. Might be good to use it here too ;)
Anyhow, good job.