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.

Count determinate provider on join and log accesses

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
p
popolare
Voice
Posts: 6
Joined: Sun Mar 25, 2007 11:51 am

Count determinate provider on join and log accesses

Post by popolare »

Hello there,

in this my first post i wanna tell thanks to slennox's website and forum because it helped me so much understand how to use and adapt eggdrop to channel needs.

Now I need to code little logger of accesses from determinate provider (lets say *.example.com)

I downloaded some counters in tcl but they are very complicated for me.

Can someone help me to write one?

I need to know how many times in 24 hrs. (better if script can archive data and show also accesses only from determinate provider also in month and year if it possible)

If someone knows already existing script which does this please share the link or help me to write one.

Thanks in advance,

Popolare
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Access to what, from what? (you mean ops from specific hosts?)
p
popolare
Voice
Posts: 6
Joined: Sun Mar 25, 2007 11:51 am

Post by popolare »

Sir_Fz wrote:Access to what, from what? (you mean ops from specific hosts?)
Sir_Fz and other users, sorry for my ambiguous post,
under accesses i mean simple joins to specified channel ONLY let say from *example.com (and if possible have DNSlookup to check if by some reason example.com host isn't resolved by IRC server)

It would be amazing if output could give you somethink like this:
<popolare> !joins today
<eggdrop> Today we had 17 users joined our channel using EXAMPLE.COM ISP

I don't know how is complicated to archive data in eggdrop with unique hosts to have exact stat and to have options like today, month, year..

Thanks in advance again to everyone who can help me with this.

Kind regards,

Popolare
User avatar
iamdeath
Master
Posts: 323
Joined: Fri Feb 11, 2005 2:32 pm
Location: *HeLL*
Contact:

Post by iamdeath »

This script will show count whenever someone will join your channel.

Code: Select all

# count.tcl
# version 0.1
# caesar <cezarica@prietenii.com>
# #eggdrop @ Undernet.org
# http://www.geocities.com/caesartcl/

# In what file do you want the joins to be stored?
set joins "joins.dat" 

# From what date you want to start the counting?
set date "1 January 2006" 

# In what channel do you want this to be enabled?
# This can be with capital or lower letter, eg: #cHaNnEl and #channel.
set counting "#channel" 

### ANY EDITING AND/OR MODIFICATIONS MADE BEYOND THIS IS YOUR OWN RISK! ###

bind join - "*" the:counting 

proc the:counting {nick uhost handle chan} { 
if {[string tolower $nick] == [string tolower $::botnick] || [string tolower $chan] != [string tolower $::counting] } { return } 
if {![string match *.example.com [getchanhost $nick $chan]] || ![string match *192.168.0.* [getchanhost $nick $chan]]} {return}

if {![file exists $::joins]} { 
putlog "$::joins file doesnt exists, creating file..." 
set file [open $::joins w] 
puts $file "0" 
catch {close $file} 
} 

set file [open $::joins r] 
set tilnow "[gets $file]" 
catch {close $file} 

set file [open $::joins w] 
puts $file "[expr $tilnow + 1]" 
set tilnow [expr $tilnow + 1] 
catch {close $file} 

putserv "NOTICE $nick :You are person number \002$tilnow\002 to join $chan using *.example.com host, since $::date."
} 

putlog "counter.tcl is loaded.." 
I don't know how to DNSLookup I am working on it, if I do it I'll let you know meanwhile try that script written by caesar I have added:

You may add *.example or unresolved ip that will solve the issue atleast.

Code: Select all

if {![string match *.example.com [getchanhost $nick $chan]] || ![string match *192.168.0.* [getchanhost $nick $chan]]} {return}
I have'nt tested it, so let me know if that works :P
Post Reply