mIRC Home    About    Download    Register    News    Help

Print Thread
please help in anti offensive nicknames #268232 16/12/20 03:44 AM
Joined: Jul 2020
Posts: 7
D
druino Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
D
Joined: Jul 2020
Posts: 7
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 }

Re: please help in anti offensive nicknames [Re: druino] #268249 17/12/20 04:58 PM
Joined: Jan 2004
Posts: 1,481
maroon Offline
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 1,481
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.

Re: please help in anti offensive nicknames [Re: maroon] #268252 18/12/20 12:50 AM
Joined: Jul 2020
Posts: 7
D
druino Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
D
Joined: Jul 2020
Posts: 7
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 $+ !*@*

Re: please help in anti offensive nicknames [Re: druino] #268253 18/12/20 06:34 AM
Joined: Jan 2004
Posts: 1,481
maroon Offline
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 1,481
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.

Re: please help in anti offensive nicknames [Re: maroon] #268256 19/12/20 02:29 AM
Joined: Jul 2020
Posts: 7
D
druino Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
D
Joined: Jul 2020
Posts: 7
maroon thanks for your help

Re: please help in anti offensive nicknames [Re: druino] #268267 20/12/20 09:41 PM
Joined: Jul 2020
Posts: 7
D
druino Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
D
Joined: Jul 2020
Posts: 7
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

Last edited by druino; 20/12/20 09:48 PM.
Re: please help in anti offensive nicknames [Re: druino] #268299 29/12/20 01:46 AM
Joined: Jul 2020
Posts: 7
D
druino Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
D
Joined: Jul 2020
Posts: 7
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....

Last edited by druino; 29/12/20 04:31 AM.