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.

error in mirclog.tcl

Old posts that have not been replied to for several years.
Locked
P
PLUGGER
Voice
Posts: 24
Joined: Sat Nov 30, 2002 6:54 am
Contact:

error in mirclog.tcl

Post by PLUGGER »

i have been running this on an eggdrop for months without any problems..

i wasnt sure about posting the whole god damn file (didnt want to use up too much space on here) but seen as you asked here is the whole mirclog.tcl

Code: Select all

# mIRC style logging
# Created by Kenny of PSdNetworks
# http://kenny.psdnetworks.co.uk/
# http://www.psdnetworks.co.uk/
# kenny@psdnetworks.co.uk
#
# Very simple operation. Channels are logged as soon as the bot joins them. No addition of channels
# to extra files or configurations is required.
#
# Configuration options:
#
#   set mirc_path
#       ^ The directory to store the log files in. This is the relative path from the bot's ~/ or
#         an absolute path.
#
#   set mirc_stripsign
#       ^ Strip the first character from the channel name?
#         Set to "0" to keep the whole name
#         Set to "1" to strip the first character
#         Examples:
#           Stripping off: "#psdnetworks" would become "#psdnetworks.log"
#           Stripping on:  "#psdnetworks" would become "psdnetworks.log"
#
#   set mirc_ext
#       ^ This is the extension to give the filenames
#         Examples:
#           set mirc_ext ".chanlog" - #mychannel would be logged to #mychannel.chanlog
#           set mirc_ext ".log"     - #mychannel would be logged to #mychannel.log
#           set mirc_ext ".abc"     - #mychannel would be logged to #mychannel.abc
#
#
set mirc_path "/home/unrealircd/bots/constrictorbot/logs/mircstatlog/"
set mirc_stripsign "1"
set mirc_ext "constrictor.log"
#
#
# NOTE: Channels containing the "-" character will have "-" converted to "_"
#       Example: #my-channel would be logged to something like #my_channel.log
#
# -- END OF CONFIGURATION --
#
proc mirc_privmsg {nick host handle channel text} { mirc_log "PRIVMSG" $channel $nick $host "" "$text" }
proc mirc_join {nick host handle channel} { mirc_log "JOIN" $channel $nick $host "" "" }
proc mirc_quit {nick host handle channel reason} { mirc_log "QUIT" $channel $nick $host "" "$reason" }
proc mirc_topic {nick host handle channel topic} { mirc_log "TOPIC" $channel $nick $host "" "$topic" }
proc mirc_kick {nick host handle channel target reason} { mirc_log "KICK" $channel $nick $host $target "$reason" }
proc mirc_nick {nick host handle channel newnick} { mirc_log "NICK" $channel $nick $host "" "$newnick" }
proc mirc_mode {nick host handle channel change victim} { mirc_log "MODE" $channel $nick $host $victim "$change" }
proc mirc_part {nick host handle channel partmsg} { mirc_log "PART" $channel $nick $host "" "$partmsg" }
proc mirc_action {nick host handle channel keyword text} { mirc_log "ACTION" $channel $nick $host "" "$text" }
proc mirc_stamp {min hour day month year} {
  global mirc_path mirc_stripsign mirc_ext
  foreach channel [channels] {
    set chanfile $channel
    while {"[string match *-* $chanfile]" > "0"} { regsub "\\\-" $chanfile "_" chanfile }
    if {"$mirc_stripsign" == "0"} { set mirc_filename "[string tolower $chanfile]" } else { set mirc_filename "[string range [string tolower $chanfile] 1 end]" }
    set logID [open $mirc_path$mirc_filename$mirc_ext a]
    puts $logID "Session Time: [ctime [unixtime]]"
    close $logID
  }
}
proc mirc_log {event channel nick host target details} {
  global botnick mirc_path mirc_stripsign mirc_ext
  if {"$channel" != "$botnick"} {
    set chanfile $channel
    while {"[string match *-* $chanfile]" > "0"} { regsub "\\\-" $chanfile "_" chanfile }
    set mirc_line "\[[time]\]"
    if {"$mirc_stripsign" == "0"} { set mirc_filename "[string tolower $chanfile]" } else { set mirc_filename "[string range [string tolower $chanfile] 1 end]" }
    if {"$event" == "PRIVMSG"} { set mirc_line "$mirc_line \<$nick\> $details" }
    if {"$event" == "JOIN"} { if {"$botnick" == "$nick"} {
    if {![file exists $mirc_path$mirc_filename$mirc_ext]} {
        set logID [open $mirc_path$mirc_filename$mirc_ext w]
        putlog "Starting a new logfile for $channel"
        puts $logID "Session Start: [ctime [unixtime]]"
      } else {
        set logID [open $mirc_path$mirc_filename$mirc_ext a]
        putlog "Continuing logfile for $channel"
        puts $logID "Session Time: [ctime [unixtime]]"
      }
      puts $logID "\[[time]\] *** Now talking in $channel"
      set mirc_line ""
      close $logID
    } else { set mirc_line "$mirc_line *** $nick ($host) has joined $channel" } }
    if {"$event" == "QUIT"} { set mirc_line "$mirc_line *** $nick ($host) Quit ($details)" }
    if {"$event" == "TOPIC"} { if {"$nick" == "*"} { set mirc_line "$mirc_line *** Topic is '$details'" } else { set mirc_line "$mirc_line *** $nick changes topic to '$details'" } }
    if {"$event" == "KICK"} { if {"$target" == "$botnick"} { set mirc_line "$mirc_line *** You were kicked by $nick ($details)" } else { set mirc_line "$mirc_line *** $target was kicked by $nick ($details)" } }
    if {"$event" == "NICK"} { set mirc_line "$mirc_line *** $nick is now known as $details" }
    if {"$event" == "MODE"} { set mirc_line "$mirc_line *** $nick sets mode: $details $target" }
    if {"$event" == "PART"} { set mirc_line "$mirc_line *** $nick ($host) has left $channel" }
    if {"$event" == "ACTION"} { set mirc_line "$mirc_line * $nick $details" }
    if {![file exists $mirc_path$mirc_filename$mirc_ext]} {
      set logID [open $mirc_path$mirc_filename$mirc_ext w]
      puts $logID "Session Start: [ctime [unixtime]]"
      puts $logID "\[[time]\] *** Now talking in $channel"
    } else { set logID [open $mirc_path$mirc_filename$mirc_ext a] }
    if {"$mirc_line" != ""} { puts $logID "$mirc_line" }
    close $logID
  }
}
bind pubm - * mirc_privmsg
bind join - * mirc_join
bind sign - * mirc_quit
bind topc - * mirc_topic
bind kick - * mirc_kick
bind nick - * mirc_nick
bind mode - * mirc_mode
bind part - * mirc_part
bind ctcp - "ACTION" mirc_action
bind time - "00 00 * * *" mirc_stamp
bind time - "00 06 * * *" mirc_stamp
bind time - "00 12 * * *" mirc_stamp
bind time - "00 18 * * *" mirc_stamp
putlog "fuzzled: mIRC Logger"
does anyone know if i can run it on another eggdrop at the same time in a different #room.. because what ever i try the bot just throws me an error in the partyline and doesnt log any text in that room

