mIRC Home    About    Download    Register    News    Help

Print Thread
hotlink doesnt work for extended muteban #270453 29/06/22 02:28 PM
Joined: Nov 2021
Posts: 35
Simo Offline OP
Ameglian cow
OP Offline
Ameglian cow
Joined: Nov 2021
Posts: 35
greetz folkz,

i noticed a hotlink event i use to reverse bans on channel doesnt seem to work on certain extended bans

Code

On $^*:hotlink:/([^\s\x28\x29]+\!?[^\s\x28\x29]+\@[^\s\x28\x29]+)/g:#:{ }
On $*:hotlink:/([^\s\x28\x29]+\!?[^\s\x28\x29]+\@[^\s\x28\x29]+)/g:#:{ checkaccessXOne $chan  $iif($regml(1) isban $chan,-b,+b)  $replace($regml(1),~,*) }
alias checkaccessXOne { if ($nick(#,$me,@&~%)) { !mode $1- }  | else { cs mode $1 set $2-  } }





for example this extended muteban works fine
Quote

~q:*!*@Testing-y4r.440.52.08.IP
m:*!*@Testing-y4r.440.52.08.IP

but this one doesnt seem to work:

Quote

~quiet:*!*@Testing-y4r.440.52.08.IP


thanks in advance,

Re: hotlink doesnt work for extended muteban [Re: Simo] #270455 29/06/22 06:02 PM
Joined: Nov 2021
Posts: 35
Simo Offline OP
Ameglian cow
OP Offline
Ameglian cow
Joined: Nov 2021
Posts: 35
never mind i found the issue in the code

thanks,

Re: hotlink doesnt work for extended muteban [Re: Simo] #270456 29/06/22 08:17 PM
Joined: Jan 2004
Posts: 1,805
maroon Offline
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 1,805
from talking with him in the help channel, turned out the problem was that $replace($regml(1),~,*) was altering the string. We don't know what is the purpose of \x28 or \x29, since \x28 is the character used by the Ctrl+I italic controlcode, and chr(29) is unknown. Also, this regex pattern doesn't anchor the end of the string, so even if the chr28 or chr29 were in the middle of the string, it would still capture the portion touching the "@". If the intent were to strip all control codes should change /g to /gS

Re: hotlink doesnt work for extended muteban [Re: maroon] #270462 30/06/22 10:04 PM
Joined: Jan 2004
Posts: 1,805
maroon Offline
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 1,805
Follow up on this, Wims pointed out that 28 and 29 were hex not decimal, so these are excluding the open/close parenthesis, which allows it to handle (ban@mask) correctly.