Author Topic: onjoin IP writes to list  (Read 4075 times)

Orbi

  • Newbie
  • *
  • Posts: 3
onjoin IP writes to list
« on: March 15, 2006, 10:06:21 AM »
Hello, i am on a chat, where users like to change their nicks often. Only way to recognize them is by IP. Is there a way /script/ that will make a list of "nick" and "IP" and write it to file/log? I mean, when someone joins the chat, his nick and IP will be written to a log file. And when i look at the file, there will be "IP" and a "list of names" that the IP had. I dont know how to better explain it....

Maybe like this   192.168.0.1  John, Mike, Lusy
                       192.168.0.2  Petr, Mark

Or there can be for each IP addres separate file with names.

Can anyone and is anyone able to write some sort of this script?

Snerf

  • Administrator
  • Hero Member
  • *****
  • Posts: 1968
    • IceChat IRC Client
Re: onjoin IP writes to list
« Reply #1 on: March 15, 2006, 06:13:18 PM »
The Nick/IP shows when they join a channel.
So if you look at the log file for the channel, it will all be in there already.
The IceChat God

Orbi

  • Newbie
  • *
  • Posts: 3
Re: onjoin IP writes to list
« Reply #2 on: March 17, 2006, 08:34:49 AM »
yes, but there also the chat, i need only IP and names

Snerf

  • Administrator
  • Hero Member
  • *****
  • Posts: 1968
    • IceChat IRC Client
Re: onjoin IP writes to list
« Reply #3 on: March 19, 2006, 07:53:52 PM »
Well, all the IP's do show in the nicklist.
In any case, I guess the easiest way to do this is to write an INI file using WriteIniFile and GetIniFile to retrieve information in the scripts.
In any case, this makes a text file called JoinList.txt inside your IceChat5\Scripts folder. It adds a comma at end of each nickname, so it can easily check for duplicates.

Code: [Select]
Sub ONJOIN(Nickname,Host,Channel,ServerNumber)
'remove the ident part from the host
Host = Mid(Host,Instr(Host,"@")+1)
'check if any nicks are already added for this Host
Name = GetIniFile("JoinList.txt","Names",Host,"")
If Name = "" then
  'name is blank, add the nickname
  WriteIniFile "JoinList.txt","Names",Host,NickName & ","
Else
  'check if name is already exists, if not, write the file
  If instr(Name,NickName & ",") = 0 Then
    WriteIniFile "JoinList.txt","Names",Host,Name + "," + NickName
  End If
End if
End Sub

The IceChat God

Orbi

  • Newbie
  • *
  • Posts: 3
Re: onjoin IP writes to list
« Reply #4 on: April 07, 2006, 07:09:44 AM »
thank you, its working perfectly