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 

Chanlogs

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


Joined: 08 Feb 2013
Posts: 11
Location: Undernet #ACAB

PostPosted: Sun Mar 24, 2013 3:58 pm    Post subject: Chanlogs Reply with quote

Hello Smile

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
Back to top
View user's profile Send private message
willyw
Revered One


Joined: 15 Jan 2009
Posts: 1175

PostPosted: Mon Mar 25, 2013 9:34 am    Post subject: Re: Chanlogs Reply with quote

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.


Quote:

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-tutorials/13566-bash-shell-script-ftp-file-server.html
There are many more.


I hope this helps.
Back to top
View user's profile Send private message
delinquent
Voice


Joined: 08 Feb 2013
Posts: 11
Location: Undernet #ACAB

PostPosted: Sat Mar 30, 2013 7:41 pm    Post subject: Reply with quote

Eggdrop Logger 2.0 @ http://www.egghelp.org/cgi-bin/tcl_archive.tcl?mode=download&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
Back to top
View user's profile Send private message
delinquent
Voice


Joined: 08 Feb 2013
Posts: 11
Location: Undernet #ACAB

PostPosted: Sun Mar 31, 2013 1:43 pm    Post subject: Reply with quote

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

Code:
########################################################
#        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
Back to top
View user's profile Send private message
SpiKe^^
Owner


Joined: 12 May 2006
Posts: 792
Location: Tennessee, USA

PostPosted: Sun Mar 31, 2013 3:46 pm    Post subject: Reply with quote

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:
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
.
Back to top
View user's profile Send private message Visit poster's website
dirty
Halfop


Joined: 08 Feb 2013
Posts: 40
Location: Romania

PostPosted: Mon Apr 01, 2013 4:14 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message Visit poster's website
willyw
Revered One


Joined: 15 Jan 2009
Posts: 1175

PostPosted: Mon Apr 01, 2013 8:44 am    Post subject: Reply with quote

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:

Backwards compatible script that logs eggdrop's own messages using bind out if available
Back to top
View user's profile Send private message
dirty
Halfop


Joined: 08 Feb 2013
Posts: 40
Location: Romania

PostPosted: Mon Apr 01, 2013 11:23 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message Visit poster's website
Madalin
Master


Joined: 24 Jun 2005
Posts: 310
Location: Constanta, Romania

PostPosted: Sat Jun 01, 2013 5:20 pm    Post subject: Reply with quote

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
_________________
https://github.com/MadaliNTCL - To chat with me: https://tawk.to/MadaliNTCL
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
delinquent
Voice


Joined: 08 Feb 2013
Posts: 11
Location: Undernet #ACAB

PostPosted: Sun Jun 02, 2013 12:59 pm    Post subject: Reply with quote

and how do i activate it ? ... like .chanset +logs ? Confused?
_________________
delinquent @ Undernet

BotLending Project @ www.BotLending.tk
Channels : #Y&X #E&A #LendEgg #mIRC-Bots #MyBot #botland #mythic #lmt #elmt #Eggdrops
Back to top
View user's profile Send private message
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