I use pisg.tcl for generating stats from my irc channels but i have a weird problem and i dont understand why.
i use 2 different eggdrop on two different channel , the first eggdrop everything works fine on channel " #channel1" but with the second eggdrop pisg.tcl seems to hang while he generate stats and the only reason i found is that the channel name may cause problem since it contains a "-" and a "." ( channel is #aide-moi.net )
heres what i saw in PL while trying to generate stats
I'm affraid you're right about the error: the "-moi.net" is considered as an argument.
Peharps you may escape it by editing the tcl to add a slash before the "-" and the dot.
since the tcl have both public and dcc fonctions i`m not sure where to look and how to manage to add the " / " so i`ll paste here the tcl and if somebody can help me and put me on the right track it will be appreciate
# pisg-0.5.tcl by soroh (Last Updated: December 20th, 2003)
#
# Usage:
# type .pisg in a channel or dcc chat to manually update
# otherwise, at 00:00, 06:00, 12:00 and 18:00 it will
# will automatically update the stats page.
#
# This script works by executing $pisgpath -co $pisgconfig
#
# Pisg stats automaker and trigger-based stats updating.
# Based off of ircstats.tcl by Caramel <mmm_caramel@hotmail.com>
#
# Pisg can be found at: http://pisg.sourceforge.net
#
# Please stop by on IRC if you find a bug, or want to request a feature or something.
# Odds are I won't help you set it up, so don't waste my time..:)
#
# IRC: irc.enterthegame.com #fiend
# - soroh
# Please stop by and say hello/idle if you're using it.. the more the merrier.
#
# README
# ------
# Your pisg.cfg file must output parsed log files in the format of #fiend -> fiend.html
# unless you modify the code, of course.
#
# VERSION HISTORY
# ---------------
# 0.5: - semi-overhaul of code
# - added in ftp support
# - easier to configure
# 0.4: - found a bug about faulty pisg configs, see Notes portion of this header
# - changed command character to ! or . -- I wouldn't mind seeing all TCL
# coders follow this format really. ! *and* . is teh win.
# - fixed pisg_manstats (which is now pisg_dccstats)
# - changed the binds to m|m in case some op decides to !pisg;!pisg;!pisg..
#
# 0.3: - this was a flop, I discontinued and deleted all (little) work on it.
#
# 0.2: - fixed a bug with multiple channels, no longer uses two vars for
# messaging. everything appears to work fine now.
#
# 0.1: - initial release
#
# TODO
# ----
# - !pisg #channel/channel to update a singular channel
#
# NOTES
# -----
# - if your pisg config file has an error in it, this script can malfunction..
# so please test your configs. :)
#
# version
set pisgversion "0.5"
# you can use .pisg or !pisg
set pisgcmdchar "!"
set pisgaltchar "."
# path to pisg binary/executable *must be valid*
set pisgpath "/usr/home/aidemoi/aidemoi/pisg/pisg"
# path to pisg config *must be valid*
set pisgconfig "/usr/home/aidemoi/aidemoi/pisg/pisg.cfg"
# set to the channels you WANT to have the bot message (do NOT include the # sign)
set pisgchan "aide-moi.net"
# the binds
bind dcc m|m pisg pisg_dccstats
bind pub m|m [string trim $pisgcmdchar]pisg pisg_manstats
bind pub m|m [string trim $pisgaltchar]pisg pisg_manstats
# automagic updating - every 6 hours by default
# MM HH D M Y
bind time - "00 00 * * *" pisg_stats
bind time - "00 06 * * *" pisg_stats
bind time - "00 12 * * *" pisg_stats
bind time - "00 18 * * *" pisg_stats
# url where files will be hosted (without the filename, no trailing /)
set pisg_url "http://aide-moi.net/pisg"
# messages to display
# note: don't include the *filename* in here.. it will be tacked on to the end (no trailing /)
# $pisg_url will become $pisg_url/file.html after the script parses it, so include it somewhere
# in the configuration of your messages below.
# The URL to the files will come at the *END* of the messages below. (unless you modify the script)
# If you want to position the URL at the beginning, grep around for $pisg_newurl
set pisg_manmsg "Update manuel des statistiques / Manually updating channel stats :: "
set pisg_automsg "Update automatique des statistiques en cours / Updating channel stats automatically :: "
# ftp configuration
# pisg_useftp is either 1 or .. it's off.
# pisg_localdir should be a full path, without trailing /
set pisg_useftp "1"
set pisg_server "onyx2.ows.ch"
set pisg_user "f206466"
set pisg_pass "PvzIOrMV"
set pisg_localdir "/usr/home/aidemoi/aidemoi/"
set pisg_remotedir "/pisg"
#### END OF CONFIGURATION ####
# Sendftp v1.01 (12/6/97) by Ernst <ernst@studbox.uni-stuttgart.de>
# Ernst's eggdrop page: http://www.sodre.net/ernst/eggdrop/ (defunct)
#
# modified by soroh: only removed pingcheck portion, and changed the proc name
# in case users already had sendftp.tcl loaded, as well as aligned the code.
proc pisg_sendftp { localfile server user pass remotefile } {
global pingcheck
if {![file exist $localfile]} {
return "sendftp: File $localfile does not exist."
}
set noftp [catch {set ftpprog [exec which ftd]}]
if {$noftp} {
if {[file executable /usr/bin/ftp]} {
set ftpprog /usr/bin/ftp
set noftp 0
}
if {[file executable /bin/ftp]} {
set ftpprog /bin/ftp
set noftp 0
}
}
if {$noftp} { return "sendftp: You don't seem to have the 'ftp' tool" }
set pipe [open "|$ftpprog -n $server" w]
puts $pipe "user $user $pass"
puts $pipe "bin"
puts $pipe "put $localfile $remotefile"
puts $pipe "quit"
close $pipe
return 1
}
# used for auto-creation and public !pisg messages
proc pisg_stats {min hour day month year} {
global pisgpath pisgconfig pisgchan
global pisg_localdir pisg_remotedir pisg_server pisg_user pisg_pass pisgversion pisg_useftp pisg_automsg pisg_url
putlog "pisg-$pisgversion: Channel Stats Generating.. please wait."
exec $pisgpath -co $pisgconfig
foreach pisgc [string tolower $pisgchan] {
set pisg_filename "$pisgc.html"
set pisg_newurl "$pisg_url/$pisg_filename"
if {$pisg_useftp == 1} {
set pisg_localfile "$pisg_localdir/$pisg_filename"
set pisg_remotefile "$pisg_remotedir/$pisg_filename"
pisg_sendftp $pisg_localfile $pisg_server $pisg_user $pisg_pass $pisg_remotefile
}
puthelp "PRIVMSG \#$pisgc :$pisg_automsg $pisg_newurl"
}
}
# used for public-messages
proc pisg_manstats {min hour day month year} {
global pisgpath pisgconfig pisgchan
global pisg_localdir pisg_remotedir pisg_server pisg_user pisg_pass pisgversion pisg_useftp pisg_manmsg pisg_url
putlog "pisg-$pisgversion: Channel Stats Generating.. please wait."
exec $pisgpath -co $pisgconfig
foreach pisgc [string tolower $pisgchan] {
set pisg_filename "$pisgc.html"
set pisg_newurl "$pisg_url/$pisg_filename"
if {$pisg_useftp == 1} {
set pisg_localfile "$pisg_localdir/$pisg_filename"
set pisg_remotefile "$pisg_remotedir/$pisg_filename"
pisg_sendftp $pisg_localfile $pisg_server $pisg_user $pisg_pass $pisg_remotefile
}
puthelp "PRIVMSG \#$pisgc :$pisg_manmsg $pisg_newurl"
}
}
# used for the partyline (dcc chat)
proc pisg_dccstats {handle ipx arg} {
global pisgpath pisgconfig pisgchan
global pisg_localdir pisg_remotedir pisg_server pisg_user pisg_pass pisgversion pisg_useftp pisg_manmsg pisg_url
putlog "pisg-$pisgversion: Channel Stats Generating.. please wait."
exec $pisgpath -co $pisgconfig
foreach pisgc [string tolower $pisgchan] {
set pisg_filename "$pisgc.html"
set pisg_newurl "$pisg_url/$pisg_filename"
if {$pisg_useftp == 1} {
set pisg_localfile "$pisg_localdir/$pisg_filename"
set pisg_remotefile "$pisg_remotedir/$pisg_filename"
pisg_sendftp $pisg_localfile $pisg_server $pisg_user $pisg_pass $pisg_remotefile
}
puthelp "PRIVMSG \#$pisgc :$pisg_manmsg $pisg_newurl"
}
}