This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

I need a IP-logging script

Old posts that have not been replied to for several years.
c
croyfer
Voice
Posts: 9
Joined: Sun Oct 10, 2004 8:15 am

I need a IP-logging script

Post by croyfer »

I'm looking for a script for my eggdrop that does this:
When someone joins a channel the bot finds their IP and saves it in a file together with $date $time and the users $nick.
The ip and userinfo is to be saved in #channel.mrc - different channels must be saved in different files!

Anyone know where I can find a script like this, or can anyone out there make it for me?

Help is very appreciated :)
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

Simple, bind on join.

Split the uhost from @ with lindex 1, to get *!*@host.com then, go ahead and append to a file [open $file "a"].

You can eventually do that for every channel by using a foreach [channels] loop and matching the file name.
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
c
croyfer
Voice
Posts: 9
Joined: Sun Oct 10, 2004 8:15 am

Post by croyfer »

Well I'm sure you're right, but I have no idea how to make a script like this, so I need some help to write it.

I'd be very happy if someone would care to help me !

8)
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

Sorry but I don't do work for public anymore, and that also creating something from scratch. All the recent requests on this forum include "help me write", "write a **** script for me" and so on.

I would help someone which has a problem with a already working script, as that person would have made it himself.

I just find it useless for me to help others; takes a bit time and a bit of devotion no matter what the problem is. So you better start searching tcl guides related to eggdrops on the web. Reading faq's, search this forum, see tutorial lessons, read the tcl manual, read tcl-commands.doc, see some simple scripts and read them carefully. No one taught me.

That's where I learned it from and if I can do it, so can you.
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
c
croyfer
Voice
Posts: 9
Joined: Sun Oct 10, 2004 8:15 am

Post by croyfer »

..so you don't care

ktnx
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

We are here to help those that help themselves. Pre-written scripts can be found in the TCL Archive on the front page. Remember that everyone here do have other things to do besides sitting here and writing requested scripts from scratch just because someone seems unwilling to try. We've lost a lot of good scripters/members because of this. I suggest you visit MC_8's TCL Scripts site and read an interesting article that may give you some more insight regarding this statement of yours that "..so you don't care". :-?
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
User avatar
YooHoo
Owner
Posts: 939
Joined: Thu Feb 13, 2003 10:07 pm
Location: Redwood Coast

Post by YooHoo »

croyfer wrote:Well I'm sure you're right, but I have no idea how to make a script like this, so I need some help to write it.
Excellent. First requirement to learning to write tcl code is to aquire an understanding of exactly what you are talking about, namely reading documentation such as enhancing your eggdrop that explain tcl in general terms, with a variety of useful links, such as this excellent tcl beginner's guide. Hope this is helpful :mrgreen:
c
croyfer
Voice
Posts: 9
Joined: Sun Oct 10, 2004 8:15 am

Post by croyfer »

ERR guys.

I'm just asking if someone has a script like this - or if someone would care to make it..


If you dont have it or if you dont want to make it - JUST DONT REPLY !
User avatar
user
 
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Weird request

Post by user »

croyfer wrote:I'm looking for a script for my eggdrop that does this:
When someone joins a channel the bot finds their IP and saves it in a file together with $date $time and the users $nick.
The ip and userinfo is to be saved in #channel.mrc - different channels must be saved in different files!
croyfer wrote:I'm just asking if someone has a script like this - or if someone would care to make it..
If you dont have it or if you dont want to make it - JUST DONT REPLY !
You want someone to make you a script that does something random to find the ip and generates random output to a file. I'll be happy to do that last part for you :roll:

How does the bot find their ip? Do you want to attempt to resolve the hostname using the dns module or will a /USERIP $nick be fine? Are there hosts that should be ignored when attempting to find an ip?
What "userinfo" is saved to the file and in what format?
Have you ever read "The Manual"?
D
DarkJFMan
Halfop
Posts: 85
Joined: Mon Dec 15, 2003 3:19 pm

Re: Weird request

Post by DarkJFMan »

