Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ON *:TEXT:*:#opers: {
- 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. }
- }
- }
- }
- ON *:SNOTICE:*Client Connecting*: {
- if (!%bancountry) { return }
- if (*on port* iswm $1-) { set -eu60 %connecting_ [ $+ [ $9 ] ] $server $+ : $+ $remove($8,:) $10 | userip $9 }
- else { set -eu60 %connecting_ [ $+ [ $8 ] ] $remove($7,:) $9 | userip $8 }
- }
- raw 340:*: {
- haltdef
- if (%connecting_ [ $+ [ $gettok($2-,1,61) ] ]) {
- var %nick = $gettok($2-,1,61)
- var %ip = $gettok($2-,2,64)
- var %server = $gettok(%connecting_ [ $+ [ %nick ] ],1,32)
- var %addr = $gettok(%connecting_ [ $+ [ %nick ] ],2,32)
- var %v = lookup_ $+ $rand(1,10000000000000)
- var %u = https://geoip.nekudo.com/api/ $+ %ip $+ /en/short
- JSONOpen -u %v %u
- if ($JSONError) { JSONClose %v | return }
- var %name = $json(%v,country,name).value
- var %country = $json(%v,country,code).value
- JSONClose %v
- if (%name) && (%country) { send_msg $iif(%nick,$v1,N/A) $iif(%addr,$v1,N/A) $iif(%ip,$v1,N/A) $iif(%server,$v1,N/A) $iif(%country,$v1,N/A) $iif(%name,$v1,N/A) }
- }
- }
- alias -l send_msg {
- if (!$1-) { return }
- if ($ulist($5,country,1)) {
- gline *@ $+ $3 2h 10[ 4G-Lined 10]: 5Your country ( $+ $5 $+ ) is NOT permitted on that network.
- if ($me ison #opers) { .msg #opers 10-- Client 4BANNED 10due connecting at7 $4 $+ :4 $1 $+ 5 $2 10(4 $+ $3 $+ 10) 10from4 $6 ( $+ $5 $+ ) }
- }
- else {
- if ($me ison #opers) { .msg #opers 10-- Client connecting at7 $4 $+ :4 $1 $+ 5 $2 10(4 $+ $3 $+ 10) 10from4 $6 ( $+ $5 $+ ) }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement