Advertisement
westor

On join allow only TLS or WEBIRC users for Debian v1.7

Mar 27th, 2023 (edited)
2,007
1
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
mIRC 2.68 KB | Source Code | 1 0
  1. #wc_prot on
  2. #wc_prot end
  3.  
  4. alias -l wc_bantime { return 3600 } ; 3600 = 1 hour , 0 = never expire
  5. alias -l wc_bantype { return 4 } ; 4 = bantype, use /help $mask to change it
  6. alias -l wc_kickreason { return [WC]: You are NOT using a SSL/TLS or WEBIRC to stay here } ; kick reason
  7. alias -l wc_chans { return #trivia,#ilusion } ; channels , use comma to add more
  8. alias -l wc_exempt_nicks { return westor } ; add nicks, use space (example: nick1 nick2) to add more nicks
  9.  
  10. ON !*:JOIN:$($wc_chans): {
  11.   if ($group(#wc_prot).status !== on) { return }
  12.   if ($istok($wc_exempt_nicks,$nick,32)) { return }
  13.   if (*irccloud.com* iswm $ial($nick).host) || (*mibbit.com* iswm $ial($nick).host) { return }
  14.  
  15.   .timer[WC_ $+ $nick $+ _NOW] 1 2 wc_do_whois $nick
  16. }
  17.  
  18. raw *:*: {
  19.   if (!$hget(WC,$2)) { return }
  20.  
  21.   if ($numeric == 671) && (*using a Secure Connection* iswm $1-) { hinc -mu10 WC $2 1 }
  22.   if ($numeric == 320) && (*connecting via WEBIRC* iswm $1-) { hinc -mu10 WC $2 1 }
  23.   if ($numeric == 320) && (*connecting via IRCCloud* iswm $1-) { hinc -mu10 WC $2 1 }
  24.   if ($numeric == 318) {
  25.     if ($hget(WC,$2) == 1) { wc_do_ban $2 }
  26.  
  27.     hdel WC $2
  28.   }
  29. }
  30.  
  31. alias wc_prot {
  32.   if (!$1) { echo 4 -at [WC]: Error, Use an option ON or OFF and try again! | return }
  33.   if (!$istok(on off,$1,32)) { echo 4 -at [WC]: Error, use ON or OFF options! | return }
  34.  
  35.   var %s = $group(#wc_prot).status
  36.  
  37.   if ($1 == ON) {
  38.     if (%s == on) { echo 4 -at [WC]: Error, Already enabled! }
  39.     else { .enable #wc_prot | echo -at [WC]: Allow SSL/TLS or WEBIRC users only protection enabled! - Channels: $wc_chans }
  40.   }
  41.  
  42.   if ($1 == OFF) {
  43.     if (%s == off) { echo 4 -at [WC]: Error, Already disabled! }
  44.     else { .disable #wc_prot | echo -at [WC]: Allow SSL/TLS or WEBIRC users only protection disabled! }
  45.   }
  46.  
  47. }
  48.  
  49. alias wc_do_whois {
  50.   ; $1 = nick
  51.  
  52.   if (!$1) { return }
  53.   if ($wc_check_is_not_regular($nick)) { echo -a lol | return }
  54.  
  55.   hadd -mu10 WC $1 1
  56.  
  57.   whois $1 $1
  58. }
  59.  
  60. alias -l wc_do_ban {
  61.   ; $1 = nick
  62.  
  63.   if (!$1) { return }
  64.  
  65.   var %h = $ial($1).host
  66.   var %t = $numtok($wc_chans,44)
  67.   var %i = 1
  68.  
  69.   while (%i <= %t) {
  70.     var %c = $gettok($wc_chans,%i,44)
  71.  
  72.     if ($me ison %c) && ($me isop %c) && ($1 ison %c) {
  73.       if (*.IP iswm %h) { ban $+(-u,$wc_bantime) %c *!*@*. $+ $gettok(%h,3-,46) | kick %c $1 $wc_kickreason }
  74.       else { ban $+(-ku,$wc_bantime) %c $1 $wc_bantype $wc_kickreason }
  75.     }
  76.  
  77.     inc %i
  78.   }
  79. }
  80.  
  81. alias -l wc_check_is_not_regular {
  82.   ; $1 = nick
  83.  
  84.   var %t = $numtok($wc_chans,44)
  85.   var %i = 1
  86.  
  87.   while (%i <= %t) {
  88.     var %c = $gettok($wc_chans,%i,44)
  89.  
  90.     if ($me ison %c) && ($1 ison %c) && ($1 isreg %c) { return 1 }
  91.  
  92.     inc %i
  93.   }
  94.  
  95.   return 0
  96. }
Advertisement
Comments
Add Comment
Please, Sign In to add comment
Advertisement