Script that stores nicknames and IP addresses

By Truk on Jul 02, 2013

This is a script that stores nicknames and IP addresses so that the next time that same person joins a chat that you are in the script will display them joining and shows their nick name like this "new join SomeNickName ---- ustreamer1234567~!@xxxxxxxxxxx.cm-3-4c.dynamic.xxxxxx.nl

This is good esp for ustream chats as people often join with a random name and you dont know who is joining your chat.

The script does not clean the text file it creates so it could become very large - keep that in mind.

This may cause a drain on your chat and make it hang if you are on a lot of channels so you may want to filter the channels it monitors and stores nick names on.

;you need two Remote files:
;#1 File name: on_join_to_txt_file.mrc
;-----> This script makes a file storing ip addresses and the nickname used for that IP address.  If the chatter does not nick up it will not store an entry.  So with time this file will grow a database of names and IP addresses and with time the script becomes increasingly more informative as people join chats
on *:JOIN:*: {  
  if (ustreamer !isin $nick ) {
    /write -a NicknameIPs.txt $nick $+ ~ $+ $gettok($wildsite,1-,46)
  }
}

;#2 File name: show-join-nick-in-chat.mrc
;-----> This script looks up new join IP's from the file that the above script makes and lists the nick name used by that IP address.
on *:JOIN:#: {
  var %i 1
  var %ip $gettok($wildsite,1-,46) 
  /echo 9 -t $chan new join $nick $+ $chr(32)  $+ ---- $+ $chr(32)  $+ $read(NicknameIPs.txt,w,%ip)
}

Comments

Sign in to comment.
ProIcons   -  Jul 05, 2013

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)
}
Truk  -  Jul 09, 2013

Thanks ProIcons!! I will mess with these more. Still a novice at this mIRC scripting.

ProIcons  -  Jul 09, 2013

Be noticed.
Speed:
HashTables > Variables > Ini Files.

HashTables loads extremely faster all the data since they are getting stored directly into your RAM Memory

Truk  -  Jul 09, 2013

One question. I did some reading on HashTables and assumed they were faster and I am using the HashTable atm, but will the results stored in the HashTable have to be regenerated each time mIRC is started?

Truk  -  Jul 09, 2013

Never mind that last stupid question - eyes @-@ are open now. Thanks Again!

ProIcons  -  Jul 09, 2013

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

Savage_CL  -  Aug 09, 2013

@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).

ProIcons  -  Aug 09, 2013

Just AppHang, not crash:D

Fundamental  -  Dec 01, 2018

How to see real ip? its show hidden ips
(01:22:47) Chris_Evans (Mibbit@773473.D54EC4.F95EB2.EE02AD) has joined #Chatroom
(01:22:47) |---› Chris_Evans~
!*@773473.D54EC4.F95EB2.EE02AD
how to see real ip address? if a person is ircop and wanted to see on join nick real ip instead of hidden cloak?

Sign in to comment

Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.