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

	<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>2005-01-24T14:03:12-04:00</updated>

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

		<entry>
		<author><name><![CDATA[micky]]></name></author>
		<updated>2005-01-24T14:03:12-04:00</updated>

		<published>2005-01-24T14:03:12-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=45793#p45793</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=45793#p45793"/>
		<title type="html"><![CDATA[first/last line]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=45793#p45793"><![CDATA[
very thx!:)<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5782">micky</a> — Mon Jan 24, 2005 2:03 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[spock]]></name></author>
		<updated>2005-01-24T13:31:02-04:00</updated>

		<published>2005-01-24T13:31:02-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=45792#p45792</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=45792#p45792"/>
		<title type="html"><![CDATA[first/last line]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=45792#p45792"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>set somestring "FIR\nrandom1\nrandom2\nrandom3\nFIRST\nrandom4\nrandom5\nrandom6\nLAST\nrandom7\netc"bind pub n .s pub:sproc pub:s { n u h c t } {  if {[llength [split $t]] != 2} { puthelp "PRIVMSG $c :usage: .s &lt;first&gt; &lt;last&gt;" ; return }  if {[set result [s [lindex [split $t] 0] [lindex [split $t] 1]]] != "ERROR" } {    foreach l $result { puthelp "PRIVMSG $c :$l" }    return  }  puthelp "PRIVMSG $c :$result"  return}proc s { f l } {  set d [split $::somestring \n] ;# set d $::somestring (if it's a list)  if {[set f [lsearch $d $f]] != -1 &amp;&amp; [set l [lsearch $d $l]] != -1} {    set r [lrange $d [expr {$f+1}] [expr {$l-1}]]  } { return ERROR }}</code></pre></div><blockquote class="uncited"><div>&lt;you&gt; .s FIRST LAST<br>&lt;bot&gt; random4<br>&lt;bot&gt; random5<br>&lt;bot&gt; random6<br><br>can also use wildcards<br>&lt;you&gt; .s *IRS* *AST<br>&lt;bot&gt; random4<br>&lt;bot&gt; random5<br>&lt;bot&gt; random6</div></blockquote><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2369">spock</a> — Mon Jan 24, 2005 1:31 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[micky]]></name></author>
		<updated>2005-01-24T12:41:49-04:00</updated>

		<published>2005-01-24T12:41:49-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=45790#p45790</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=45790#p45790"/>
		<title type="html"><![CDATA[first/last line]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=45790#p45790"><![CDATA[
but "file" is:<div class="codebox"><p>Code: </p><pre><code>FIR random text1 random text2 random text3 FIRST random text4 random text5 random text6 LAST random text7 random text8 random text9 NEXT [...] </code></pre></div>and i need to write to channel:<br>nick: .s FIRST LAST<br>bot: random text4 <br>bot: random text5 <br>bot: random text6 <br><img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"> <br>thx for help:)<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5782">micky</a> — Mon Jan 24, 2005 12:41 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[spock]]></name></author>
		<updated>2005-01-24T09:32:25-04:00</updated>

		<published>2005-01-24T09:32:25-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=45786#p45786</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=45786#p45786"/>
		<title type="html"><![CDATA[first/last line]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=45786#p45786"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>proc s { w f l } {  set fp [open $w r] ; set d [split [read $fp] \n] ; close $fp  set r [lrange $d [expr {[lsearch $d $f]+1}] [expr {[lsearch $d $l]-1}]]}</code></pre></div><blockquote class="uncited"><div>% s &lt;file&gt; FIRST LAST<br>text4 text5 text6</div></blockquote>obviously you'd also check to see if file exists/readable (if you're reading from a file), and you should check if the lsearch fails<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2369">spock</a> — Mon Jan 24, 2005 9:32 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[micky]]></name></author>
		<updated>2005-01-24T08:27:13-04:00</updated>

		<published>2005-01-24T08:27:13-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=45784#p45784</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=45784#p45784"/>
		<title type="html"><![CDATA[first/last line]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=45784#p45784"><![CDATA[
Someone write script like this:<br><br>cmd: .s FIRST LAST<div class="codebox"><p>Code: </p><pre><code>FIRtext1text2text3FIRSTtext4text5text6LASTtext7text8text9NEXT[...]</code></pre></div>script return:<br>text4<br>text5<br>text6<br>all between FIRST and LAST.<br>Thx for help<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5782">micky</a> — Mon Jan 24, 2005 8:27 am</p><hr />
]]></content>
	</entry>
	</feed>
