mIRC Homepage
Posted By: SBDOnslaught Filtering. - 26/12/14 05:31 PM
Merry Christmas Everyone! Happy Holidays if you don't Celebrate Christmas!

Anyways, like all my other posts, this is for a twitch bot. I've made a link filter (kinda), and was wondering how to make a CAPS filter so people can't spam caps you know?
The way i would like it to work is if more than 30% of the message is caps they would get erased, but i don't know if it's possible to calculate the number of characters in a line or even if it's possible to detect caps with mIRC. If you guys could also let me know what to use for a "Repetition" filter ( so people can spam !!!!!!!!!!!!!!!!!!!!!.... Ya know?) That would be great!

All of you here probably know how, so that's why im asking! :P

Also, does anyone know how I can use my bot to change the Game/Title. Currently using Nightbot for that, but i really don't want him in my chat smirk

Thank you guys! Once again, Happy Holidays!! smile
Posted By: judge2020 Re: Filtering. - 27/12/14 11:34 PM
There is a search button, but i'll post this anyways:
it gives one warning then times out (%SecondsToTimeOut) seconds on second offense. the second offense timer wares off (%cooldownAmount) seconds from the first offense
also ignores mod caps since a mod can't time out a mod
Code:
on *:text:*:#: {
  set -e %SecondsToTimeOut 120
  set -e %TimeOutMessage Message Goes here
  set -e %cooldownAmount 300
  if ($nick isop #) return
  if ( $len($1-) >= 10 ) {
    if ( $calc($regex($1-,/[A-Z]/g) / $regex($1-,/[A-Z]/gi) * 100) >= 75 ) { 
      if !$istok(%caps.warned,$nick,32) {
        msg $chan $nick -> stop typing in caps! [warning] 
        set -e %caps.warned $addtok(%caps.warned,$nick,32)
        .timer 1 %cooldownamount remove.warned $nick
      }
      else msg $chan %TimeoutMessage | msg $chan .timeout $nick %SecondsToTimeout 
    }
  }
}
alias -l remove.warned {
  set -e %caps.warned $remtok(%caps.warned,$1,1,32)
}
Posted By: SBDOnslaught Re: Filtering. - 30/12/14 10:57 AM
Thanks Judge! Works like a charm! <3
Posted By: judge2020 Re: Filtering. - 30/12/14 12:51 PM
PS make sure this is either in it's own remote file or is at the bottom of another file. it may make other scripts mess up since it tries to scan every single message that comes.
© mIRC Discussion Forums