westor

Untitled

Feb 23rd, 2021
545
2 days
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ; --- Settings ---
  2.  
  3. alias -l slapbacktriggers { return slaps,smacks,hits,smax,smaxes,kicks,punches,pokes,thwaps,bops }
  4.  
  5. ; --- Settings ---
  6.  
  7. #SlapBack on
  8.  
  9. ON *:ACTION:$($+(*,$me,*)):#: {
  10.   tokenize 32 $strip($1-)
  11.  
  12.   if ($ircv3caps(server-time).enabled) && ($msgstamp) && ($msgstamp < $ctime) { return }
  13.   if ($thx_check_exception($network,$chan,$nick)) { return }
  14.   if ($+(%,slap_,$chan,_flood)) { return }
  15.   if ($chk_slap($1-)) { return }
  16.  
  17.   describe $chan slaps $nick back.
  18.  
  19.   set -eu10 %slap_ $+ $chan $+ _flood 1
  20. }
  21.  
  22. #SlapBack end
  23.  
  24. alias slapback {
  25.   if (!$1) { echo -st SlapBack is set to $group(#SlapBack) | return }
  26.  
  27.   if ($1 == on) { .enable #SlapBack | echo -st SlapBack is set to $group(#SlapBack)  }
  28.   if ($1 == off) { .disable #SlapBack | echo -st SlapBack is set to $group(#SlapBack) }
  29. }
  30.  
  31. alias -l chk_slap {
  32.   if ($1 == $null) { return 0 }
  33.  
  34.   var %l = $numtok($1-,32)
  35.   var %i = 1
  36.  
  37.   while (%i <= %l) {
  38.     var %w = $gettok($1-,%i,32)
  39.  
  40.     if (%w) && ($istok($slapbacktriggers,%w,44)) { return 1 }
  41.  
  42.     inc %i
  43.   }
  44.  
  45.   return 0
  46. }
  47.  
RAW Paste Data