Hello,
I have a problem with "AVOnJoin 1.02 by Baerchen", when I load this tcl and than rehash the bot goes down (die) and can't come online anymore till I unload it again
download-link of the tcl is
http://www.egghelp.org/tclhtml/3478-4-0 ... OnJoin.htm
this is the complete script...
#
# ___ _____ _ _
# / \ \ / / _ \ _ __ | | ___ (_)_ __
# / _ \ \ / / | | | '_ \ _ | |/ _ \| | '_ \
# / ___ \ V /| |_| | | | | |_| | (_) | | | | |
# /_/ \_\_/ \___/|_| |_|\___/ \___/|_|_| |_|1.02
#
#
# by Baerchen (
baerchen@germany-chat.net), March 2001 for eggdrop 1.4.x+
#
# Script listens to a botmaster's/channelmaster's command <.av on|off>
# in the channel and enables or disables autovoicing of joining users.
# AVOnJoin will not voice when channel is +m(oderated). Settings
# are being kept in a config-file, so no worrying about re-enabling
# each channel after Bot restart. AVOnJoin handles all channels
# independently.
#
# History
#
# 1.02: Fixed a nasty bug causing the bot to crash when script was loaded was time (Sorry ..)
#
#
# Set path and filename for configuration file:
#
set av_cfg "workdir/av_cfg.cfg"
#
##### CODEBASE BELOW
bind pub m|m .av av_init
proc av_init {nick uhost handle channel arg} {
global av_a
set c [string tolower $channel]; set av_switch [string tolower [lindex $arg 0]]
if {$av_switch != "on" && $av_switch != "off"} {puthelp "NOTICE $nick :Usage: .avjoin on|off"; return}
switch -exact $av_switch {
"on" {
if {[lsearch -exact [bind join - "$c *"] av_do] > -1} {puthelp "notice $nick :AutoVoicing is already enabled"; return}
set av_a($c) "on"; bind join - "$c *" av_do
if {![botisop $c]} {puthelp "NOTICE $nick :Got you, but I need OP to do that. I will start autovoicing right after I got OPs."; return}
puthelp "NOTICE $nick :AutoVoicing enabled for $c."; putlog "AutoVoicing enabled for $c. ($nick)"
}
"off" {
if {[lsearch -exact [bind join - "$c *"] av_do] == -1} {puthelp "notice $nick :AutoVoicing is already disabled"; return}
set av_a($c) "off"; unbind join - "$c *" av_do
puthelp "NOTICE $nick :AutoVoicing disabled for $c."; putlog "AutoVoicing disabled for $c. ($nick)"
}
}
av_save
}
proc av_save {} {
global av_a av_cfg
set fid [open $av_cfg w]; foreach a [array names av_a] {puts $fid "$a $av_a($a)"}; close $fid
}
proc av_read {} {
global av_a av_cfg
if {![file exists $av_cfg]} {putlog "AVOnJoin settings not found. Creating empty file."; set fid [open $av_cfg w]; close $fid; return}
set fid [open $av_cfg r]; while {![eof $fid]} {gets $fid line; if {[llength $line] == 2} {set av_a([lindex $line 0]) [lindex $line 1]}}
close $fid; foreach a [array names av_a] {if {$av_a($a) == "on"} {bind join - "$a *" av_do}}
}
proc av_do {nick uhost handle c} {
global av_a botnick
if {(![botisop $c]) || ([lsearch -regexp [getchanmode $c] "m"] > -1)} {return}; set c [string tolower $c]
if {([info exists av_a($c)]) && ($av_a($c) == "on") && ($nick != $botnick)} {pushmode $c +v $nick}
}
av_read
putlog "TCL LOADED: AVOnJoin 1.02 by Baerchen"