Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ON *:TEXT:*:#opers: {
- tokenize 32 $strip($1-)
- if ($1 == !i) {
- var %opts = add del clear list total start stop on off
- if (!$2) { .msg $chan ( $+ $nick $+ ): Error, Please use an option of $qt(%opts) $+ . | return }
- if (!$istok(%opts,$2,32)) { .msg $chan ( $+ $nick $+ ): Error, Please use on of the correct options $qt(%opts) $+ . | return }
- if ($2 == start) || ($2 == on) {
- if (%banident) { .msg $chan ( $+ $nick $+ ): The Ban Ident module is already running! | return }
- set %banident 1
- .msg $chan ( $+ $nick $+ ): The Ban Ident module has been started.
- }
- if ($2 == stop) || ($2 == off) {
- if (!%banident) { .msg $chan ( $+ $nick $+ ): The Ban Ident module is NOT running! | return }
- set %banident 0
- .msg $chan ( $+ $nick $+ ): The Ban Ident module has been stopped.
- }
- if ($2 == add) {
- if (!$3) { .msg $chan ( $+ $nick $+ ): Error, Please use the ident! | return }
- if ($ulist($3,ident,1)) { .msg $chan ( $+ $nick $+ ): Error, That $qt($3) ident is already exists in the list! | return }
- .auser ident $3
- .msg $chan ( $+ $nick $+ ): The $qt($3) ident has been added to the list.
- }
- if ($2 == del) {
- if (!$3) { .msg $chan ( $+ $nick $+ ): Error, Please use the ident! | return }
- if (!$ulist($3,ident,1)) { .msg $chan ( $+ $nick $+ ): Error, That $qt($3) ident does NOT exists in the list! | return }
- .ruser ident $3
- .msg $chan ( $+ $nick $+ ): The $qt($3) ident has been removed from the list.
- }
- if ($2 == list) {
- var %t = $ulist(*,ident,0)
- if (!%t) { .msg $chan ( $+ $nick $+ ): The ident list is empty. | return }
- var %i = 1
- while (%i <= %t) { .msg $chan ( $+ $nick $+ ): $chr(35) $+ %i -> $ulist(*,ident,%i) | inc %i }
- }
- if ($2 == clear) {
- var %t = $ulist(*,ident,0)
- if (!%t) { .msg $chan ( $+ $nick $+ ): The ident list is empty. | return }
- while (%t) { .ruser country $ulist(*,ident,%t) | dec %t }
- .msg $chan ( $+ $nick $+ ): All the idents have been cleared.
- }
- if ($2 == total) {
- var %t = $ulist(*,ident,0)
- if (!%t) { .msg $chan ( $+ $nick $+ ): The ident list is empty. }
- else { .msg $chan ( $+ $nick $+ ): There are %t idents in the list. }
- }
- }
- ; -------
- if ($1 == !c) {
- var %opts = add del clear list total start stop on off
- if (!$2) { .msg $chan ( $+ $nick $+ ): Error, Please use an option of $qt(%opts) $+ . | return }
- if (!$istok(%opts,$2,32)) { .msg $chan ( $+ $nick $+ ): Error, Please use on of the correct options $qt(%opts) $+ . | return }
- if ($2 == start) || ($2 == on) {
- if (%bancountry) { .msg $chan ( $+ $nick $+ ): The Ban Country module is already running! | return }
- set %bancountry 1
- .msg $chan ( $+ $nick $+ ): The Ban Country module has been started.
- }
- if ($2 == stop) || ($2 == off) {
- if (!%bancountry) { .msg $chan ( $+ $nick $+ ): The Ban Country module is NOT running! | return }
- set %bancountry 0
- .msg $chan ( $+ $nick $+ ): The Ban Country module has been stopped.
- }
- if ($2 == add) {
- if (!$3) { .msg $chan ( $+ $nick $+ ): Error, Please use the country code! | return }
- if ($ulist($3,country,1)) { .msg $chan ( $+ $nick $+ ): Error, That $qt($3) country code is already exists in the list! | return }
- .auser country $3
- .msg $chan ( $+ $nick $+ ): The $qt($3) country code has been added to the list.
- }
- if ($2 == del) {
- if (!$3) { .msg $chan ( $+ $nick $+ ): Error, Please use the country code! | return }
- if (!$ulist($3,country,1)) { .msg $chan ( $+ $nick $+ ): Error, That $qt($3) country code does NOT exists in the list! | return }
- .ruser country $3
- .msg $chan ( $+ $nick $+ ): The $qt($3) country code has been removed from the list.
- }
- if ($2 == list) {
- var %t = $ulist(*,country,0)
- if (!%t) { .msg $chan ( $+ $nick $+ ): The country code list is empty. | return }
- var %i = 1
- while (%i <= %t) { .msg $chan ( $+ $nick $+ ): $chr(35) $+ %i -> $ulist(*,country,%i) | inc %i }
- }
- if ($2 == clear) {
- var %t = $ulist(*,country,0)
- if (!%t) { .msg $chan ( $+ $nick $+ ): The country code list is empty. | return }
- while (%t) { .ruser country $ulist(*,country,%t) | dec %t }
- .msg $chan ( $+ $nick $+ ): All the country codes have been cleared.
- }
- if ($2 == total) {
- var %t = $ulist(*,country,0)
- if (!%t) { .msg $chan ( $+ $nick $+ ): The country code list is empty. }
- else { .msg $chan ( $+ $nick $+ ): There are %t country codes in the list. }
- }
- }
- if ($1 == !clines) {
- if (%scan_nick) { .msg $chan ( $+ $nick $+ ): This progress is already running from %scan_nick $+ , Please wait $var(scan_nick,1).unset seconds.. | return }
- .msg $chan ( $+ $nick $+ ): Start removing all G:Lines and Z:Lines from this server..
- set -eu20 %scan_nick $nick
- set -eu10 %scan_glines 1
- os akill list
- stats g
- .timer[SCAN_ZLINES] -h 1 1000 set -eu10 %scan_zlines 1 $(|) stats k
- }
- }
- raw 216:*: { if (%scan_nick) { haltdef } }
- raw 223:*: {
- if (%scan_nick) {
- haltdef
- if (%scan_zlines) && ($2 === z) { set -eu3 %zlines $calc(%zlines +1) | zline - $+ $3 }
- if (%scan_glines) && ($2 === G) { set -eu3 %glines $calc(%glines +1) | gline - $+ $3 }
- }
- }
- raw 219:*: {
- if (%scan_nick) {
- haltdef
- if ($me ison #opers) {
- if (%scan_zlines) && (%zlines) { .msg #opers ( $+ %scan_nick $+ ): All Z:Lines have been removed. - (Total: %zlines $+ ) | unset %scan_zlines %zlines }
- elseif (%scan_zlines) && (!%zlines) { .msg #opers ( $+ %scan_nick $+ ): Z:Lines are currently empty. | unset %scan_zlines }
- if (%scan_glines) && (%glines) { .msg #opers ( $+ %scan_nick $+ ): All G:Lines have been removed. - (Total: %glines $+ ) | unset %scan_glines %glines }
- elseif (%scan_glines) && (!%glines) { .msg #opers ( $+ %scan_nick $+ ): G:Lines are currently empty. | unset %scan_glines }
- }
- if ($2 === k) && ($me ison #opers) { .msg #opers ( $+ %scan_nick $+ ): End of removing all G:Lines and Z:Lines from the server. }
- }
- }
- ON ^*:NOTICE:*:?: {
- if ($nick == OperServ) && (%scan_nick) {
- haltdef
- tokenize 32 $strip($1-)
- if (*AKILL list is empty* iswm $1-) { .msg #opers ( $+ %scan_nick $+ ): BOT AKILLs List is currently empty. }
- if (*Current AKILL list:* iswm $1-) { set -eu3 %akills_start 1 }
- if (*End of Akill list* iswm $1-) {
- if (%akills) { .msg #opers ( $+ %scan_nick $+ ): All BOT AKILLs have been removed. - (Total: %akills $+ ) }
- else { .msg #opers ( $+ %scan_nick $+ ): BOT AKILLs are currently empty. }
- }
- if (%akills_start) && ($1 isnum) && ($remove($2,*,@,.) isletter) && ($len($remove($2,*,@,.)) == 2) && (!$ulist($remove($2,*,@,.),country,1)) { set -eu3 %akills $calc(%akills +1) | os akill del $2 }
- }
- }
- ON ^*:SNOTICE:*: {
- haltdef
- if (*Z:Line added for* iswm $1-) { .timer[COUNTRYBAN_ $+ $remove($5,*,@) $+ _NOW] off }
- if (*Client Exiting* iswm $1-) {
- if ($hget(COUNTRIES,$6)) { hdel COUNTRIES $6 }
- .timer[COUNTRY_ $+ $6 $+ _SCAN] off
- .timer[BANIDENT_ $+ $6 $+ _NOW] off
- }
- if (*Client Connecting* iswm $1-) && (*on port* iswm $1-) {
- var %nick = $9
- var %addr = $remove($10,$chr(40),$chr(41),~)
- var %ident = $gettok($remove($10,$chr(40),$chr(41),~),1,64)
- if (%banident) {
- if (%nick) && (%addr) && (%ident) && (!$ulist(%ident,ident,1)) {
- .timer[BANIDENT_ $+ %nick $+ _NOW] -h 1 1000 gline *@ $+ $gettok(%addr,2,64) 2h 10[ 4G-Lined 10]: 5Your ident ( $+ %ident $+ ) is NOT permitted on that network.
- .msg #opers 10-- Client 4BANNED 10due connecting with bad-ident4 %ident 10as5 %nick 10(4 $+ %addr $+ 10)
- return
- }
- }
- if (%bancountry) {
- var %code = $upper($gettok(%addr,$numtok(%addr,46),46))
- if ($len(%code) == 2) && (%code isletter) && (!$ulist(%code,country,1)) {
- os akill add +2h *@*. $+ %code 2[ 4AKILLED 2]: Your country ( $+ %code $+ ) is NOT permitted to connect on this network.
- gline *@ $+ $gettok($remove($10,$chr(40),$chr(41)),2,64) 2h 2[ 4G-Lined 2]: Your country ( $+ %code $+ ) is NOT permitted on that network.
- if ($me ison #opers) { .msg #opers 2-- Client 4BANNED 2due connecting4 $9 2(5 $+ %addr $+ 2) from4 %code }
- return
- }
- }
- if ($check_ip(%addr)) { .timer[COUNTRY_ $+ %nick $+ _SCAN] -h 1 1000 scan_country %nick %addr %ident }
- else { hadd -m COUNTRIES %nick %addr %ident | .timer[COUNTRY_ $+ %nick $+ _SCAN] -h 1 1000 userip %nick }
- }
- }
- raw 340:*: {
- haltdef
- var %nick = $gettok($2-,1,61)
- var %ip = $gettok($2-,2,64)
- var %match = $hget(COUNTRIES,%nick)
- if (%match) && (%ip) { scan_country %nick %ip $gettok(%match,2,32) }
- }
- alias -l scan_country {
- if (!$check_ip($2)) { var %addr = $gettok($hget(COUNTRIES,$1),1,32) $+ @ $+ $gettok($hget(COUNTRIES,$1),2,32) | hdel COUNTRIES $1 }
- else { var %addr = $3 $+ @ $+ $2 }
- var %v = lookup_ $+ $rand(1,10000000000000)
- var %u = https://geoip.nekudo.com/api/ $+ $2 $+ /en/short
- JSONOpen -u %v %u
- if ($JSONError) { JSONClose %v | return }
- var %name = $json(%v,country,name).value
- var %country = $upper($json(%v,country,code).value)
- JSONClose %v
- if (%name) && (%country) { .timer[COUNTRYBAN_ $+ $2 $+ _NOW] -h 1 1000 send_msg $1 %addr $2 %country %name }
- }
- alias -l send_msg {
- if (!$1-) { return }
- if (%bancountry) && (!$ulist($4,country,1)) {
- os akill add +2h *@*. $+ $4 2[ 4AKILLED 2]: Your country ( $+ $4 $+ ) is NOT permitted to connect anymore on this network.
- zline *@ $+ $3 2h 2[ 4Z-Lined 2]: Your country ( $+ $4 $+ ) is NOT permitted on that network.
- if ($me ison #opers) { .msg #opers 2-- Client 4BANNED 2due connecting4 $1 2(5 $+ $2 $+ 2) (4 $+ $3 $+ 2) from4 $5- ( $+ $4 $+ ) }
- }
- else {
- if ($me ison #opers) { .msg #opers 2-- Client connecting3 $1 2(5 $+ $2 $+ 2) (3 $+ $3 $+ 2) from3 $5- ( $+ $4 $+ ) }
- }
- }
- alias -l check_ip {
- if (!$1) { return 0 }
- if ($regex($1-,/^(\d{1,3}.\d{1,3}.\d{1,3}.\d{1,3})$/Sx)) { return 1 }
- return 0
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement