Snippets Project Page
Author: entropy
Added: 5y
Updated: Never
mIRC: v7.55+
Hits: 1,726
Downloads: 48
Review: westor
Size: 1.45KB
1
0
Login to vote.
Ban Bad IP City
v1.0
This snippet looks up and bans IPv4 addresses that match given city.
Download
JSON
▲ Review
▼ Source
;============================================================================ ; Ban Bad IP City v1.0 - by Talon and entropy 2020 ;============================================================================ menu status,channel,query,menubar { - Ban Bad IP City v1.0 .Channels $chr(9) %ip_channel { noop $input(Channel(s)? (seperated by comma),5,Input Request,%ip_channel) | if ($! != $null) { set %ip_channel $! } | echo $color(info) -tag * Channels are now: %ip_channel } .Bad Cities $chr(9) %ip_city { noop $input(Bad Cities? (seperated by comma),5,Input Request,%ip_city) | if ($! != $null) { set %ip_city $! } | echo $color(info) -tag * Bad Cities are now: %ip_city } .- .Unload { .unload -rs $qt($script) | unset %ip_city %ip_channel | echo $color(info) -tag * Ban Bad IP City is now unloaded! } - } on @*:join:%ip_channel:{ getip $gettok($fulladdress,2,64) # $nick } alias -l getip { if ($regex($1,/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/)) { noop $urlget(http://ipinfo.io/ $+ $1 $+ /geo,gb,& $+ $ticks,gotip & $+ $ticks $1-) } } alias -l gotip { var %3 = $3, %4 = $4 | noop $regsubex($bvar($1,1-).text,/"([^"]+)": ?"([^"]+)"/g,$filtergotip(%3,%4,\1,\2)) } alias -l filtergotip { if ($3 == city && $istok(%ip_city,$4,44) && $1 ischan && $me isop $1) { ban -ku300 $1 $2 Bad City } }
Changelog:
0
0
Comments (2)


