mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jun 2004
Posts: 133
S
state Offline OP
Vogon poet
OP Offline
Vogon poet
S
Joined: Jun 2004
Posts: 133
Sorry about title, tryed to get the best explanation.

basically when a user joins a channel i want it to write to a text file(or something better if u suggest)

nick address

then next time if a nick joins under a different name it saves it as

newnick address was also nick

make sense?

Joined: Jan 2006
Posts: 34
N
Ameglian cow
Offline
Ameglian cow
N
Joined: Jan 2006
Posts: 34
the best way i can think of is to save to an ini file

address=nick
and
nick=address
then you can have the script perform differant lookups

by looking up the address if the nick is differant result = newnick used to be oldnick

by looking up the nick if the nick exists and the address is differant then result = nick is connecting on a differant ip address

Joined: Jun 2004
Posts: 133
S
state Offline OP
Vogon poet
OP Offline
Vogon poet
S
Joined: Jun 2004
Posts: 133
i have no idea how to do any of that grin

Last edited by state; 21/06/09 06:21 PM.
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Alternatives include using a hash table and using an ini file.

For the hash table you would use something like
Code:
on *:join:#:{
.hadd -m Nicks $address $addtok($hget(Nicks,$address),$nick,32)
}
on *:nick:{
.hadd -m Nicks $address $addtok($hget(Nicks,$address),$newnick,32)
}

Now this will only store the information into the hash table, which is stored in RAM, thus, if you want to preserve the information between sessions, you will also need to save the information using the /hsave command, as well as load the information when the script starts using /hload

Recommended reading /help hash tables.

If you want the information to be displayed, you'll need to use $hget and/or $hfind, depending on just what information you actually want displayed.

The big advantage to using a hash table rather than a text or ini file, is that it is extremely fast, thus if you have a lot of people join the channel in a short period of time (such as after a netsplit), a hash table will be able to keep up with the modifications necessary, but a text or ini file might not, due to the speed limitation of having to access the hard drive.


Link Copied to Clipboard