mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jul 2006
Posts: 4,145
W
Wims Offline OP
Hoopy frood
OP Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,145
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


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Dec 2002
Posts: 5,411
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 5,411
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?

Joined: Jul 2006
Posts: 4,145
W
Wims Offline OP
Hoopy frood
OP Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,145
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).


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Dec 2002
Posts: 5,411
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 5,411
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.

Joined: Jul 2006
Posts: 4,145
W
Wims Offline OP
Hoopy frood
OP Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,145
Yeah ok, thanks for the information.


#mircscripting @ irc.swiftirc.net == the best mIRC help channel

Link Copied to Clipboard