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

	<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>2006-06-20T03:10:48-04:00</updated>

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

		<entry>
		<author><name><![CDATA[SaPrOuZy]]></name></author>
		<updated>2006-06-20T03:10:48-04:00</updated>

		<published>2006-06-20T03:10:48-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=64216#p64216</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=64216#p64216"/>
		<title type="html"><![CDATA[Getting first Line of a on-the-web-located file]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=64216#p64216"><![CDATA[
i think you should declare check as global <br>try it.<br><div class="codebox"><p>Code: </p><pre><code>bind time - * man ;# runs every minute proc man {m h d mo y} {  global check   set a [info exists check]    set fs [open file.txt r]    gets $fs line(first)    close $fs    if { $a == 1 } {       if { $check != $line(first) } {          putserv "PRIVMSG #channel1 :$line(first)"          unset check          set check "$line(first)"       }    } elseif { $a == 0 } {       set burpie "a is 0"       putserv "PRIVMSG #channel1 :$burpie"       set check "$line(first)"         } else {       set burp "damnit, a is not 0 or 1"       putserv "PRIVMSG #channel1 :$burp"    } } </code></pre></div>EDIT: woops, i didn't see the second page of the post.  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_redface.gif" width="15" height="15" alt=":oops:" title="Embarassed"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=4727">SaPrOuZy</a> — Tue Jun 20, 2006 3:10 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[aap]]></name></author>
		<updated>2006-06-19T13:26:14-04:00</updated>

		<published>2006-06-19T13:26:14-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=64199#p64199</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=64199#p64199"/>
		<title type="html"><![CDATA[Getting first Line of a on-the-web-located file]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=64199#p64199"><![CDATA[
Wauw!<br><br>That is exactly what I needed!<br>Really thanks a lot!<br><br>aap<br><br>PS. if you need something from me <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_wink.gif" width="15" height="15" alt=";)" title="Wink"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7891">aap</a> — Mon Jun 19, 2006 1:26 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[deadite66]]></name></author>
		<updated>2006-06-19T12:39:46-04:00</updated>

		<published>2006-06-19T12:39:46-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=64197#p64197</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=64197#p64197"/>
		<title type="html"><![CDATA[Getting first Line of a on-the-web-located file]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=64197#p64197"><![CDATA[
that will only work on a local file not from the internet<br><br>try this<div class="codebox"><p>Code: </p><pre><code>package require http # set your channel name and urlset channelx "#mychannel"set fileurl "http://myurl/text.txt"# don't edit below this lineset ol ""bind time - * manproc man {m h d mo y} {global channelx ol fileurlset x [::http::geturl $fileurl]set x2 [split [::http::data $x] \n]set nl [lindex $x2 0]if {$nl != $ol} {set ol [lindex $x2 0]puthelp "PRIVMSG $channelx :$nl"} }</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6296">deadite66</a> — Mon Jun 19, 2006 12:39 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[aap]]></name></author>
		<updated>2006-06-19T11:49:15-04:00</updated>

		<published>2006-06-19T11:49:15-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=64196#p64196</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=64196#p64196"/>
		<title type="html"><![CDATA[Getting first Line of a on-the-web-located file]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=64196#p64196"><![CDATA[
New problem <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br><br>the problem is that 'a' is ALWAYS 0 :S<br><br>function of the script:<br>I want the script to output the first line of a .txt file, ONLY if it is new.<br><div class="codebox"><p>Code: </p><pre><code>bind time - * man ;# runs every minuteproc man {m h d mo y} {   set a [info exists check]   set fs [open file.txt r]   gets $fs line(first)   close $fs   if { $a == 1 } {      if { $check != $line(first) } {         putserv "PRIVMSG #channel1 :$line(first)"         unset check         set check "$line(first)"      }   } elseif { $a == 0 } {      set burpie "a is 0"      putserv "PRIVMSG #channel1 :$burpie"      set check "$line(first)"         } else {      set burp "damnit, a is not 0 or 1"      putserv "PRIVMSG #channel1 :$burp"   }}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7891">aap</a> — Mon Jun 19, 2006 11:49 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[aap]]></name></author>
		<updated>2006-06-19T10:55:56-04:00</updated>

		<published>2006-06-19T10:55:56-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=64195#p64195</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=64195#p64195"/>
		<title type="html"><![CDATA[Getting first Line of a on-the-web-located file]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=64195#p64195"><![CDATA[
so far I know<br><br>utimer is the same as timer, but in seconds<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7891">aap</a> — Mon Jun 19, 2006 10:55 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[deadite66]]></name></author>
		<updated>2006-06-19T10:54:05-04:00</updated>

		<published>2006-06-19T10:54:05-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=64194#p64194</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=64194#p64194"/>
		<title type="html"><![CDATA[Getting first Line of a on-the-web-located file]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=64194#p64194"><![CDATA[
won't that utimer just run the proc once when the bot starts up?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6296">deadite66</a> — Mon Jun 19, 2006 10:54 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[aap]]></name></author>
		<updated>2006-06-19T10:55:20-04:00</updated>

		<published>2006-06-19T10:48:12-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=64193#p64193</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=64193#p64193"/>
		<title type="html"><![CDATA[Getting first Line of a on-the-web-located file]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=64193#p64193"><![CDATA[
It worked <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"> Thanks,<br><br>but just 1 question: How can I change the timer, I mean... change 1 minute to 2 minutes, or 30 seconds. ?<br><br>thx<br><br><br>EDIT: that was a reply on the post from deadite66<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7891">aap</a> — Mon Jun 19, 2006 10:48 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[krimson]]></name></author>
		<updated>2006-06-19T10:42:20-04:00</updated>

		<published>2006-06-19T10:42:20-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=64192#p64192</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=64192#p64192"/>
		<title type="html"><![CDATA[Getting first Line of a on-the-web-located file]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=64192#p64192"><![CDATA[
you don't need all those args if you're calling the proc in a timer. the reason why the script doesnt work is that you call the proc with no args, while it requires 'n u h c t' as arguments.<br><br>you either give all the params when calling the proc, or you use the following code:<div class="codebox"><p>Code: </p><pre><code>set chan "#change_this"utimer 15 [now $chan]proc now {chan} {     set fs [open file.txt r]     gets $fs line(first)     putserv "PRIVMSG $chan :$line(first)"}</code></pre></div>(i don't see why you use 'return' at the end of that proc, so i didn't include it)<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7663">krimson</a> — Mon Jun 19, 2006 10:42 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[deadite66]]></name></author>
		<updated>2006-06-19T10:39:35-04:00</updated>

		<published>2006-06-19T10:39:35-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=64191#p64191</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=64191#p64191"/>
		<title type="html"><![CDATA[Getting first Line of a on-the-web-located file]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=64191#p64191"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>bind time - * now ;# runs every minuteproc now {m h d mo y} {</code></pre></div>this will run the procedure every minute, you'll have to change $c on the putserv line to the channel name.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6296">deadite66</a> — Mon Jun 19, 2006 10:39 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[aap]]></name></author>
		<updated>2006-06-19T10:23:03-04:00</updated>

		<published>2006-06-19T10:23:03-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=64190#p64190</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=64190#p64190"/>
		<title type="html"><![CDATA[Getting first Line of a on-the-web-located file]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=64190#p64190"><![CDATA[
I really need a timer, since the channel is not that crowded <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_wink.gif" width="15" height="15" alt=";)" title="Wink"><br>other idea's to solve it?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7891">aap</a> — Mon Jun 19, 2006 10:23 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[deadite66]]></name></author>
		<updated>2006-06-19T10:09:57-04:00</updated>

		<published>2006-06-19T10:09:57-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=64189#p64189</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=64189#p64189"/>
		<title type="html"><![CDATA[Getting first Line of a on-the-web-located file]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=64189#p64189"><![CDATA[
if you want the procedure called when someone issue a command in the channel change utimer to <br><div class="codebox"><p>Code: </p><pre><code>bind pub - !line now</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6296">deadite66</a> — Mon Jun 19, 2006 10:09 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[aap]]></name></author>
		<updated>2006-06-19T07:55:50-04:00</updated>

		<published>2006-06-19T07:55:50-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=64184#p64184</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=64184#p64184"/>
		<title type="html"><![CDATA[wrong number of args]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=64184#p64184"><![CDATA[
I really hate this... <br><br>I have now: <br><br><div class="codebox"><p>Code: </p><pre><code>utimer 15 "now"proc now {n u h c t} {  set fs [open file.txt r]  gets $fs line(first)  putserv "PRIVMSG $c :$line(first)"  return}</code></pre></div>eggdrop gives me something like<br><br>"wrong # of arguments, should be {now n u h c t}"<br>and when I do that, it says "should be {now now n u h c t}"<br>and so on...<br><br>Can someone help me? <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7891">aap</a> — Mon Jun 19, 2006 7:55 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[aap]]></name></author>
		<updated>2006-06-19T07:28:00-04:00</updated>

		<published>2006-06-19T07:28:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=64182#p64182</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=64182#p64182"/>
		<title type="html"><![CDATA[Getting first Line of a on-the-web-located file]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=64182#p64182"><![CDATA[
<img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"> It worked...<br><br>Thanks a lot!<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7891">aap</a> — Mon Jun 19, 2006 7:28 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[SaPrOuZy]]></name></author>
		<updated>2006-06-19T07:06:36-04:00</updated>

		<published>2006-06-19T07:06:36-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=64181#p64181</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=64181#p64181"/>
		<title type="html"><![CDATA[Getting first Line of a on-the-web-located file]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=64181#p64181"><![CDATA[
try to replace:<blockquote class="uncited"><div>foreach e [split [::http::data $x] \n] { <br>  regsub -all {&lt;([^&lt;])*&gt;} $e {} e <br>  puthelp "privmsg $c :$e" <br> } </div></blockquote>with<br><blockquote class="uncited"><div>  set e [lindex [split [::http::data $x] \n]  1]<br>  regsub -all {&lt;([^&lt;])*&gt;} $e {} e <br>  puthelp "privmsg $c :$e" <br> } </div></blockquote>i can't test it now, but i think it should work.[/quote]<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=4727">SaPrOuZy</a> — Mon Jun 19, 2006 7:06 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[aap]]></name></author>
		<updated>2006-06-19T06:56:31-04:00</updated>

		<published>2006-06-19T06:56:31-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=64180#p64180</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=64180#p64180"/>
		<title type="html"><![CDATA[Getting first Line of a on-the-web-located file]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=64180#p64180"><![CDATA[
I found this:<br><div class="codebox"><p>Code: </p><pre><code>proc foo {n u h c t} { set x [::http::geturl http://www.domain.com/file.txt] foreach e [split [::http::data $x] \n] {  regsub -all {&lt;([^&lt;])*&gt;} $e {} e  puthelp "privmsg $c :$e" }}</code></pre></div>And I understand that regsub -all won't read the html tags...<br>But how can I make the script so it won't read the 2nd line until the end of the file? So it will only output the first line?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7891">aap</a> — Mon Jun 19, 2006 6:56 am</p><hr />
]]></content>
	</entry>
	</feed>
