Advertisement
westor

IP Command Lookup for ircv3 v1.0

Dec 21st, 2019
2,194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
mIRC 3.25 KB | None | 0 0
  1. ON @*:TEXT:!ip *:#msl: {
  2.   if ($nick !isop $chan) { msg $chan ( $+ $bold($nick) $+ ): Error, Access Denied! | return }
  3.  
  4.   if ($2 ison $chan) {
  5.     .ialfill $chan
  6.  
  7.     var %ip = $ial($2).host
  8.     var %nick = $2
  9.  
  10.     if (!%ip) { msg $chan ( $+ $bold($nick) $+ ): There was an error while trying to retrieve the user IP Address! | return }
  11.     if (!$check_ipv4(%ip)) && (!$check_ipv6(%ip)) { msg $chan ( $+ $bold($nick) $+ ): Incorrect user IP Address type! | return }
  12.  
  13.     goto scan
  14.   }
  15.  
  16.   var %ip = $2
  17.  
  18.   if (!$check_ipv4(%ip)) && (!$check_ipv6(%ip)) { msg $chan ( $+ $bold($nick) $+ ): Error, Incorrect IP Address! | return }
  19.  
  20.   :scan
  21.  
  22.   var %v = IP_LOOKUP_ $+ $rand(1,10000000000)
  23.   var %u = https://proxycheck.io/v2/ $+ %ip $+ ?key= $+ $key $+ &vpn=1&asn=1&inf=1&risk=2&port=1
  24.  
  25.   JSONOpen -ud %v %u
  26.   if ($jsonerror) { msg $chan ( $+ $bold($nick) $+ ): There was a connection problem while trying to connect to the server! - Error Details: $bold($jsonerror) | return }
  27.  
  28.   var %status = $json(%v,status).value
  29.   var %message = $json(%v,message).value
  30.  
  31.   if (%status !== ok) && (%message) { msg $chan ( $+ $bold($nick) $+ ): There was a parsing problem while trying to parse the data from the server! - Error Details: $bold(%message) | return }
  32.  
  33.   var %asn = $json(%v,%ip,asn).value
  34.   var %isp = $json(%v,%ip,provider).value
  35.   var %proxy = $json(%v,%ip,proxy).value
  36.   var %proxy_type = $json(%v,%ip,type).value
  37.   var %country = $json(%v,%ip,country).value
  38.   var %country_code = $json(%v,%ip,isocode).value
  39.   var %score = $json(%v,%ip,risk).value
  40.  
  41.   if (%proxy == yes) { var %proxy = $bold(3Yes) }
  42.   if (%proxy == no) { var %proxy = $bold(4No) }
  43.  
  44.   msg $chan ( $+ $bold($nick) $+ ): $iif(%nick,Nickname: $bold(%nick) $chr(124)) IP address: $bold(%ip) $chr(124) Location: $bold(%country) ( $+ $bold(%country_code) $+ ) $chr(124) ASN: $bold(%isp %asn) $chr(124) Proxy: $iif(%proxy,$v1,N/A) $iif(%proxy_type,$chr(124) Proxy Type:13 $bold(%proxy_type) $+ ) $chr(124) Score: $bold(%score)
  45. }
  46.  
  47. alias -l key {
  48.   if (!%ip_key) { set %ip_key 1 }
  49.  
  50.   var %keys = 104514-018k09-639675-705hpf
  51.   var %key = $gettok(%keys,%ip_key,44)
  52.  
  53.   if (%ip_key == $numtok(%keys,44)) { set %ip_key 1 }
  54.   else { inc %ip_key 1 }
  55.  
  56.   if (%key) { return %key }
  57.   else { return 0 }
  58. }
  59.  
  60. alias -l bold { return $+($chr(2),$1-,$chr(2)) }
  61. alias -l check_ipv4 {
  62.   if (!$1) { return 0 }
  63.  
  64.   if ($regex($1,/^(\d{1,3}.\d{1,3}.\d{1,3}.\d{1,3})$/Sx)) && ($iptype($1) == ipv4) { return 1 }
  65.  
  66.   return 0
  67. }
  68. alias -l check_ipv6 {
  69.   if (!$1) { return 0 }
  70.  
  71.   if ($regex($1,/(fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|2[0-4][0-9]|1{0,1}[0-9]{0,1}[0-9])\.{3,3})(25[0-5]|2[0-4][0-9]|1{0,1}[0-9]{0,1}[0-9])|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|2[0-4][0-9]|1{0,1}[0-9]{0,1}[0-9])\.{3,3})(25[0-5]|2[0-4][0-9]|1{0,1}[0-9]{0,1}[0-9])|:((:[0-9a-fA-F]{1,4}){1,7}|:))/iD)) && ($iptype($1) == ipv6) { return 1 }
  72.  
  73.   return 0
  74. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement