Advertisement
westor

/hkline alias for Koragg v5.2

Jan 31st, 2021 (edited)
1,666
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
mIRC 3.09 KB | None | 0 0
  1. alias hkline {
  2.   if ($status !== connected) { echo 4 -aet * /hkline: Error, you are not connected! | return }
  3.   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 }
  4.  
  5.   if (-* !iswm $1) { set -eu0 %hkline_action GZLINE }
  6.   elseif (-* iswm $1) {
  7.     if (*t* iswmcs $1) { set -eu0 %hkline_debug 1 }
  8.  
  9.     if (*s* iswmcs $1) { set -eu0 %hkline_action SHUN }
  10.     elseif (*g* iswmcs $1) { set -eu0 %hkline_action GLINE }
  11.     elseif (*z* iswmcs $1) { set -eu0 %hkline_action ZLINE }
  12.     elseif (*k* iswmcs $1) { set -eu0 %hkline_action KLINE }
  13.     elseif (*G* iswmcs $1) { set -eu0 %hkline_action GZLINE }
  14.     else { set -eu0 %hkline_action GZLINE }
  15.   }
  16.  
  17.   if ($find_time_value($1-)) { set -eu0 %hkline_duration $v1 }
  18.  
  19.   if (!%hkline_duration) { set -eu0 %hkline_duration Unlimited }
  20.  
  21.   if ($find_mask_value($1-)) { set -eu0 %hkline_mask $v1 }
  22.  
  23.   if (!%hkline_mask) { set -eu0 %hkline_mask $find_nick_value($1-) }
  24.  
  25.   set -eu0 %hkline_reason $find_reason_value($1-)
  26.  
  27.   $iif(%hkline_debug,echo -aetc info2 * /hkline:) %hkline_action %hkline_mask $iif(%hkline_duration == Unlimited,0,$v1) %hkline_reason
  28. }
  29.  
  30. alias -l find_reason_value {
  31.   if (!$1) { return 0 }
  32.  
  33.   var %t = $numtok($1-,32)
  34.   var %i = 2
  35.  
  36.   while (%i <= %t) {
  37.     var %p = $gettok($1-,%i,32)
  38.  
  39.     if (%p !== %hkline_duration) && (%p !== %hkline_mask) { var %r = $addtok(%r,%p,32) }
  40.  
  41.     inc %i
  42.   }
  43.  
  44.   if (!%r) { return You have violated the Terms Of Use of $network $+ . }
  45.  
  46.   if (%r == evade) { return Ban evasion is not permitted on $network $+ . }
  47.   if (%r == spam) { return Spam is not permitted on $network $+ . }
  48.   if (%r == harass) { return Please do not harass other users on $network $+ . }
  49.   if (%r == tou) { return You have violated the Terms Of Use of $network $+ . }
  50.  
  51.   return %r
  52. }
  53.  
  54. alias -l isdigit {
  55.   if ($1 == $null) { return 0 }
  56.   if ($regex($1,^\d+$)) { return 1 }
  57.  
  58.   else { return 0 }
  59. }
  60.  
  61. alias check_time_format {
  62.   if (!$1) { return 0 }
  63.  
  64.   var %p = /^(?:(\d+)y)?(?:(\d+)w)?(?:(\d+)d)?(?:(\d+)h)?(?:(\d+)m)?(?:(\d+)s)?$/i
  65.  
  66.   if ($regex($1,%p)) { return 1 }
  67.   else { return 0 }
  68. }
  69.  
  70. alias -l find_nick_value {
  71.   if (!$1) { return 0 }
  72.  
  73.   if ($wildtok($1-,*@*,0,32)) { return 0 }
  74.  
  75.   var %t = $numtok($1-,32)
  76.   var %i = 1
  77.  
  78.   while (%i <= %t) {
  79.     var %p = $gettok($1-,%i,32)
  80.  
  81.     if (-* !iswm %p) && (!$check_time_format(%p)) { return %p }
  82.  
  83.     inc %i
  84.   }
  85.  
  86.   return 0
  87. }
  88.  
  89. alias -l find_mask_value {
  90.   if (!$1) { return 0 }
  91.  
  92.   if (!$wildtok($1-,*@*,0,32)) || ($wildtok($1-,*@*,0,32) > 1) { return 0 }
  93.  
  94.   var %t = $numtok($1-,32)
  95.   var %i = 1
  96.  
  97.   while (%i <= %t) {
  98.     var %p = $gettok($1-,%i,32)
  99.  
  100.     if (*@* iswm %p) && ($count(%p,@) == 1) { return %p }
  101.  
  102.     inc %i
  103.   }
  104.  
  105.   return 0
  106. }
  107.  
  108. alias -l find_time_value {
  109.   if (!$1) { return 0 }
  110.  
  111.   var %t = $numtok($1-,32)
  112.   var %i = 1
  113.  
  114.   while (%i <= %t) {
  115.     var %p = $gettok($1-,%i,32)
  116.  
  117.     if ($check_time_format(%p)) || ($isdigit(%p)) { return %p }
  118.  
  119.     inc %i
  120.   }
  121.  
  122.   return 0
  123. }
  124.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement