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

	<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>2003-02-27T13:50:28-04:00</updated>

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

		<entry>
		<author><name><![CDATA[ppslim]]></name></author>
		<updated>2003-02-27T13:50:28-04:00</updated>

		<published>2003-02-27T13:50:28-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=17178#p17178</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=17178#p17178"/>
		<title type="html"><![CDATA[dnslookup not playing nice]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=17178#p17178"><![CDATA[
<blockquote class="uncited"><div><div class="codebox"><p>Code: </p><pre><code>bind dcc n|n dns2 dcc:dns2proc dcc:dns2 {handle idx nick} {  global ip  set host [lindex [split [getchanhost $nick] @] end]  set lookup [dnslookup $host lookup]  putdcc $idx "Result: $host $lookup"}proc lookup { ip hostname status } {return $ip}</code></pre></div>This is working fine to me.<br>Result: caesar.u2.something.ro 192.168.108.55</div></blockquote>This is still incorrect, and only works if the information is cached.<br><br>Try doing it on a few nicks, and you may find it fails on some.<br><br>What the command does is this.<br><br>1: You do a lookup on the hostname, or IP. Along with it, you specify a command and any argument you want ot pass to it.<br><br>2: If the data is allready cached, return this cached information.<br><br>3: Do a lookup if needed<br><br>4: If details are not cached, cache them for later.<br><br>5: Call the command specified with the details.<br><br>6: The command should then continue where the other script left off.<br><br>With your "return $ip", it doesn't make it return the data to the previously runnign script.<br><br>Asycronous means, that the bot doesn't feeze while it obtains the data, and is able to continue, to prevent possible PING timeouts.<br><br>It simply continues with the script.<br><br>IOnce the result of the DNS is in, if it be 1 second, or 1 hour, the command will then be called.<br><br>The command with the return code in, is no more usful that the original post, as it doesn't return to the original code.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2">ppslim</a> — Thu Feb 27, 2003 1:50 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2003-02-27T13:35:32-04:00</updated>

		<published>2003-02-27T13:35:32-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=17177#p17177</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=17177#p17177"/>
		<title type="html"><![CDATA[dnslookup not playing nice]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=17177#p17177"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>bind dcc n|n dns2 dcc:dns2proc dcc:dns2 {handle idx nick} {  global ip  set host [lindex [split [getchanhost $nick] @] end]  set lookup [dnslookup $host lookup]  putdcc $idx "Result: $host $lookup"}proc lookup { ip hostname status } {return $ip}</code></pre></div>This is working fine to me.<br>Result: caesar.u2.something.ro 192.168.108.55<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Thu Feb 27, 2003 1:35 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[spock]]></name></author>
		<updated>2003-02-27T11:18:20-04:00</updated>

		<published>2003-02-27T11:18:20-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=17171#p17171</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=17171#p17171"/>
		<title type="html"><![CDATA[dnslookup not playing nice]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=17171#p17171"><![CDATA[
i heard bmw makes cars now. maybe fiat should stop because of this <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br><br>thanks<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2369">spock</a> — Thu Feb 27, 2003 11:18 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[egghead]]></name></author>
		<updated>2003-02-27T11:13:45-04:00</updated>

		<published>2003-02-27T11:13:45-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=17170#p17170</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=17170#p17170"/>
		<title type="html"><![CDATA[Re: dnslookup not playing nice]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=17170#p17170"><![CDATA[
<blockquote class="uncited"><div>Im trying to write a script to do the following task:<br><br>&lt;me&gt;.ip nick<br>&lt;bot&gt; this.is.the.host.net 123.123.123.123<br><br><br>when i .ip nick, it returns<br>&lt;bot&gt; this.is.the.host.net<br><br>in other words, doesnt return ip.<br>strange thing is, second time around .ip samenick, it works like i want it to<br>&lt;bot&gt; this.is.the.host.net 123.123.123.123<br><br>any ideas on where i **** up ?</div></blockquote>dnslookup is asynchronous. It returns immediately if it has the lookup info cached. This actually is the way you use the proc. That is why first you don't get the result and a few seconds later the proc returns the result from cache.<br><br>Otherwise you will need to call a proc after the dnslookup has completed.<br>Read doc/tcl-commands.doc for more info on how to do that.<br><br>By the way, there are scripts that do exactly what you want.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=282">egghead</a> — Thu Feb 27, 2003 11:13 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[spock]]></name></author>
		<updated>2003-02-27T11:08:01-04:00</updated>

		<published>2003-02-27T11:08:01-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=17169#p17169</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=17169#p17169"/>
		<title type="html"><![CDATA[dnslookup not playing nice]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=17169#p17169"><![CDATA[
Im trying to write a script to do the following task:<br><br>&lt;me&gt;.ip nick<br>&lt;bot&gt; this.is.the.host.net 123.123.123.123<br><br>its a dcc command, and it returns host and ip of nick.<br><div class="codebox"><p>Code: </p><pre><code>bind dcc n|n ip dcc:ipproc dcc:ip {handle idx nick} {set host [lindex [split [getchanhost $nick] @] end] set lookup [dnslookup $host lookup]putdcc $idx "$host $lookup"}proc lookup { ip hostname status } {  return $ip}</code></pre></div>now, the problem is:<br><br>when i .ip nick, it returns<br>&lt;bot&gt; this.is.the.host.net<br><br>in other words, doesnt return ip.<br>strange thing is, second time around .ip samenick, it works like i want it to<br>&lt;bot&gt; this.is.the.host.net 123.123.123.123<br><br>any ideas on where i [censored] up ?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2369">spock</a> — Thu Feb 27, 2003 11:08 am</p><hr />
]]></content>
	</entry>
	</feed>
