I have experienced an odd issue with eggdrop 1.6.18. Besides this one issue the bot operates flawlessly. The problem is that nearly every script in the /scripts directory is executed. Currently 84 scripts reside in that directory (as the result of heavy tweaks and shifting interests over the years) and 82 are initialized!
The config file currently in use has at most 1/2 of those (usually a 1/3rd) loaded at any one time. What is alarming is scripts not enabled (or listed!) in the current bot config file are being executed. I noticed in the console log following the "Initialising Scripts" line:
Current search path:
scripts
Followed by a list of all of the scripts in the /scripts directory. Any idea whats going on?
what do you mean that all the scripts are initializing? Scripts are loaded via the conf file, down at the bottom in the scripts section. If you have a script listed down there, it will load, if it is commented out, it will not. Maybe I am just not clear about what you mean exactly....
I realize how things operate normally, however I am loading a config file that only specifies ~ 30 scripts. Scripts NOT in the config file are loading. I have even removed the commented out scripts. Thats why it's odd. Unfortunately I did not make a backup of the config file (since it was business as usual + a few new scripts). I am going to retry a stock config and see if I get the same results.
Is it possible for the eggdrop to load an entire directory (*.tcl)?
My only guess as of now are that one of the newer scripts is executing the other scripts (not sure how). I'll give a better break down shortly.
Artificial wrote:My only guess as of now are that one of the newer scripts is executing the other scripts (not sure how). I'll give a better break down shortly.
Definitely that's the issue, Eggdrop only loads the scripts specified via source (in the .conf file or any other loaded script).
You might like to search through your scripts for anyone containing the command "glob", as this could be used to locate files in a speciffic path or such. The command you'd be looking for should look something like this:
# Load all *.tcl files in either this directory or "script-path".
if {$LOAD_ALL_SCRIPTS} {
putlog "--------------------------------------";
putlog "-------- Initialising scripts --------";
if {![info exists script-path]} {
set script-path [list [file dirname [info script]]];
}
foreach fsck(dir) ${script-path} {
putlog "Current search path:";
putlog $fsck(dir);
set fsck(scripts) [lsort -dictionary [glob -nocomplain -- "[string trimright $fsck(dir) "/"]/*"]];
set fsck(error) "";
set fsck(x) 0; set fsck(y) 0;
foreach fsck(script) $fsck(scripts) {
if {![file isdirectory $fsck(script)] && [string match -nocase *?.tcl $fsck(script)]} {
incr fsck(y);
if {![string compare [info script] $fsck(script)]} {
incr fsck(x);
continue;
}
if {[catch {source $fsck(script)} fsck(error)]} {
Error "fsck" FATAL "Couldn't load $fsck(script) \[$fsck(error)\]";
continue;
}
incr fsck(x);
}
}
putlog "$fsck(x) of $fsck(y) script[expr {($fsck(y) == 1) ? "" : "s"}] initialised.";
}
catch {unset fsck}
}
What a curious bit of code. Thank you for the prompt responses! This is completely my fault for not reviewing what a script does before executing it. Lesson learned! Quite a useful function too, however need to vet through my scripts directory to weed out outdated scripts and scripts I don't want run - such as one that emulates another person by creating new lines from a grepped logfile.