IRCRehberi.Net- Türkiyenin En iyi IRC ve Genel Forum Sitesi

IRCRehberi.Net- Türkiyenin En iyi IRC ve Genel Forum Sitesi (https://www.ircrehberi.net/)
-   mIRC Scripting Hazır Kodlar (https://www.ircrehberi.net/mirc-scripting-hazir-kodlar/)
-   -   İP Adresine göre Şehir ve Ülke Bilgisi Alma ( güncel ) (https://www.ircrehberi.net/mirc-scripting-hazir-kodlar/213582-ip-adresine-gore-sehir-ve-ulke-bilgisi-alma-guncel.html)

Mylife 16 Mart 2025 10:38

İP Adresine göre Şehir ve Ülke Bilgisi Alma ( güncel )
 
Kod:

on $*:TEXT:/^[\\.!]nerden/Si:#denemee:{
  set %:kanal #
  var %ip = $2
  if ($gettok(%ip,1,46) !isnum 1-255) || ($gettok(%ip,2,46) !isnum 0-255) || ($gettok(%ip,3,46) !isnum 0-255) || ($gettok(%ip,4,46) !isnum 0-255) || (!$2) {
    msg # Kullanım: !nerden <IP adresi>
    return
  }
  if ($sock(geo.sock)) { sockclose geo.sock }
  sockopen geo.sock ip-api.com 80
  set %geo.ip %ip
}
on *:SOCKOPEN:geo.sock:{
  if ($sockerr) {
    msg #denemee Bağlantı hatası: $sockerr
    return
  }
  sockwrite -n $sockname GET /line/ $+ %geo.ip $+ ?fields=city,country HTTP/1.1
  sockwrite -n $sockname Host: ip-api.com
  sockwrite -n $sockname User-Agent: Mozilla/5.0
  sockwrite -n $sockname Connection: close
  sockwrite -n $sockname $crlf
}
on *:SOCKREAD:geo.sock:{
  var %data
  sockread %data
  if (%data == $null) { return }
  if ($left(%data,4) == HTTP) { return }
  if (*:* iswm %data) { return }
  if (%data != $null) {
    var %city = $gettok(%data,1,44)
    var %country = $gettok(%data,2,44)
    msg %:kanal IP Adresi %geo.ip şu konumda bulunuyor: %city %country
  }
  unset %geo.ip
}
on *:SOCKCLOSE:geo.sock:{
  if ($isSet(%geo.ip)) {
    msg %:kanal IP Adresi %geo.ip için konum bilgisi bulunamadı.
    unset %geo.ip

  }
  unset %:kanal
}

Kodun amacı;

Belirtilen ip adresinin hangi ülke ve şehirde olduğu bilgisini verir.

Kullanım;

.nerden ipadresi

Chloe 16 Mart 2025 16:15

Emeğine sağlık.

Raina 22 Haziran 2025 06:15

Emeğine sağlık :kahve:

Huh 22 Haziran 2025 08:34

Emeğine sağlık güzel çalışma için teşekkür ederiz.

Te5ir 05 Temmuz 2025 15:46

Emeğine saglik

Rhea 05 Temmuz 2025 15:54

Emeğine sağlık


Tüm Zamanlar GMT +3 Olarak Ayarlanmış. Şuanki Zaman: 07:44.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions, Inc.

Copyright ©2019 - 2025 | IRCRehberi.Net