mIRC Homepage
Posted By: krisb34213 userID ban help - 04/09/21 12:02 PM
Ok, i found this little code:

on *:TEXT:*words*:#chan: { ban -k $chan $nick 3 | /mode $chan +b $remtok($gettok($address($nick,0),1,64),*,0,33) }

when a nick says a certain word in a specific channel gets banned and kicked.

However I would like to improve the ban on the id, at the moment the ban of the id is like this (taking an id at random): 8snfFjHJ6!*@*

I would like to add a wildcard (I don't know if it should look like this *8snfFjHJ6!*@* or *!*8snfFjHJ6!*@* ) to have anyone with that id be banned regardless of the rest (nick, domain, etc etc)

Is it possible to make this change to the line of code above (without increasing the number of lines of code, but only in that line)?

Thank you for your help.
Posted By: Epic Re: userID ban help - 05/09/21 09:15 AM
You can try using this variant of the script:
Code
on *:TEXT:*words*:#chan:{ .ban -k $chan $nick 3 | .mode $chan +b $+(*!*,$remove($gettok($address($nick,0),1,64),*,!),*@*) }

Step-by-step explanation of the sequence of actions:

     1. $address($nick,0) - this returns the mask of the address of the user who is on the channel. More details: Here
     2. $gettok($address($nick,0),1,64) - this returns 1 mask token, separated by "@". More details: Here
     3. $remove($gettok($address($nick,0),1,64),*,!) - this will cut out all the extra characters. More details: Here
     4. $+(*!*,$remove($gettok($address($nick,0),1,64),*,!),*@*) - this adds any required wildcards to the identifier. More details: Here


The correct syntax for the user address mask is: "nick!ident@host"

Posted By: krisb34213 Re: userID ban help - 05/09/21 12:13 PM
Thank you very much and thanks also for the explanation! I save it, which for sure will come in handy smile
© mIRC Discussion Forums