<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
	<link rel="self" type="application/atom+xml" href="https://forum.eggheads.org/app.php/feed/topic/18396" />

	<title>egghelp/eggheads community</title>
	<subtitle>Discussion of eggdrop bots, shell accounts and tcl scripts.</subtitle>
	<link href="https://forum.eggheads.org/index.php" />
	<updated>2011-03-30T15:08:01-04:00</updated>

	<author><name><![CDATA[egghelp/eggheads community]]></name></author>
	<id>https://forum.eggheads.org/app.php/feed/topic/18396</id>

		<entry>
		<author><name><![CDATA[streamish]]></name></author>
		<updated>2011-03-30T15:02:21-04:00</updated>

		<published>2011-03-30T15:02:21-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=96579#p96579</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=96579#p96579"/>
		<title type="html"><![CDATA[adding a search]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=96579#p96579"><![CDATA[
Alright, thanks for all your help<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11439">streamish</a> — Wed Mar 30, 2011 3:02 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[speechles]]></name></author>
		<updated>2011-03-30T15:08:01-04:00</updated>

		<published>2011-03-30T14:59:25-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=96578#p96578</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=96578#p96578"/>
		<title type="html"><![CDATA[adding a search]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=96578#p96578"><![CDATA[
<blockquote class="uncited"><div>Rehash fails<div class="codebox"><p>Code: </p><pre><code>[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] &lt; 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</code></pre></div>I simply do not get it. lol<br><br>But like I said, if I change the code to read the file locally, everything works fine.</div></blockquote>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.. <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_wink.gif" width="15" height="15" alt=";)" title="Wink"><br><br>note: You can likely #comment or remove all those $version checks as your likely not using such an ancient eggdrop. <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_biggrin.gif" width="15" height="15" alt=":D" title="Very Happy"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8138">speechles</a> — Wed Mar 30, 2011 2:59 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[streamish]]></name></author>
		<updated>2011-03-30T14:09:05-04:00</updated>

		<published>2011-03-30T14:09:05-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=96577#p96577</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=96577#p96577"/>
		<title type="html"><![CDATA[adding a search]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=96577#p96577"><![CDATA[
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<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11439">streamish</a> — Wed Mar 30, 2011 2:09 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[streamish]]></name></author>
		<updated>2011-03-30T14:08:28-04:00</updated>

		<published>2011-03-30T14:08:28-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=96576#p96576</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=96576#p96576"/>
		<title type="html"><![CDATA[adding a search]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=96576#p96576"><![CDATA[
Used your code exactly.<br><br>Launches fine<br><div class="codebox"><p>Code: </p><pre><code>[11:05:49] Writing channel file...[11:05:49] Userfile loaded, unpacking...[11:05:49] === oldskewl: 3 channels, 349 users.Launched into the background  (pid: 94069)</code></pre></div>Rehash fails<div class="codebox"><p>Code: </p><pre><code>[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] &lt; 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</code></pre></div>I simply do not get it. lol<br><br>But like I said, if I change the code to read the file locally, everything works fine.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11439">streamish</a> — Wed Mar 30, 2011 2:08 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[speechles]]></name></author>
		<updated>2011-03-30T13:57:47-04:00</updated>

		<published>2011-03-30T13:57:47-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=96575#p96575</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=96575#p96575"/>
		<title type="html"><![CDATA[adding a search]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=96575#p96575"><![CDATA[
You missed a brace somewhere else then or otherwise made a small mistake. To remedy the issue, try the complete code below. This should work.<div class="codebox"><p>Code: </p><pre><code># requires http packagepackage 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_shoelaceproc 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] &gt; 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]"}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8138">speechles</a> — Wed Mar 30, 2011 1:57 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[streamish]]></name></author>
		<updated>2011-03-30T13:46:25-04:00</updated>

		<published>2011-03-30T13:46:25-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=96574#p96574</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=96574#p96574"/>
		<title type="html"><![CDATA[adding a search]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=96574#p96574"><![CDATA[
Sorry, I was copying the code from here rather than from my source.  My code does have the bracket.<br><div class="codebox"><p>Code: </p><pre><code>package require httpif {[catch {set shoefile [::http::geturl "http://shoelace.org/picdump.txt" -timeout 5000]} error]} {  putlog "ERROR: Cannot create link list ( $error )"  set shoelace [list] ; unset shoefile} else {  set shoelace [split [http::data $shoefile] "\n"]  ::http::cleanup $shoefile ; unset shoefile}</code></pre></div>But rehash is still crashing the bot with the odd errors<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11439">streamish</a> — Wed Mar 30, 2011 1:46 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[speechles]]></name></author>
		<updated>2011-03-30T13:43:39-04:00</updated>

		<published>2011-03-30T13:43:39-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=96573#p96573</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=96573#p96573"/>
		<title type="html"><![CDATA[adding a search]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=96573#p96573"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>if [catch {set shoefile [::http::geturl "http://www.whateverdomain.com/links.txt" -timeout 5000]} error]} {</code></pre></div>I thought you said you fixed that missing brace there son...<br><br>Notice, between if and [ is a missing { ...<br>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<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8138">speechles</a> — Wed Mar 30, 2011 1:43 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[streamish]]></name></author>
		<updated>2011-03-30T13:43:54-04:00</updated>

		<published>2011-03-30T13:39:43-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=96571#p96571</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=96571#p96571"/>
		<title type="html"><![CDATA[adding a search]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=96571#p96571"><![CDATA[
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.<br><br>Also, when I changed <div class="codebox"><p>Code: </p><pre><code>package require http if [catch {set shoefile [::http::geturl "http://www.whatever.com/links.txt" -timeout 5000]} error]} {   putlog "ERROR: Cannot create link list ( $error )"   set shoelace [list] ; unset shoefile } else {   set shoelace [split [http::data $shoefile] "\n"]   ::http::cleanup $shoefile ; unset shoefile }</code></pre></div>To <div class="codebox"><p>Code: </p><pre><code>set shoefile [open "scripts/links.txt" r] set shoelace [split [read -nonewline $shoefile] "\n"] close $shoefile ; unset shoefile</code></pre></div>There are no longer errors.  This is why I assume it must be in the first set of code.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11439">streamish</a> — Wed Mar 30, 2011 1:39 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2011-03-30T13:33:59-04:00</updated>

		<published>2011-03-30T13:33:59-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=96570#p96570</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=96570#p96570"/>
		<title type="html"><![CDATA[adding a search]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=96570#p96570"><![CDATA[
<blockquote class="uncited"><div>&lt;oldskewl&gt;   die "*** netbots.tcl $nb_ver requires eggdrop 1.3.22 or later. Please upgrade your ..."<br>&lt;oldskewl&gt;     (file "netbots/netbots.tcl" line 13)<br>&lt;oldskewl&gt;     invoked from within<br>&lt;oldskewl&gt; "source netbots/netbots.tcl" </div></blockquote>The error clearly states the contrary to what you think is the culprit. <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Wed Mar 30, 2011 1:33 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[streamish]]></name></author>
		<updated>2011-03-30T13:30:04-04:00</updated>

		<published>2011-03-30T13:30:04-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=96569#p96569</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=96569#p96569"/>
		<title type="html"><![CDATA[adding a search]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=96569#p96569"><![CDATA[
Actually I take it back.  All of these conflicts seem to be due to this piece of code<br><div class="codebox"><p>Code: </p><pre><code>package require http if [catch {set shoefile [::http::geturl "http://www.whateverdomain.com/links.txt" -timeout 5000]} error]} {   putlog "ERROR: Cannot create link list ( $error )"   set shoelace [list] ; unset shoefile } else {   set shoelace [split [http::data $shoefile] "\n"]   ::http::cleanup $shoefile ; unset shoefile }</code></pre></div>Any possible reasons?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11439">streamish</a> — Wed Mar 30, 2011 1:30 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[streamish]]></name></author>
		<updated>2011-03-29T19:22:09-04:00</updated>

		<published>2011-03-29T19:22:09-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=96565#p96565</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=96565#p96565"/>
		<title type="html"><![CDATA[adding a search]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=96565#p96565"><![CDATA[
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.<br>Every time I .rehash the bot crashes with the following errors:<br><br><div class="codebox"><p>Code: </p><pre><code>&lt;oldskewl&gt; [16:18:17] *** Can't load Userinfo TCL v1.07 -- At least Eggdrop v1.4.3 required&lt;oldskewl&gt; [16:18:17] Loading netbots.tcl v4.10...&lt;oldskewl&gt; [16:18:17] Tcl error in file 'oldskewl.conf':&lt;oldskewl&gt; [16:18:17] can't read "version": no such variable&lt;oldskewl&gt;     while executing&lt;oldskewl&gt; "split $version"&lt;oldskewl&gt;     invoked from within&lt;oldskewl&gt; "if {[string trimleft [lindex [split $version] 1] 0] &lt; 1032200} {&lt;oldskewl&gt;   die "*** netbots.tcl $nb_ver requires eggdrop 1.3.22 or later. Please upgrade your ..."&lt;oldskewl&gt;     (file "netbots/netbots.tcl" line 13)&lt;oldskewl&gt;     invoked from within&lt;oldskewl&gt; "source netbots/netbots.tcl"&lt;oldskewl&gt;     (file "oldskewl.conf" line 1374)&lt;oldskewl&gt; [16:18:17] * CONFIG FILE NOT LOADED (NOT FOUND, OR ERROR)*** Connection closed</code></pre></div>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<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11439">streamish</a> — Tue Mar 29, 2011 7:22 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[streamish]]></name></author>
		<updated>2011-03-25T03:01:54-04:00</updated>

		<published>2011-03-25T03:01:54-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=96548#p96548</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=96548#p96548"/>
		<title type="html"><![CDATA[adding a search]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=96548#p96548"><![CDATA[
Hahaha, no problem. I should have caught that myself =P<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11439">streamish</a> — Fri Mar 25, 2011 3:01 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[speechles]]></name></author>
		<updated>2011-03-25T02:55:26-04:00</updated>

		<published>2011-03-25T02:55:26-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=96547#p96547</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=96547#p96547"/>
		<title type="html"><![CDATA[adding a search]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=96547#p96547"><![CDATA[
Try this instead...<div class="codebox"><p>Code: </p><pre><code>package require httpif {[catch {set shoefile [::http::geturl "http://www.whateverdomain.com/links.txt" -timeout 5000]} error]} {  putlog "ERROR: Cannot create link list ( $error )"  set shoelace [list] ; unset shoefile} else {  set shoelace [split [http::data $shoefile] "\n"]  ::http::cleanup $shoefile ; unset shoefile}</code></pre></div>That's what giving advice at midnight does to me.. lmfao<br><br>I missed a leading start brace { to lead the "if" expression containing the catch. My bad.. sorry to have caused your bot to crash... <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_lol.gif" width="15" height="15" alt=":lol:" title="Laughing"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8138">speechles</a> — Fri Mar 25, 2011 2:55 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[streamish]]></name></author>
		<updated>2011-03-25T02:50:34-04:00</updated>

		<published>2011-03-25T02:50:34-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=96546#p96546</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=96546#p96546"/>
		<title type="html"><![CDATA[adding a search]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=96546#p96546"><![CDATA[
Not sure what happened with that snippet of code.  Eggdrop crashed, and I'm getting this error:<br><div class="codebox"><p>Code: </p><pre><code>[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</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11439">streamish</a> — Fri Mar 25, 2011 2:50 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[speechles]]></name></author>
		<updated>2011-03-25T02:40:31-04:00</updated>

		<published>2011-03-25T02:40:31-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=96545#p96545</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=96545#p96545"/>
		<title type="html"><![CDATA[adding a search]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=96545#p96545"><![CDATA[
It wouldn't quite work that way. File handlers are not the same as http socket handlers.<br>A very basic way to accomplish it would be as follows:<div class="codebox"><p>Code: </p><pre><code>set shoefile [open "scripts/links.txt" r]set shoelace [split [read -nonewline $shoefile] "\n"]close $shoefile ; unset shoefile</code></pre></div>Change what you see above, to look like it does below.<div class="codebox"><p>Code: </p><pre><code>package require httpif [catch {set shoefile [::http::geturl "http://www.whateverdomain.com/links.txt" -timeout 5000]} error]} {  putlog "ERROR: Cannot create link list ( $error )"  set shoelace [list] ; unset shoefile} else {  set shoelace [split [http::data $shoefile] "\n"]  ::http::cleanup $shoefile ; unset shoefile}</code></pre></div>This of course doesn't account for redirects, cookies, secure sockets, gzip, other types of http transaction errors, etc. This method simply assumes your http call will succeed with a code 200 always. We will assume it always does. <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8138">speechles</a> — Fri Mar 25, 2011 2:40 am</p><hr />
]]></content>
	</entry>
	</feed>
