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.

Chanlogs

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
d
delinquent
Voice
Posts: 11
Joined: Fri Feb 08, 2013 10:58 am
Location: Undernet #ACAB

Chanlogs

Post by delinquent »

Hello :)

i am looking for a script to save the logs from multuiple channels (so probably would be better with .chanset +/-chanlogs) with joins/parts/quits/kicks/bans/notice/ame .. all of them ... but the logs to be made for 1 week (something like a&a but for one week not one day) to be saved like $chan.log and $chan.lastweek.log ... becouse i want to put them on a ftp .. is its posible olso the tcl for the ftp upload ...

thank you in advance !
delinquent @ Undernet

BotLending Project @ www.BotLending.tk
Channels : #Y&X #E&A #LendEgg #mIRC-Bots #MyBot #botland #mythic #lmt #elmt #Eggdrops
w
willyw
Revered One
Posts: 1203
Joined: Thu Jan 15, 2009 12:55 am

Re: Chanlogs

Post by willyw »

I do this, and use:

Eggdrop Logger 2.0 - www.mircstats.com

You can find it on the TCL Archive here.
It has a configurable option for weekly, but I have never used it.

As is, it does not have an On/Off switch. It simply logs all the channels.
I suppose you could modify it slightly.

is its posible olso the tcl for the ftp upload ...
I do it with a bash script, run on a schedule by crontab.

You can google for examples of bash scripts that will do this.
Here's one hit:
http://nixcraft.com/getting-started-tut ... erver.html
There are many more.


I hope this helps.
d
delinquent
Voice
Posts: 11
Joined: Fri Feb 08, 2013 10:58 am
Location: Undernet #ACAB

Post by delinquent »

Eggdrop Logger 2.0 @ http://www.egghelp.org/cgi-bin/tcl_arch ... ad&id=1180

the only problem is that the bots doesn`t save what he is saying on the channel ... it logs for everybody else .. but for him not ...
delinquent @ Undernet

BotLending Project @ www.BotLending.tk
Channels : #Y&X #E&A #LendEgg #mIRC-Bots #MyBot #botland #mythic #lmt #elmt #Eggdrops
d
delinquent
Voice
Posts: 11
Joined: Fri Feb 08, 2013 10:58 am
Location: Undernet #ACAB

Post by delinquent »

i`ll post the code here .. maybe someone has a clue ..

Code: Select all

########################################################
#        Eggdrop Logger 2.0 - www.mircstats.com        #
#        Logging in mIRC 6.17 format. 27/04/2006       #
#                                                      #
#   Make sure you have created the dir 'logger(dir)'   #
#                                                      #
#         Created by Lanze <simon@freeworld.dk>        #
#         Improved by zowtar <zowtar@gmail.com>        #
#                                                      #
########################################################


### Configuration


#;;; Where the logs will be saved.
set logger(dir) "chanlogs/"

#;;; Strip codes?
#;;; 0 = save codes\colors
#;;; 1 = no save codes\colors
set logger(strip) "1"

#;;; Save by Day, Week, Month or Disable?
set logger(time) "Month"



# # # # # # # # # # # # # # # #   DO NOT CHANGE ANYTHING BELOW HERE   # # # # # # # # # # # # # # # #



### Events
bind join - "#* *!*@*" logger:join
bind part - "#* *!*@*" logger:part
bind sign - "#* *!*@*" logger:quit
bind pubm - "#* *" logger:text
bind nick - "#* *" logger:nick
bind kick - "#* *" logger:kick
bind mode - "#* *" logger:mode
bind topc - "#* *" logger:topic
bind raw - "333" logger:topic-author
bind ctcp - "ACTION" logger:action


### Primary Commands
proc logger:join {nick uhost handle chan} {
  global logger botnick
  if {$nick == $botnick} {
    set log "[open "$logger(dir)$chan.log" a]"
    puts $log "\r"
    puts $log "Session Start: [strftime "%a %b %d %T %Y"]\r"
    puts $log "Session Ident: $chan\r"
    puts $log "\[[strftime "%H:%M"]\] * Now talking in $chan\r"
    close $log
  } else {
    logger:save $chan "* $nick ($uhost) has joined $chan"
  }
}

proc logger:part {nick uhost handle chan msg} {
  if {$msg == ""} {
    logger:save $chan "* $nick ($uhost) has left $chan"
  } else {
    logger:save $chan "* $nick ($uhost) has left $chan ($msg)"
  }
}

proc logger:quit {nick uhost handle chan reason} {
  logger:save $chan "* $nick ($uhost) Quit ($reason)"
}

proc logger:text {nick uhost handle chan text} {
  if {[isop $nick $chan] == "1"} {
    set nick "@$nick"
  } elseif {[ishalfop $nick $chan] == "1"} {
    set nick "%$nick"
  } elseif {[isvoice $nick $chan] == "1"} {
    set nick "+$nick"
  }
  logger:save $chan "<$nick> $text"
}

proc logger:nick {nick uhost handle chan newnick} {
  logger:save $chan "* $nick is now known as $newnick"
}

proc logger:kick {nick uhost handle chan target reason} {
  logger:save $chan "* $target was kicked by $nick ($reason)"
}

proc logger:mode {nick uhost handle chan mode victim} {
  logger:save $chan "* $nick sets mode: $mode $victim"
}

proc logger:topic {nick uhost handle chan topic} {
  if {$nick == "*"} {
    logger:save $chan "* Topic is '$topic'"
  } else {
    logger:save $chan "* $nick changes topic to '$topic'"
  }
}

