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

	<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>2001-11-15T02:32:00-04:00</updated>

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

		<entry>
		<author><name><![CDATA[stdragon]]></name></author>
		<updated>2001-11-15T02:32:00-04:00</updated>

		<published>2001-11-15T02:32:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=1686#p1686</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=1686#p1686"/>
		<title type="html"><![CDATA[Sockets]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=1686#p1686"><![CDATA[
Don't use list commands on a string (lindex $arg). Also, there's a reason they're called variable *names* and not variable numbers. Don't use confusing variable names like "1" and "2" that just makes the code harder to understand.<br><br>More to the point at hand, you split $test up into a list of lines, and examine each line, one at a time. So of course you will never find "Server" and "Connection:" in the same element.. they're on separate lines.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8">stdragon</a> — Thu Nov 15, 2001 2:32 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2001-11-14T20:59:00-04:00</updated>

		<published>2001-11-14T20:59:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=1681#p1681</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=1681#p1681"/>
		<title type="html"><![CDATA[Sockets]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=1681#p1681"><![CDATA[
Hi, i am trying to make a script that will<br>tell me the webserver software of a site<br>i put putserv "PRIVMSG $chan :$i" in so i could see what was going on. So i did .http eggdrop.org and it said to the channel:<br><br>HTTP/1.1 200 OK<br>Date: Wed, 14 Nov 2001 22:49:14 GMT<br>Server: Apache/1.3.14<br>Connection: close<br>Content-Type: text/html<br><br>i wanted it to tell me the text between Server: and Connection: but it only writes the above to the channel and not the text between the two.<br><br>Code:<br><br>bind pub - http http<br>proc http {nick host hand chan arg} {<br>  set site "[lindex $arg 0]"<br>  set sock [socket $site 80]<br>  puts $sock "HEAD / HTTP/1.0n"<br>  flush $sock<br>  set test [read $sock]<br>  close $sock<br> set test [split $test n]<br><br>foreach i $test {<br>putserv "PRIVMSG $chan :$i"<br>if {[string first Server $i] != -1} {<br> set 1 [expr [string first : $i] +2]<br> set 2 [expr [string first Connection: $i] -1]<br> set result [string range $i $1 $2]<br>putserv "PRIVMSG $chan :$result"<br>}<br>}<br>}<br><br>whats wrong with this?<br>Thanks<br><br><br>&lt;font size=-1&gt;[ This Message was edited by: PnT on 2001-11-14 18:01 ]&lt;/font&gt;<p>Statistics: Posted by Guest — Wed Nov 14, 2001 8:59 pm</p><hr />
]]></content>
	</entry>
	</feed>
