Locating via IP
Posted by wonder
Wednesday, March 21, 2007
Description: Locates a nick/IP to city, state, and country

Use: @locate ip/nick
example: @locate [clan]bob1337 or @locate 123.456.78.91
Does not work with someone with a masked ip. (blah.user.gamesurge) and some certain ISPs.

P.S: Can you unban me now? I requested myself for accidently pasting a script over a year ago :( and I havent been unbanned yet QQ
on *:text:@locate*:*:{
  set %ipaddchan $chan
  if ( $gettok($2,1,46) isnum 1-99 ) {
    set %resolved $2
    iplocate
  }
  elseif ( $gettok($2,1,$chr(10)) isletter abcdefghijklmnopqrstuvwxyz ) {
    dns $address($2,1)
  }  
}
on *:DNS:{
  if ($raddress == $null) { msg # $+ %ipaddchan IP could not be resolved. | halt }
  set %resolved $raddress
  iplocate
}
ALIAS iplocate {
  set %iploc 1
  sockclose iploc
  sockopen iploc dnsstuff.com 80
}
ALIAS halnohtml var %haltmp , %i = $regsub($1-,/(<[^>]+>)/g,$chr(32),%haltmp) | return %haltmp
on *:SOCKOPEN:iploc: {
  sockwrite -n $sockname GET /tools/ipall.ch?ip= $+ %resolved HTTP/1.1
  sockwrite -n $sockname Host: www.melissadata.com
  sockwrite -n $sockname User-agent: mIRC/ $+ $version
  sockwrite -n $sockname $crlf
}

on *:SOCKREAD:iploc: {
  if ($sockerr > 0) { return }
  var %haltmp | sockread %haltmp
  while ($sockbr) {
    if ( *City (per outside source):* iswm %haltmp ) {
      set %ipcity $gettok($remove($halnohtml(%haltmp),$chr(40) $+ per,outside,source $+ $chr(41),city,$chr(58)),1,44))
      set %ipstate $gettok($remove($halnohtml(%haltmp),$chr(40) $+ per,outside,source $+ $chr(41),city,$chr(58)),2,44))
      msg %ipaddchan IP: %resolved
      msg %ipaddchan City: %ipcity
      msg %ipaddchan State: %ipstate
    }
    if ( *Country (per outside source):* iswm %haltmp ) {
      set %ipcountry $remove($halnohtml(%haltmp),$chr(40) $+ per,outside,source $+ $chr(41),city,$chr(58),$chr(91),$chr(93),US,Country)))
      msg %ipaddchan Country: %ipcountry
      inc %iploc
    }
    set %mytemp $halnohtml(%haltmp)
    sockread %haltmp
  }
}
roflolol
Posted by b0x
Thursday, March 22, 2007 08:22am PDT
I've seen this script elsewhere, exact same script, just a few variable names changed... why can't you kids be original, and just give your recognition to the actual scripters and thank them in your beginning comments... thats my 2 cents - nice script.... TOO BAD YOU DIDN'T MAKE IT.
Subject line
Posted by wonder
Thursday, March 22, 2007 08:42pm PDT
Actually, yes I did make this.  The variables can't be the same because I basically stripped down an old script of mine that did the same thing but with server data.  I posted for help on this in the mIRC forums a few days ago, and fixed it by just changing the site.  If you can find the "exact same script" please send it, they are not the same.
http://trout.snt.utwente.nl/ubbthreads/ubbthreads.php?ubb=showflat&Number=173138&page=1#Post173138
IT DONT WORKEH!
Posted by TrioN
Saturday, March 24, 2007 04:37pm PDT
Doesn't work??
^
Posted by wonder
Sunday, March 25, 2007 12:56am PDT
This is for a bot, to make it so if you type @locate it works just add an on input (/help on input)

if your problem is "IP cannot be resolved" then make sure their IP/hostmask isn't username.user.gamesurge or it just can't plainly be resolved
dont work!
Posted by TrioN
Sunday, April 01, 2007 09:34pm PDT
it doesnt work on my bot.. i type @locate 63.247.77.149 and nothings coming up
Submit a comment
Oops! You need to login or register before you can post a comment!

ebaum's world