proc logger:topic-author {from keyword text} {
  logger:save [lindex $text 1] "* Set by [lindex $text 2] on [strftime "%a %b %d %T" [lindex $text 3]]"
}

proc logger:action {nick uhost handle dest keyword text} {
  if {[validchan $dest] == "1"} {
    if {[isop $nick $dest] == "1"} {
      set nick "@$nick"
    } elseif {[ishalfop $nick $dest] == "1"} {
      set nick "%$nick"
    } elseif {[isvoice $nick $dest] == "1"} {
      set nick "+$nick"
    }
    logger:save $dest "* $nick $text"
  }
}


### Secondary Commands
proc logger:save {chan text} {
  global logger
  set log "[open "$logger(dir)$chan.log" a]"
  puts $log "\[[strftime "%H:%M"]\] [logger:strip $text]\r"
  close $log
}


### Tertiary Commands
proc logger:strip {text} {
  global logger numversion
  if {$logger(strip) == "1"} {
    if {$numversion >= "1061700"} {
      set text "[stripcodes bcruag $text]"
    } else {
      regsub -all -- {\002,\003([0-9][0-9]?(,[0-9][0-9]?)?)?,\017,\026,\037} $text "" text
    }
  }
  return $text
}


### Time
proc logger:time {} {
  global logger
  foreach bind [binds time] {
    if {[string match "time * logger:time-save" $bind] == "1"} {
      unbind time - "[lindex $bind 2]" logger:time-save
    }
  }
  switch [string toupper $logger(time)] {
    DAY {
      bind time - "00 00 [strftime "%d" [expr [unixtime] + 86400]] * *" logger:time-save
    }
    WEEK {
      bind time - "00 00 [strftime "%d" [expr [unixtime] + ((7 - [strftime "%w"]) * 86400)]] * *" logger:time-save
    }
    MONTH {
      bind time - "00 00 01 [strftime "%m" [expr [unixtime] + ((32 - [strftime "%d"]) * 86400)]] *" logger:time-save
    }
  }
}

proc logger:time-save {minute hour day month year} {
  global logger
  foreach channel [channels] {
    if {[file exists "$logger(dir)$channel.log"] == "1"} {
      file rename -force "$logger(dir)$channel.log" "$logger(dir)${channel}_\[[strftime "%Y.%m.%d"]\].log"
    }
    set log "[open "$logger(dir)$channel.log" w]"
    puts $log "\r"
    puts $log "Session Start: [strftime "%a %b %d %T %Y"]\r"
    puts $log "Session Ident: $channel\r"
    puts $log "\[[strftime "%H:%M"]\] * Now talking in $channel\r"
    close $log
    putquick "TOPIC $channel"
  }
  logger:time
}


logger:time


putlog "TCL Logger.tcl Loaded!"
delinquent @ Undernet

BotLending Project @ www.BotLending.tk
Channels : #Y&X #E&A #LendEgg #mIRC-Bots #MyBot #botland #mythic #lmt #elmt #Eggdrops
User avatar
SpiKe^^
Owner
Posts: 831
Joined: Fri May 12, 2006 10:20 pm
Location: Tennessee, USA
Contact:

Post by SpiKe^^ »

As far as I know, the bot Will Never trigger a pubm bind on any text sent from itself.
The script relies on a pubm bind to write channel text to it's log files...

Code: Select all

bind pubm - "#* *" logger:text
SpiKe^^

Get BogusTrivia 2.06.4.7 at www.mytclscripts.com
or visit the New Tcl Acrhive at www.tclarchive.org
.
d
dirty
Halfop
Posts: 40
Joined: Fri Feb 08, 2013 2:33 pm
Location: Romania
Contact:

Post by dirty »

like i told you before delinquent, only way to get the messages from bot in the log files is to setup this tcl in another bot
come to the dark side.. I have cookies!
WwW.BotZone.TK
w
willyw
Revered One
Posts: 1203
Joined: Thu Jan 15, 2009 12:55 am

Post by willyw »

dirty wrote:like i told you before delinquent, only way to get the messages from bot in the log files is to setup this tcl in another bot
Not so sure about that.

http://forum.egghelp.org/viewtopic.php?p=89174#89174
and see the link:

Code: Select all

Backwards compatible script that logs eggdrop's own messages using bind out if available
d
dirty
Halfop
Posts: 40
Joined: Fri Feb 08, 2013 2:33 pm
Location: Romania
Contact:

Post by dirty »

true.. you can log the messages with bind out but like thommey clearly said in that post.. it is not really compatible with the network.. what if the egg is not on the channel? what if the bot is muted? banned? etc .. the messages will still be logged even do they do not reach the channel.. so doing this correctly and really logging everything including the bot`s messages is putting the log tcl in another bot.
come to the dark side.. I have cookies!
WwW.BotZone.TK
User avatar
Madalin
Master
Posts: 310
Joined: Fri Jun 24, 2005 11:36 am
Location: Constanta, Romania
Contact:

Post by Madalin »

A script that does that

"This script makes eggdrop log its own public messages to the default channel log (logflag p).
Note that it assumes all sent messages actually reach the server (even through +m, +b, colorblock, ..)."

Download it from:
http://thommey.tclhelp.net/dl/dl.htcl?id=5
d
delinquent
Voice
Posts: 11
Joined: Fri Feb 08, 2013 10:58 am
Location: Undernet #ACAB

Post by delinquent »

and how do i activate it ? ... like .chanset +logs ? :-??
delinquent @ Undernet

BotLending Project @ www.BotLending.tk
Channels : #Y&X #E&A #LendEgg #mIRC-Bots #MyBot #botland #mythic #lmt #elmt #Eggdrops
Post Reply