mIRC Home    About    Download    Register    News    Help

Topic Options
#262079 - 28/12/17 06:14 PM on hotlink $hotlink(word) and $1
Wims Offline
Planetary brain

Registered: 31/07/06
Posts: 3496
Loc: France
In previous version of on hotlink, we had $1 to refer to the matched word, with the new version, $hotlink(word) achieve the same thing except that $1 is stripped from control code.
I think $hotlink(word) not stripping isn't on purpose but it might be useful to get the real match so maybe not worth fixing? I just noticed it and thought I should report it
_________________________
Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net

Top
#262092 - 30/12/17 08:18 AM Re: on hotlink $hotlink(word) and $1 [Re: Wims]
Khaled Offline


Planetary brain

Registered: 04/12/02
Posts: 4420
Loc: London, UK
Thanks for your bug report. As far as I know, this has always been the case. I tested this with mIRC v6.35 and it returned a stripped $1- as well. Can you provide an example where $1- in a hotlink event includes the control codes?

Top
#262094 - 30/12/17 09:28 AM Re: on hotlink $hotlink(word) and $1 [Re: Khaled]
Wims Offline
Planetary brain

Registered: 31/07/06
Posts: 3496
Loc: France
The bug would be about $hotlink(word) not stripping to me, not $1 stripping.
I can only imagine $hotlink(word) meant to be the same as $1.
In fact this non stripping version will also cause the position to be different in some cases ($hotlink(word).pos vs $hotlinepos).
I was just testing $hotlink etc and I ended up with this code:

Code:
on $*:hotlink:*:*:{
  if ($hotlink(word) != $1) echo -s $v1 $v2 -- more debug here
}


And I discovered to my surprised that I was getting echo in status windows when hovering lines in channel: default quit messages from users have a $chr(15) right before the closing ')'

Like I said, it might be useful to someone to have a stripped version and a non stripped version to play with, for example if we had only a non stripped version and we wanted to use a stripped version in our script, if we were to just use $strip($hotlink(word)), well we can't just $strip($hotlink(word).pos) so we would have to parse the word ourself etc which is not trivial. That being said I never saw anyone needing a non stripped version of the word (which is all we had before).
_________________________
Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net

Top
#262095 - 30/12/17 10:32 AM Re: on hotlink $hotlink(word) and $1 [Re: Wims]
Khaled Offline


Planetary brain

Registered: 04/12/02
Posts: 4420
Loc: London, UK
Right. I checked the code - the stripping was purposefully commented out as this was requested when the new hotlink method was implemented. This means that you are receiving the original location of the match word and you will need to strip it yourself if you do not want the control codes in it.

Top
#262096 - 30/12/17 01:16 PM Re: on hotlink $hotlink(word) and $1 [Re: Khaled]
Wims Offline
Planetary brain

Registered: 31/07/06
Posts: 3496
Loc: France
Yeah ok, thanks for the information.
_________________________
Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net

Top