| View previous topic :: View next topic |
| Author |
Message |
popolare Voice
Joined: 25 Mar 2007 Posts: 6
|
Posted: Sun Mar 25, 2007 11:57 am Post subject: Count determinate provider on join and log accesses |
|
|
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 |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Sun Mar 25, 2007 8:10 pm Post subject: |
|
|
Access to what, from what? (you mean ops from specific hosts?) _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
popolare Voice
Joined: 25 Mar 2007 Posts: 6
|
Posted: Tue Mar 27, 2007 8:35 am Post subject: |
|
|
| 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 |
|
| Back to top |
|
 |
iamdeath Master

Joined: 11 Feb 2005 Posts: 323 Location: *HeLL*
|
Posted: Tue Mar 27, 2007 10:57 am Post subject: |
|
|
This script will show count whenever someone will join your channel.
| Code: | # 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: | | 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  |
|
| Back to top |
|
 |
|