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

	<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-04T21:13:44-04:00</updated>

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

		<entry>
		<author><name><![CDATA[karodde]]></name></author>
		<updated>2007-05-04T21:13:44-04:00</updated>

		<published>2007-05-04T21:13:44-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=72542#p72542</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=72542#p72542"/>
		<title type="html"><![CDATA[Eggdrop Web Information]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=72542#p72542"><![CDATA[
Another Way I would appreciate even more is this:<br>The command !hello is standard and should have <span style="color:olive">2 more attributes</span>.<br>!hello <span style="color:olive">chair blue</span>, !hello <span style="color:olive">table green</span> and so on.<br>'chair blue' will have to link to a proc, 'table green' to another proc, table red to another proc, table white also to another etc...<br><br>How to make this?<br><br>I still need to tell the script, that chair has to link to chair.htm and table to table.htm. So I will have to make a variable of the .htm.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8961">karodde</a> — Fri May 04, 2007 9:13 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[karodde]]></name></author>
		<updated>2007-05-04T18:19:28-04:00</updated>

		<published>2007-05-04T18:19:28-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=72538#p72538</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=72538#p72538"/>
		<title type="html"><![CDATA[Eggdrop Web Information]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=72538#p72538"><![CDATA[
thanks,<br>now I have a last question.<br><blockquote class="uncited"><div>bind pub - !<span style="color:red">hello</span> my:test<br><br>proc my:test {nick uhost hand chan text} {<br>  set url "<a href="http://www.site.com/" class="postlink">http://www.site.com/</a><span style="color:red">$hello</span>.htm"  <br>  set token [::http::geturl $url]<br>  set content [::http::data $token]<br>  ::http::cleanup $content<br>  regexp {&lt;html&gt;(.*?)&lt;/html&gt;.*?} $content fullmatch exactmatch<br>  regexp {&lt;html&gt;(.*?)&lt;/html&gt;.*?} $content fullmatch2 exactmatch2<br>  putserv "PRIVMSG $chan : $exactmatch"<br>}</div></blockquote>I want that the ! command (in my case !hello) is set as a variable which stands for the .htm file.<br><br>For example:<br>Somebody types !chair, then the page <a href="http://www.site.com/chair.htm" class="postlink">http://www.site.com/chair.htm</a> has to be proc'ed in my proc code.<br>When a word is typed, that not exists (at the site) then a error message has to came.<br><span style="font-size:84%;line-height:116%">sorry for my english</span><br><br>that would be awsome, thanks for the help!<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8961">karodde</a> — Fri May 04, 2007 6:19 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[rosc2112]]></name></author>
		<updated>2007-05-04T17:28:35-04:00</updated>

		<published>2007-05-04T17:28:35-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=72536#p72536</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=72536#p72536"/>
		<title type="html"><![CDATA[Eggdrop Web Information]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=72536#p72536"><![CDATA[
There are newlines in the result, so you either need to remove them with regsub or do some further processing (perhaps using foreach line [split $exactmatch \n]) or even change the regexp to take account of the newlines.<br><br>As far as how to handle parameters within a single proc, you basically test for them and process them. A short example:<br><div class="codebox"><p>Code: </p><pre><code>proc myproc {nick uhost hand chan text} {        set command [lindex [split $text] 0]        if {$command == "" || $command == "option1"} {               # do thing1        } elseif {$command == "option2"} {               #do thing2        } elseif {$command == "option3"} {               #do thing3        } else {               #do default action        }#anti-wordwrap######################################</code></pre></div>The action part of the if's (#do thing) can call another proc and return, or call another proc and wait for the result. If you want to get the result, you use like:<div class="codebox"><p>Code: </p><pre><code>#do thing1set myvar [someotherproc (optional parameters)]</code></pre></div>where optional parameters can be input such as $command, $nick, $text, and so on, or whatever params you want to pass to "someotherproc"<br><br>If you just want to branch off to another proc, you do:<div class="codebox"><p>Code: </p><pre><code># do thing2someotherproc (optional params)return[code]Or you might want to do further processing after calling someotherproc so you leave the "return" out.You can also integrate the other subprocs into the main proc, under the "if's"Matter of style and design really. I generally keep everything in the same proc, unless it's reusable (meaning, other scripts or parts of the same script use the functions.)  As an example, when I make html scripts, if I have to do extensive regsub's or word-wrapping, I make the wordwrap and regsub functions into seperate procs, so that there's only 1 copy of that processing code, instead of duplicating it under many different "if" sections of the main proc.Hope that makes some sense.</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7395">rosc2112</a> — Fri May 04, 2007 5:28 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[karodde]]></name></author>
		<updated>2007-05-04T13:58:47-04:00</updated>

		<published>2007-05-04T13:58:47-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=72534#p72534</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=72534#p72534"/>
		<title type="html"><![CDATA[Eggdrop Web Information]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=72534#p72534"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>bind pub - !test my:testproc my:test {nick uhost hand chan text} {          #this has to have the name theproc1  set url "http://www.site.com/page.htm"  set token [::http::geturl $url]  set content [::http::data $token]  ::http::cleanup $content  regexp {&lt;html&gt;(.*?)&lt;/html&gt;.*?} $content fullmatch exactmatch  regexp {&lt;html&gt;(.*?)&lt;/html&gt;.*?} $content fullmatch2 exactmatch2  putserv "PRIVMSG $chan : $exactmatch"}</code></pre></div>When somebody types !test the 'proc' from my code will be outputted by eggdrop.<br><br>What I want now, is to give this 'proc' a name, so that I have to type "<span style="color:red">!test theproc1</span>" to let the eggdrop output the proc <span style="color:red">theproc1</span>.<br>I have other proc's too in the later code, I want to give each proc a name,<br>theproc1<br>theproc2<br>theproc3 and so on...<br><br>So is there any chance to give each 'proc' a name? I want that the command <span style="color:olive">!test</span> <em class="text-italics">doesnt</em> work, just the commands <span style="color:red">!test theproc1</span>, <span style="color:blue">!test theproc2</span>, <span style="color:green">!test theproc3</span> should work.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8961">karodde</a> — Fri May 04, 2007 1:58 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[karodde]]></name></author>
		<updated>2007-05-04T12:57:06-04:00</updated>

		<published>2007-05-04T12:57:06-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=72525#p72525</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=72525#p72525"/>
		<title type="html"><![CDATA[Eggdrop Web Information]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=72525#p72525"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>bind pub - !example my:exampleproc my:example {nick uhost hand chan text} {  set url "http://uhrzeit.org/atomuhr.html"  set token [::http::geturl $url]  set content [::http::data $token]  ::http::cleanup $content  regexp {&lt;h6 id="anzeige".*?&gt;(.*?)&lt;/h6&gt;.*?Die Uhrzeit} $content fullmatch exactmatch  putserv "PRIVMSG $chan :$exactmatch"}</code></pre></div>The script doesnt work, but when I change the last line:<br><br>putserv "PRIVMSG $chan :$exactmatch"<br>to<br>putserv "PRIVMSG $chan :$fullmatch"<br><br>I get the following message from my eggdrop by typing !example<br><blockquote class="uncited"><div>(MyEggdrop) &lt;h6 id="anzeige" class="off" style="padding-left:15px;padding-right:15px;"&gt;</div></blockquote><br>p.s.<br>for other sites it works, thanks.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8961">karodde</a> — Fri May 04, 2007 12:57 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[rosc2112]]></name></author>
		<updated>2007-05-04T03:12:27-04:00</updated>

		<published>2007-05-04T03:12:27-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=72508#p72508</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=72508#p72508"/>
		<title type="html"><![CDATA[Eggdrop Web Information]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=72508#p72508"><![CDATA[
You want to use regexp to get the string you're looking for. From your example, something like:<div class="codebox"><p>Code: </p><pre><code>regexp {&lt;h6 id="anzeige".*?&gt;(.*?)&lt;/h6&gt;.*?Die Uhrzeit} $htmlInput fullmatch exactmatch</code></pre></div>There's lots of example scripts for grabbing data from html pages. Take a look around the forum and archive.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7395">rosc2112</a> — Fri May 04, 2007 3:12 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[karodde]]></name></author>
		<updated>2007-05-03T07:46:57-04:00</updated>

		<published>2007-05-03T07:19:34-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=72461#p72461</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=72461#p72461"/>
		<title type="html"><![CDATA[Eggdrop Web Information]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=72461#p72461"><![CDATA[
Hello,<br>I need a script, which should do this:<br>When somebody in a channel types "!test", I want that my eggdrop automaticly posts a text/string. This text/string comes from a php or html file (<a href="http://www.site.com/thefile.html" class="postlink">http://www.site.com/thefile.html</a>), i specified.<br>The Problem is, that the html source code contains much text, and I dont know how to tell the eggdrop, to post just the text/string I want.<br><br>By searching I found this example code:<div class="codebox"><p>Code: </p><pre><code>bind pub - !example my:exampleproc my:example {nick uhost hand chan text} {  set url "http://your.web.server/page.php"  set token [::http::geturl $url]  set content [::http::data $token]  ::http::cleanup $content  foreach line [split $content \n] {    putserv "PRIVMSG $chan :$line"  }} </code></pre></div>When I use this script the whole html source code is posted by the eggdrop, but I only need one string.<br><br>Example:<blockquote class="uncited"><div>&lt;html&gt;<br><br>...code...<br><br>&lt;tr&gt;&lt;td bgcolor="#ffffff"&gt;&lt;b&gt;Here is any text&lt;/b&gt;&lt;br&gt;<span style="color:red">I want this</span>&lt;/td&gt;&lt;td bgcolor="#ffffff" align="right" valign="top"&gt;text...&lt;b&gt;text&lt;/b&gt;&lt;br&gt;more text and so on&lt;b&gt;text&lt;/b&gt;&lt;/td&gt;&lt;/tr&gt;<br><br>...code...</div></blockquote>This is a part of the html source code, and I want the eggdrop to post the red marked text on my channel when somebody types !test.<br><br>Thanks for helping!<br><br><br>p.s.<br>Here another good example:<br><a href="http://uhrzeit.org/atomuhr.html" class="postlink">http://uhrzeit.org/atomuhr.html</a><br>(uhrzeit is german and means "Time"; uhr = a clock)<br><br>When somebody types !time, I want that the time is posted on the channel.<br>The source code from the website:<div class="codebox"><p>Code: </p><pre><code>...code...&lt;h6 id="anzeige" class="off" style="padding-left:15px;padding-right:15px;"&gt;13:39:53&lt;/h6&gt;&lt;br&gt;&lt;br&gt;Die Uhrzeit wird in regelmässigen Abständen mit.....code.....</code></pre></div><br><br><strong class="text-strong">EDIT:</strong><br>I tried the script from <a href="http://forum.egghelp.org/viewtopic.php?t=9972&amp;postdays=0&amp;postorder=asc&amp;start=0&amp;sid=d3aff90aaa980644b6e37ba527afc44c" class="postlink">demond </a> (which needs tDOC), and it works. But it only works in my shell at home:) not with the eggdrop<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8961">karodde</a> — Thu May 03, 2007 7:19 am</p><hr />
]]></content>
	</entry>
	</feed>
