IP Locator

IP Locator

mIRC snippet that connects to a website and check the ip location.

Postat de Copyright Categorie Review user Vizualizari Data
BLKoldSUN dronez4 sockopen Cod netestat 517 2023-12-04 19:28:10

menu * {
  .IP Locator:{
    dialog -m ipinfoRC ipinfoRC
  }
}

DIALOG ipinfoRC {
  title "RenCorner IPinfo Tool"
  size -1 -1 400 400
  button "Search",1, 100 30 200 25
  button "Copy",3, 20 280 170 25
  button "IP Logs",30, 200 280 170 25
  text "",4, 20 70 250 200
  list 2, 100 100 282 35, autohs
  text "Country:" 10, 30 100 70 20
  list 5, 100 130 282 35, autohs
  text "ISP:" 12, 30 130 70 20
  list 6, 100 160 282 35, autohs
  text "HostName:" 14, 30 160 70 20
  list 7, 100 190 282 35, autohs
  text "Currency:" 16, 30 190 70 20
  list 8, 100 220 282 35, autohs
  text "IP Speed:" 18, 30 220 70 20
  list 9, 100 250 282 35, autohs
  text "Blacklist:" 20, 30 250 40 20
  text "© Copyright by dronez4 ©",300, 10 385 170 20
  text "IP Locator and Logger V1.0",301, 250 385 170 20
}

on *:dialog:ipinfoRC:init:0:{
did -a ipinfoRC 4 Press search to find information on an IP address }

ON *:DIALOG:ipinfoRC:SCLICK:1: {
  did -r ipinfoRC 2
  did -r ipinfoRC 5
  did -r ipinfoRC 6
  did -r ipinfoRC 7
  did -r ipinfoRC 8
  did -r ipinfoRC 9
  set %dgip $$?="Enter a Valid IP Address"
  getdg
}

ON *:DIALOG:ipinfoRC:SCLICK:30:{
  if ($read(iplocinfo.ini) == $null) {
    did -r ipinfoRC 2
    did -r ipinfoRC 5
    did -r ipinfoRC 6
    did -r ipinfoRC 7
    did -r ipinfoRC 8
    did -r ipinfoRC 9
    did -a ipinfoRC 2 No logs at all
    did -a ipinfoRC 5 No logs at all
    did -a ipinfoRC 6 No logs at all
    did -a ipinfoRC 7 No logs at all
    did -a ipinfoRC 8 No logs at all 
    did -a ipinfoRC 9 No logs at all
  }
  else {
  run iplocinfo.ini }
} 

ON *:DIALOG:ipinfoRC:SCLICK:3:{ 
  clipboard $did(2).seltext
  clipboard $did(5).seltext
  clipboard $did(6).seltext
  clipboard $did(7).seltext
  clipboard $did(8).seltext
  clipboard $did(9).seltext
}

alias getdg {
  sockclose dg123
  sockopen dg123 www.ip-tracker.org 80
}

alias NoHTML {
  if (alt=": isin $1) {
    return $regsubex($1,/<[^>]+(?:>|$)|^[^<>]+>/g,) :emoticon:
  }
  else {
    if (&#39 isin $1) {
      set %removed1 l $remove(%read,&#39)
      return $regsubex($1,/<[^>]+(?:>|$)|^[^<>]+>/g,)
    }
    else {
      return $regsubex($1,/<[^>]+(?:>|$)|^[^<>]+>/g,) 
    }
  }
}
alias striphtml {
  return $regsubex($1,/=[^"]+(?:>|$)|^[^<>]+</g,) 
}

on *:sockread:dg123:{
  if ($sockerr > 0) { return }
  else {
    var %read
    sockread %read 
    if (*<img src=images/ip-flags/* iswm %read) && (*ip += "* iswm %read) {
      writeini iplocinfo.ini %dgip Country $remove($nohtml(%read),ip += ",";,$chr(9))
      did -a ipinfoRC 2 $remove($nohtml(%read),ip += ",";)
    }
    if (*</tr><tr><th>Hostname:</th>* iswm %read) {
      set %resultdg $nohtml(%read)
      set %resultdg1 $remove(%resultdg,IP To Country],[Domain To Location,Hostname:)
      writeini iplocinfo.ini %dgip hostname $remove(%resultdg1,$chr(9))
      did -a ipinfoRC 6 %resultdg1
    }
    if (*ISP:* iswm %read) {
      writeini iplocinfo.ini %dgip ISP $remove($gettok(%read,42,62),</td,$chr(9))
      did -a ipinfoRC 5 $remove($gettok(%read,42,62),</td)
    }
    if (*IP Currency:* iswm %read) {
      set %currency $remove($gettok(%read,7,62),</td,$chr(9))
      writeini iplocinfo.ini %dgip Currency $remove(%currency,;#128;,&nbsp;)
      did -a ipinfoRC 7 $remove(%currency,#128;,&nbsp;)      
    }
    if (*IP Address Speed:* iswm %read) {
      writeini iplocinfo.ini %dgip Address-Speed $remove($gettok(%read,88,62),$chr(9))
      did -a ipinfoRC 8 $gettok(%read,88,62)
    }
    if (*IP Blacklist Check:* iswm %read) {
      writeini iplocinfo.ini %dgip Blacklist $remove($nohtml(%read),IP Blacklist Check:,$chr(9))
      did -a ipinfoRC 9 $remove($nohtml(%read),IP Blacklist Check:)
    }
  }
}
On *:sockopen:dg123: {
  if (!$sockerr) {
    sockwrite -nt dg123 GET /locator/ip-lookup.php?ip= $+ %dgip HTTP/1.0
    sockwrite -n dg123 Host: www.ip-tracker.org
    sockwrite -n dg123 $crlf
  }
  else { echo -st Socket Error $nopath($script) | sockclose $sockname | return }
}