Hello There, Guest! Login or Register


Anti-caps filter
#1
hey so I think we need an anti-caps feature, it'd work like this:
if 5 (this can be changed) or more letters in the player's message have caps enabled, the whole message would be displayed as lowercase
However, if it was "LOL" or "OMFG" or "ROFL" it'd show as caps, as long as the rest of the sentence didn't have random caps in there

Lemme know what you think please :)
Reply
#2
That's something we really want to implement, we even have a ticket for it already: https://github.com/LVPlayground/playground/issues/121

The more we can replace with scripts, the better.
Reply
#3
Sorry for my lame reply, I meant to say: thank you cake, for the quick reply. I am happy to see that development is considering this, and I will gratefully await your work!
Reply
#4
You're absolutely right, this is an issue that could probably be solved within 15 minutes, together with removal of the "nocaps" setting.

It does take some time to figure out a good heuristic for filtering capitals. One-word messages such as "LMAO" are fine. Two-word sentences such as "OMG ROFL" are fine. Three-word sentences such as "WTFFFFFFF CAKE OMGGGG" are not fine. Sentences such as "I write PHP, JS and COBOL" are fine, other use of caps likely isn't.

If we were to implement this in JavaScript, we could have a JSON file with whitelisted capital-only words and recapitalise sentences with a certain lower/uppercase ratio entirely. That'd be effective, maintainable, testable and performant. It does require moving main chat to JavaScript.
Reply
#5
Hello Guys !!!

i suggest to use that code i will do a PR later in Github
Quote:public OnPlayerText(playerid, text[])
{
      new Caps[4][] = {
        "PHP",
        "JSON",
        "ROFL",
        "OMG"
    };

      for (new d = 0; d< sizeof(Caps); d++) {

      for(new i=1; i<strlen(text); i++)
     {
        if(text[i] > 64 && text[i]< 91 && strfind (text, Caps[d], false) != -1) text[i] += 32;
      }
       return 1;
}

Sadly The Founder of This Feature Not Here :(
Reply