mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Nov 2021
Posts: 87
Simo Offline OP
Babel fish
OP Offline
Babel fish
Joined: Nov 2021
Posts: 87
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,

Joined: Nov 2021
Posts: 87
Simo Offline OP
Babel fish
OP Offline
Babel fish
Joined: Nov 2021
Posts: 87
never mind i found the issue in the code

thanks,

Joined: Jan 2004
Posts: 2,127
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 2,127
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

Joined: Jan 2004
Posts: 2,127
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 2,127
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.


Link Copied to Clipboard