[23:49:49] Tcl error in file 'oldskewl.conf':
[23:49:49] invalid character "}"
in expression "0}"
(parsing expression "0}")
invoked from within
"if [catch {set shoefile [http::geturl "http://www.oldskewl.info/links.txt" -timeout 5000]} error]} {
putlog "ERROR: Cannot create link list ( $erro..."
(file "scripts/SorgIS.tcl" line 50)
invoked from within
I'm having a super weird problem with my script, and it's been happening from the beginning of usage, I just figured it was something random.
Every time I .rehash the bot crashes with the following errors:
<oldskewl> [16:18:17] *** Can't load Userinfo TCL v1.07 -- At least Eggdrop v1.4.3 required
<oldskewl> [16:18:17] Loading netbots.tcl v4.10...
<oldskewl> [16:18:17] Tcl error in file 'oldskewl.conf':
<oldskewl> [16:18:17] can't read "version": no such variable
<oldskewl> while executing
<oldskewl> "split $version"
<oldskewl> invoked from within
<oldskewl> "if {[string trimleft [lindex [split $version] 1] 0] < 1032200} {
<oldskewl> die "*** netbots.tcl $nb_ver requires eggdrop 1.3.22 or later. Please upgrade your ..."
<oldskewl> (file "netbots/netbots.tcl" line 13)
<oldskewl> invoked from within
<oldskewl> "source netbots/netbots.tcl"
<oldskewl> (file "oldskewl.conf" line 1374)
<oldskewl> [16:18:17] * CONFIG FILE NOT LOADED (NOT FOUND, OR ERROR)
*** Connection closed
I have absolutely no idea what this might be, because its two totally different scripts which are not communicating with each other. Also, this only happens when I load the TCL in question. If I disable i can start/rehash with no problems. Eggdrop version is 1.6.20
<oldskewl> die "*** netbots.tcl $nb_ver requires eggdrop 1.3.22 or later. Please upgrade your ..."
<oldskewl> (file "netbots/netbots.tcl" line 13)
<oldskewl> invoked from within
<oldskewl> "source netbots/netbots.tcl"
The error clearly states the contrary to what you think is the culprit.
Once the game is over, the king and the pawn go back in the same box.
You would think so, and thats why this issue is so odd. When I disable the script and restart the eggdrop there are no errors, and i can rehash fine. Only when the script is loaded will it crash the bot with the errors, unrelating to the script.
if [catch {set shoefile [::http::geturl "http://www.whateverdomain.com/links.txt" -timeout 5000]} error]} {
I thought you said you fixed that missing brace there son...
Notice, between if and [ is a missing { ...
We discussed this above, scroll up... This is the problem, that unaligned brace.. Fix it like you said you already did... Mark your thread [solved] once you do ... heh
# requires http package
package require http
# can we load our web sourced shoelace list?
if {[catch {set shoefile [::http::geturl "http://shoelace.org/picdump.txt" -timeout 5000]} error]} {
# no, report error, empty the list
putlog "ERROR: Cannot create link list ( $error )"
set shoelace [list]
} else {
# yes, success, build the list
set shoelace [split [http::data $shoefile] "\n"]
::http::cleanup $shoefile ; unset shoefile
}
bind pub - !shoelace pub_shoelace
proc pub_shoelace {nick mask hand channel text} {
global shoelace
if {[string length [string trim $text]]} {
#user supplied a search-term
set hits [lsearch -all $shoelace *[string trim $text]*]
#test if we found any..
if {[llength $hits] > 0} {
#We've got atleast one match, pick a random one if we've got multiple ones
set item [lindex $hits [rand [llength $hits]]] ; set status "SEARCH FOUND"
} else {
#No hits, pick a random line from the list
set item [rand [llength $shoelace]] ; set status "RANDOMIZED"
}
} else {
#No search-term supplied, pick a random item
set item [rand [llength $shoelace]] ; set status "RANDOMIZED"
}
putserv "PRIVMSG $channel :\[$status\] [lindex $shoelace $item]"
}
On a side note, I have tried this on multiple eggdrops on different servers. Same result. The script itself runs fantastic. It only crashes when I need to rehash the eggdrop
[oldskewl(dcc)] [11:06:29] Writing channel file...
[oldskewl(dcc)] [11:06:29] Listening at telnet port 42000 (all).
[oldskewl(dcc)] [11:06:29] Loading netbots.tcl v4.10...
[oldskewl(dcc)] [11:06:29] Tcl error in file 'oldskewl.conf':
[oldskewl(dcc)] [11:06:29] can't read "version": no such variable
[oldskewl(dcc)] while executing
[oldskewl(dcc)] "split $version"
[oldskewl(dcc)] invoked from within
[oldskewl(dcc)] "if {[string trimleft [lindex [split $version] 1] 0] < 1032200} {
[oldskewl(dcc)] die "*** netbots.tcl $nb_ver requires eggdrop 1.3.22 or later. Please upgrade your ..."
[oldskewl(dcc)] (file "netbots/netbots.tcl" line 13)
[oldskewl(dcc)] invoked from within
[oldskewl(dcc)] "source netbots/netbots.tcl"
[oldskewl(dcc)] (file "oldskewl.conf" line 1374)
[oldskewl(dcc)] [11:06:29] * CONFIG FILE NOT LOADED (NOT FOUND, OR ERROR)
*** Connection closed
I simply do not get it. lol
But like I said, if I change the code to read the file locally, everything works fine.
It isn't this script causing your issue. It's "netbots" causing your issue here. For some reason or another. You may need to contact "slennox" personally on this one. The owner of these very forums. "netbots" is his baby..
note: You can likely #comment or remove all those $version checks as your likely not using such an ancient eggdrop.
Last edited by speechles on Wed Mar 30, 2011 3:08 pm, edited 1 time in total.