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

	<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-08-17T04:17:03-04:00</updated>

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

		<entry>
		<author><name><![CDATA[Ofloo]]></name></author>
		<updated>2003-08-17T04:17:03-04:00</updated>

		<published>2003-08-17T04:17:03-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=25141#p25141</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=25141#p25141"/>
		<title type="html"><![CDATA[dns reverse ip ?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=25141#p25141"><![CDATA[
thats almost the same script as me i tought you meanth bot_ip was a global var like botnick ... its the same script i got almost then ..<br><div class="codebox"><p>Code: </p><pre><code>bind EVNT - init-server conn:init proc conn:init init-server { global botnick  putserv "USERHOST $botnick" }bind RAW - 302 reslove:rawproc reslove:raw {from key arg} {global botnick  set bothost [join [lrange $arg 0 end]]  set sbothost [lindex [split $bothost @] 1]  set nslookup [dnslookup $sbothost reslove:ipaddress]}proc reslove:ipaddress {ipaddres hostname status} {  set wfile [open "MyIP" "w"]  puts -nonewline $wfile $ipaddres  close $wfile  putlog "Succesfully cached ip: \002$ipaddres\002."}proc MyIP {} {  set rfile [open "MyIP" "r"]   set MyIP [read $rfile]  close $rfile   if {"$MyIP" == "" || "$MyIP" == "0.0.0.0"} {    set MyIP ""     foreach a {a b c d e f g h i j k} {       catch {       set external [socket $a.root-servers.net 53]       set MyIP [lindex [fconfigure $external -sockname] 0]       close $external                   }     if { ![string equal $MyIP ""] } { break }     }    return $MyIP  } else {    return $MyIP  }}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3151">Ofloo</a> — Sun Aug 17, 2003 4:17 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[rolandguy]]></name></author>
		<updated>2003-08-16T18:15:30-04:00</updated>

		<published>2003-08-16T18:15:30-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=25100#p25100</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=25100#p25100"/>
		<title type="html"><![CDATA[dns reverse ip ?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=25100#p25100"><![CDATA[
if it's showing a name and not an IP, that means that you're checking USERHOST for someone other than you...ermmm....check $botnick lol <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"> is the only thing I can figure...<br><br>roland<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3658">rolandguy</a> — Sat Aug 16, 2003 6:15 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Ofloo]]></name></author>
		<updated>2003-08-16T15:54:05-04:00</updated>

		<published>2003-08-16T15:54:05-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=25092#p25092</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=25092#p25092"/>
		<title type="html"><![CDATA[dns reverse ip ?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=25092#p25092"><![CDATA[
hmm i get a strange result it shows the ip of an other bot on my lan ? well not exactly ip but computer netbios name<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3151">Ofloo</a> — Sat Aug 16, 2003 3:54 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[rolandguy]]></name></author>
		<updated>2003-08-16T04:07:37-04:00</updated>

		<published>2003-08-16T04:07:37-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=25046#p25046</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=25046#p25046"/>
		<title type="html"><![CDATA[dns reverse ip ?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=25046#p25046"><![CDATA[
did you restart the bot, so that it actually triggers the USERHOST command on connect?  if you're already connected, the it wouldn't have set the IP yet...<br><br>am guessing you probably did tho...<br><br>here's everything so far all in one chunk lol...I took out writing the file just to make it easier to look at, and also a check to see if bot_ip exists in the testing proc, just in case <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_wink.gif" width="15" height="15" alt=";)" title="Wink"><br><div class="codebox"><p>Code: </p><pre><code>bind EVNT - init-server conn:init bind RAW - 302 reslove:raw bind pub - !test test:pub proc conn:init { init-server } {   global botnick   putserv "USERNAME $botnick" } proc reslove:raw {from key arg} {   global bot_ip   set bot_ip [lindex [split $arg @] 1]   putlog "Succesfully cached ip: \002$bot_ip\002." } proc test:pub {nick host hand chan args} {   global bot_ip botnick  if {![info exists bot_ip]} {    putserv "USERNAME $botnick"    return  }  putserv "notice $nick :$bot_ip" }</code></pre></div>that should work fine <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br><br>roland<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3658">rolandguy</a> — Sat Aug 16, 2003 4:07 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Ofloo]]></name></author>
		<updated>2003-08-16T01:57:32-04:00</updated>

		<published>2003-08-16T01:57:32-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=25043#p25043</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=25043#p25043"/>
		<title type="html"><![CDATA[dns reverse ip ?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=25043#p25043"><![CDATA[
yes i did <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=3151">Ofloo</a> — Sat Aug 16, 2003 1:57 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[rolandguy]]></name></author>
		<updated>2003-08-15T08:13:46-04:00</updated>

		<published>2003-08-15T08:13:46-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=24997#p24997</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=24997#p24997"/>
		<title type="html"><![CDATA[dns reverse ip ?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=24997#p24997"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>proc test:pub {nick host hand chan args} {   global bot_ip  putserv "notice $nick :$bot_ip" }</code></pre></div>?<br><br>roland<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3658">rolandguy</a> — Fri Aug 15, 2003 8:13 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Ofloo]]></name></author>
		<updated>2003-08-15T06:44:53-04:00</updated>

		<published>2003-08-15T06:44:53-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=24991#p24991</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=24991#p24991"/>
		<title type="html"><![CDATA[dns reverse ip ?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=24991#p24991"><![CDATA[
yes i did global<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3151">Ofloo</a> — Fri Aug 15, 2003 6:44 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[rolandguy]]></name></author>
		<updated>2003-08-15T01:29:40-04:00</updated>

		<published>2003-08-15T01:29:40-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=24981#p24981</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=24981#p24981"/>
		<title type="html"><![CDATA[dns reverse ip ?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=24981#p24981"><![CDATA[
<blockquote class="uncited"><div><blockquote class="uncited"><div>[05:43]Tcl error [test:pub]: can't read "bot_ip": no such variable<br>and if it would work and the bot is binded to 192.168.0.1</div></blockquote>did you "global bot_ip" in test:pub?<br><br>roland</div></blockquote><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3658">rolandguy</a> — Fri Aug 15, 2003 1:29 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Ofloo]]></name></author>
		<updated>2003-08-15T00:22:10-04:00</updated>

		<published>2003-08-15T00:22:10-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=24974#p24974</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=24974#p24974"/>
		<title type="html"><![CDATA[dns reverse ip ?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=24974#p24974"><![CDATA[
<blockquote class="uncited"><div>Why catch everything (only socket would cause an error) and not even use the return value? This is a rewrite that will gain the same result: </div></blockquote>changed it to your code and crash :/ ?<br><div class="codebox"><p>Code: </p><pre><code>foreach a {a b c d e f g h i j k} {   if {[catch {socket $a.root-servers.net 53} s]} continue   set MyIP [lindex [fconfigure $s -sockname] 0]   close $s   break } </code></pre></div> <br><br>can't put my finger on it .. :/<br><blockquote class="uncited"><div>ahh, try the USERHOST &lt;botnick&gt; server command to get your bots IP...is the 302 numeric </div></blockquote>True that would be easyer good point <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_wink.gif" width="15" height="15" alt=";)" title="Wink"> and would work all the time hehe<br><blockquote class="uncited"><div>that is, if you even want to bother writing it to a file. since the global variable $bot_ip is reset every time the bot connects, there's really not much reason to save it...unless you want to use the IP for an external program. </div></blockquote>[05:43]Tcl error [test:pub]: can't read "bot_ip": no such variable<br>and if it would work and the bot is binded to 192.168.0.1<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3151">Ofloo</a> — Fri Aug 15, 2003 12:22 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[rolandguy]]></name></author>
		<updated>2003-08-14T18:19:25-04:00</updated>

		<published>2003-08-14T18:19:25-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=24965#p24965</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=24965#p24965"/>
		<title type="html"><![CDATA[dns reverse ip ?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=24965#p24965"><![CDATA[
sure is alot of wasted code for eggdrop TCL...if you're already connected to chat, and all you want is your own IP...<br><div class="codebox"><p>Code: </p><pre><code>bind EVNT - init-server conn:init bind RAW - 302 reslove:raw proc conn:init init-server {  global botnick  putserv "USERNAME $botnick" } proc reslove:raw {from key arg} {  global bot_ip  set bot_ip [lindex [split $arg @] 1]  set wfile [open "MyIP" "w"]   puts -nonewline $wfile $bot_ip   close $wfile  putlog "Succesfully cached ip: \002$bot_ip\002." }</code></pre></div>that is, if you even want to bother writing it to a file.  since the global variable $bot_ip is reset every time the bot connects, there's really not much reason to save it...unless you want to use the IP for an external program.<br><br>or am I still not getting what you mean? lol<br><br>roland<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3658">rolandguy</a> — Thu Aug 14, 2003 6:19 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[user]]></name></author>
		<updated>2003-08-14T17:18:13-04:00</updated>

		<published>2003-08-14T17:18:13-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=24962#p24962</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=24962#p24962"/>
		<title type="html"><![CDATA[dns reverse ip ?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=24962#p24962"><![CDATA[
<blockquote class="uncited"><div><div class="codebox"><p>Code: </p><pre><code>...  foreach a {a b c d e f g h i j k} {     catch {       set external [socket $a.root-servers.net 53]       set MyIP [lindex [fconfigure $external -sockname] 0]       close $external                 }     if {![string equal $MyIP ""] } { break }   }...</code></pre></div></div></blockquote>Why catch everything (only socket would cause an error) and not even use the return value? This is a rewrite that will gain the same result:<br><div class="codebox"><p>Code: </p><pre><code>foreach a {a b c d e f g h i j k} {   if {[catch {socket $a.root-servers.net 53} s]} continue  set MyIP [lindex [fconfigure $s -sockname] 0]   close $s  break}</code></pre></div>Also, you might wanna change the order of those root-servers (putting the ones close to you at the start of the list)<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2878">user</a> — Thu Aug 14, 2003 5:18 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[rolandguy]]></name></author>
		<updated>2003-08-14T16:35:38-04:00</updated>

		<published>2003-08-14T16:35:38-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=24956#p24956</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=24956#p24956"/>
		<title type="html"><![CDATA[dns reverse ip ?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=24956#p24956"><![CDATA[
all TCL commands that start with the letter l are list commands, except "load" and possibly some module commands.  basicly all lists are are just strings, but by calling it a list, it interprets {} and " as signalling the beginning and end of parts of the list.  for example:<br><br>{ "something" "something else" }<br><br>in the literal sense, this is a string, because it is just ascii characters, 8 bits each.  but taken in the context of a list...is much more usefull <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile">. <br><br>using your old code:<br><div class="codebox"><p>Code: </p><pre><code>proc reslove:raw {from key arg} {   global botnick   set bothost [join [lrange $arg 0 end]]   set sbothost [lindex [split $bothost @] 1]   set nslookup [dnslookup $sbothost reslove:ipaddress] }</code></pre></div>$arg is a string, and is treated as a single object.  no matter what is contained in that string, TCL doesn't care, doesn't even look at it.  but by using lrange (list range), the TCL interpreter forces the string into a list structure.  so if (for example) you had:  "{\/}y name is Bot"  in the realname field of the whois reply, you bot would puke.  it would try to interpret all of the special chars in that string as special chars...instead of just treating the whole thing as one object, and each char as just an anonymous 8 bits.  <br>if you are wanting to use the string as a list, however, you need to [split $arg].  this escapes all the special characters in the original string, and adds new special characters to form a list.<br><br>"{\/}y name is Bot" -&gt; { "\{\\/\}y" "name" "is" "Bot" }<br><br>in any case, even with a properly formated list, [lrange $list 0 end] does absolutely nothing <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_wink.gif" width="15" height="15" alt=";)" title="Wink">  I'm thinking all you need for that proc is:<br><div class="codebox"><p>Code: </p><pre><code>proc reslove:raw {from key arg} {   set bothost [lindex [split $arg @] 1]   set nslookup [dnslookup $sbothost reslove:ipaddress] }</code></pre></div>(of course, you could skip the bothost var all togeather, but wanted to make sure things are clear <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_wink.gif" width="15" height="15" alt=";)" title="Wink"><br><br>hope this helps <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br><br>roland<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3658">rolandguy</a> — Thu Aug 14, 2003 4:35 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[rolandguy]]></name></author>
		<updated>2003-08-14T16:03:39-04:00</updated>

		<published>2003-08-14T16:03:39-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=24950#p24950</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=24950#p24950"/>
		<title type="html"><![CDATA[dns reverse ip ?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=24950#p24950"><![CDATA[
ahh, try the USERHOST &lt;botnick&gt; server command to get your bots IP...is the 302 numeric <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br><br>not positive how unreal has things set up these days, so dunno if a user can see their own *real* host in their WHOIS reply...but either way, USERHOST always returns an IP for a client using the command on itself, for exactly that reason <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_wink.gif" width="15" height="15" alt=";)" title="Wink"><br><br>roland<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3658">rolandguy</a> — Thu Aug 14, 2003 4:03 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Ofloo]]></name></author>
		<updated>2003-08-14T15:04:43-04:00</updated>

		<published>2003-08-14T15:04:43-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=24945#p24945</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=24945#p24945"/>
		<title type="html"><![CDATA[dns reverse ip ?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=24945#p24945"><![CDATA[
oh and sorry again for putting up a topic with no question didn't mean it like this .. :/ tnx for understanding <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=3151">Ofloo</a> — Thu Aug 14, 2003 3:04 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Ofloo]]></name></author>
		<updated>2003-08-14T15:06:28-04:00</updated>

		<published>2003-08-14T15:02:25-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=24944#p24944</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=24944#p24944"/>
		<title type="html"><![CDATA[dns reverse ip ?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=24944#p24944"><![CDATA[
<blockquote class="uncited"><div>btw...might want to be carefull there mixing the string commands and list commands...using lrange on a string is asking for trouble if there are any odd chars like {}"() in there. in any event, lrange of a list from 0 to end is just the same list...without knowing the syntax of the numeric tho, not sure what you're looking for *chuckle* </div></blockquote>thats the main reason why i use lrange and not lindex .. ? or am i wrong again cause if i remember correctly same thing is been told to me in the passed or something like that and i they suggested to use lrange and not lindex ..<br><br>and yes i tested what you sad, well sort of change raw to ramdom raws and result always was ip 0.0.0.0 so thats why the fail safe its not a perfect one the script is more relayable but in case it fails ..<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3151">Ofloo</a> — Thu Aug 14, 2003 3:02 pm</p><hr />
]]></content>
	</entry>
	</feed>
