Hello again!
This is another script that I'm trying to study and edit but really too advanced for my knowledge.
Is a on join and nickchange check.
What to check:
- Lenght of nick (at least 3 LETTERS : Max59 allowed, M59 not allowed or Max59 allowed , Ma_59 not allwed. All symbols ,;.:?!_ are not allowed)
- Caps letters (no more than 40%)
- MindUser can't be part of nick (i.e. MindUser65432 not allowed)
- If user is op (~ & @ % +) = NO ACTION
So, if not allowed nick:
- 1st NOTICE WARN after 1 seconds
- 2nd NOTICE WARN after 10 seconds
- 3rd NOTICE WARN after 20 seconds
- KICK (no need ban) after 30 seconds
No needs log because is just a kick.
This is the one that I found around and tried to use but as I said, I can't understand it.
on !*:JOIN:#CHANNEL:{
if ($nick($chan,$me,@&~%)) {
if ($calc($regex($nick,/[A-Z]/g) * 100 / $len($nick)) < 40 && $len( $nick ) > 2)
}
var %banmask = $gettok($gettok($address( $nick ,1),2,33),1,42)
if ($calc($regex(%nick,/[A-Z]/g) * 100 / $len(%nick)) > 40 || $len( %nick ) < 3) {
if (!$Timer($+(ChckNickZ,.,$network,.,$chan,.,%banmask))) { .Timer $+ $+(ChckNickZ,.,$network,.,$chan,.,%banmask) -md 1 750 xxbadnick_alias $unsafe($chan) $nick }
}
}
}
ON *:nick:{
haltdef
var %whloop = 1, %banmask = $gettok($gettok($address( $newnick ,1),2,33),1,42)
while ( $comchan($newnick,%whloop) != $null ) {
var %chan $v1
if (!$istok(MindForge,$network,32) || !$istok(#CHANNEL,%chan,32)) { break }
if (!$nick(%chan,$newnick,~&@%) && $nick(%chan,$me,~&@%+)) { xxbadnick_alias %chan $newnick }
inc %whloop
}
halt
}
Alias xxbadnick_alias {
var %chan $1 , %nick $2, %banmask = $gettok($gettok($address( $2 ,1),2,33),1,42)
if (%nick !ison %chan || $nick( %chan , %nick ,@&~%+)) { halt }
if ($calc($regex(%nick,/[A-Z]/g) * 100 / $len(%nick)) < 40 && $len( %nick ) > 2)
if ($Timer($+(CheckNickZ,.,$network,.,%chan,.,%banmask))) { .timer $+ $+(CheckNickZ,.,$network,.,%chan,.,%banmask) off }
unset $eval($+(%,CheckWarnings,.,$network,.,%chan,.,%banmask),1)
}
if ($len( %nick ) < 3 || $calc($regex(%nick,/[A-Z]/g) * 100 / $len(%nick)) > 40) { .timer 1 2 notice %nick NOTICE WARN }
if ($len( %nick ) < 3 || $calc($regex(%nick,/[A-Z]/g) * 100 / $len(%nick)) > 40) {
if (!$Timer($+(CheckNickZ,.,$network,.,%chan,.,%banmask))) {
.Timer $+ $+(CheckNickZ,.,$network,.,%chan,.,%banmask) 3 15 xxbadnick_still_on_chan $unsafe(%chan) %nick
}
}
}
Alias -l xxbadnick_still_on_chan {
var %chan $1 , %nick $2, %banmask = $gettok($gettok($address( $2 ,1),2,33),1,42)
if ($nick(%chan,%nick,~&@%+)) { halt }
if ($len( %nick ) > 2 && $calc($regex(%nick,/[A-Z]/g) * 100 / $len(%nick)) < 40)
if ($Timer($+(CheckNickZ,.,$network,.,%chan,.,%banmask))) .Timer $+ $+(CheckNickZ,.,$network,.,%chan,.,%banmask) off
if ($+(%,CheckWarnings,.,$network,.,%chan,.,%banmask)) unset $eval($+(%,CheckWarnings,.,$network,.,%chan,.,%banmask),1)
halt
}
inc $+(%,CheckWarnings,.,$network,.,%chan,.,%banmask)
if (%nick ison %chan && $($+(%,CheckWarnings,.,$network,.,%chan,.,%banmask),2) < 3) { notice %nick NOTICE WARN }
else {
if ($eval($+(%,CheckWarnings,.,$network,.,%chan,.,%banmask),2) == 3 && %nick ison %chan && $len( %nick ) < 3 || $calc($regex(%nick,/[A-Z]/g) * 100 / $len(%nick)) > 40) { kick %chan %nick REASON FOR KICK | if ($Timer($+(CheckNickZ,.,$network,.,%chan,.,%banmask))) .Timer $+ $+(CheckNickZ,.,$network,.,%chan,.,%banmask) off | if ($+(%,CheckWarnings,.,$network,.,%chan,.,%banmask)) unset $eval($+(%,CheckWarnings,.,$network,.,%chan,.,%banmask),1) }
if (%nick !ison %chan) { if ($Timer($+(CheckNickZ,.,$network,.,%chan,.,%banmask))) .Timer $+ $+(CheckNickZ,.,$network,.,%chan,.,%banmask) off | if ($+(%,CheckWarnings,.,$network,.,%chan,.,%banmask)) unset $eval($+(%,CheckWarnings,.,$network,.,%chan,.,%banmask),1) }
}
}
I tried to edit it, and it doesn't work (and that's too advanced that I not even remind what I edited, it blown my brain)
Thanks for help
P.S. Or maybe is possible to integrate something here: https://forum.epicnet.ru/viewtopic.php?id=1042#p1644
Something like:
[c]if ($calc($regex(%nick,/[A-Z]/g) * 100 / $len(%nick)) > 40 || $len( %nick ) < 3) DO SOMETHING[/c]
or:
[c]if ($calc($regex($nick,/[A-Z]/g) * 100 / $len($nick)) < 40 && $len( $nick ) > 2) {halt}[/c]

Отредактировано Chandra (28.09.2025 13:10)


If I won't try I'll never learn a bit. I'll compare my wrong code with Your working one , it'll help me to understand