the errors
[07:14] -NickServ (services@snakehouse.no-ip.info)- This nickname is registered and protected. If it is your
[07:14] -NickServ (services@snakehouse.no-ip.info)- nick, type /msg NickServ IDENTIFY password. Otherwise,
[07:14] -NickServ (services@snakehouse.no-ip.info)- please choose a different nick.
[07:14] -NickServ (services@snakehouse.no-ip.info)- Password accepted - you are now recognized.
[07:14] Tcl error [mirc_join]: no value given for parameter "nick" to "time"
[07:14] |ACCbot| joined #constrictors.
[07:14] Tcl error [mirc_topic]: no value given for parameter "nick" to "time"
[07:14] #constrictors: mode change '+o |ACCbot|' by ChanServ!services@snakehouse.no-ip.info
[07:14] Tcl error [mirc_mode]: no value given for parameter "nick" to "time"
[07:15] @#constrictors (+trn) : [m/2 o/1 h/0 v/0 n/1 b/0 e/- I/-]

there are quite a few tcl errors there

now this is no different except the room and the data path to the other bot running the same script

bot 1 runns on this config floorlessly

Code: Select all

set mirc_path "/home/unrealircd/bots/sabrina/logs/mircstatlog/"
set mirc_stripsign "1"
set mirc_ext "snakehouse.log"
and bot 2 runs this config with the above errors

