| View previous topic :: View next topic |
| Author |
Message |
Hero Halfop
Joined: 26 Jun 2012 Posts: 49 Location: root@localhost
|
Posted: Sat Aug 04, 2012 4:59 am Post subject: Need Small Script To Save Connecting Nicks On Server |
|
|
Hello I Need A Small Script..
Client Connecting On My Server And The Format Is:
irc.server.com- *** Notice -- Client connecting on port 6667: Abc (~ABC@69.42.218.545) [clients]
I Need The Bot Save This Line To A File: irc.server.com- *** Notice -- Client connecting on port 6667: Abc (~ABC@69.42.218.545) [clients]
In Logs.txt Is It Possible? |
|
| Back to top |
|
 |
SpiKe^^ Owner

Joined: 12 May 2006 Posts: 792 Location: Tennessee, USA
|
Posted: Tue Jan 22, 2013 10:20 am Post subject: |
|
|
Believe that's the rough idea, see if it logs anything, and if it needs more work:)
| Code: |
# set full route and filename ##
set the_log_file "/usr/home/spike/connect.log"
# set mask(s) to match for lines to save to the log ##
# note: put each mask on it's own line. ##
set the_notc_masks {
*Client connecting*
}
############# end settings #############
set the_notc_masks [split [string trim $the_notc_masks] \n]
bind raw - NOTICE notc:log:proc
proc notc:log:proc {from keyword text} {
foreach mask $::the_notc_masks {
if {[string match -nocase $mask $text]} {
set open [open $::the_log_file a]
puts $open $text
close $open
break
}
}
return 0
}
|
_________________ SpiKe^^
Get BogusTrivia 2.06.4.7 at www.mytclscripts.com
or visit the New Tcl Acrhive at www.tclarchive.org
. |
|
| Back to top |
|
 |
|