Here I'm again, and here is my code example (almost a nightmare)
on *:TEXT:*:#test:{ var %n 2 if ($regex($nick($chan,$nick).pnick, /[~|&|@|%|+].*/) != 1) { var %percentage 40 if ($calc($regex($1-,/[A-Z]/g) / $len($1-) * 100) > %percentage) { if (%n < 3) { inc $+(%,caps,.,$nick,.,$wildsite) var %i $($+(%,caps,.,$nick,.,$wildsite),2) if (%i <= %n) { notice $nick 4***FIRST WARN*** } if (%i = 2) { kick # $nick 4***SECOND WARN*** } if (%i = 3) { ban -ku600 # $nick 4***BAN REASON*** | write $mircdir $+ banemule.txt *CapsText* $date $time $nick ---> $site unset $+(%caps,.,$nick,.,$wildsite) } } } } }
This script check for text wrote in a channel.
Rules:
- Caps Letter = No more than 40% - otherwise, the next action will be performed sequentially
- Warn/Kick/Ban = 1. WARN , 2. KICK , 3. BAN - on third violation
For example, the following text should be prohibited:
[rect width=500]
C________I__________A__________O________123
B___U___O::::N***G===I***O:::R___N___O ?
[/rect]
But due to the fact that in addition to capital letters, the text contains many special characters, the calculation gives less than 40%, and this is wrong, it should be 100%
Therefore, before checking, all unnecessary parts must be cut out from the text so that only letters remain, for the correct percentage calculation.
Thanks in advance