First of all you can combine them to one JOIN alias
on *:JOIN:*: {
var %ip $gettok($wildsite,1-,46)
if (ustreamer !isin $nick ) {
/write -a NicknameIPs.txt $nick $+ ~ $+ %ip
}
/echo 9 -t $chan new join $nick $+ $chr(32) $+ ---- $+ $chr(32) $+ $read(NicknameIPs.txt,w,%ip)
}
Second of all you can make it with INI Files, or even hash tables
Ini File Example:
on *:JOIN:*: {
var %ip $gettok($wildsite,1-,46)
if (ustreamer !isin $nick) {
writeini -a NicknameIPs.ini %ip full $+($nick,~,%ip)
}
echo 9 -t $chan new join $nick ---- $readini(NicknameIPs.ini,%ip,full)
}
Hash Table Example:
on *:JOIN:*: {
if (!$hget(nickjoins)) { hmake nickjoins 100 | if ($exists(NicknameIPs.hash)) { hload nickjoins NicknameIPs.hash } | else { hsave nickjoins NicknameIPs.hash } }
var %ip $gettok($wildsite,1-,46)
if (ustreamer !isin $nick) {
hadd -m nickjoins %ip $+($nick,~,%ip)
hsave nickjoins NicknameIPs.hash
}
echo 9 -t $chan new join $nick ---- $hget(nickjoins,%ip)
}
In my example it checks if the hashtable exists, IF NOT creates one and then checks if there's a file containing the database then it is loading it into our hashtable, otherwise it is creating it.
So on each join stores to our Local Database the results, and ALSO stores all the hashtable into file(this make it SLOW) if you want to be faster, you can save the database on EXIT, anyway and then it retrieves the data from the db
@ProIcons Thank you for that last bit about on EXIT. Else this script would become VERY slow when your counts ranged into the thousands and you were rewriting the entire text file every time (not to mention the wear on your drive >.>). Another option would be to save on exit and every 20 or so new records (incase mIRC crashes).
Thanks ProIcons!! I will mess with these more. Still a novice at this mIRC scripting.