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.

Need Small Script To Save Connecting Nicks On Server

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
H
Hero
Halfop
Posts: 49
Joined: Tue Jun 26, 2012 6:27 pm
Location: root@localhost
Contact:

Need Small Script To Save Connecting Nicks On Server

Post by Hero »

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?
User avatar
SpiKe^^
Owner
Posts: 831
Joined: Fri May 12, 2006 10:20 pm
Location: Tennessee, USA
Contact:

Post by SpiKe^^ »

Believe that's the rough idea, see if it logs anything, and if it needs more work:)

Code: Select all

# 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
.
Post Reply