mIRC Home    About    Download    Register    News    Help

Print Thread
#269348 04/09/21 12:02 PM
Joined: Sep 2021
Posts: 7
K
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
K
Joined: Sep 2021
Posts: 7
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.

Joined: Jan 2012
Posts: 299
Fjord artisan
Offline
Fjord artisan
Joined: Jan 2012
Posts: 299
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"



🌐 http://forum.epicnet.ru 📜 irc.epicnet.ru 6667 #Code | mIRC scripts, help, discuss, examples
Epic #269352 05/09/21 12:13 PM
Joined: Sep 2021
Posts: 7
K
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
K
Joined: Sep 2021
Posts: 7
Thank you very much and thanks also for the explanation! I save it, which for sure will come in handy smile


Link Copied to Clipboard