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

	<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>2007-03-07T17:59:06-04:00</updated>

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

		<entry>
		<author><name><![CDATA[rosc2112]]></name></author>
		<updated>2007-03-07T17:59:06-04:00</updated>

		<published>2007-03-07T17:59:06-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=71077#p71077</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=71077#p71077"/>
		<title type="html"><![CDATA[Split Message in different line]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=71077#p71077"><![CDATA[
The first error was a missing var..  Rename the vars to use whatever you are using..  The second error was a missing close brace, find the missing closed brace and fix it.<br><br>Those 2 procs work just fine, you either broke the 2nd one with the missing close brace, or you didn't rename the var in the 1st to suit YOUR script.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7395">rosc2112</a> — Wed Mar 07, 2007 5:59 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[b00m]]></name></author>
		<updated>2007-03-07T15:46:56-04:00</updated>

		<published>2007-03-07T15:46:56-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=71074#p71074</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=71074#p71074"/>
		<title type="html"><![CDATA[Split Message in different line]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=71074#p71074"><![CDATA[
Sorry rosc2122, i try proc nlwordwrap with this in the same tcl and i have this error:<br>[20:41] Tcl error in file 'eggdrop.conf':<br>[20:41] can't read "nlmissdesc": no such variable<br>    while executing<br>"nlwordwrap $nlmissdesc"<br>    invoked from within<br>"set missdesc [nlwordwrap $nlmissdesc]"<br>    (file "scripts/split.tcl" line 2)<br>    invoked from within<br>"source scripts/split.tcl"<br>    (file "eggdrop.conf" line 1340)<br>[20:41] * CONFIG FILE NOT LOADED (NOT FOUND, OR ERROR)<br><br><br>If i use <br># Example from my dream.tcl script, $dreammatch is set when regexp<br># gets data from a website: <br>etc....<br>i have this error:<br><br>[20:44] Tcl error in file 'eggdrop.conf':<br>[20:44] missing close-brace<br>    while executing<br>"foreach line [split $dreammatch \n] {<br>                        if {$line != ""} {<br>                                set len 375<br>                         ..."<br>    (file "scripts/split.tcl" line 5)<br>    invoked from within<br>"source scripts/split.tcl"<br>    (file "eggdrop.conf" line 1340)<br>[20:44] * CONFIG FILE NOT LOADED (NOT FOUND, OR ERROR)<br><br>I have tried your code but there were some errors and I do not understand why... I would like to have a tlc that I can load into file .conf and my problem is that when the sentence is too long the BOT don't divide the sentence in two part such as two reply but stop it with a [censored] &amp;... I want only that the bot divide the sentence in two part without breaking the WORD...<br><br>thank u, and sorry for my english <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_razz.gif" width="15" height="15" alt=":P" title="Razz"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8760">b00m</a> — Wed Mar 07, 2007 3:46 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[rosc2112]]></name></author>
		<updated>2007-03-03T00:23:13-04:00</updated>

		<published>2007-03-03T00:23:13-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=70930#p70930</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=70930#p70930"/>
		<title type="html"><![CDATA[Split Message in different line]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=70930#p70930"><![CDATA[
Here's an example of using the wrapper from one of my scripts:<div class="codebox"><p>Code: </p><pre><code>proc nlwordwrap {input} {        # word wrapper        set j 0        set tempdef ""        foreach line [split $input \n] {                if {$line != ""} {                        set len 375                        set splitChr " "                        set out [set cur {}]; set i 0                        foreach word [split $line $splitChr] {                                if {[incr i [string len $word]]&gt;$len} {                                        lappend out [join $cur $splitChr]                                        set cur [list $word]                                        set i [string len $word]                                        incr j                                } else {                                        lappend cur $word                                }                                incr i                        }                        lappend out [join $cur $splitChr]                        foreach line2 $out {                                if {$j &gt;= 1} {                                        set line2 [linsert $line2 end \002(con't)\002]                                        set j [expr $j -1]                                }                                lappend tempdef $line2                        }                }               }        return $tempdef}</code></pre></div>To use it, you feed input to it from another proc, like:<div class="codebox"><p>Code: </p><pre><code># This line feeds text to the wrapper proc:set missdesc [nlwordwrap $nlmissdesc]# This line takes the wrapped text and pumps it out to privmsg:foreach line $missdesc {       if {$line != ""} {                puthelp "PRIVMSG $chan :$line"       }}</code></pre></div>You could also put the wrapper inside of whatever proc you want:<div class="codebox"><p>Code: </p><pre><code># Example from my dream.tcl script, $dreammatch is set when regexp# gets data from a website:                set j 0;set dhct 0                foreach line [split $dreammatch \n] {                        if {$line != ""} {                                set len 375                                set splitChr " "                                set out [set cur {}]; set i 0                                foreach word [split $line $splitChr] {                                        if {[incr i [string len $word]]&gt;$len} {                                                lappend out [join $cur $splitChr]                                                set cur [list $word]                                                set i [string len $word]                                                incr j                                        } else {                                                lappend cur $word                                        }                                        incr i                                }                                lappend out [join $cur $splitChr]                                foreach line2 $out {                                        if {$dhct == 0} {                                                set line2 [linsert $line2 0 \002[string totitle $text]\002:]                                                incr dhct                                                if {$j &gt;= 1} {                                                        set line2 [linsert $line2 end \002(con't)\002]                                                        set j [expr $j - 1]                                                }                                        } else {                                                set line2 [linsert $line2 0 \002([string totitle $text] con't)\002]                                                if {$j &gt;= 1} {                                                        set line2 [linsert $line2 end \002(con't)\002]                                                        set j [expr $j - 1]                                                }                                        }                                        puthelp "PRIVMSG $chan :[join $line2]"                                }                        }#######################################################################################################################</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7395">rosc2112</a> — Sat Mar 03, 2007 12:23 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[b00m]]></name></author>
		<updated>2007-03-02T20:03:28-04:00</updated>

		<published>2007-03-02T20:03:28-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=70924#p70924</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=70924#p70924"/>
		<title type="html"><![CDATA[Split Message in different line]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=70924#p70924"><![CDATA[
thx for the reply rosc,<br>i have for example:<br><br>bind pub -|- !help pub_help<br><br>proc pub_test {nick host handle chan text} {<br>putserv "PRIVMSG $chan : !bla, !bla2, !bla3, !bla4, !bla5" <br>}<br><br>I increase the process 'proc wordwrap' in my codes?<br>It's possible only a tcl that allow this split?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8760">b00m</a> — Fri Mar 02, 2007 8:03 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[rosc2112]]></name></author>
		<updated>2007-03-02T19:46:22-04:00</updated>

		<published>2007-03-02T19:46:22-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=70923#p70923</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=70923#p70923"/>
		<title type="html"><![CDATA[Split Message in different line]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=70923#p70923"><![CDATA[
<a href="http://forum.egghelp.org/viewtopic.php?p=33031#33031" class="postlink">http://forum.egghelp.org/viewtopic.php?p=33031#33031</a><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7395">rosc2112</a> — Fri Mar 02, 2007 7:46 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[b00m]]></name></author>
		<updated>2007-03-02T18:49:46-04:00</updated>

		<published>2007-03-02T18:49:46-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=70917#p70917</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=70917#p70917"/>
		<title type="html"><![CDATA[Split Message in different line]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=70917#p70917"><![CDATA[
Hi guys, <br>i have a little problem with my eggdrop. <br>I would want one small tcl that when my egg spam in my channel,if the message in too big, for example contain 200 caracters, i want that split the message in another line, without to cut the words, even split with the spaces, for example.<br><br>Please, if u can help me, help me <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_razz.gif" width="15" height="15" alt=":P" title="Razz"><br><br>...and excuse me for my english <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=8760">b00m</a> — Fri Mar 02, 2007 6:49 pm</p><hr />
]]></content>
	</entry>
	</feed>
