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

	<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-05-02T07:24:47-04:00</updated>

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

		<entry>
		<author><name><![CDATA[rosc2112]]></name></author>
		<updated>2007-05-02T07:24:47-04:00</updated>

		<published>2007-05-02T07:24:47-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=72439#p72439</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=72439#p72439"/>
		<title type="html"><![CDATA[Help split the result]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=72439#p72439"><![CDATA[
Read the faq about basic file operations (reading/writing files) and use puts instead of puthelp of course.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7395">rosc2112</a> — Wed May 02, 2007 7:24 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Merky]]></name></author>
		<updated>2007-05-02T02:37:07-04:00</updated>

		<published>2007-05-02T02:37:07-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=72432#p72432</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=72432#p72432"/>
		<title type="html"><![CDATA[Help split the result]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=72432#p72432"><![CDATA[
how about i split file.txt?<br><br>set sometext "some real long string of text over 400 chars for example"<br><br>set sometext "file.txt"<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8625">Merky</a> — Wed May 02, 2007 2:37 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[rosc2112]]></name></author>
		<updated>2006-08-03T02:11:01-04:00</updated>

		<published>2006-08-03T02:11:01-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=65110#p65110</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=65110#p65110"/>
		<title type="html"><![CDATA[some enhancement for splitting long lines]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=65110#p65110"><![CDATA[
I did a little enhancement to this word-wrapper, thought I'd share <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><div class="codebox"><p>Code: </p><pre><code>############################################################################################################# If the input came from a msg bind, we set $chan to "privmsg" # for example:bind msg - !mytrigger myprocproc mytrigger {nick uhost hand text} {        # pass the params to 'wrapproc' and set the channelname to "privmsg"        wrapproc $nick $uhost $hand privmsg $text        return}bind pub - !mytrigger wrapprocproc wrapproc {nick uhost hand chan text} {        if {$chan == "privmsg"} {set chan $nick}        # inputtitle would normally be the commandline given with the trigger, such as '!horoscope leo'         # title would be set to 'leo'        # You'd have to do further processing on the $text input of course, to limit its length,         # split it to make it tcl-special char safe, etc.        if {$text != ""} {set inputtitle "$text"} else {set inputtitle "titlefoo"}        # here we grab data into a var, say $sometext, from something like a geturl/regexp operation        set sometext "some real long string of text over 400 chars for example"        # word wrapper        set j 0        set linecount 0        foreach line [split $sometext \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 {$linecount == 0} {                                        set line2 [linsert $line2 0 \002[string totitle $inputtitle]\002:]                                        incr linecount                                        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($inputtitle con't)\002]                                        if {$j &gt;= 1} {                                                set line2 [linsert $line2 end \002(con't)\002]                                                set j [expr $j - 1]                                        }                                }                                puthelp "PRIVMSG $chan :$line2"                        }                }        }        puthelp "PRIVMSG $chan :\[end of $inputtitle output.\]"}</code></pre></div>I've been using this for various scripts, like the dream and funny horoscope scripts I made. The final result looks something like:<br><br>&lt;TheEntity&gt; Taurus: Everything will suddenly sound good to you today. This may be due to a syringing appointment you have earlier in the week, or it may be become love has just entered your life in the form someone floating down a river in a large plastic swan-type boat. Or it may just be because you've won a serious amount of money and people want to shower you with platitudes. Speaking of (con't)<br>&lt;TheEntity&gt; (taurus con't) which - you do look amazing today! Parts of you feel like giving up the ghost today, but feeding those parts with ice-cream and bacon bits may revive them, to an extent. Clowns with pickaxes will haunt your dreams tonight and will affect you at around mid-morning the following day. The effect of such dreams will cause you to a) be tired, b) look startled when people slam (con't)<br>&lt;TheEntity&gt; (taurus con't) the door, or c) be nice to any clowns you meet.<br>&lt;TheEntity&gt; [end of taurus horoscope]<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7395">rosc2112</a> — Thu Aug 03, 2006 2:11 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[De Kus]]></name></author>
		<updated>2006-03-24T13:03:54-04:00</updated>

		<published>2006-03-24T13:03:54-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=61354#p61354</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=61354#p61354"/>
		<title type="html"><![CDATA[Help split the result]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=61354#p61354"><![CDATA[
<blockquote class="uncited"><div>There is another problem, message send, too fast, the bot always quit (excess flood). any idea?  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_cry.gif" width="15" height="15" alt=":cry:" title="Crying or Very sad"> i set the char to 250  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_wink.gif" width="15" height="15" alt=":wink:" title="Wink"><br>how to make it delay 5seconds each line?</div></blockquote>1st:<br>"PRIVMSG $chan :" is at least 12 characters long, depending on channel maybe even 20. So I'd advise to wrap at around 230-235 chars, if want to keep line size below 256 bytes.<br>2nd:<br>if your bot floods on putserv or even on puthelp, you should consider increasing '#define msgrate' in your 'src/mod/server.mod/server.c' (and of course recompile and reinstall). This will however slow down reaction speed of the bot, but better 1s later than ending in being kicked.<br>Default and advised value is 2, my bots run well with 1 on QuakeNet and EuIRCnet. But might need to be set to 3 or 4 on more strict networks and depending on expected line length (1 assumes you do not exceed 250 characters/line).<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2382">De Kus</a> — Fri Mar 24, 2006 1:03 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Reynaldo]]></name></author>
		<updated>2006-03-17T23:37:06-04:00</updated>

		<published>2006-03-17T23:37:06-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=61144#p61144</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=61144#p61144"/>
		<title type="html"><![CDATA[Help split the result]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=61144#p61144"><![CDATA[
There is another problem, message send, too fast, the bot always quit (excess flood). any idea?  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_cry.gif" width="15" height="15" alt=":cry:" title="Crying or Very sad"> i set the char to 250  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_wink.gif" width="15" height="15" alt=":wink:" title="Wink"><br>how to make it delay 5seconds each line?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6218">Reynaldo</a> — Fri Mar 17, 2006 11:37 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Reynaldo]]></name></author>
		<updated>2006-03-17T20:07:09-04:00</updated>

		<published>2006-03-17T20:07:09-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=61141#p61141</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=61141#p61141"/>
		<title type="html"><![CDATA[Help split the result]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=61141#p61141"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>foreach line [wordwrap $word] {    puthlp "PRIVMSG $chan :$line" }</code></pre></div>i got it!  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_lol.gif" width="15" height="15" alt=":lol:" title="Laughing"><br>Thank you Guys  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_eek.gif" width="15" height="15" alt=":shock:" title="Shocked"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6218">Reynaldo</a> — Fri Mar 17, 2006 8:07 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[De Kus]]></name></author>
		<updated>2006-03-17T18:43:48-04:00</updated>

		<published>2006-03-17T18:43:48-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=61140#p61140</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=61140#p61140"/>
		<title type="html"><![CDATA[Help split the result]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=61140#p61140"><![CDATA[
btw. if server supports multitargeting of messages I would suggest to use:<br>[join [channels] ,]<br>as target <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=2382">De Kus</a> — Fri Mar 17, 2006 6:43 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Sir_Fz]]></name></author>
		<updated>2006-03-17T17:30:50-04:00</updated>

		<published>2006-03-17T17:30:50-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=61139#p61139</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=61139#p61139"/>
		<title type="html"><![CDATA[Help split the result]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=61139#p61139"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>set output "$wordwrap $word"</code></pre></div>Did you mean<div class="codebox"><p>Code: </p><pre><code>set output [wordwrap $word]</code></pre></div>?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3085">Sir_Fz</a> — Fri Mar 17, 2006 5:30 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Reynaldo]]></name></author>
		<updated>2006-03-17T01:19:40-04:00</updated>

		<published>2006-03-17T01:19:40-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=61120#p61120</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=61120#p61120"/>
		<title type="html"><![CDATA[Help split the result]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=61120#p61120"><![CDATA[
after parse the html into $word<div class="codebox"><p>Code: </p><pre><code>    set output "$wordwrap $word"    foreach x [channels] {    putserv "PRIVMSG $x :$output"  }proc wordwrap {str {len 70} {splitChr { }}} {    set out [set cur {}]; set i 0    foreach word [split [set str][unset str] $splitChr] {       if {[incr i [string len $word]]&gt;$len} {          lappend out [join $cur $splitChr]          set cur [list $word]          set i [string len $word]       } {          lappend cur $word       }       incr i    }    lappend out [join $cur $splitChr] } </code></pre></div>seems it's not working <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_cry.gif" width="15" height="15" alt=":cry:" title="Crying or Very sad"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6218">Reynaldo</a> — Fri Mar 17, 2006 1:19 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[De Kus]]></name></author>
		<updated>2006-03-16T05:51:43-04:00</updated>

		<published>2006-03-16T05:51:43-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=61103#p61103</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=61103#p61103"/>
		<title type="html"><![CDATA[Help split the result]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=61103#p61103"><![CDATA[
search function is your friend:<br><a href="http://forum.egghelp.org/viewtopic.php?t=6690#33031" class="postlink">http://forum.egghelp.org/viewtopic.php?t=6690#33031</a><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2382">De Kus</a> — Thu Mar 16, 2006 5:51 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Reynaldo]]></name></author>
		<updated>2006-03-16T03:15:27-04:00</updated>

		<published>2006-03-16T03:15:27-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=61102#p61102</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=61102#p61102"/>
		<title type="html"><![CDATA[Help split the result]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=61102#p61102"><![CDATA[
i've already grab from web into $result<div class="codebox"><p>Code: </p><pre><code>foreach line [split $result "\n"] {puthlp "PRIVMSG $nick :$notc $line"}</code></pre></div>but the problem is, some lines in $result is to long. how to make it about max 200 words each lines?.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6218">Reynaldo</a> — Thu Mar 16, 2006 3:15 am</p><hr />
]]></content>
	</entry>
	</feed>
