egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Count determinate provider on join and log accesses

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
popolare
Voice


Joined: 25 Mar 2007
Posts: 6

PostPosted: Sun Mar 25, 2007 11:57 am    Post subject: Count determinate provider on join and log accesses Reply with quote

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
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Sun Mar 25, 2007 8:10 pm    Post subject: Reply with quote

Access to what, from what? (you mean ops from specific hosts?)
_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
popolare
Voice


Joined: 25 Mar 2007
Posts: 6

PostPosted: Tue Mar 27, 2007 8:35 am    Post subject: Reply with quote

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
View user's profile Send private message
iamdeath
Master


Joined: 11 Feb 2005
Posts: 323
Location: *HeLL*

PostPosted: Tue Mar 27, 2007 10:57 am    Post subject: Reply with quote

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 Razz
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber