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

	<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>2003-10-15T03:53:07-04:00</updated>

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

		<entry>
		<author><name><![CDATA[Spirit]]></name></author>
		<updated>2003-10-15T03:53:07-04:00</updated>

		<published>2003-10-15T03:53:07-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=28508#p28508</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=28508#p28508"/>
		<title type="html"><![CDATA[cant post text to a user]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=28508#p28508"><![CDATA[
Yep, you are right.<br>My script at the beginning was working in the first place.<br>The problem is, that i was using a "msg"-bind, which does not work with a proc that contains the "chan" variable.<br><br>Here are the final (and hopefully working  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_wink.gif" width="15" height="15" alt=":wink:" title="Wink"> ) scripts:<br><br>With a list ...<div class="codebox"><p>Code: </p><pre><code>set msg_welcome {   "Text"   "more Text"   "and more"   "EOF" } proc bsd:main {nick uhost hand chan para} {   global msg_welcome     if {![string length $para] &gt; 0} {       foreach data $msg_welcome {         putserv "PRIVMSG $nick :$data"      }     } } bind pub - !bsd bsd:main</code></pre></div>..and the same function with a textfile which posts the contents of the file line by line..<div class="codebox"><p>Code: </p><pre><code>set exFile "c:\file.txt"proc bsd:main {nick uhost hand chan para} {   global exFile    if {![string length $para] &gt; 0} {       set fs [open $exFile r]       while {[gets $fs line]&gt;-1} {         putserv "PRIVMSG $nick :$line"       }    } } bind pub - !bsd bsd:main</code></pre></div>Greets!<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3972">Spirit</a> — Wed Oct 15, 2003 3:53 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[CrazyCat]]></name></author>
		<updated>2003-10-14T04:24:27-04:00</updated>

		<published>2003-10-14T04:24:27-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=28458#p28458</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=28458#p28458"/>
		<title type="html"><![CDATA[Re: cant post text to a user]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=28458#p28458"><![CDATA[
Sorry, I'm back on the beggining of the thread, but I'm affraid that<blockquote class="uncited"><div>foreach {data} $msg_welcome {</div></blockquote>should be better with:<div class="codebox"><p>Code: </p><pre><code>foreach data $msg_welcome {</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=691">CrazyCat</a> — Tue Oct 14, 2003 4:24 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Spirit]]></name></author>
		<updated>2003-10-13T17:17:04-04:00</updated>

		<published>2003-10-13T17:17:04-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=28441#p28441</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=28441#p28441"/>
		<title type="html"><![CDATA[cant post text to a user]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=28441#p28441"><![CDATA[
Oh man, that did it!<br>Sorry ..i took it out *slapmyself*  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_wink.gif" width="15" height="15" alt=":wink:" title="Wink"><br>Thx very much!!!<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3972">Spirit</a> — Mon Oct 13, 2003 5:17 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[egghead]]></name></author>
		<updated>2003-10-13T17:14:05-04:00</updated>

		<published>2003-10-13T17:14:05-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=28439#p28439</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=28439#p28439"/>
		<title type="html"><![CDATA[cant post text to a user]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=28439#p28439"><![CDATA[
<blockquote class="uncited"><div>Thx, but i didn't help. [snip] <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_confused.gif" width="15" height="15" alt=":-?" title="Confused"></div></blockquote>But then again, you need to include a ":" when using a PRIVMSG.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=282">egghead</a> — Mon Oct 13, 2003 5:14 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Spirit]]></name></author>
		<updated>2003-10-13T17:09:46-04:00</updated>

		<published>2003-10-13T17:09:46-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=28437#p28437</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=28437#p28437"/>
		<title type="html"><![CDATA[cant post text to a user]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=28437#p28437"><![CDATA[
Thx, but i didn't help. It is pretty unusual.. is TCL reading the files different, than other languages?<br>Usually it should read the complete line and the bot should post it completely  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_confused.gif" width="15" height="15" alt=":-?" title="Confused"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3972">Spirit</a> — Mon Oct 13, 2003 5:09 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Sir_Fz]]></name></author>
		<updated>2003-10-13T17:00:19-04:00</updated>

		<published>2003-10-13T17:00:19-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=28434#p28434</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=28434#p28434"/>
		<title type="html"><![CDATA[cant post text to a user]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=28434#p28434"><![CDATA[
try [join [lrange $data 0 end]] ; just and idea.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3085">Sir_Fz</a> — Mon Oct 13, 2003 5:00 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Spirit]]></name></author>
		<updated>2003-10-13T16:32:10-04:00</updated>

		<published>2003-10-13T16:32:10-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=28429#p28429</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=28429#p28429"/>
		<title type="html"><![CDATA[cant post text to a user]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=28429#p28429"><![CDATA[
You are right ..its better to use a textfile for that, but i still got the old problem!<br>The bot is just posting the last word of every sentence!<br><div class="codebox"><p>Code: </p><pre><code>set cmdhelp "file.txt"proc bsd:main {nick uhost hand chan para} {    global cmdhelp    if {![string length $para] &gt; 0} {      set fs [open $cmdhelp r]      while {[gets $fs line] != -1} {        putserv "PRIVMSG $nick $line"      }      close $fs    }}</code></pre></div>I couldn't see, why you were using the<div class="codebox"><p>Code: </p><pre><code>set command [lindex [split $para] 0]</code></pre></div>line, because it didn't do anything.<br><br>Does anybody know, why the bot is "loosing" the first part of every line?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3972">Spirit</a> — Mon Oct 13, 2003 4:32 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Darkj]]></name></author>
		<updated>2003-10-12T10:13:28-04:00</updated>

		<published>2003-10-12T10:13:28-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=28330#p28330</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=28330#p28330"/>
		<title type="html"><![CDATA[cant post text to a user]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=28330#p28330"><![CDATA[
Just re-read the post, and say you were having trouble with not reading spaces<br><br>In my example, instead of this<br><div class="codebox"><p>Code: </p><pre><code>set command [lindex [split $para] 0]</code></pre></div>go<br><div class="codebox"><p>Code: </p><pre><code>set command [lrange [split $para] 0 end]</code></pre></div>Think thats right....<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3459">Darkj</a> — Sun Oct 12, 2003 10:13 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Darkj]]></name></author>
		<updated>2003-10-12T10:10:02-04:00</updated>

		<published>2003-10-12T10:10:02-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=28329#p28329</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=28329#p28329"/>
		<title type="html"><![CDATA[cant post text to a user]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=28329#p28329"><![CDATA[
oh and a close $fs at the end of that<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3459">Darkj</a> — Sun Oct 12, 2003 10:10 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Darkj]]></name></author>
		<updated>2003-10-12T10:08:53-04:00</updated>

		<published>2003-10-12T10:08:53-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=28328#p28328</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=28328#p28328"/>
		<title type="html"><![CDATA[cant post text to a user]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=28328#p28328"><![CDATA[
Instead of hardcoding that in, I would just suggest using a file<br><br>Then to output it, just<br><div class="codebox"><p>Code: </p><pre><code>set fs [open file.txt r]while {[gets $fs line]&gt;-1} { set command [lindex [split $para] 0]putserv "PRIVMSG $nick :$command"}</code></pre></div>Then in your file.txt, just list them like this<br>Text<br>more Text<br>and more<br>EOF<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3459">Darkj</a> — Sun Oct 12, 2003 10:08 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Spirit]]></name></author>
		<updated>2003-10-12T09:58:46-04:00</updated>

		<published>2003-10-12T09:58:46-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=28327#p28327</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=28327#p28327"/>
		<title type="html"><![CDATA[cant post text to a user]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=28327#p28327"><![CDATA[
No, i want it like this:<br><br>text<br>more text<br>and more<br>eof<br><br>It is suppose to be a list of commands<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3972">Spirit</a> — Sun Oct 12, 2003 9:58 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Darkj]]></name></author>
		<updated>2003-10-12T09:56:08-04:00</updated>

		<published>2003-10-12T09:56:08-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=28326#p28326</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=28326#p28326"/>
		<title type="html"><![CDATA[cant post text to a user]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=28326#p28326"><![CDATA[
So basically you want it to show up like this?<br><br>"text more text and more eof"<br><br>I don't quite understand what you are going for here.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3459">Darkj</a> — Sun Oct 12, 2003 9:56 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Spirit]]></name></author>
		<updated>2003-10-12T09:42:24-04:00</updated>

		<published>2003-10-12T09:42:24-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=28324#p28324</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=28324#p28324"/>
		<title type="html"><![CDATA[cant post text to a user]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=28324#p28324"><![CDATA[
Oh, but i found that before...it is already "putserv"<br><br>But after a little playing around, i almost got it!<br>Now the bot is posting only the last word of every sentence.<br><div class="codebox"><p>Code: </p><pre><code>set msg_welcome {   "Text"   "more Text"   "and more"   "EOF" }</code></pre></div>and the bot posts:<br>"Text"<br>"Text"<br>"more"<br>"EOF"<br><br>looks like is can't handle the spaces between the words, but i don't know why.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3972">Spirit</a> — Sun Oct 12, 2003 9:42 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Darkj]]></name></author>
		<updated>2003-10-12T09:35:17-04:00</updated>

		<published>2003-10-12T09:35:17-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=28323#p28323</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=28323#p28323"/>
		<title type="html"><![CDATA[cant post text to a user]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=28323#p28323"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>putsrv "PRIVMSG $nick $data </code></pre></div>that is way off, should be something like<br><div class="codebox"><p>Code: </p><pre><code>putserv "PRIVMSG $nick :$data" </code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3459">Darkj</a> — Sun Oct 12, 2003 9:35 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Spirit]]></name></author>
		<updated>2003-10-12T09:07:21-04:00</updated>

		<published>2003-10-12T09:07:21-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=28321#p28321</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=28321#p28321"/>
		<title type="html"><![CDATA[cant post text to a user]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=28321#p28321"><![CDATA[
I want the bot to post a couple lines to a user.<br>But somehow, i cant get it to work:<div class="codebox"><p>Code: </p><pre><code>set msg_welcome {  "Text"  "more Text"  "and more"  "EOF"}proc bsd:main {nick uhost hand chan para} {    global msg_welcome    if {![string length $para] &gt; 0} {      foreach {data} $msg_welcome {        putsrv "PRIVMSG $nick $data      }    }}bind msg - !bsd bsd:main</code></pre></div>the error is:<div class="codebox"><p>Code: </p><pre><code>Tcl error [bsd:main]: wrong # args: should be "bsd:main nick uhost hand chan para"</code></pre></div>But the args are ok <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_rolleyes.gif" width="15" height="15" alt=":roll:" title="Rolling Eyes"><br><br>Thx for your help!<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3972">Spirit</a> — Sun Oct 12, 2003 9:07 am</p><hr />
]]></content>
	</entry>
	</feed>
