mIRC Homepage
Posted By: druino please help in anti offensive nicknames - 16/12/20 03:44 AM
good morning I have this little addons anti offensive nicknames it works at the first well it warns with notification to the offensive nicknames, but then it is triggered and ejects direct it seems to be some fault in the execution times.
Please some friend to help me with the failure of execution of the times
it works using this command to add banned nicknames /auser 4 *sex*
Quote

on +4!:join:#: { msg $chan $nick notice 1º change your nickname please or you will be expelled using this command /nick your-nick } { .timer $+ $nick 1 20 msg $chan $nick notice 2º: change nickname last notice please /nick tunick } { .timerK $+ $nick 1 40 /kick $chan $nick You were warned to change your nickname, now you are expelled }
on +4!:NICK:{
if $level($newnick) != 4 ) { .timer $+ $nick off | ./timerK $+ $nick off }
}

on *:LOAD:{ ./auser 4 webchat-* | ./auser 4 guest-* | /echo -s 0,4 Addon warn nicks4-9,3loaded }

on *:UNLOAD: { ./rlevel -r 4 | /echo -s 11,12 Addon warn nicks4-0,4unloaded }
Posted By: maroon Re: please help in anti offensive nicknames - 17/12/20 04:58 PM
Can you post your script using the "code" keyword instead of "quote"? Either "quote" is destroying your code, or your code is defective.

Also, it's possible for your code to have a collision between timers if NICK and KNICK both join. Better is to use a character which cannot exist as the 1st character of the nick. For example change

timer $+ $nick
timerK $+ $nick
to
timerscriptname $+ $nick
timerscriptname0K $+ $nick

This change also prevents someone from deleting a different script's timer. if they know the name of the other script's timer, they can change to that nick before joining your channel, and that will stop the other script's timer.
Posted By: druino Re: please help in anti offensive nicknames - 18/12/20 12:50 AM
thanks maroon Excellent
it worked great
now I need if you can help me add a ban with time if possible thanks
example: /ban -u60 $chan $nick $+ !*@*
Posted By: maroon Re: please help in anti offensive nicknames - 18/12/20 06:34 AM
The /ban -u has a -k switch to combine the kick with the ban, however the kick only works if you give it a nick+mask instead of giving only the address. The available masks are shown with /help $mask but none of them is nick!*@* with the closest available being mask 9 as nick!*@*.host

To use this with mask 9, change from:
.timerscriptname0K $+ $nick 1 40 /kick $chan $nick You were warned to change your nickname, now you are expelled
to
.timerscriptname0K $+ $nick 1 40 /ban -ku60 $chan $nick 9 You were warned to change your nickname, now you are expelled

The 60 is seconds, so if you want to ban 5 minutes that is 60*5=300 seconds.
Note that the unban after 60 seconds is a mIRC timer that waits 60 seconds then sends a command to remove the ban. At 60 seconds in the future, if you are not in the channel or do not have @ status to remove bans, then the ban is not removed.

Also, the server has a limit to how many bans they will hold for a channel, and the ban fails if that list is full.

--

If you still want to have the ban use nick!*@* instead of nick!*@*.host you would need to have 2 timers, with 1 timer doing the kick in 40 seconds and the other timer doing the ban in 40 seconds. You would then need to clear both timers in the place where you now clear just the 1 timer.
Posted By: druino Re: please help in anti offensive nicknames - 19/12/20 02:29 AM
maroon thanks for your help
Posted By: druino Re: please help in anti offensive nicknames - 20/12/20 09:41 PM
It seems that it fails in some methods of adding when I add * .sex, it throws an error and bans all those who enter the channel, it could be extended to the code recognizing or accepting special methods such as for example:

/auser 4 *_cam or /auser 4 * _cam*

that can be added with the variants in *
example: /auser 4 sex0*?* /auser 4 sex*!*@* /auser 4 sex!*@*

Thanks for the help
Posted By: druino Re: please help in anti offensive nicknames - 29/12/20 01:46 AM
that can be added with the variants in *
example: /auser 4 sex0*?* /auser 4 sex*!*@* /auser 4 sex!*@*

I tried to accommodate it to something simpler using characters like * but it does not work for me as it should, it kicks all the users who enter the channel
Code
on @1:JOIN:#:{
  if (sex0*?* isin $nick) || (ex*!*@* isin $nick) || (*desvirgado* isin $nick) || (*bastard* isin $nick) || (*lesbian* isin $nick) && ($nick != $me),$nick,32)) {
    msg $chan $nick notice 1º change your nickname please or you will be expelled using this command /nick your-nick } { .timerscriptname $+ $nick 1 20 msg $chan $nick notice 2º: change nickname last notice please /nick tunick } { .timerscriptname0K $+ $nick 1 40 /kick $chan $nick You were warned to change your nickname, now you are expelled 
  }
} 

on @1:NICK:{
  if $level($newnick) != @1 ) { .timerscriptname $+ $nick off | ./timerscriptname0K $+ $nick off }
}


it doesn't work well for me, someone please help me....
© mIRC Discussion Forums