0

Sorry if my title wasn't clear enough. I'm back for some more guidance!

I'm trying to set up a unique language kicking bot. The chats I moderate have influxes of Russian language chat spammers. So I was trying to set up a bot that kicks someone when they type in Russian. So I set this up:

alias -l russian.words { RETURN Л.Д.э.И }

ON @*:TEXT:*:#: {
  IF ($nick isop #) return
  VAR %x = $strip($1-) , %i = $numtok($russian.words,46)
  WHILE (%i) {
    IF ($istok(%x,$gettok($russian.words,%i,46),32)) {
      raw -q mode # +b $wildsite
      msg # $nick $+ , English in chat, please! Только на английском языке в чате!
      msg # /timeout $nick 1
      RETURN
    }
    DEC %i
  }
}

The problem is that the bot checks for the russian letters only if they are 'on their own'. If the Russian letters are part of a larger sentence/word, the bot doesn't work.

I believe it's because of the delimiter in the $gettok, which is set at 32 (a space). However, when I change the delimiter to 0 (null), the bot doesn't work at all.

So right now, the only thing the bot kicks are people who use ONLY those specific letters. I want the bot to kick to anyone who uses those letters on their own or when in a sentence/word.

BTW, I've chosen these letters because they are considered the most common Russian letters that do not share the same letters as English.

Any help is appreciated.

vika09
  • 19
  • 6
  • forget this kind of script, send here which russian words you want it to match, by the way $gettok wont match for null, since they are not receiving "null" character, it is receiving space character – Sirius_Black Aug 13 '14 at 02:22

1 Answers1

0

try this
paste into a new remote file

on $@*:text:/(Л|Д|э|И)/iS:#:{
if ($nick !isop $chan) {
ban -k $nick 2 English in chat, please! Только на английском языке в чате!
}
}
Sirius_Black
  • 471
  • 3
  • 11
  • Yes! This seems to be working! I added "msg # $nick $+ , English in chat, please! Только на английском языке в чате!" and "msg # /timeout $nick 1" because it was for Twitch (should I mentioned that, sorry). So, does /(text input)/iS mean it will search for form of the input text in a sentence? If so, that will help me set up more 'reactionary bots'. Thanks a lot again Sirius! @Sirius_Black – vika09 Aug 13 '14 at 22:56
  • @vika09 that is a regex match, if you're interested i can teach you MSL – Sirius_Black Aug 14 '14 at 00:59