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.

Converting mIRC logs into Eggdrop logformat.

Discussion of Eggdrop's code and module programming in C.
Post Reply
D
Daleth
Voice
Posts: 3
Joined: Fri Jan 07, 2011 10:46 am

Converting mIRC logs into Eggdrop logformat.

Post by Daleth »

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!
User avatar
Trixar_za
Op
Posts: 143
Joined: Wed Nov 18, 2009 1:44 pm
Location: South Africa
Contact:

Post by Trixar_za »

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.
D
Daleth
Voice
Posts: 3
Joined: Fri Jan 07, 2011 10:46 am

Post by Daleth »

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.
User avatar
Trixar_za
Op
Posts: 143
Joined: Wed Nov 18, 2009 1:44 pm
Location: South Africa
Contact:

Post by Trixar_za »

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: 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>        #
#         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!"
w
while
Voice
Posts: 34
Joined: Sat Jul 11, 2009 9:05 am
Location: beat mort

Post by while »

the one that worked best for me and no errors with pisg is this http://www.egghelp.org/cgi-bin/tcl_arch ... oad&id=563
:)
Post Reply