<?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/17387" />

	<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>2009-12-17T15:51:18-04:00</updated>

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

		<entry>
		<author><name><![CDATA[blake]]></name></author>
		<updated>2009-11-30T20:53:31-04:00</updated>

		<published>2009-11-30T20:53:31-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=91140#p91140</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=91140#p91140"/>
		<title type="html"><![CDATA[help please[solved]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=91140#p91140"><![CDATA[
slitely changed this script again as it was sending the hole file to channel <br><br>id like to be able to change it so the command !tr without linenumber can be typed in the bots pm will still need to read one line at a time fron text file currently we have to type !tr line number in the channel the bot is in the back proc is ok but if that could be set so we can type that in pm also would be great line nimber needs to remain for back proc<br><div class="codebox"><p>Code: </p><pre><code>set out_chan "#Trainingroom"set txt_file "training.txt"bind pub SA|SA !tr next_procbind pub SA|SA !back back_procproc tr_proc { nick uhost hand chan arg } {  global out_chan txt_file  set line [lindex [split $arg] 0]  if {$line == ""} {    putserv "PRIVMSG $chan :Usage: !tr &lt;line number&gt;"    return  }  set take_me [open $txt_file r]  set take_all [split [read $take_me] "\n"]  close $take_me  set data [lindex $take_all [expr $line - 1]]  putquick "PRIVMSG $out_chan :$data"}proc back_proc { nick uhost hand chan arg } {  global out_chan txt_file  set line [lindex [split $arg] 0]  if {$line == ""} {    putserv "PRIVMSG $chan :Usage: !back &lt;line number&gt;"    return  }  set take_me [open $txt_file r]  set take_all [split [read $take_me] "\n"]  close $take_me  set data [lindex $take_all [expr $line - 1]]  putquick "PRIVMSG $out_chan :$data"}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10512">blake</a> — Mon Nov 30, 2009 8:53 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[blake]]></name></author>
		<updated>2009-11-27T19:36:01-04:00</updated>

		<published>2009-11-27T19:36:01-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=91106#p91106</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=91106#p91106"/>
		<title type="html"><![CDATA[help please[solved]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=91106#p91106"><![CDATA[
it would channel specific its only used  in one  room which is #trainingroom and only has one person at anyone  time using it<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10512">blake</a> — Fri Nov 27, 2009 7:36 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2009-11-27T19:08:15-04:00</updated>

		<published>2009-11-27T19:08:15-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=91105#p91105</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=91105#p91105"/>
		<title type="html"><![CDATA[help please[solved]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=91105#p91105"><![CDATA[
Code still looks broken, and your braces {} are still out of order..<br>You currently get away with it if you execute !next atleast once before executing !back, since you actually managed to nest back_proc inside next_proc.<br><br>This is how it should look, and the point of indenting is to keep track of how many "nested" braces you've got.. add one {, indent one step more.. add one }, indent one step less...<br><div class="codebox"><p>Code: </p><pre><code>set out_chan "#Trainingroom"set txt_file "Training.txt"bind pub SA|SA !next next_procbind pub SA|SA !back back_procproc next_proc { nick uhost hand chan arg } {  global out_chan txt_file  set line [lindex [split $arg] 0]  if {$line == ""} {    putserv "PRIVMSG $chan :Usage: !next &lt;linenumber&gt;"    return  }  set take_me [open $txt_file r]  set take_all [split [read $take_me] "\n"]  close $take_me  foreach txt_line $take_all {    if {$txt_line != ""} {      putquick "PRIVMSG $out_chan :$txt_line"    }  }}proc back_proc { nick uhost hand chan arg } {  global out_chan txt_file  set line [lindex [split $arg] 0]  if {$line == ""} {    putserv "PRIVMSG $chan :Usage: !back &lt;line number&gt;"    return  }  set take_me [open $txt_file r]  set take_all [split [read $take_me] "\n"]  close $take_me  set data [lindex $take_all [expr $line - 1]]  putquick "PRIVMSG $out_chan :$data"}</code></pre></div>For your !next without linenumbers, you'd have to keep a counter for the displayed line. Should this be user-specific, channel-specific, global, or something else?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Fri Nov 27, 2009 7:08 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[blake]]></name></author>
		<updated>2009-11-27T18:52:24-04:00</updated>

		<published>2009-11-27T18:52:24-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=91104#p91104</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=91104#p91104"/>
		<title type="html"><![CDATA[help please[solved]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=91104#p91104"><![CDATA[
Have sorted it so its outputting the text of the file any help with line numbers i want to be able to just type !next and it display the next line without having to do !next linenumber<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10512">blake</a> — Fri Nov 27, 2009 6:52 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[blake]]></name></author>
		<updated>2009-11-27T18:41:02-04:00</updated>

		<published>2009-11-27T18:41:02-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=91102#p91102</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=91102#p91102"/>
		<title type="html"><![CDATA[help please[solved]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=91102#p91102"><![CDATA[
<blockquote class="uncited"><div>Removed the extra brace now get this error<br><div class="codebox"><p>Code: </p><pre><code>[17:34] can't read "take_all": no such variable    while executing"foreach txt_line $take_all {  if {$txt_line != ""} {    putquick "PRIVMSG $out_chan :$txt_line"  }}"</code></pre></div>[/code]</div></blockquote>removed the brace before foreach this is how its looking getting no errors<div class="codebox"><p>Code: </p><pre><code>set out_chan "#Trainingroom"set txt_file "Training.txt"bind pub SA|SA !next next_procbind pub SA|SA !back back_procproc next_proc { nick uhost hand chan arg } {  global out_chan txt_file  set line [lindex [split $arg] 0]  if {$line == ""} {    putserv "PRIVMSG $chan :Usage: !next &lt;linenumber&gt;"    return  }  set take_me [open $txt_file r]  set take_all [split [read $take_me] "\n"]  close $take_me  foreach txt_line $take_all {  if {$txt_line != ""} {    putquick "PRIVMSG $out_chan :$txt_line"  }}proc back_proc { nick uhost hand chan arg } {  global out_chan txt_file  set line [lindex [split $arg] 0]  if {$line == ""} {    putserv "PRIVMSG $chan :Usage: !back &lt;line number&gt;"    return  }  set take_me [open $txt_file r]  set take_all [split [read $take_me] "\n"]  close $take_me  set data [lindex $take_all [expr $line - 1]]  putquick "PRIVMSG $out_chan :$data"}}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10512">blake</a> — Fri Nov 27, 2009 6:41 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[blake]]></name></author>
		<updated>2009-11-27T18:36:01-04:00</updated>

		<published>2009-11-27T18:36:01-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=91100#p91100</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=91100#p91100"/>
		<title type="html"><![CDATA[help please[solved]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=91100#p91100"><![CDATA[
Removed the extra brace now get this error<br><div class="codebox"><p>Code: </p><pre><code>[17:34] can't read "take_all": no such variable    while executing"foreach txt_line $take_all {  if {$txt_line != ""} {    putquick "PRIVMSG $out_chan :$txt_line"  }}"</code></pre></div>[/code]<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10512">blake</a> — Fri Nov 27, 2009 6:36 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2009-11-27T18:29:15-04:00</updated>

		<published>2009-11-27T18:29:15-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=91099#p91099</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=91099#p91099"/>
		<title type="html"><![CDATA[help please[solved]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=91099#p91099"><![CDATA[
If I were to properly indent your last code snippet, it would look like this:<div class="codebox"><p>Code: </p><pre><code>set out_chan "#Trainingroom"set txt_file "Training.txt"bind pub SA|SA !next next_procbind pub SA|SA !back back_procproc next_proc { nick uhost hand chan arg } {  global out_chan txt_file  set line [lindex [split $arg] 0]  if {$line == ""} {    putserv "PRIVMSG $chan :Usage: !next &lt;linenumber&gt;"    return  }  set take_me [open $txt_file r]  set take_all [split [read $take_me] "\n"]  close $take_me}foreach txt_line $take_all {  if {$txt_line != ""} {    putquick "PRIVMSG $out_chan :$txt_line"  }}proc back_proc { nick uhost hand chan arg } {  global out_chan txt_file  set line [lindex [split $arg] 0]  if {$line == ""} {    putserv "PRIVMSG $chan :Usage: !back &lt;line number&gt;"    return  }  set take_me [open $txt_file r]  set take_all [split [read $take_me] "\n"]  close $take_me  set data [lindex $take_all [expr $line - 1]]  putquick "PRIVMSG $out_chan :$data"}}</code></pre></div>In this case, you've got the foreach-loop outside the next_proc proc, I suppose that's not what you intended. Also, there's one stray } after the back_proc proc.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Fri Nov 27, 2009 6:29 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[blake]]></name></author>
		<updated>2009-11-27T18:23:58-04:00</updated>

		<published>2009-11-27T18:23:58-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=91098#p91098</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=91098#p91098"/>
		<title type="html"><![CDATA[help please[solved]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=91098#p91098"><![CDATA[
<blockquote class="uncited"><div>You've got a few unbalanced braces in there..<br>Indent the code properly, and it should be alot simpler to see where they're missing..</div></blockquote>I`ve put it back to how I think it should have been unfortunetly the original script I had was on computer that went bang<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10512">blake</a> — Fri Nov 27, 2009 6:23 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2009-11-27T17:31:51-04:00</updated>

		<published>2009-11-27T17:31:51-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=91097#p91097</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=91097#p91097"/>
		<title type="html"><![CDATA[help please[solved]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=91097#p91097"><![CDATA[
You've got a few unbalanced braces in there..<br>Indent the code properly, and it should be alot simpler to see where they're missing..<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Fri Nov 27, 2009 5:31 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[blake]]></name></author>
		<updated>2009-12-17T15:51:18-04:00</updated>

		<published>2009-11-27T16:58:09-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=91096#p91096</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=91096#p91096"/>
		<title type="html"><![CDATA[help please[solved]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=91096#p91096"><![CDATA[
Hey can someone help with this code i keep getting errors when i try starting my eggie<br><br>also when i do the command !next i have to put the lnie number is it possible to just do !next without line number so it will read each line seperate this used to work but has been messed up somewere<br><div class="codebox"><p>Code: </p><pre><code>[15:49] Tcl error in file 'eggdrop.conf':[15:49] missing close-brace    while executing"proc next_proc { nick uhost hand chan arg } { global out_chan txt_file set line [lindex [split $arg] 0] if {$line == ""} { putserv "PRIVMSG $chan..."    (file "scripts/training.tcl" line 6)    invoked from within"source scripts/training.tcl"    (file "eggdrop.conf" line 1332)[15:49] * CONFIG FILE NOT LOADED (NOT FOUND, OR ERROR)</code></pre></div><div class="codebox"><p>Code: </p><pre><code>set out_chan "#Trainingroom" set txt_file "Training.txt" bind pub SA|SA !next next_proc bind pub SA|SA !back back_proc proc next_proc { nick uhost hand chan arg } {    global out_chan txt_file    set line [lindex [split $arg] 0]    if {$line == ""} {    putserv "PRIVMSG $chan :Usage: !next &lt;linenumber&gt;"    return    }    set take_me [open $txt_file r]    set take_all [split [read $take_me] "\n"]    close $take_me    }   foreach txt_line $take_all {    if {$txt_line != ""} {    putquick "PRIVMSG $out_chan :$txt_line"    }}proc back_proc { nick uhost hand chan arg } {    global out_chan txt_file    set line [lindex [split $arg] 0]    if {$line == ""} {    putserv "PRIVMSG $chan :Usage: !back &lt;line number&gt;"    return    }    set take_me [open $txt_file r]    set take_all [split [read $take_me] "\n"]    close $take_me    set data [lindex $take_all [expr $line - 1]]    putquick "PRIVMSG $out_chan :$data"    }} </code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10512">blake</a> — Fri Nov 27, 2009 4:58 pm</p><hr />
]]></content>
	</entry>
	</feed>
