Advertisement
Paladinz2k

mIRC Unicode Spam Detector

Jul 6th, 2023 (edited)
6,484
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
mIRC 1.24 KB | None | 0 0
  1. on @*:text:*:*:{
  2.   if ($network != Undernet) { halt }
  3.   if ($nick !isreg $chan) { halt }
  4.   if (($1 ison $chan) && ($2 ison $chan) && ($3 ison $chan) && ($4 ison $chan)) {
  5.     ban -ku600 $chan $address($nick,2) Spam, spam, spam | auser uspam $address($nick,2)
  6.   }
  7.   if ($unicodecount($1-) >= 15) {
  8.     if ($me isop #) {
  9.       ban -u60 # $nick 2
  10.       kick # $nick 0,12<15>0,2<15>12,1«[0 Unicode spam detected 12,1]»0,2<15>0,12<15>
  11.     }
  12.     if ($window(@Spam) == $null) { window -Cnbk0 +e @Spam }
  13.     aline @Spam $timestamp $chan $nick $address($nick,1) $1-
  14.     .auser uspam $address($nick,2) Unicode Spam $day
  15.     halt
  16.   }
  17. }
  18.  
  19. on uspam:JOIN:#: {
  20.   if (($me isop #) && ($nick isreg $chan) && (*undernet.org !iswm $site)) {
  21.     kick # $nick 0 144,5<1>1500 144,5<1>150 144,5<1>15 Unicode spam previously detected from this address. 1,5<4>15 1,5<4>15 1,5<4>
  22.     ban -u60 # $nick 2
  23.   }
  24. }
  25.  
  26. alias unicodecount {
  27.   var %temp = $strip($1-)
  28.   var %loop = 1
  29.   var %length = $len(%temp)
  30.   var %count = 0
  31.   var %chr = 0
  32.   while (%loop < %length) {
  33.     %chr = $mid(%temp,%loop,1)
  34.     if ($asc(%chr) > 255) { inc %count }
  35.     inc %loop
  36.   }
  37.   return %count
  38. }
  39.  
  40. on *:start:{
  41.   .rlevel uspam
  42. }
  43.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement