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 

Converting mIRC logs into Eggdrop logformat.

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Modules & Programming
View previous topic :: View next topic  
Author Message
Daleth
Voice


Joined: 07 Jan 2011
Posts: 3

PostPosted: Fri Jan 07, 2011 10:51 am    Post subject: Converting mIRC logs into Eggdrop logformat. Reply with quote

Ive tried to convert mIRC logs into Eggdrop without any special success. Ive browsed the forum and found a person using mirc2egg.sed which is included in pisg, so I used it but it will only convert
Session Start: Sat Oct 09 07:57:31 2010
into
[07:58] --- Sat Oct 09 2010

This leaves out everything else like chat, mirc2egg.sed seems to be quite outdated but not sure if this makes any difference. Is there any other way to convert mIRC logs into Eggdrop?

Cheers!
Back to top
View user's profile Send private message
Trixar_za
Op


Joined: 18 Nov 2009
Posts: 143
Location: South Africa

PostPosted: Fri Jan 07, 2011 4:04 pm    Post subject: Reply with quote

The question is why do you want to do this though. I admit that I use a script to rather make the bot output mIRC like logs (with a very ugly hacked up script...) so I can use it with pisg myself.
_________________
http://www.trixarian.net/Projects
Back to top
View user's profile Send private message Visit poster's website
Daleth
Voice


Joined: 07 Jan 2011
Posts: 3

PostPosted: Fri Jan 07, 2011 4:08 pm    Post subject: Reply with quote

Reason for me doing it, its because I lost my eggdrop old logs on my server, and Ive got a mIRC channellog with approx 100 days which I would like to use for PISG but Im running PISG with eggdrop on a linux server.
Back to top
View user's profile Send private message
Trixar_za
Op


Joined: 18 Nov 2009
Posts: 143
Location: South Africa

PostPosted: Fri Jan 07, 2011 4:24 pm    Post subject: Reply with quote

So it's possible just to use the mIRC logs and then continue with mIRC logs with eggdrop?

Not sure if this helps, but here's the hacked up script I use:
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>        #
#         Improved by Trixar_za <trixarian@gmail.com>  #
#                                                      #
########################################################
setudef flag slog
# Only logs in channels with .chanset #chan +slog now

### Configuration

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

#;;; 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) "WEEK"



# # # # # # # # # # # # # # # #   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} {
  if {![channel get $chan slog]} {
    return 0
  }
  global logger botnick
  set chan [string tolower $chan]
  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 [string tolower $chan] "* $nick ($uhost) has joined $chan"
  }
}

proc logger:part {nick uhost handle chan msg} {
  if {![channel get $chan slog]} {
    return 0
  }
  if {$msg == ""} {
    logger:save [string tolower $chan] "* $nick ($uhost) has left $chan"
  } else {
    logger:save [string tolower $chan] "* $nick ($uhost) has left $chan ($msg)"
  }
}

proc logger:quit {nick uhost handle chan reason} {
  if {![channel get $chan slog]} {
    return 0
  }
  logger:save [string tolower $chan] "* $nick ($uhost) Quit ($reason)"
}

proc logger:text {nick uhost handle chan text} {
  if {![channel get $chan slog]} {
    return 0
  }
  logger:save [string tolower $chan] "<$nick> $text"
}

proc logger:nick {nick uhost handle chan newnick} {
  if {![channel get $chan slog]} {
    return 0
  }
  logger:save [string tolower $chan] "* $nick is now known as $newnick"
}

proc logger:kick {nick uhost handle chan target reason} {
  if {![channel get $chan slog]} {
    return 0
  }
  logger:save [string tolower $chan] "* $target was kicked by $nick ($reason)"
}

proc logger:mode {nick uhost handle chan mode victim} {
  if {![channel get $chan slog]} {
    return 0
  }
  logger:save [string tolower $chan] "* $nick sets mode: $mode $victim"
}

proc logger:topic {nick uhost handle chan topic} {
  if {![channel get $chan slog]} {
    return 0
  }
  if {$nick == "*"} {
    logger:save [string tolower $chan] "* Topic is '$topic'"
  } else {
    logger:save [string tolower $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 {![channel get $dest slog]} {
    return 0
  }
  if {[validchan $dest] == "1"} {
    logger:save $dest "* $nick $text"
  }
}


### Secondary Commands
proc logger:save {chan text} {
  if {![channel get $chan slog]} {
    return 0
  }
  global logger
  set chan [string tolower $chan]
  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 $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] + ((31 - [strftime "%d"]) * 86400)]] *" logger:time-save
    }
  }
}

proc logger:time-save {minute hour day month year} {
  global logger
  foreach channel [channels] {
    set channel [string tolower $channel]
    if {[channel get $channel slog]} {
      if {[file exists "$logger(dir)$channel.log"] == "1"} {
        file delete -force "$logger(dir)$channel.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!"

_________________
http://www.trixarian.net/Projects
Back to top
View user's profile Send private message Visit poster's website
while
Voice


Joined: 11 Jul 2009
Posts: 34
Location: beat mort

PostPosted: Tue Jan 11, 2011 8:28 am    Post subject: Reply with quote

the one that worked best for me and no errors with pisg is this http://www.egghelp.org/cgi-bin/tcl_archive.tcl?mode=download&id=563
_________________
Smile
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 -> Modules & Programming 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