mIRC Home    About    Download    Register    News    Help

Print Thread
on hotlink $hotlink(word) and $1 #262079 28/12/17 06:14 PM
Joined: Jul 2006
Posts: 3,559
W
Wims Offline OP
Hoopy frood
OP Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,559
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
Re: on hotlink $hotlink(word) and $1 [Re: Wims] #262092 30/12/17 08:18 AM
Joined: Dec 2002
Posts: 4,521
Khaled Offline
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 4,521
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?

Re: on hotlink $hotlink(word) and $1 [Re: Khaled] #262094 30/12/17 09:28 AM
Joined: Jul 2006
Posts: 3,559
W
Wims Offline OP
Hoopy frood
OP Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,559
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
Re: on hotlink $hotlink(word) and $1 [Re: Wims] #262095 30/12/17 10:32 AM
Joined: Dec 2002
Posts: 4,521
Khaled Offline
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 4,521
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.

Re: on hotlink $hotlink(word) and $1 [Re: Khaled] #262096 30/12/17 01:16 PM
Joined: Jul 2006
Posts: 3,559
W
Wims Offline OP
Hoopy frood
OP Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,559
Yeah ok, thanks for the information.


Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net