If I may, I'd like to point out a little something that increases readability in the code that
has been presented, and gets rid of those aweful eval brackets.

Since the eval brackets are not needed when setting a variable, we can do:

inc -u86400 %punctuation. [ $+ [ $+($cid,.,$chan,.,$nick) ] ]
inc -u86400 $+(%,punctuation.,$cid,.,$chan,.,$nick)

However, what is even neater is the following:
  • var %a = $+(%,punctuation.,$cid,.,$chan,.,$nick)
    inc -u86400 $(%a)
    var %b = $(%a,2)

    if %b == 1 { }
    elseif %b == 2 { }
    elseif %b == 3 { }
    elseif %b == 4 { }
    else { }

    What it does is assign %punctuation.<value of $cid>.<value of $chan>.<value of $nick> to the
    variable %a. The value of variable %a could for example look like: %punctuation.2.#blah.FiberOPtics

    I've added $cid so that the variable is network specific (assuming you don't have a clone of yours in the same
    channels running the same script)

    We then increment the value of variable %a to be unset in 24 hours. Why didn't I just do: inc %a ?
    Because when settting a variable, the variable that u want to set is obviously not evaluated, otherwise it
    would be impossible to set one in the first place. When you do //var %a = value, if the %a would evaluate,
    then how can we set the variable %a to something?

    Therefore we force evaluation of %a by putting an $eval around it, so that %punctuation.2.#blah.FiberOPtics is
    incremented, rather than %a itself. There are more ways to force evaluation of %a prior to the setting.

    Examples //inc [ [ %a ] ] or //inc $+(%a) etc.

    Then we assign the value of %punctuation.2.#blah.FiberOPtics to variable %b. How is this done?
    By forcing double evaluation on variable %a, with the use of $eval(<variable>,2).

    Level 0: $(%a,0) = %a
    Level 1: $(%a,1) = $(%a) = %punctuation.2.#blah.FiberOPtics
    Level 2: $(%a,2) = value of %punctuation.2.#blah.FiberOPtics for example = 2

    So then we simply compare %b, which has the value of the incremented variable, to see what kind of
    measurements should be taken.

For the excessive punctuation detection, that incredibly long if statement can be replaced with a regex.

If I understand the OP correctly, he wants it to trigger in the case of: 4 or more following identic characters,
which can be punctuation or letters. I'm just going to include everything but digits and whitespaces, just
know that it can be customized exactly to fit ones needs, they just have to be specific with
what they mean with "punctuation".

if $regex($1-,/([^\d\s])\1{3}/S) { }

If you would like it so that it also detects mixes of certain punctuation, like .+*-.+ then leave out \1, change 3 to 4,
and remove the brackets around the character class. HOWEVER I would not allow letters to be part of the punctuation
then, as that would just kick ban on basically any 4 letter word.

Therefore we could construct another regex which matches in case of:
  • 4 or more identic letters (both lower/upper case), but not in mixed shape. Matches aaaa, not abab.
  • 4 or more non-alfanumeric characters, so basically anything apart from letters and numbers,
    with the condition that the non-alfanumerics may not be whitespaces like tab, space, $cr, $lf.

    These can be in mixed shape, so not only !!!!! but also *+-?![-

    The incoming string is stripped from control codes.

    if $regex($1-,/[^a-z\d\s]{4}|([a-z])\1{3}/Si) { }

    Unfortunately \w covers a-zA-Z0-9 and _ so I couldn't have simply done [^\w\s] it would had to be something like: (?:[^\w\s]|_)

If you want it to match more specific things, then just say the word, but be specific.


Gone.