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

	<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>2023-06-25T14:28:05-04:00</updated>

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

		<entry>
		<author><name><![CDATA[RoKiTo]]></name></author>
		<updated>2023-06-25T14:28:05-04:00</updated>

		<published>2023-06-25T14:28:05-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=112014#p112014</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=112014#p112014"/>
		<title type="html"><![CDATA[Need help with IPinfo Script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=112014#p112014"><![CDATA[
Will you be able to adapt this api please caesar <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_biggrin.gif" width="15" height="15" alt=":D" title="Very Happy"> <br><a href="https://proxycheck.io/v2/2806:10be:a:7699:e094:f36d:6b6c:7a23" class="postlink">https://proxycheck.io/v2/2806:10be:a:76 ... :6b6c:7a23</a><br><blockquote class="uncited"><div>{<br>    "status": "ok",<br>    "2806<img alt=":10be:" class="emoji smilies" draggable="false" src="//cdn.jsdelivr.net/gh/twitter/twemoji@latest/assets/svg/10be.svg">a:7699:e094:f36d:6b6c:7a23": {<br>        "proxy": "no",<br>        "type": "Business"<br>    }<br>}</div></blockquote><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12930">RoKiTo</a> — Sun Jun 25, 2023 2:28 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2023-04-27T13:34:24-04:00</updated>

		<published>2023-04-27T13:34:24-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=111891#p111891</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=111891#p111891"/>
		<title type="html"><![CDATA[Need help with IPinfo Script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=111891#p111891"><![CDATA[
The command is <em class="text-italics">!ginfo ip</em> not <em class="text-italics">!test ip</em>, unless you changed the command from !ginfo to !test.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Thu Apr 27, 2023 1:34 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nobody]]></name></author>
		<updated>2023-04-26T21:51:54-04:00</updated>

		<published>2023-04-26T21:51:54-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=111889#p111889</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=111889#p111889"/>
		<title type="html"><![CDATA[Re: weird]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=111889#p111889"><![CDATA[
good morning, because that's my opinion when i tried checking the ip on both website.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12858">nobody</a> — Wed Apr 26, 2023 9:51 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[BLaCkShaDoW]]></name></author>
		<updated>2023-04-26T09:42:44-04:00</updated>

		<published>2023-04-26T09:42:44-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=111887#p111887</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=111887#p111887"/>
		<title type="html"><![CDATA[Re: weird]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=111887#p111887"><![CDATA[
Hello, why do you say that ipinfo.io is more accurate then the the source from BlackIP.tcl ?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10416">BLaCkShaDoW</a> — Wed Apr 26, 2023 9:42 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nobody]]></name></author>
		<updated>2023-04-26T01:31:36-04:00</updated>

		<published>2023-04-26T01:31:36-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=111884#p111884</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=111884#p111884"/>
		<title type="html"><![CDATA[weird]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=111884#p111884"><![CDATA[
how to see errors?<br><br>&lt;guy&gt; witch rehash<br>-witch- Reloading scripts/settings..<br>&lt;guy&gt; !test<br>-witch- Error, syntax is: !Ginfo &lt;ip&gt;<br>&lt;guy&gt; !test 1.1.1.1<br><br><br>- no response at all im currently using blackip.tcl using ip-info.com service but i found ipinfo.io near to accurate.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12858">nobody</a> — Wed Apr 26, 2023 1:31 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nobody]]></name></author>
		<updated>2023-04-26T01:13:29-04:00</updated>

		<published>2023-04-26T01:13:29-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=111883#p111883</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=111883#p111883"/>
		<title type="html"><![CDATA[Need help with IPinfo Script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=111883#p111883"><![CDATA[
this is good for ircop?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12858">nobody</a> — Wed Apr 26, 2023 1:13 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2023-04-25T10:57:07-04:00</updated>

		<published>2023-04-25T10:57:07-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=111880#p111880</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=111880#p111880"/>
		<title type="html"><![CDATA[Need help with IPinfo Script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=111880#p111880"><![CDATA[
And the version that uses <em class="text-italics">ip</em> library to do the IP v4 and v6 validation rather than that regexp that won't match IP v6:<div class="codebox"><p>Code: </p><pre><code>package require httppackage require jsonpackage require ipbind raw - NOTICE server:noticesproc server:notices {from keyword text} {if {![string match -nocase "*client connecting*" $text]} returnset lookup [lindex [split $text] 6]if {[::ip::version $lookup] &lt; 4} returncatch {set http [::http::geturl http://ipinfo.io/$lookup/json -timeout 6000]} errorset data [::http::data $http]set json [::json::json2dict $data]::http::cleanup $httpset keys [dict keys $json]foreach ele {ip hostname city region country loc postal phone org} {set $ele [expr {[lsearch $keys $ele] &gt; -1 ? [dict get $json $ele] : "n/a"}]}puthelp "PRIVMSG #Opers :$nick -  $ip - $country"}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Tue Apr 25, 2023 10:57 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[simo]]></name></author>
		<updated>2023-04-25T05:39:56-04:00</updated>

		<published>2023-04-25T05:39:56-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=111875#p111875</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=111875#p111875"/>
		<title type="html"><![CDATA[Need help with IPinfo Script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=111875#p111875"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>package require httppackage require jsonbind pub m|- !ginfo Pub:Geo:INFOproc Pub:Geo:INFO {nick uhost hand chan text} {   if {[scan $text {%s} lookup] != 1} {      puthelp "NOTICE $nick :Error, syntax is: !Ginfo &lt;ip&gt;"      return   }   if {![regexp {([0-9]+\.)([0-9]+\.)([0-9]+\.)([0-9]+)} $lookup]} {      puthelp "NOTICE $nick :Error, the IP you mentioned is not valid."      return   }   catch {set http [::http::geturl http://ipinfo.io/$lookup/json -timeout 6000]} error   set data [::http::data $http]   set json [::json::json2dict $data]   ::http::cleanup $http   set keys [dict keys $json]   foreach ele {ip hostname city region country loc postal phone org} {      set $ele [expr {[lsearch $keys $ele] &gt; -1 ? [dict get $json $ele] : "n/a"}]   }   puthelp "NOTICE $nick :IP: $ip - Hostname: $hostname - City: $city - Region: $region - Country: $country - Location: $loc - Organization: $org"}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12505">simo</a> — Tue Apr 25, 2023 5:39 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nobody]]></name></author>
		<updated>2023-04-25T01:53:33-04:00</updated>

		<published>2023-04-25T01:53:33-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=111873#p111873</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=111873#p111873"/>
		<title type="html"><![CDATA[Need help with IPinfo Script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=111873#p111873"><![CDATA[
<blockquote class="uncited"><div>Forgot to reply back. Script works flawless now. Thank you</div></blockquote>can you post the complete working script here bro , if you don't mind?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12858">nobody</a> — Tue Apr 25, 2023 1:53 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2019-04-04T02:29:26-04:00</updated>

		<published>2019-04-04T02:29:26-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=107579#p107579</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=107579#p107579"/>
		<title type="html"><![CDATA[Need help with IPinfo Script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=107579#p107579"><![CDATA[
I just noticed that I copy/paste the code you gave me and didn't double check the variables, so instead of:<div class="codebox"><p>Code: </p><pre><code>set hostmask [lindex [split $text] 6] </code></pre></div>should have been:<div class="codebox"><p>Code: </p><pre><code>set lookup [lindex [split $text] 6] </code></pre></div>Anyway, back to what you asked. We can just use TCLib's IP to validate a Ipv4 or IPv6 that will return -1 if the IP isn't valid, 4 for IPv4 and 6 for IPv6. Simple, no?<br><br>Basically we change these two lines:<div class="codebox"><p>Code: </p><pre><code>      set hostmask [lindex [split $text] 6]      if {![regexp {([0-9]+\.)([0-9]+\.)([0-9]+\.)([0-9]+)} $lookup]} return </code></pre></div>with:<div class="codebox"><p>Code: </p><pre><code>      set lookup [lindex [split $text] 6]      if {[::ip::version $lookup] &lt; 4} return</code></pre></div>and above:<div class="codebox"><p>Code: </p><pre><code>bind raw - NOTICE server:notices </code></pre></div>simply add:<div class="codebox"><p>Code: </p><pre><code>package require ip</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Thu Apr 04, 2019 2:29 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[sysusr]]></name></author>
		<updated>2019-04-03T22:22:51-04:00</updated>

		<published>2019-04-03T22:22:51-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=107578#p107578</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=107578#p107578"/>
		<title type="html"><![CDATA[Need help with IPinfo Script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=107578#p107578"><![CDATA[
i have a slight inquiry since your last update, you can no longer look up IPv6 addresses <br><br>so i decided to remove the regex that requires numerical digits and it worked just fine<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12661">sysusr</a> — Wed Apr 03, 2019 10:22 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2019-01-28T15:52:18-04:00</updated>

		<published>2019-01-28T14:36:25-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=107382#p107382</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=107382#p107382"/>
		<title type="html"><![CDATA[Need help with IPinfo Script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=107382#p107382"><![CDATA[
Keep this in mind about <strong class="text-strong">ipinfo.io</strong> website:<blockquote class="uncited"><div>If you need to make under 1,000 requests a day to our API and it's for non-commercial use, or you just want to test things out, signup for our free plan.</div></blockquote>meaning that they offer a paid lookup service, so if you do a few of them then I guess that they won't mind, but if you plan to whois every IP that is connecting (meaning a lot of traffic) should consider either getting a paid account or another service, maybe an addon for the IRC server itself.<br><br>Anyway, if whatever you get from:<div class="codebox"><p>Code: </p><pre><code>set hostmask [lindex [split $text] 6]</code></pre></div>isn't a valid IP in the format x.x.x.x this won't work, you would have to reverse DNS to get the actual IP.<br><br>Give this untested code a try:<div class="codebox"><p>Code: </p><pre><code>bind raw - NOTICE server:noticesproc server:notices {from keyword text} {if {[string match -nocase "*client connecting*" $text]} {set hostmask [lindex [split $text] 6]if {![regexp {([0-9]+\.)([0-9]+\.)([0-9]+\.)([0-9]+)} $lookup]} returncatch {set http [::http::geturl http://ipinfo.io/$lookup/json -timeout 6000]} errorset data [::http::data $http]set json [::json::json2dict $data]::http::cleanup $httpset keys [dict keys $json]foreach ele {ip hostname city region country loc postal phone org} {set $ele [expr {[lsearch $keys $ele] &gt; -1 ? [dict get $json $ele] : "n/a"}]}puthelp "PRIVMSG #Opers :$nick -  $ip - $country"}}</code></pre></div>Duno from what position in that raw notice you get the <em class="text-italics">$nick</em> from cos you didn't give me an example so left it as is and it's up to you to fix it.<br><br>Edit: There are multiple paid and free options you should consider if plan to filter every connection. Just do a <em class="text-italics">ip to country database</em> lookup on Google.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Mon Jan 28, 2019 2:36 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Stefano1990]]></name></author>
		<updated>2019-01-28T12:17:41-04:00</updated>

		<published>2019-01-28T12:17:41-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=107380#p107380</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=107380#p107380"/>
		<title type="html"><![CDATA[Script help]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=107380#p107380"><![CDATA[
Can u make this script and to show on connect client Nick IP Country Code and msg connect client on channel #opers <br><br>and to make save blacklist list countrycode on #opers !add blcountry AA | !del blcountry AA | !blcountry list <br><br>if the country code is on blacklist to show only this msg one #oper during client Global connect <br><br>INFO:Client Global Connecting : [G-ZLine] : Jimmy 46.34.57.23 Germany De [BlackCountry] <br><br>to take gzline *@IP 2h: Your Country Is Not Allowed In This Network <br><br>and to make save exemp list on channel #opers !add exemp 46.34.* US | !del exemp 46.34.* US | <br>!exemp list <br><br>if the Ip + country code is on exemp list to show only this msg one #oper during client Global connect <br><br>INFO: Client Global Connecting : Jimmy 46.34.57.23 Germany De <br><br>if the Ip dont have his Country Code on exemp to be gzline <br>same and for the Country Code when dont have his Ip on exemp <blockquote class="uncited"><div><div class="codebox"><p>Code: </p><pre><code>bind raw - NOTICE server:noticesproc server:notices {from keyword text} {  global outputchan      if {[string match -nocase "*client connecting*" $text]} {        set hostmask [lindex [split $text] 6]     puthelp "PRIVMSG #Opers :$nick -  $IP - $country"         return 0      }} </code></pre></div></div></blockquote><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12745">Stefano1990</a> — Mon Jan 28, 2019 12:17 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2019-01-28T03:45:12-04:00</updated>

		<published>2019-01-28T03:45:12-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=107377#p107377</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=107377#p107377"/>
		<title type="html"><![CDATA[Need help with IPinfo Script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=107377#p107377"><![CDATA[
Care to elaborate on what you tried and is complicated? Here is an updated code that validates user input and if the ip is in correct format (for example 1.1.1.1).<div class="codebox"><p>Code: </p><pre><code>package require httppackage require jsonbind pub * !geo fetch:geoproc fetch:geo {nick uhost hand chan text} {if {[scan $text {%s} lookup] != 1} {puthelp "PRIVMSG $chan :Error, syntax is: !geo &lt;ip&gt;"return}if {![regexp {([0-9]+\.)([0-9]+\.)([0-9]+\.)([0-9]+)} $lookup]} {puthelp "PRIVMSG $chan :Error, the IP you mentioned is not valid."return}catch {set http [::http::geturl http://ipinfo.io/$lookup/json -timeout 6000]} errorset data [::http::data $http]set json [::json::json2dict $data]::http::cleanup $httpset keys [dict keys $json]foreach ele {ip hostname city region country loc postal phone org} {set $ele [expr {[lsearch $keys $ele] &gt; -1 ? [dict get $json $ele] : "n/a"}]}puthelp "PRIVMSG $chan :IP: $ip - Hostname: $hostname - City: $city - Region: $region - Country: $country - Location: $loc - Organization: $org"}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Mon Jan 28, 2019 3:45 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Sadie05]]></name></author>
		<updated>2019-01-27T16:46:56-04:00</updated>

		<published>2019-01-27T16:46:56-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=107376#p107376</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=107376#p107376"/>
		<title type="html"><![CDATA[Re: Need help with IPinfo Script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=107376#p107376"><![CDATA[
I tried but It's a little complicated  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_mad.gif" width="15" height="15" alt=":x" title="Mad"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12787">Sadie05</a> — Sun Jan 27, 2019 4:46 pm</p><hr />
]]></content>
	</entry>
	</feed>
