Tekil Mesaj gösterimi
Alt 16 Mart 2025, 10:38   #1
Mylife
i don't care if i'm misfit.
Mylife - ait Kullanıcı Resmi (Avatar)

Arrow İ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
________________


Stay strong, trust your instincts.
Set your spirit free, never forget your spiritual side.
Even in the midst of hardships,
there is always a light to guide your way.