mIRC Homepage
Posted By: Simo hotlink doesnt work for extended muteban - 29/06/22 02:28 PM
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,
Posted By: Simo Re: hotlink doesnt work for extended muteban - 29/06/22 06:02 PM
never mind i found the issue in the code

thanks,
Posted By: maroon Re: hotlink doesnt work for extended muteban - 29/06/22 08:17 PM
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
Posted By: maroon Re: hotlink doesnt work for extended muteban - 30/06/22 10:04 PM
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.
© mIRC Discussion Forums