|
Joined: May 2022
Posts: 110
Vogon poet
|
OP
Vogon poet
Joined: May 2022
Posts: 110 |
I have this addon that perfectly work (thanks to Your help :-P ) I'd like to add a feature: Is a not allowed nick join or change nick with a not allowed one, he'll be ban/quiet. I tried to add: on *:join:#CHANNEL:if (($calc($regex($nick,/[A-Z]/g) * 100 / $len($nick)) > 40)) badnick_alias2 #CHANNEL $nick
on *:nick:if (($calc($regex($newnick,/[A-Z]/g) * 100 / $len($newnick)) > 40)) badnick_alias2 #CHANNEL $newnick
alias badnick_alias2 {
var %chan $1 , %nick $2
if (%nick !ison %chan) || (%nick isop %chan) || (%nick ishop %chan) || ($len(%nick) < 3) return
if (!$3) {
[b][color:#FF0000].timer 1 2 /mode #CHANNEL +b ~q: $+ $address($1,2) $$1 NICK NOT ALLOWED![/color][/b]
.timer 1 5 notice %nick WARN ON JOIN
.timer 1 20 badnick_alias2 %chan %nick 20
.timer 1 30 badnick_alias2 %chan %nick 30
;.timer 1 40 badnick_alias2 %chan %nick 40
.timer 1 41 badnick_alias2 %chan %nick 41
return
}
elseif ($3 == 20) notice %nick SECOND WARN
elseif ($3 == 30) notice %nick Ultimo avviso, LAST WARN
elseif ($3 == 41) kick %chan %nick KICK
}
} If user doesn't change nick with allowed one, he'll be kicked out. if user change nick with regular one, then he'll get unbanned from quiet. But doesn't work. Any help? Thanks
|
|
|
|
Joined: Nov 2021
Posts: 145
Vogon poet
|
Vogon poet
Joined: Nov 2021
Posts: 145 |
you could try this (i havend added warnings but it sets ban first time see if this works u can add warning later, also make sure you have the putmode code loaded for mode stacking) :
on *:JOIN:#chan,#chan1,#chan2,#chan3,#chan4,#chan5:{
if ($round($calc($regex($nick,/[A-Z]/g) / $regex($nick,/[A-Za-z]/g) * 100),0) > 40) {
if ($+(~q:,$address($nick,2)) !isban $chan) { putmode $chan +b $+(~q:,$address($nick,2)) }
}
}
ON *:nick: {
var %loopnckz = 1
while ( $comchan($newnick,%%loopnckz) != $null ) {
var %chan $v1
if (!$istok(#chan #chan1 #chan2 #chan3 #chan4 #chan5 ,%chan,32)) { break }
if ($nick(%chan,$me,@%&~)) {
if ($round($calc($regex($nick,/[A-Z]/g) / $regex($nick,/[A-Za-z]/g) * 100),0) > 40) {
if ($newnick isvoice %chan) { putmode %chan -v $newnick }
if ($+(~q:,$address($newnick,2)) !isban %chan) { putmode %chan +b $+(~q:,$address($newnick,2)) }
}
inc %%loopnckz
}
}
|
|
|
|
Joined: Nov 2021
Posts: 145
Vogon poet
|
Vogon poet
Joined: Nov 2021
Posts: 145 |
i believe i made some mistakes in the nick event ive posted this should fix it :
on *:JOIN:#test,#chan1,#chan2,#chan3,#chan4,#chan5:{
if ($nick($chan,$me,@%&~)) {
if ($round($calc($regex($nick,/[A-Z]/g) / $regex($nick,/[A-Za-z]/g) * 100),0) > 40) {
if ($+(~q:,$address($nick,2)) !isban $chan) { putmode $chan +b $+(~q:,$address($nick,2)) }
}
}
}
ON *:nick: {
var %loopnckz = 1
while ( $comchan($newnick,%loopnckz) != $null ) {
var %chan $v1
if (!$istok(#test #chan1 #chan2 #chan3 #chan4 #chan5 ,%chan,32)) { break }
if ($nick(%chan,$me,@%&~)) {
if ($round($calc($regex($newnick,/[A-Z]/g) / $regex($newnick,/[A-Za-z]/g) * 100),0) > 40) {
if ($newnick isvoice %chan) { putmode %chan -v $newnick }
if ($+(~q:,$address($newnick,2)) !isban %chan) { putmode %chan +b $+(~q:,$address($newnick,2)) }
}
inc %loopnckz
}
}
}
Last edited by Simo; Yesterday at 04:04 PM.
|
|
|
|
|