Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- alias hkline {
- if ($status !== connected) { echo 4 -aet * /hkline: Error, you are not connected! | return }
- if (!$1) { echo 4 -aet * /hkline: Error, Not enough parameters! | echo -aetc info * /hkline: Syntax: /hkline [-tsgzkG] <nickname|mask> [duration] [reason] - NOTE: <> = required - [] = optionally | return }
- if (-* !iswm $1) { set -eu0 %hkline_action GZLINE }
- elseif (-* iswm $1) {
- if (*t* iswmcs $1) { set -eu0 %hkline_debug 1 }
- if (*s* iswmcs $1) { set -eu0 %hkline_action SHUN }
- elseif (*g* iswmcs $1) { set -eu0 %hkline_action GLINE }
- elseif (*z* iswmcs $1) { set -eu0 %hkline_action ZLINE }
- elseif (*k* iswmcs $1) { set -eu0 %hkline_action KLINE }
- elseif (*G* iswmcs $1) { set -eu0 %hkline_action GZLINE }
- else { set -eu0 %hkline_action GZLINE }
- }
- if ($find_time_value($1-)) { set -eu0 %hkline_duration $v1 }
- if (!%hkline_duration) { set -eu0 %hkline_duration Unlimited }
- if ($find_mask_value($1-)) { set -eu0 %hkline_mask $v1 }
- if (!%hkline_mask) { set -eu0 %hkline_mask $find_nick_value($1-) }
- set -eu0 %hkline_reason $find_reason_value($1-)
- $iif(%hkline_debug,echo -aetc info2 * /hkline:) %hkline_action %hkline_mask $iif(%hkline_duration == Unlimited,0,$v1) %hkline_reason
- }
- alias -l find_reason_value {
- if (!$1) { return 0 }
- var %t = $numtok($1-,32)
- var %i = 2
- while (%i <= %t) {
- var %p = $gettok($1-,%i,32)
- if (%p !== %hkline_duration) && (%p !== %hkline_mask) { var %r = $addtok(%r,%p,32) }
- inc %i
- }
- if (!%r) { return You have violated the Terms Of Use of $network $+ . }
- if (%r == evade) { return Ban evasion is not permitted on $network $+ . }
- if (%r == spam) { return Spam is not permitted on $network $+ . }
- if (%r == harass) { return Please do not harass other users on $network $+ . }
- if (%r == tou) { return You have violated the Terms Of Use of $network $+ . }
- return %r
- }
- alias -l isdigit {
- if ($1 == $null) { return 0 }
- if ($regex($1,^\d+$)) { return 1 }
- else { return 0 }
- }
- alias check_time_format {
- if (!$1) { return 0 }
- var %p = /^(?:(\d+)y)?(?:(\d+)w)?(?:(\d+)d)?(?:(\d+)h)?(?:(\d+)m)?(?:(\d+)s)?$/i
- if ($regex($1,%p)) { return 1 }
- else { return 0 }
- }
- alias -l find_nick_value {
- if (!$1) { return 0 }
- if ($wildtok($1-,*@*,0,32)) { return 0 }
- var %t = $numtok($1-,32)
- var %i = 1
- while (%i <= %t) {
- var %p = $gettok($1-,%i,32)
- if (-* !iswm %p) && (!$check_time_format(%p)) { return %p }
- inc %i
- }
- return 0
- }
- alias -l find_mask_value {
- if (!$1) { return 0 }
- if (!$wildtok($1-,*@*,0,32)) || ($wildtok($1-,*@*,0,32) > 1) { return 0 }
- var %t = $numtok($1-,32)
- var %i = 1
- while (%i <= %t) {
- var %p = $gettok($1-,%i,32)
- if (*@* iswm %p) && ($count(%p,@) == 1) { return %p }
- inc %i
- }
- return 0
- }
- alias -l find_time_value {
- if (!$1) { return 0 }
- var %t = $numtok($1-,32)
- var %i = 1
- while (%i <= %t) {
- var %p = $gettok($1-,%i,32)
- if ($check_time_format(%p)) || ($isdigit(%p)) { return %p }
- inc %i
- }
- return 0
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement