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

	<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>2014-04-18T16:45:54-04:00</updated>

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

		<entry>
		<author><name><![CDATA[SmasHinG]]></name></author>
		<updated>2014-04-18T16:45:54-04:00</updated>

		<published>2014-04-18T16:45:54-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=102749#p102749</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=102749#p102749"/>
		<title type="html"><![CDATA[GEOIP Location]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=102749#p102749"><![CDATA[
if someone can do to set ban to certain city/country  i will be very happy <br>thank you<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11766">SmasHinG</a> — Fri Apr 18, 2014 4:45 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Hero]]></name></author>
		<updated>2013-06-22T17:12:33-04:00</updated>

		<published>2013-06-22T17:12:33-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=101721#p101721</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=101721#p101721"/>
		<title type="html"><![CDATA[GEOIP Location]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=101721#p101721"><![CDATA[
Thanks MadaliN My Issue Resolved Now <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12019">Hero</a> — Sat Jun 22, 2013 5:12 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Hero]]></name></author>
		<updated>2013-06-22T16:08:03-04:00</updated>

		<published>2013-06-22T16:08:03-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=101720#p101720</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=101720#p101720"/>
		<title type="html"><![CDATA[GEOIP Location]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=101720#p101720"><![CDATA[
Hehe Ok No Problem Buddy <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12019">Hero</a> — Sat Jun 22, 2013 4:08 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Madalin]]></name></author>
		<updated>2013-06-22T16:06:12-04:00</updated>

		<published>2013-06-22T16:06:12-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=101719#p101719</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=101719#p101719"/>
		<title type="html"><![CDATA[GEOIP Location]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=101719#p101719"><![CDATA[
I really dont know. There are alot other that are using the same script and noone get that error before. Maybe someone else that will see this post will figure out what is wrong.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6396">Madalin</a> — Sat Jun 22, 2013 4:06 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Hero]]></name></author>
		<updated>2013-06-22T15:56:48-04:00</updated>

		<published>2013-06-22T15:56:48-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=101718#p101718</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=101718#p101718"/>
		<title type="html"><![CDATA[GEOIP Location]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=101718#p101718"><![CDATA[
Same Error!! <br><div class="codebox"><p>Code: </p><pre><code>[00:56:08] Tcl error [geoip:main]: syntax error in expression "[string index $arg 0] in $temp(trigger)": extra tokens at end of expression</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12019">Hero</a> — Sat Jun 22, 2013 3:56 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Madalin]]></name></author>
		<updated>2013-06-22T13:01:47-04:00</updated>

		<published>2013-06-22T13:01:47-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=101717#p101717</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=101717#p101717"/>
		<title type="html"><![CDATA[GEOIP Location]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=101717#p101717"><![CDATA[
I edited my first post .. i copyed the exact code i am using now on my eggdrop and works. Try copy everything again and see if it works<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6396">Madalin</a> — Sat Jun 22, 2013 1:01 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Hero]]></name></author>
		<updated>2013-06-22T10:58:36-04:00</updated>

		<published>2013-06-22T10:58:36-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=101716#p101716</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=101716#p101716"/>
		<title type="html"><![CDATA[GEOIP Location]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=101716#p101716"><![CDATA[
And Server Info Here! But Im Getting Same Error In Both Servers!<br><div class="codebox"><p>Code: </p><pre><code>&lt;X&gt; I am X, running eggdrop v1.6.21: 1 user (mem: 352k).&lt;X&gt; Online for 05:39 (background) - CPU: 00:02 - Cache hit:  0.5%&lt;X&gt; Configured with: &lt;X&gt; Admin: Hero&lt;X&gt; Config file: eggdrop.conf&lt;X&gt; OS: Linux 3.2.0-23-generic&lt;X&gt; Tcl library: /usr/local/lib/tcl8.4&lt;X&gt; Tcl version: 8.4.19 (header version 8.4.19)&lt;X&gt; Socket table: 20/100</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12019">Hero</a> — Sat Jun 22, 2013 10:58 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Hero]]></name></author>
		<updated>2013-06-22T10:51:20-04:00</updated>

		<published>2013-06-22T10:51:20-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=101715#p101715</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=101715#p101715"/>
		<title type="html"><![CDATA[GEOIP Location]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=101715#p101715"><![CDATA[
Check This!<br><div class="codebox"><p>Code: </p><pre><code>&lt;X&gt; I am X, running eggdrop v1.6.21: 1 user (mem: 715k).&lt;X&gt; Online for 05:59 (background) - CPU: 00:01 - Cache hit: 66.3%&lt;X&gt; Configured with: &lt;X&gt; Admin: Hero&lt;X&gt; Config file: eggdrop.conf&lt;X&gt; OS: Linux 2.6.32-5-xen-amd64&lt;X&gt; Tcl library: /usr/share/tcltk/tcl8.5&lt;X&gt; Tcl version: 8.5.8 (header version 8.5.8)&lt;X&gt; Tcl is threaded.&lt;X&gt; Socket table: 20/100</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12019">Hero</a> — Sat Jun 22, 2013 10:51 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Madalin]]></name></author>
		<updated>2013-06-22T06:05:45-04:00</updated>

		<published>2013-06-22T06:05:45-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=101713#p101713</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=101713#p101713"/>
		<title type="html"><![CDATA[GEOIP Location]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=101713#p101713"><![CDATA[
What version of tcl are you using. This can be caused if you are using something lower than tcl8.5. I am not sure but this would be a reason (the problem is i dont have a system with tcl8.4 to test on). Type .status in dcc chat and see what version of tcl you are using then tell me.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6396">Madalin</a> — Sat Jun 22, 2013 6:05 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Hero]]></name></author>
		<updated>2013-06-22T05:20:18-04:00</updated>

		<published>2013-06-22T05:20:18-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=101711#p101711</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=101711#p101711"/>
		<title type="html"><![CDATA[GEOIP Location]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=101711#p101711"><![CDATA[
And Im Getting This Error Too!<br><div class="codebox"><p>Code: </p><pre><code>[14:19:24] Tcl error [geoip:main]: syntax error in expression "[string index $arg 0] in $temp(trigger)": extra tokens at end of expression</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12019">Hero</a> — Sat Jun 22, 2013 5:20 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Hero]]></name></author>
		<updated>2013-06-22T05:11:28-04:00</updated>

		<published>2013-06-22T05:11:28-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=101710#p101710</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=101710#p101710"/>
		<title type="html"><![CDATA[GEOIP Location]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=101710#p101710"><![CDATA[
How To Install tdom???<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12019">Hero</a> — Sat Jun 22, 2013 5:11 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Madalin]]></name></author>
		<updated>2013-06-22T13:00:12-04:00</updated>

		<published>2013-06-16T06:52:27-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=101681#p101681</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=101681#p101681"/>
		<title type="html"><![CDATA[GEOIP Location]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=101681#p101681"><![CDATA[
This a script that keep count of the users who joined your channel (from whtat their country are they and what city). It also has !top commands to display a specified top daily/weekly/monthly/total<br><div class="codebox"><p>Code: </p><pre><code>#### ++++ Author: MadaliN &lt;madalinmen28@yahoo.com&gt;### +++ Website: www.Ascenture.ro## +++ TCL Name: GEOIP Location# +++ Version: 1.0## ++++# Commands:#   !top &lt;country|city&gt; [today/weekly/monthly/total]## IMPORTANT#- You need TDOM installed on your system## NOTES#- It will record every IP (only once) so if the same user will cycle the channel it wont be recorded again#- The .chanset #channel +geoip (dcc chat command) will only deactivate the auto message. The ip recording will still be enabled#########   You need to be atleast VOICE or OP in the channel########bind JOIN - * geoipbind PUBM - * geoip:mainbind TIME - "00 14 * * *" geoip:routinebind TIME - "00 20 * * *" geoip:routinebind TIME - "00 23 * * *" geoip:routineset temp(trigger) {! . `}package require httppackage require tdomsetudef flag geoipproc geoip:main {nick uhost hand chan arg} {global tempif {[string index $arg 0] in $temp(trigger)} {set temp(cmd) [string range $arg 1 end]set temp(cmd) [lindex [split $temp(cmd)] 0]set arg [join [lrange [split $arg] 1 end]]} elseif {[isbotnick [lindex [split $arg] 0]]} {set temp(cmd) [lindex [split $arg] 1]set arg [join [lrange [split $arg] 2 end]]} else { return 0 }if {[info commands geoip:$temp(cmd)] != ""} { geoip:$temp(cmd) $nick $uhost $hand $chan $arg }}proc geoip:top {nick uhost hand chan arg} {global top tempif {[isvoice $nick $chan] || [isop $nick $chan]} {switch -exact -- [lindex [split $arg] 0] {tara -country {switch -exact -- [lindex [split $arg] 1] {today { geoip:parse country today $chan $nick }weekly { geoip:parse country weekly $chan $nick }monthly { geoip:parse country monthly $chan $nick }anually { geoip:parse country anually $chan $nick }total { geoip:parse country total $chan $nick }default { geoip:parse country total $chan $nick }}}oras -city {switch -exact -- [lindex [split $arg] 1] {today { geoip:parse city today $chan $nick }weekly { geoip:parse city weekly $chan $nick }monthly { geoip:parse city monthly $chan $nick }anually { geoip:parse city anually $chan $nick }total { geoip:parse city total $chan $nick }default { geoip:parse city total $chan $nick }}}}}}proc geoip:parse {{one ""} {two ""} {three ""} {four ""}} {global top tempswitch -exact -- $two {today { set temp(type) 0 }weekly { set temp(type 1 }monthly { set temp(type) 2 }anually { set temp(type) 3}total { set temp(type) 4 }default { set temp(type) 4 }}switch -exact -- $one {country {set temp(list) ""; set temp(tdisplay) ""foreach n [array names top $three,$one,*] { lappend temp(list) "[list [lindex [split $n ,] 2] [lindex [split $top($n)] $temp(type)]]" }set temp(list) [lsort -integer -decreasing -index 1 $temp(list)]set place 0foreach x $temp(list) {incr placeset country [join [lrange $x 0 0]]set times [join [lrange $x 1 1]]if {$country != "" &amp;&amp; $times != ""} {lappend temp(tdisplay) "\00312\002#$place\002 \00304$country \00310$times\003"}}set temp(td) [join [lrange $temp(tdisplay) 0 9]]if {$temp(td) == ""} { putserv "PRIVMSG $three :\002$four\002 - There are no informations yet, please try again later."; return }putserv "PRIVMSG $three :\002$four\002 - TOP $one: $two = $temp(td)"}city {set temp(list) ""set temp(tdisplay) ""foreach n [array names top $three,$one,*] {lappend temp(list) "[list [lindex [split $n ,] 2] [lindex [split $top($n)] 4] [lindex [split $top($n)] 5]]"}set temp(list) [lsort -integer -decreasing -index 1 $temp(list)]set place 0foreach x $temp(list) {incr placeset country [join [lrange $x 0 0]]set times [join [lrange $x 1 1]]set code [join [lrange $x 2 2]]if {$country != "" &amp;&amp; $times != "" &amp;&amp; $code != ""} {lappend temp(tdisplay) "\00312\002#$place\002 \00304$country\003 (\00312$code\003) \00310$times\003"}}set temp(td) [join [lrange $temp(tdisplay) 0 9]]if {$temp(td) == ""} { putserv "PRIVMSG $three :\002$four\002 - There are no informations yet, please try again later."; return }putserv "PRIVMSG $three :\002$four\002 - TOP $one: $two = $temp(td)"}}}proc geoip {nick uhost hand chan} {global top temp ignoreitif {[isbotnick $nick]} { return }if {[string match -nocase *users* [lindex [split $uhost @] 1]]} { return }if {[info exists ignoreit($chan,[lindex [split $uhost @] 1])]} { return }if {![info exists ignoreit($chan,[lindex [split $uhost @] 1])]} { set ignoreit($chan,[lindex [split $uhost @] 1]) "[unixtime]"; geoip:save }set token [http::config -useragent Mozilla]set token [http::geturl "http://freegeoip.net/xml/[lindex [split $uhost @] 1]"]set data [::http::data $token]::http::cleanup $tokenset XML $dataset doc [dom parse $XML]set root [$doc documentElement]set country [$root selectNodes CountryName]set country [$country asText]set code [$root selectNodes CountryCode]set code [$code asText]set city [$root selectNodes City]set city [$city asText]if {$country == "" || $code == "" || $city == ""} { return }if {![info exists top($chan,country,$country)]} { set top($chan,country,$country) "1 1 1 1 1 $nick [lindex [split $uhost @] 1] [unixtime]"; geoip:save } else { set top($chan,country,$country) "[expr [lindex [split $top($chan,country,$country)] 0] +1] [expr [lindex [split $top($chan,country,$country)] 1] +1] [expr [lindex [split $top($chan,country,$country)] 2] +1] [expr [lindex [split $top($chan,country,$country)] 3] +1] [expr [lindex [split $top($chan,country,$country)] 4] +1] $nick [lindex [split $uhost @] 1] [unixtime]"; geoip:save }if {![info exists top($chan,city,$city)]} { set top($chan,city,$city) "1 1 1 1 1 $code $nick [lindex [split $uhost @] 1] [unixtime]"; geoip:save } else { set top($chan,city,$city) "[expr [lindex [split $top($chan,city,$city)] 0] +1] [expr [lindex [split $top($chan,city,$city))] 1] +1] [expr [lindex [split $top($chan,city,$city))] 2] +1] [expr [lindex [split $top($chan,city,$city)] 3] +1] [expr [lindex [split $top($chan,city,$city)] 4] +1] $code $nick [lindex [split $uhost @] 1] [unixtime]"; geoip:save }}proc geoip:check {what chan} {global topswitch -exact -- $what {tara -country {set temp(list) ""set temp(tdisplay) ""foreach n [array names top $chan,country,*] { lappend temp(list) "[list [lindex [split $n ,] 2] [lindex [split $top($n)] 4]]" }set temp(list) [lsort -integer -decreasing -index 1 $temp(list)]foreach x $temp(list) { return "[lindex [split $x] 0]" }}oras -city {set temp(list) ""set temp(tdisplay) ""foreach n [array names top $chan,city,*] { lappend temp(list) "[list [lindex [split $n ,] 2] [lindex [split $top($n)] 4]]" }set temp(list) [lsort -integer -decreasing -index 1 $temp(list)]foreach x $temp(list) { return "[lindex [split $x] 0]" }}ccountry { set nr 0; foreach n [array names top $chan,country,*] { incr nr }; return $nr }ccity { set nr 0; foreach n [array names top $chan,city,*] { incr nr }; return $nr }}}proc geoip:routine {min hour day month year} {foreach n [channels] {if {[channel get $n geoip]} {if {[geoip:check ccountry $n] == 0} { return }putserv "PRIVMSG $n :The most active users who visited \002$n\002 are from country \00312[geoip:check country $n]\003 and city \00304[geoip:check city $n]\003 accumulating a total of \00305[geoip:check ccountry $n]\003 countries and \00305[geoip:check ccity $n]\003 cities that have visited this channel so far."}}}proc geoip:save {} {global top ignoreitset nfw [open geoip w]puts $nfw "array set top [list [array get top]]"puts $nfw "array set ignoreit [list [array get ignoreit]]"close $nfw}catch {source geoip}putlog "++ Succesfully loaded: \00312GEOIP Location"</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6396">Madalin</a> — Sun Jun 16, 2013 6:52 am</p><hr />
]]></content>
	</entry>
	</feed>
