IceChat Forums

IceChat 7 => IceChat 7 Scripts => Topic started by: akemi on July 22, 2011, 04:49:05 AM

Title: Nick/IP Tracker
Post by: akemi on July 22, 2011, 04:49:05 AM
I have been working and looking for some script/help to try and create a nick/IP tracker and I can't seem to find one, could someone help me?

Thanks!
Title: Re: Nick/IP Tracker
Post by: Morio on July 22, 2011, 07:16:17 AM
I'm not sure if this is what you are looking for, but Dark`Star made this script a long time ago, and I still happen to have it.

Code: [Select]
Sub ONJOIN(Nickname,Host,Channel,ServerNumber)
  ident = lcase(Left(Host,instr(Host,"@")-1))
  Host = lcase(Mid(Host,instr(Host,"@")+1))
  hosts = getinifile("hosts.ini",Network,Host,"")
  idents = getinifile("idents.ini",Network,ident,"")
  if len(hosts) > 0 then
    if instr(hosts,lcase(nickname)) = 0 then
      SendCommand "/print " & Channel & " New host match; " & nickname & " matches host previously used by: " & replace(hosts,","," | "),ServerNumber
      hosts = hosts & "," & lcase(nickname)
    end if
  else
    hosts = lcase(nickname)
  end if
  if len(idents) > 0 and instr("~icechat7,~chatzilla,~icechat5,~icechat77",lcase(ident))=0 then
    if instr(idents,lcase(nickname)) = 0 then
      SendCommand "/print " & Channel & " New ident match; " & nickname & " matches ident previously used by: " & replace(idents,","," | "),ServerNumber
      idents = idents & "," & lcase(nickname)
    end if
  else
    idents = lcase(nickname)
  end if
  writeinifile "hosts.ini",Network,host,hosts
  writeinifile "idents.ini",Network,ident,idents
End Sub

When someone joins a channel, the script checks if the host/ident matches the one used by another nickname sometime in the past.
Title: Re: Nick/IP Tracker
Post by: akemi on July 22, 2011, 08:08:39 AM
Yup that's what I want it to do, but I loaded the script and it's still not working. I saved it as a IceChat 5 script as well. Any other suggestions?

Thanks for your help!

akemi
Title: Re: Nick/IP Tracker
Post by: Snerf on July 22, 2011, 01:38:06 PM
Do you see nothing happening, any errors in the Console?
Title: Re: Nick/IP Tracker
Post by: akemi on July 22, 2011, 01:44:48 PM
Nothing, no errors, nada.

akemi
Title: Re: Nick/IP Tracker
Post by: Morio on July 22, 2011, 02:26:34 PM
I just tried the script and it works fine.

Keep in mind that it needs to build up a database before it can tell which nicknames connect from the same host
Title: Re: Nick/IP Tracker
Post by: akemi on July 22, 2011, 05:53:14 PM
So this does it from host, is it possible to get it to also do the following or another script do to the following:

I log in as John then I log in as Louise, to get a script that say "Louise has been seen as: John" before?

Thanks a bunch!

akemi
Title: Re: Nick/IP Tracker
Post by: Snerf on July 22, 2011, 10:37:10 PM
That is what the script does.
Title: Re: Nick/IP Tracker
Post by: Dan_B on November 18, 2011, 03:14:10 AM
I cant get it to work either, no errors or messages. A basic, quick step-by-step please? :)
Title: Re: Nick/IP Tracker
Post by: Snerf on November 18, 2011, 07:35:18 PM
One fault I see in it is this:

hosts = getinifile("hosts.ini",Network,Host,"")

Where is 'Network' defined? No where. So it will not work.

What should be in there is the network name, which needs to be extracted from an $identifier\


Network = GetIdentifier("$network", ServerNumber)

I added it right after the ONJOIN call.
No idea if it will make it work, but its certainly a start, because w/o it, it will surely NOT work, as "len(hosts)" will always equal 0, so the if statement fails.

Code: [Select]
Sub ONJOIN(Nickname,Host,Channel,ServerNumber)
  Network = GetIdentifier("$network", ServerNumber)
  ident = lcase(Left(Host,instr(Host,"@")-1))
  Host = lcase(Mid(Host,instr(Host,"@")+1))
  hosts = getinifile("hosts.ini",Network,Host,"")
  idents = getinifile("idents.ini",Network,ident,"")
  if len(hosts) > 0 then
    if instr(hosts,lcase(nickname)) = 0 then
      SendCommand "/print " & Channel & " New host match; " & nickname & " matches host previously used by: " & replace(hosts,","," | "),ServerNumber
      hosts = hosts & "," & lcase(nickname)
    end if
  else
    hosts = lcase(nickname)
  end if
  if len(idents) > 0 and instr("~icechat7,~chatzilla,~icechat5,~icechat77",lcase(ident))=0 then
    if instr(idents,lcase(nickname)) = 0 then
      SendCommand "/print " & Channel & " New ident match; " & nickname & " matches ident previously used by: " & replace(idents,","," | "),ServerNumber
      idents = idents & "," & lcase(nickname)
    end if
  else
    idents = lcase(nickname)
  end if
  writeinifile "hosts.ini",Network,host,hosts
  writeinifile "idents.ini",Network,ident,idents
End Sub

Title: Re: Nick/IP Tracker
Post by: Morio on November 19, 2011, 12:52:46 PM
'Network' actually returns your current network, and I never did any extensive testing of the script which is probably why I missed it.
Title: Re: Nick/IP Tracker
Post by: Muttley9 on February 27, 2012, 03:12:28 PM
How would I best access this script? I have it installed and have an alias to access it, but no result appears in the room I am in.

the alias I am using: /nc /! onjoin $1

I have also used: /nc /! ONJOIN $1

what am I doing wrong?  :?

Thank you
Title: Re: Nick/IP Tracker
Post by: Snerf on February 27, 2012, 05:52:08 PM
As was stated above, the script is broken, and the original author is not around to fix it.
You may just need to patch it as the 'Network' issue above states, but no certainty in this.