Code: Select all

set mirc_path "/home/unrealircd/bots/constrictorbot/logs/mircstatlog/"
set mirc_stripsign "1"
set mirc_ext "constrictor.log"
anyone any ideas
Last edited by PLUGGER on Mon Nov 29, 2004 1:58 pm, edited 1 time in total.
User avatar
YooHoo
Owner
Posts: 939
Joined: Thu Feb 13, 2003 10:07 pm
Location: Redwood Coast

Post by YooHoo »

it would really help if you just stated what you wish your tcl to do, instead of trying to hack some inferior mirc script... or at least post us the procedures that are erroring {mirc_join, mirc_mode, mirc_topic}, or :o hey, maybe you could post the whole thing...?
:wink:
P
PLUGGER
Voice
Posts: 24
Joined: Sat Nov 30, 2002 6:54 am
Contact:

Post by PLUGGER »

YooHoo wrote:it would really help if you just stated what you wish your tcl to do, instead of trying to hack some inferior mirc script... or at least post us the procedures that are erroring {mirc_join, mirc_mode, mirc_topic}, or :o hey, maybe you could post the whole thing...?
:wink:

can i have some of what your smokin m8


i thought it was pretty self explanatory. the script is called mirclog.tcl.

its NOT a mirc script, its an eggdrop tcl script, so im not trying to hack anything

just get it working

if you have no idea to my questions, then fair enough just dont post a reply, or dont say anything... i thought i was posting my query in the right section on the right forum
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

this script uses the [time] command incorrectly, with no args, whereas it requires at least one arg (command); so I wonder how has it been running at all... or maybe you run other scripts that redefine the [time] command

the whole thing is rather inefficent, opening/closing files on potentially fast paced irc events... would recommend against using it
P
PLUGGER
Voice
Posts: 24
Joined: Sat Nov 30, 2002 6:54 am
Contact:

Post by PLUGGER »

ok, thanks for the enlightenment demond, any other text logging suggestions....


all i am doing is creating a stats page

i.e.

http://snakehouse.no-ip.info/ircstats/s ... stats.html



so something i can run that against a logged text file basically
User avatar
YooHoo
Owner
Posts: 939
Joined: Thu Feb 13, 2003 10:07 pm
Location: Redwood Coast

Post by YooHoo »

aww :mrgreen: don't get yer panties in a bunch. If all you wanted was a kickass stats script, you shoulda said so 8)
stats module - put mirc to shame :mrgreen:
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

well at least have your bot open the log once and then periodically [flush] queued logged stuff

and there is no need to use mIRC-style logging - unless of course your parsing tools (those you use to create the webpage) depend on this
g
greenbear
Owner
Posts: 733
Joined: Mon Sep 24, 2001 8:00 pm
Location: Norway

Post by greenbear »

its probly using the time proc from compat.tcl
just replace with [strftime "%H:%M"]
m
metroid
Owner
Posts: 771
Joined: Wed Jun 16, 2004 2:46 am

Post by metroid »

YooHoo wrote:aww :mrgreen: don't get yer panties in a bunch. If all you wanted was a kickass stats script, you shoulda said so 8)
stats module - put mirc to shame :mrgreen:
pisg owns all :P

http://pisg.sourceforge.net/
P
PLUGGER
Voice
Posts: 24
Joined: Sat Nov 30, 2002 6:54 am
Contact:

Post by PLUGGER »

actually i have sussed it


looks like it conflicts with eddie script, cause as soon as you take that out it works fine
Locked