westor

$ip2c (IP to Country) for psycho v1.1

Jan 26th, 2021 (edited)
635
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
mIRC 0.44 KB | None | 0 0
  1. alias ip2c {
  2.   if (!$1) || ($iptype($1) !== ipv4) && ($iptype($1) !== ipv6) { return 0 }
  3.  
  4.   var %v = ip2c_ $+ $rand(1,100000000000)
  5.  
  6.   jsonopen -ud %v http://ip-api.com/json/ $+ $1 $+ ?fields=country,countryCode
  7.  
  8.   if ($jsonerror) { return 0 }
  9.  
  10.   var %country = $json(%v,country).value
  11.   var %country_code = $json(%v,countryCode).value
  12.  
  13.   if (%country) && (%country_code) { return %country ( $+ %country_code $+ ) }
  14.  
  15.   return 0
  16. }
  17.  
Add Comment
Please, Sign In to add comment