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

	<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>2017-03-09T20:57:25-04:00</updated>

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

		<entry>
		<author><name><![CDATA[Arnold_X-P]]></name></author>
		<updated>2017-03-09T20:57:25-04:00</updated>

		<published>2017-03-09T20:57:25-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=105878#p105878</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=105878#p105878"/>
		<title type="html"><![CDATA[error in Whereis IP tcl by speechles]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=105878#p105878"><![CDATA[
[20:49] &lt;lsis&gt; .ip ca3.shell.xshellz.com<br>[20:49] &lt;@Kantuta&gt; Host of the ip: ca3.shell.xshellz.com; Host ip: 158.69.187.140; Country code: CA; Country: Canada; State: Quebec; City: ; Ip postcode: H3G; Latitude: 45.5000; Longitude: -73.5833<br>[20:49] &lt;@Kantuta&gt; Isp of this ip: OVH Hosting; Organization: OVH Hosting; Local time in canada: 2017-03-09 19:49; <span style="color:red">Share this info on your favorite networks! &lt;div id="fb-root"&gt;&lt;/div&gt;&lt;fb:like-box href="<a href="https://www.facebook.com/pages/IP-Adresscom/175230309216901" class="postlink">https://www.facebook.com/pages/IP-Adres ... 0309216901</a>" width="160" show_faces="false" border_color="" stream="false" header="false"&gt;&lt;/fb:like-box&gt;</span><br><div class="codebox"><p>Code: </p><pre><code> # Whereis IP geolocation scrape script (v1.6)# by speechles - Proof-of-concept # :: March 14th, 2010# -- Cookies / Referer / 302 Redirects ---# http://ereader.kiczek.com/ereader/scripts/## MAKE SURE TO: .chanset #yourchan +whereis # This script will not function in your channel# until you've done this...## --&gt; http://www.ip-adress.com/ip_tracer/# Scrapes the url above and generates relevant# information to display onto irc. fully# configurable, allows members to login, has# full error handlers, redirects, cookies,# and super action rocket missles.## * v1.6 - added: Html element transcoding#          support.# * v1.5 - added: Skip advertisement#          in middle of redirects, now works#          as did before. Enjoy ;)# * v1.4 - added: Multiple Accounts:#          Script can now use as many#          accounts as you want, and it or#          you can easily manage their use.#          added: Http post requests:#          along with post requests and 302#          traversals required for logging in#          it is now also required for fetching#          requests when logged in as well.# * v1.3 - added: EatForFree config option:#          Script will wait until free#          quota has been used up before#          attempting to login to account.# * v1.2 - auto-login mechanism added:#          detects over quota useage on#          free mode and will auto login#          and detect remaining and daily#          totals. quite effective. ;)# * v1.1 - login mechanism added: #        - uses cookies/referer/redirection# * v1.0 - first release## -- by speechles (via egghelp.org forums)# -- if you like this script donate to slennox. ;P### fully commented, want to know how something works?### every line explains it's purpose, just read comments### --&gt; CONFIG start# This will allow you to customize your output.# To see everything, only put "*" in the list below.# Otherwise, put the tags you wish to see in the list# and keep in mind the order you use is the order# they will appear during output.# Wildcards are acceptable, this is done using [string match]# Case is irrelevant, we are using -nocase.# - example below:# variable whereisFilter [list "*city:" "*state:" "*country:" "*isp*"]# this would show the city, state, country and isp of the user.# ---variable whereisFilter [list "*"]# Set your theme here, use colors whatever you want# using the 4 variables found immediately below:# What symbols/text should seperate your output?# --- 1variable whereisDivider "; "# How would you like your output to be rendered?# There are two fields to each entry, Name and Value.# You can put spaces, color, and other things here# and they will be prefixed to the name and value# when displayed.# --- 2 3 4variable whereisPrefix "" variable whereisName ""variable whereisValue " \002"# If you have an account you can set details# for it below, and the script will login# and use this info for requests.# - !wlogin and !wlogout control this feature.# - must be owner or master to use either.# If you don't want to use this feature# set whereisAlwaysLogin to 0.# # NOTE: You can still set whereisAlwaysLogin# to zero, and manually use !wlogin and# !wlogout to manage the scripts use of your# account as well...as well as using# !wauto to turn this on and off at whim.# ---variable whereisAlwaysLogin 1# set your accounts up here# the method is simple# "your-email@site.com:password-goes-here"# add as many as you like, the script will# cycle through them, or you can using# !wnext and !wprev# ---variable whereisAccounts {variable whereisAccounts {  "xp5mauraco366w@gmail.com:2bC1Tqrd9Bfd"}}# If you want to use all the free quota of# usage before letting the bot automatically# use your account, see this option below to 1.# ---variable whereisEatForFree 1# --&lt; CONFIG end# setup our bindsbind pub -|- !ip whereisbind pub -|- .ip whereisbind pub -|- ¡ip whereisbind pub mn|mn !wAuto whereisAutobind pub mn|mn !wlogin whereisLoginbind pub mn|mn !wLogout whereisLogoutbind pub mn|mn !wStatus whereisStatusbind pub mn|mn !wNext whereisNextbind pub mn|mn !wPrev whereisNext# setup our flagsetudef flag whereis# we require http package commandspackage require http# initialize states only if they# are empty. otherwise carry# over states already known, the# user can use !wlogout or !wlogin# if this is ever incorrect.if {![info exists whereisLogged]} {  set whereisLogged 0}if {![info exists whereisCookies]} {  set whereisCookies ""}if {![info exists whereisDaily]} {  set whereisDaily 0}if {![info exists whereisRemain]} {  set whereisRemain 0}if {![info exists whereisLogin]} {  set whereisLogin 0}if {![info exists whereisAccPos]} {  set whereisAccPos 0}proc whereisNext {nick uhost hand chan text} {  # flag  if {![channel get $chan whereis]} { return }  # was this an automated request?  if {[string equal "auto" $text]} {    # yes, automated is always next    set lb "!wNext"  } else {    # no, then read our last bind    set lb $::lastbind  }  # decide which direction to go.  switch -- $lb {    # Move down the account list    "!wPrev" { incr ::whereisAccPos -1               if {$::whereisAccPos &lt; 0} {                 set ::whereisAccPos [expr {[llength $::whereisAccounts] -1}]               }               set w "Previous"             }    # Move up the account list    "!wNext" { incr ::whereisAccPos 1               if {[expr {$::whereisAccPos +1}] &gt; [llength $::whereisAccounts]} {                 set ::whereisAccPos 0               }               set w "Next"             }  }  # find accout we are positioned on  set acctInfo [split [lindex $::whereisAccounts $::whereisAccPos] :]  # email  set e [lindex $acctInfo 0]  # message channel we found the account  putserv "privmsg $chan :\002Whereis\002: $w Account ([expr {$::whereisAccPos + 1}]/[llength $::whereisAccounts]) $e"  # login  whereisLogin $nick $uhost $hand $chan $text}proc whereisAuto {nick uhost hand chan text} {  # flag  if {![channel get $chan whereis]} { return }  # invert value of always login config option  # this uses binary and, will cycle between 0 and 1  # this does not overwrite the value, a .rehash  # or .restart will return the original value.  set ::whereisAlwaysLogin [expr {[incr ::whereisAlwaysLogin] % 2}]  # is the present value 1?  if {$::whereisAlwaysLogin &gt; 0} {    # yes - it's on    putserv "privmsg $chan :\002Whereis\002: Enabled automatic account login."  } else {    # no - it's off    putserv "privmsg $chan :\002Whereis\002: Disabled automatic account login."  }}proc whereisStatus {nick uhost hand chan text} {  # flag  if {![channel get $chan whereis]} { return }  # set account length count empty until needed  set l ""  # are we supposed to be logged in?  if {$::whereisAlwaysLogin &gt; 0} {    if {$::whereisLogin &gt; 0} {      # yes, are we logged in?      if {$::whereisLogged &gt; 0} {        # yes, find account we are positioned on        set acctInfo [split [lindex $::whereisAccounts $::whereisAccPos] :]        # email        set e [lindex $acctInfo 0]        # length of accounts list        set l "([expr {$::whereisAccPos + 1}]/[llength $::whereisAccounts]) "        # are we a gold member?        if {![string equal "999" $::whereisDaily]} {          # no, display normal account info          putserv "privmsg $chan :\002Whereis\002: Always login; Logged in; Account ${l}($e; DailyLimit: \002$::whereisDaily\002 with \002$::whereisRemain\002 remaining.)"        } else {          # yes, display we are gold          putserv "privmsg $chan :\002Whereis\002: Always login; Logged in; Account ${l}($e; Gold Member)"        }      } else {        # no, spam that we aren't and we're in free mode        putserv "privmsg $chan :\002Whereis\002: Account $l; Always login; Logged out; Free mode."      }    } else {      # we haven't used the command or logged in yet.      # are we eating for free?      if {$::whereisEatForFree &gt; 0} {        # yes, display that we are        putserv "privmsg $chan :\002Whereis\002: ${l}Always login; Eating for free; Free mode."      } else {        # no display that we are waiting to login instead        putserv "privmsg $chan :\002Whereis\002: ${l}Always login; Waiting for login; Free mode."      }    }  } else {    # we are set to not login, so display this    if {$::whereisLogged &gt; 0} {      # yes, find account we are positioned on      set acctInfo [split [lindex $::whereisAccounts $::whereisAccPos] :]      # email      set e [lindex $acctInfo 0]      # length of accounts list      set l "([expr {$::whereisAccPos + 1}]/[llength $::whereisAccounts]) "      # are we a gold member?      if {![string equal "999" $::whereisDaily]} {        # no, display normal account info        putserv "privmsg $chan :\002Whereis\002: Never login; Logged in; Account ${l}($e; DailyLimit: \002$::whereisDaily\002 with \002$::whereisRemain\002 remaining.)"      } else {        # yes, display we are gold        putserv "privmsg $chan :\002Whereis\002: Never login; Logged in; Account ${l}($e; Gold Member)"      }    } else {      putserv "privmsg $chan :\002Whereis\002: Never login; Logged out; Free mode."    }  }}proc whereisLogout {nick uhost hand chan text} {   # flag   if {![channel get $chan whereis]} { return }   # are we even logged in?   if {$::whereisLogged &gt; 0} {     # yes, which accout are we logging out of?     set acctInfo [split [lindex $::whereisAccounts $::whereisAccPos] :]     set e [lindex $acctInfo 0]     # we are now logged out     putserv "privmsg $chan :\002Whereis\002: Logout Successful! Accout ([expr {$::whereisAccPos + 1}]/[llength $::whereisAccounts]) $e"   } else {     # we were never logged in, we didnt need to logout     putserv "privmsg $chan :\002Whereis\002: Logout Successful! Never logged in..."   }   # initialize states and erase any stored cookies.   set ::whereisLogin 0   set ::whereisLogged 0   set ::whereisCookies ""   set ::whereisDaily 0   set ::whereisRemain 0}proc whereisLogin {nick uhost hand chan text} {   # flag   if {![channel get $chan whereis]} { return }   # set state that we want to be logged in   set ::whereisLogin 1   # set url   set url "http://www.ip-adress.com/login/"   # determine which account we are positioned on   set acctInfo [split [lindex $::whereisAccounts $::whereisAccPos] :]   # email   set e [lindex $acctInfo 0]   # password   set p [lindex $acctInfo 1]   # set query   set query "login=$e&amp;password=$p&amp;submit=login&amp;remember=1"   # set referer   set ref "$url?$query"   # user agent   ::http::config -useragent "Mozilla/5.0 ; Gecko"   # get url using post method   catch { set http [::http::geturl $url -query $query -timeout 10000] } error   # error condition 1: invalid http session   if {![string match -nocase "::http::*" $error]} {      putserv "privmsg $chan :\002Whereis\002: Login Failed: [string totitle $error] \( $url \)"      set ::whereisLogged 0      return 0   }   # error condition 2: http error   if {![string equal -nocase [::http::status $http] "ok"]} {      putserv "privmsg $chan :\002Whereis\002: Login Failed: [string totitle [::http::status $http]] \( $url \)"      set ::whereisLogged 0      return 0   }   # initialize url and redirect counters   set r 0 ; set url $ref   # clear cookies   set ::whereisCookies [list]   # reassociate variables   upvar #0 $http state   # iterate through the meta array   foreach {name value} $state(meta) {     # do we have cookies?                                                                                                                                                                                  if {[string equal -nocase $name "Set-Cookie"]} {       # yes, add them to cookie list                                                                                                                                                                                 lappend ::whereisCookies [lindex [split $value ;] 0]                                                                                                                                                                  }                                                                                                                                                                                                                }   # store http code into redirect   set redir [::http::ncode $http]   # is this really a redirect?   while {[string match "*${redir}*" "303|302|301" ]} {     # yes, iterate through the meta array     foreach {name value} $state(meta) {       # do we have a location to reference       if {[regexp -nocase ^location$ $name]} {         # yes, check if it's a partial uri         if {![string match "http*" $value]} {           # does it start with a slash?           if {![string match "/" [string index $value 0]]} {             # no, then we need to add that manually             set value "[join [lrange [split $url "/"] 0 2] "/"]/$value"           } else {             # yes, then we can concat this to our primary url/             set value "[join [lrange [split $url "/"] 0 2] "/"]$value"           }         }         # check if redirects to self causing endless redirecting         if {[string match [string map {" " "%20"} $value] $url]} { putserv "privmsg $chan :\002Whereis\002: redirect error (self to self)\( $url \)" ; return }         # get url with cookies and referer         catch {set http [::http::geturl "[string map {" " "%20"} $value]" -query $query -headers [list Referer $ref Cookie [join $::whereisCookies {;}]] -timeout [expr 1000 * 10]]} error         # cache url for looping while         set url [string map {" " "%20"} $value]         # error condition 1: invalid http session         if {![string match -nocase "::http::*" $error]} {            putserv "privmsg $chan :\002Whereis\002: Login Failed: [string totitle $error] \( $value \)"            set ::whereisLogged 0            return 0         }         # error condition 2: http error         if {![string equal -nocase [::http::status $http] "ok"]} {            putserv "privmsg $chan :\002Whereis\002: Login Failed: [string totitle [::http::status $http]] \( $url \)"            set ::whereisLogged 0            return 0         }         # cache http code for looping while         set redir [::http::ncode $http]         # reassociate variables         upvar #0 $http state         # keep traversals to 10 or less         if {[incr r] &gt; 10} { putserv "privmsg $chan :\002Whereis\002: redirect error (&gt;10 too deep) \( $url \)" ; return }       }     }    }   # get data, to check if we are logged in or not   set html [::http::data $http]   # copy the html to a file here, this may be a stupid ad.   # Need to do this so users can give the html for the   # GOLD MEMBER and other accounts..         set c [open "whereis-tcl.html" w]   puts $c $html   close $c   # bypass the stupid ad trying to get you to become a pay member....   if {[regexp -nocase {\"/member/\"&gt;} $html]} {     catch {set http [::http::geturl "http://www.ip-adress.com/member/" -headers [list Referer [string map {" " "%20"} $value] Cookie [join $::whereisCookies {;}]] -timeout [expr 1000 * 10]]} error     # cache url for looping while     # error condition 1: invalid http session     if {![string match -nocase "::http::*" $error]} {        putserv "privmsg $chan :\002Whereis\002: Login Failed: [string totitle $error] \( http://www.ip-adress.com/member \)"        set ::whereisLogged 0        return 0     }     # error condition 2: http error     if {![string equal -nocase [::http::status $http] "ok"]} {        putserv "privmsg $chan :\002Whereis\002: Login Failed: [string totitle [::http::status $http]] \( http://www.ip-adress.com/member \)"        set ::whereisLogged 0        return 0     }     # get html     set html [::http::data $http]   }   # cleanup http token   ::http::cleanup $http   # cleanse html of problematic undisplayable characters   regsub -all {(?:\n|\t|\v|\r|\x01)} $html " " html   # check that 'login failed' isn't within the html   if {![string match -nocase "*login failed*" $html]} {      # wasn't found, we must be logged in. ;)     # do we have any quota left?     if {![regexp -nocase {&lt;div class="row2"&gt;.*?&lt;span class="limit.*?&gt;(.*?)&lt;/span.*?&lt;span class="limit.*?&gt;(.*?)&lt;/span.*?&lt;span class="limit.*?&gt;(.*?)&lt;/span&gt;&lt;br&gt;} $html - daily remain extra]} {       # no, are we a gold member account?       if {![regexp -nocase {Gold Member&lt;br&gt;} $html]} {         # no, we should message we are exceeded...         putserv "privmsg $chan :\002Whereis\002: Account quota appears to have been exceeded..."         # then we should logout         set lf [whereisLogout $nick $uhost $hand $chan $text]         # and return 0 to indicate logged out         return 0       } else {         # yes, we are a gold member, set some fake variables         set daily 999 ; set remain 999 ; set extra 0       }     }     # yes, set state as logged in     set ::whereisLogged 1     # track daily amount allowed     set ::whereisDaily $daily     # track remaining amount     set ::whereisRemain [expr {$remain + $extra}]     # are we a gold member?     if {![string equal "999" $daily]} {       # no, display normal account information       putserv "privmsg $chan :\002Whereis\002: Login Successful! Account ([expr {$::whereisAccPos + 1}]/[llength $::whereisAccounts]) ($e; DailyLimit: \002$daily\002 with \002$::whereisRemain\002 remaining.)"     } else {       # yes, display we are gold       putserv "privmsg $chan :\002Whereis\002: Login Successful! Account ([expr {$::whereisAccPos + 1}]/[llength $::whereisAccounts]) ($e; Gold Member)"     }     # return 1 to indicate login was successful. ;D     return 1   } else {     # was found, we aren't logged in. ;(     putserv "privmsg $chan :\002Whereis\002: Login Failed! Account ([expr {$::whereisAccPos + 1}]/[llength $::whereisAccounts]) $e"     # set state that we aren't logged in     set ::whereisLogged 0     # move to next account, is there a next account?     if {[expr {$::whereisAccPos +1}] == [llength $::whereisAccounts] &amp;&amp; [llength $::whereisAccounts] &gt; 1} {       # no then logout we can't login, and no more accounts to cycle       # reset account position       set ::whereisAccPos 0       # message channel we reached last account and failed to login       putserv "privmsg $chan :\002Whereis\002: Out of Next Accounts..."       # logout       whereisLogout $nick $uhost $hand $chan $text       # return 0 to indicate we couldn't login.       return 0     } else {       # move to next account using auto       whereisNext $nick $uhost $hand $chan "auto"     }   }}# html element transcoderproc whereisDecode {text char} {   # if nothing to transcode return text   if {![string match *&amp;* $text]} {return $text}   # html entity map   set escapes {  \xa0 ¡ \xa1 ¢ \xa2 £ \xa3 ¤ \xa4¥ \xa5 ¦ \xa6 § \xa7 ¨ \xa8 © \xa9ª \xaa « \xab ¬ \xac ­ \xad ® \xae¯ \xaf ° \xb0 ± \xb1 ² \xb2 ³ \xb3´ \xb4 µ \xb5 ¶ \xb6 · \xb7 ¸ \xb8¹ \xb9 º \xba » \xbb ¼ \xbc ½ \xbd¾ \xbe ¿ \xbf À \xc0 Á \xc1 Â \xc2Ã \xc3 Ä \xc4 Å \xc5 Æ \xc6 Ç \xc7È \xc8 É \xc9 Ê \xca Ë \xcb Ì \xccÍ \xcd Î \xce Ï \xcf Ð \xd0 Ñ \xd1Ò \xd2 Ó \xd3 Ô \xd4 Õ \xd5 Ö \xd6× \xd7 Ø \xd8 Ù \xd9 Ú \xda Û \xdbÜ \xdc Ý \xdd Þ \xde ß \xdf à \xe0á \xe1 â \xe2 ã \xe3 ä \xe4 å \xe5æ \xe6 ç \xe7 è \xe8 é \xe9 ê \xeaë \xeb ì \xec í \xed î \xee ï \xefð \xf0 ñ \xf1 ò \xf2 ó \xf3 ô \xf4õ \xf5 ö \xf6 ÷ \xf7 ø \xf8 ù \xf9ú \xfa û \xfb ü \xfc ý \xfd þ \xfeÿ \xff ƒ \u192 Α \u391 Β \u392 Γ \u393 Δ \u394Ε \u395 Ζ \u396 Η \u397 Θ \u398 Ι \u399Κ \u39A Λ \u39B Μ \u39C Ν \u39D Ξ \u39EΟ \u39F Π \u3A0 Ρ \u3A1 Σ \u3A3 Τ \u3A4Υ \u3A5 Φ \u3A6 Χ \u3A7 Ψ \u3A8 Ω \u3A9α \u3B1 β \u3B2 γ \u3B3 δ \u3B4 ε \u3B5ζ \u3B6 η \u3B7 θ \u3B8 ι \u3B9 κ \u3BAλ \u3BB μ \u3BC ν \u3BD ξ \u3BE ο \u3BFπ \u3C0 ρ \u3C1 ς \u3C2 σ \u3C3 τ \u3C4υ \u3C5 φ \u3C6 χ \u3C7 ψ \u3C8 ω \u3C9ϑ \u3D1 ϒ \u3D2 ϖ \u3D6 • \u2022… \u2026 ′ \u2032 ″ \u2033 ‾ \u203E⁄ \u2044 ℘ \u2118 ℑ \u2111 ℜ \u211C™ \u2122 ℵ \u2135 ← \u2190 ↑ \u2191→ \u2192 ↓ \u2193 ↔ \u2194 ↵ \u21B5⇐ \u21D0 ⇑ \u21D1 ⇒ \u21D2 ⇓ \u21D3 ⇔ \u21D4∀ \u2200 ∂ \u2202 ∃ \u2203 ∅ \u2205∇ \u2207 ∈ \u2208 ∉ \u2209 ∋ \u220B ∏ \u220F∑ \u2211 − \u2212 ∗ \u2217 √ \u221A∝ \u221D ∞ \u221E ∠ \u2220 ∧ \u2227 ∨ \u2228∩ \u2229 ∪ \u222A ∫ \u222B ∴ \u2234 ∼ \u223C≅ \u2245 ≈ \u2248 ≠ \u2260 ≡ \u2261 ≤ \u2264≥ \u2265 ⊂ \u2282 ⊃ \u2283 ⊄ \u2284 ⊆ \u2286⊇ \u2287 ⊕ \u2295 ⊗ \u2297 ⊥ \u22A5⋅ \u22C5 ⌈ \u2308 ⌉ \u2309 ⌊ \u230A⌋ \u230B 〈 \u2329 〉 \u232A ◊ \u25CA♠ \u2660 ♣ \u2663 ♥ \u2665 ♦ \u2666" \x22 &amp; \x26 &lt; \x3C &gt; \x3E O&amp;Elig; \u152 œ \u153Š \u160 š \u161 Ÿ \u178 ˆ \u2C6˜ \u2DC   \u2002   \u2003   \u2009‌ \u200C ‍ \u200D ‎ \u200E ‏ \u200F – \u2013— \u2014 ‘ \u2018 ’ \u2019 ‚ \u201A“ \u201C ” \u201D „ \u201E † \u2020‡ \u2021 ‰ \u2030 ‹ \u2039 › \u203A€ \u20AC &amp;apos; \u0027 ‎ "" ‏ "" ‬ "" ‭ ""‮ "" — \u2014   };  # convertfrom encoding...  if {![string equal $char [encoding system]]} { set text [encoding convertfrom $char $text] }  # convert html entities and sanitize string for subst  set text [string map [list "\]" "\\\]" "\[" "\\\[" "\$" "\\\$" "\\" "\\\\"] [string map $escapes $text]]  # map remaining entities  regsub -all -- {&amp;#([[:digit:]]{1,5});} $text {[format %c [string trimleft "\1" "0"]]} text  regsub -all -- {&amp;#x([[:xdigit:]]{1,4});} $text {[format %c [scan "\1" %x]]} text  regsub -all -- {\\x([[:xdigit:]]{1,2})} $text {[format %c [scan "\1" %x]]} text  # apply transcoding  set text [subst "$text"]  # convertto encoding...  if {![string equal $char [encoding system]]} { set text [encoding convertto $char $text] }  # return transcoded text  return $text}proc whereis {nick uhost hand chan text {maxed 0}} {   # flag   if {![channel get $chan whereis]} { return }   # resolve nicknames to their irc hostmasks   # this won't work correctly for cloaked (+x) users   if {![string match "*.*" $text]} {      set wnick [lindex [split [getchanhost [lindex [split $text] 0] $chan] @] 1]      if {[string length $wnick]} { set text $wnick }   }   # useragent   ::http::config -useragent "Mozilla/5.0 ; Gecko"   # did we want to be logged in?   if {(($::whereisLogin &gt; 0 || $::whereisAlwaysLogin &gt; 0) &amp;&amp; $::whereisRemain &gt; -1 &amp;&amp; ($::whereisEatForFree &lt;1 || $maxed == 1)) || $::whereisLogged &gt; 0} {     # yes, are we logged in already?     if {$::whereisLogged == 0} {       # no, attempt to login       set lf [whereisLogin $nick $uhost $hand $chan $text]     }     # if we run out of remaining queries and we are logged in     # let's say so, and logout for the query instead.     if {$::whereisLogged &gt; 0 &amp;&amp; [incr ::whereisRemain -1] &lt; 0} {       putserv "privmsg $chan :\002Whereis\002: Quota of $::whereisDaily exceed..."       set junk [whereisLogout $nick $uhost $hand $chan $text]     }     # set query line up for out post below     set query [http::formatQuery "QRY" $text "lookup" 1 "submit" "IP Address or Host Lookup"]     # post query, with error handler, cookies and referer used. This is logged in.     catch { set http [::http::geturl "http://www.ip-adress.com/ip_tracer/" -query $query -headers [list referer "http://www.ip-adress.com/ip_tracer/" Cookie [join $::whereisCookies]] -timeout 10000 ] } error   } else {     # geturl, with error handler, no cookies or referer used. This is not logged in.     catch { set http [::http::geturl "http://www.ip-adress.com/ip_tracer/$text" -timeout 10000 ] } error   }   # associate the state array   upvar #0 $http state   # error condition 1: invalid http session   if {![string match -nocase "::http::*" $error]} {      putserv "privmsg $chan :\002Whereis\002: [string totitle $error] \( http://www.ip-adress.com/ip_tracer/$text \)"      return 0   }   # error condition 2: http error   if {![string equal -nocase [::http::status $http] "ok"]} {      putserv "privmsg $chan :\002Whereis\002: [string totitle [::http::status $http]] \( http://www.ip-adress.com/ip_tracer/$text \)"      return 0   }   # logged in now uses a redirected catch after supplying required php session cookie   # are we redirected?   if {[string match "*[::http::ncode $http]*" "303|302|301" ]} {     # yes, associate the state array     upvar #0 $http state     # iterate the state meta array     foreach {name value} $state(meta) {       # do we have a location field?       if {[regexp -nocase ^location$ $name]} {         # yes, traverse to it         if {![string match "http*" $value]} {           # does it start with a slash?           if {![string match "/" [string index $value 0]]} {             # no, then we need to add that manually             set value "http://www.ip-adress.com/$value"           } else {             # yes, then we can concat this to our primary url/             set value "http://www.ip-adress.com$value"           }         }         catch {set http [::http::geturl "$value" -headers [list Referer "http://www.ip-adress.com/ip_tracer/" Cookie [join $::whereisCookies]] -timeout [expr 1000 * 10]]} error         # error condition 1: invalid http session         if {![string match -nocase "::http::*" $error]} {           putserv "privmsg $chan :\002Whereis\002: [string totitle $error] \( http://www.ip-adress.com/ip_tracer/$text \)"           return 0         }         # error condition 2: http error         if {![string equal -nocase [::http::status $http] "ok"]} {           putserv "privmsg $chan :\002Whereis\002: [string totitle [::http::status $http]] \( http://www.ip-adress.com/ip_tracer/$text \)"           return 0         }       }     }   }   # get html data, decoding any html elements to real characters.   set data [whereisDecode [::http::data $http] $state(charset)]   # cleanup http token   ::http::cleanup $http   # cleanse html for parsing   regsub -all {\[&lt;.*?&gt;\]} $data "" data   regsub -all "&lt;script.*?&gt;.*?&lt;/script&gt;" $data "" data   regsub -all "&lt;a href.*?&lt;/a&gt;" $data "" data   regsub -all "&lt;img src=.*?&gt;" $data "" data   regsub -all {(?:\n|\t|\v|\r|&lt;/span&gt;)} $data "" data   regsub -all {&lt;span.*?&gt;} $data "" data   # can we retrieve table fields?   while {[regexp -nocase -- {&lt;th&gt;(.*?)&lt;/th&gt;.*?&lt;td&gt;(.*?)&lt;/td&gt;} $data -&gt; type attrib]} {      # yes, add them to variables and partially cleanse them.      set type [string map {"::" ":"} [string totitle [string trim [string map -nocase {"ip country code" "country code" "ip country" "country" "ip state" "state" "ip city" "city" "ip latitude" "latitude" "ip longitude" "longitude" " :" ":"} [string map -nocase {"ip address" "ip" " :" ":"} $type]]]]]      # remove all excess spacing      while {[string match "*  *" $type]} { regsub -all -- {  } $type " " type }      # is this our own ip?      if {[string match -nocase "my *" $type] &amp;&amp; ![info exists own]} {        # yes, these are free. increment our count back up        incr ::whereisRemain 1        # flag so we only do this once        set own 0      }      # are we over quota?      if {![string length [string trim $attrib]]} {        # yes, is this the free account?        if {$::whereisAlwaysLogin &gt; 0 &amp;&amp; $::whereisLogged &lt; 1} {          # yes, have we done this yet?          if {![info exists doneit]} {            # no, message channel we exceeded quota and attempt to login            putserv "privmsg $chan :\002Whereis\002: Free quota has been exceeded..."            # set flag so we don't do this again            set doneit 0            # attempt to login            whereisLogin $nick $uhost $hand $chan $text            # was the login successful?            if {$::whereisLogged &gt; 0} {              # yes, retry logged in              whereis $nick $uhost $hand $chan $text 1              # we don't want to nest the recursion so return              return            } else {              # disable automatic login, we can't login.              whereisAuto $nick $uhost $hand $chan $text              # set account position to first entry.              set ::whereisAccPos 0            }          }        }      }      # add variables to output list      lappend output "[string totitle [string trim $type]]|[string trim $attrib]"      # remove scraped table fields for looping while      regsub -nocase -- {&lt;th&gt;.*?&lt;/th&gt;.*?&lt;td&gt;.*?&lt;/td&gt;} $data "" data   }   # do we have output?   if {[info exists output]} {     # yes, determine what exactly to output...     foreach entry $::whereisFilter {        foreach attribute $output {           # does the attribute match any filter masks?           if {[string match -nocase $entry [lindex [split $attribute |] 0]]} {              # yes, add to spam list              lappend spamline "$::whereisName[string trim [lindex [split $attribute |] 0]]\017$::whereisValue[string trim [lindex [split $attribute |] 1]]\017"           }        }      }      # was a spam list created?      if {[info exists spamline]} {         # if created, does it have any contents?         if {[llength $spamline]} {           # yes, spam first 9           puthelp "privmsg $chan :$::whereisPrefix[join [lrange $spamline 0 8] $::whereisDivider]"           # more than 9?           if {[llength $spamline] &gt; 8} {              # yes, spam the rest              puthelp "privmsg $chan :$::whereisPrefix[join [lrange $spamline 9 [llength $spamline]] $::whereisDivider]"           }         }      } else {         # we have output but nothing in the spam list, declare         puthelp "privmsg $chan :$text returns some useful information for me to reply with, but filtering is preventing me from showing you... ;/"      }   } else {      # we have no output at all, declare      puthelp "privmsg $chan :retorno sin ninguna informacion util, para \2$text\2 ... ;/"      # if we are logged in, this doesn't count against our quota so add back the 1 we took away. ;)      if {$::whereisLogged &gt; 0} { incr ::whereisRemain 1 }   }}putlog "Whereis.tcl v1.6  ... loaded."#EOF</code></pre></div>help please friend..<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8327">Arnold_X-P</a> — Thu Mar 09, 2017 8:57 pm</p><hr />
]]></content>
	</entry>
	</feed>
