I have allways been troubled with people spamming characters and etc. when i'm not "there"
So I finally realised it would be best to create a script for it.
It warns twice and kicks the third, it resets after the kick, but it is possible to let it ban for an hour first. This will not be in this version tho.
Long time ago since I gave anything to this community, for those who remembers me, I hope you see my scripting knowledge has increased a tiny bit.
Yes I already know I could do it in other ways, like using a tekst document and etc. But I would be glad if you share your ways. :)
And if you doesnt have anything nice to contribute, rather don't!
on *:text:!warn on:#:{
if ($nick isop $chan) || ($nick ishop $chan) {
if (%warnon [ $+ [ $chan ] ] == $null) {
set %warnon [ $+ [ $chan ] ] sup
msg $chan 7Idle-op is now ON
}
else notice $nick it is already on.
}
else notice $nick you need to be op or hop to use this.
}
on *:text:!warn off:#:{
if ($nick isop $chan) || ($nick ishop $chan) {
if (%warnon [ $+ [ $chan ] ] != $null) {
unset %warnon [ $+ [ $chan ] ]
msg $chan 7Idle-op is now OFF
}
else notice $nick it is already off.
}
else notice $nick you need to be op or hop to use this.
}
on *:TEXT:*:#: {
if (%warnon [ $+ [ $chan ] ] != $null) {
if (aaaaaa isin $1-) || (bbbbbb isin $1-) || (cccccc isin $1-) || (dddddd isin $1-) || (eeeeee isin $1-) || (ffffff isin $1-) || (gggggg isin $1-) || (hhhhhh isin $1-) || (iiiiii isin $1-) || (jjjjjj isin $1-) || (kkkkkk isin $1-) || (llllll isin $1-) || (mmmmmm isin $1-) || (nnnnnn isin $1-) || (oooooo isin $1-) || (pppppp isin $1-) || (qqqqqq isin $1-) || (rrrrrr isin $1-) || (ssssss isin $1-) || (tttttt isin $1-) || (uuuuuu isin $1-) || (vvvvvv isin $1-) || (wwwwww isin $1-) || (xxxxxx isin $1-) || (yyyyyy isin $1-) || (zzzzzz isin $1-) {
if (%nickick [ $+ [ $nick ] ] == 2) { /kick $chan $nick Please use less characters in one word (3/3) | halt }
if (%nickick [ $+ [ $nick ] ] == 1) { /msg $chan 4[Warning] $+ $nick $+ Please use less characters in one word (2/3) | set %nickick [ $+ [ $nick ] ] 2 | halt }
msg $chan 4[Warning] $+ $nick $+ Please use less characters in one word (1/3)
set %nickick [ $+ [ $nick ] ] 1
}
if (!!!!!! isin $1-) {
if (%nickick [ $+ [ $nick ] ] == 2) { /Kick $chan $nick Please use less exclamation marks! (3/3) | halt }
if (%nickick [ $+ [ $nick ] ] == 1) { /msg $chan 4[Warning] $+ $nick $+ Please use less exclamation marks! (2/3) | set %nickick [ $+ [ $nick ] ] 2 | halt }
msg $chan 4[Warning] $+ $nick $+ Please use less exclamation marks! (1/2)
set %nickick [ $+ [ $nick ] ] 1
}
}
elseif (%warnon == $null) { halt }
}
on *:PART:#: { unset %nickick [ $+ [ $nick ] ] }
on *:kick:#: { unset %nickick [ $+ [ $knick ] ] }
with a comma (marked in red) , you'll get an insufficient parameter error. Without the comma, it returns the variable name only.
i dont think i do it many times and that's work
test this
alias t {
var %x $+ $me 1
echo 4 -a evaluated 1: $(,$+(%,x,$me))
echo 6 -a evaluated 2: $($+(%,x,$me),2)
echo 3 -a not eval. 1: $+(%,x,$me)
echo 5 -a not eval. 2: $+(%x,$me)
if $(,$+(%,x,$me)) { echo -a test ok for evaluation }
}
sunslayer, did you not miss my post in response to yours above? The dot > /(.+)/ will match "literally everything," be that so-called characters or strings that you've mentioned here. The only difference is that your example will match one or more strings/characters because you added the plus sign. Mine only has a dot, which will only match the single repeated character or string.
But WorldDMT, I want to match the variable value "on" in my example, not blodix's. By not using a number, it'll only get matched for the variable itself. Besides, when you do > //echo -a $(,$+(%,warnon,#)) with a comma (marked in red) , you'll get an insufficient parameter error. Without the comma, it returns the variable name only.
@sunslayer:> [quote]about if (aaaaaa isin $1-) || (bbbbbb isin $1-) || ........ use regex .{6}
will match any character repeated 6 times, i.e. "hello there" would be matched
[/quote]i give him only an eg
@jethro_: about "set $+(%,warnon,#) on" u can set it 1 and 0
set %warnon $+ # 1
then the condition can be
if $(,$+(%,warnon,#)) { ... }
Yes, that's what the dot is for to match everything (literally)
Of the regex I've learned, and I quote, > most regex engines have a "dot matches all" or "single line" mode that makes the dot match any single character, including line breaks. Use the dot sparingly. Often, a character class or negated character class is faster and more precise.
I thought I'd edit your script and improve upon it, and here is it:
on @*:text:*:#:{
var %r = /(.)\1{5}/S
if ($regex($1-,/!warn o(n|ff)/iS)) {
if (!$nick(#,$nick,oh)) {
notice $nick you need to be op or hop to use this.
}
elseif ($regml(1) == n) && ($($+(%,warnon,#),2) != on) {
set $+(%,warnon,#) on
msg # 7Idle-op is now ON
}
elseif ($regml(1) == ff) && ($($+(%,warnon,#),2) == on) {
set $+(%,warnon,#) off
msg # 7Idle-op is now OFF
}
else { notice $nick It is already $($+(%,warnon,#),2) }
}
elseif ($($+(%,nickkick,$nick),2) > 1) && ($regex($1-,%r)) {
kick # $nick 5 repeated characters in your exceeded!
unset $+(%,nickkick,$nick)
}
elseif ($regex($1-,%r)) && ($($+(%,warnon,#),2) == on) {
inc $+(%,nickkick,$nick)
msg # 4[Warning] $+ $nick $+ Please don't exceed $&
5 repeated characters in your sentence. Thank you.
}
}
blodix's snippet is 2057 bytes, and mine is 738 bytes.
On thing I don't get is the topic of this snippet "Idle-op." This script has nothing do with idling. It should have been titled "Repeated Character Kicker with Warnings."