user wrote:
croyfer wrote:I'm looking for a script for my eggdrop that does this:
When someone joins a channel the bot finds their IP and saves it in a file together with $date $time and the users $nick.
The ip and userinfo is to be saved in #channel.mrc - different channels must be saved in different files!
croyfer wrote:I'm just asking if someone has a script like this - or if someone would care to make it..
If you dont have it or if you dont want to make it - JUST DONT REPLY !
You want someone to make you a script that does something random to find the ip and generates random output to a file. I'll be happy to do that last part for you :roll:

How does the bot find their ip? Do you want to attempt to resolve the hostname using the dns module or will a /USERIP $nick be fine? Are there hosts that should be ignored when attempting to find an ip?
What "userinfo" is saved to the file and in what format?
Wow you're very nice user I guess too nice. Wanna do all my scripts lol ;)
c
croyfer
Voice
Posts: 9
Joined: Sun Oct 10, 2004 8:15 am

Re: Weird request

Post by croyfer »

user wrote:
croyfer wrote:I'm looking for a script for my eggdrop that does this:
When someone joins a channel the bot finds their IP and saves it in a file together with $date $time and the users $nick.
The ip and userinfo is to be saved in #channel.mrc - different channels must be saved in different files!
croyfer wrote:I'm just asking if someone has a script like this - or if someone would care to make it..
If you dont have it or if you dont want to make it - JUST DONT REPLY !
You want someone to make you a script that does something random to find the ip and generates random output to a file. I'll be happy to do that last part for you :roll:

How does the bot find their ip? Do you want to attempt to resolve the hostname using the dns module or will a /USERIP $nick be fine? Are there hosts that should be ignored when attempting to find an ip?
What "userinfo" is saved to the file and in what format?
How nice of you :P
I dont know how the bots find their IPs but I want to sae the IPs in a separate file for each channel the bot is placed on. When thew bot writes the IP to the file I want it to add the time and date together with the line.
No host should be ignored - it doesnt really matter what format it saves to...

I already have this script made to mIRC, but now I'm shutting down my 2003-box and need it to be runned in an eggdrop...
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

Blah, here you go.

Code: Select all

bind join - "*" log:ips

proc log:ips {nick uhost hand chan} {
 if {(![isbotnick $nick])} {
 set file [open iplogs.txt a+]
 set time [unixtime]; set jointime [ctime $time]
 set date [string trim [lindex $jointime 2]]
 set month [string trim [lindex $jointime 1]]
 set time [string trim [lindex $jointime 3]]
 puts $file "([string toupper $chan]) \[Performed on: $date $month $time\] * $nick ($uhost) has joined $chan. \[IP Address: [lindex [split $uhost "@"] 1]\]"
 close $file
 return 0
 }
}
This will be for all the channels the bot is on.
Now the least you can do here is to modify this according to your channels and making seperate files for seperate channels to store the logs in.
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
c
croyfer
Voice
Posts: 9
Joined: Sun Oct 10, 2004 8:15 am

Post by croyfer »

Thank you awyeah !

It worked, but there is a problem - if someone joins with a vhost (bla.bla.org) the script dont get their ip, just the vhost...

Is there a way to pick out the ip - just like in /dns @ IRC... ?
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

If a person is spoofing how can you get the exact ip address of that person? Virtual hosts are mean't to hide your ip address.

If someone is on a bnc or psy using a virtual host from an ip from that box then naturally the box's ip would be shown in the host section and not the actual host of the users isp.

And /dns <ip> would give the numerical reverse of the vhost which is useless and wouldn't be the actual host of that users isp.
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
g
greenbear
Owner
Posts: 733
Joined: Mon Sep 24, 2001 8:00 pm
Location: Norway

Post by greenbear »

This code should resolve most hosts and write the info in seperate files.

If it can't resolve a host, it'll write the host instead.

You need the dns module loaded for this to work.

Code: Select all

bind join - * log:ips

proc log:ips {nick uhost hand chan} {
 if {![isbotnick $nick]} {
   set host [lindex [split $uhost @] 1]
   set ns [dnslookup $host resolve:ip $nick $chan]
 }
}

proc resolve:ip {ip host status nick chan} {
 set file [open $chan.iplogs.txt a]
 if {$ip != "0.0.0.0"} {
   puts $file "\[[strftime "%D %T"]\] <$nick> $ip"
 } else {
   puts $file "\[[strftime "%D %T"]\] <$nick> $host"
 }
 close $file
}
Locked