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

	<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-04-30T03:40:25-04:00</updated>

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

		<entry>
		<author><name><![CDATA[De Kus]]></name></author>
		<updated>2005-04-30T03:40:25-04:00</updated>

		<published>2005-04-30T03:40:25-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=48737#p48737</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=48737#p48737"/>
		<title type="html"><![CDATA[Get a txt file from net and read it]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=48737#p48737"><![CDATA[
you should get following TCL error:<br>wrong number of arguments, should "set varName ?value?"<br>invoked within "set todaysdate strftime %Y%m%d"<br>at least there are missing the [] braces around the strftime expression.<br><br>if you fix this, you will get this one:<br>no such variable $todaysmatch<br>invoked within "set start [string first "$todaysmatch" $line]"<br>did you mean $todaysdate ?!<br>same goes for "set end [string first "$todaysmatch*STATUS" $line]"<br><br>btw. "string first string1 string2 ?startIndex?" it will only search for strings, not for patterns (wildcards). not sure about that, but I wouldn't count on it!<br>ah yes, your proc will send an empty line to the server for each line without a match. you will not see it, because the server will most likely discard it, but it will flush unneccessary queues (of course only, if you disabled the same element check for server queue).<br><br>for the string extraction I reommned more somthing like this:<div class="codebox"><p>Code: </p><pre><code>set re "$todaysdate(.*)STATUS"if { [regexp $re $line {} served] } {   serve...}</code></pre></div>depending how many times "STATUS" is within that line, you might have to use (.{10,15}) to limit the match between the date STATUS to a specified range of characters.<br>read <a href="http://forum.egghelp.org/viewtopic.php?t=4319" class="postlink">http://forum.egghelp.org/viewtopic.php?t=4319</a> and <a href="http://www.tcl.tk/man/tcl8.4/TclCmd/re_syntax.htm" class="postlink">http://www.tcl.tk/man/tcl8.4/TclCmd/re_syntax.htm</a> for more infos.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2382">De Kus</a> — Sat Apr 30, 2005 3:40 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[xiphrex]]></name></author>
		<updated>2005-04-29T20:54:12-04:00</updated>

		<published>2005-04-29T20:54:12-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=48718#p48718</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=48718#p48718"/>
		<title type="html"><![CDATA[Get a txt file from net and read it]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=48718#p48718"><![CDATA[
Hello, first of all I would like to say cheers to the people of this forum as I wouldnt be where I am now without reading the many threads I uncovered in searches.<br><br>I have been trying to simply read a text file hosted online, parse it and select data from it and return it in a message to the user who activated the trigger. The code is so far this, and it doesnt get passed the "on to the next proc" log message; and it doesnt give an error either. The text file is also not a .txt but a .ical file, but it can be opened as a txt file. I also took most of the code from this thread: <a href="http://forum.egghelp.org/viewtopic.php?t=9340&amp;highlight=txt+file" class="postlink">http://forum.egghelp.org/viewtopic.php? ... t=txt+file</a> so cheers to gb for that.<br><br>Here is the code <div class="codebox"><p>Code: </p><pre><code># Set the chans you want to enable it in to +news# .chanset #channel +news# set this to the URL of the news fileset newsfile "http://www.enemydown.co.uk/files/calendar.php?clan=18931"# want the answer to come out in notice (0) or privmsg (1)?set tellwho 0if ![info exists egghttp(version)] {  putlog "egghttp.tcl was NOT successfully loaded."  return}bind pub - !news getlistproc getlist {nick uhost hand chan text} {# if ![channel get $chan news] returnglobal newsfile set sock [egghttp:geturl $newsfile [list processlist $nick]]  putlog "on to the next proc"}proc processlist {nick sock} {global tellwho set todaysdate strftime %Y%m%d set data [egghttp:headers $sock] foreach line [split $data \n] {    set start [string first "$todaysmatch" $line]    set start [expr {$start - 45}]     set end [string first "$todaysmatch*STATUS" $line]    set end [expr {$end - 1}]    set served [string range $line $start $end]    putlog "$line"    putlog "$served"   if $tellwho {    putserv "NOTICE $nick :$line"   } {    putserv "PRIVMSG $nick :$line"   }  }  if [string match -no Content-Type:* $line] { putlog "Its reached the end bit"}} </code></pre></div> Can anyone point out where this code is going wrong? Or even better fix it for me? I started reading tutorials for TCL and eggdrop scripting about a week ago, so I am very beginner. Also I have loaded the egghttp.tcl script as I think the code above requires it.<br><br>Thanks in advance for any help <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=6167">xiphrex</a> — Fri Apr 29, 2005 8:54 pm</p><hr />
]]></content>
	</entry>
	</feed>
