mIRC Home    About    Download    Register    News    Help

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

Re: userID ban help [Re: krisb34213] #269350 05/09/21 09:15 AM
Joined: Jan 2012
Posts: 178
Epic Offline
Vogon poet
Offline
Vogon poet
Joined: Jan 2012
Posts: 178
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"



🅸🆁🅲 - 𝔦'𝔱𝔰 𝔸 𝕂𝖎ɴ𝙙 ᴏ𝙛 𝕄𝙖𝖌𝙞𝙘
Re: userID ban help [Re: Epic] #269352 05/09/21 12:13 PM
Joined: Sep 2021
Posts: 5
K
krisb34213 Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
K
Joined: Sep 2021
Posts: 5
Thank you very much and thanks also for the explanation! I save it, which for sure will come in handy smile