mIRC Homepage
Posted By: m0viefreak 2 HOTLINK bugs - 14/06/12 03:05 AM
1. 'halt' in hotlink in one script block hotlinks in other scripts:

Script1.mrc
Code:
on *:HOTLINK:*:*:{
  if (*abc* iswm $hotlink(word)) return
  else halt
}


Script2.mrc
Code:
on *:HOTLINK:*test*:*:{
  return
}


Moving the cursor over the word
Code:
test

does not show the hand cursor!

This used to work in mirc 7.22

It seems like in 7.25 any halt command stops showing cursor for ALL scripts, not just for the current one.
This is very annoying, because i need a HOTLINK matching * (deciding later on the context wether to actually link)


2. leaving out -d switch for /hotlink does not work properly

add this code
Code:
menu @test {
  test:echo -a test
}

on *:HOTLINK:*www*:*:{
  if ($hotlink(event) == rclick) /hotlink -m @test
}


this shows a menu ONLY containing "Test", but the action performed by it is "open link", because that would be the action of the first menu entry if -d was specified.
Posted By: argv0 Re: 2 HOTLINK bugs - 14/06/12 06:03 AM
The problem for 1 is that you were using the wrong syntax, and it was working for you due to lenient handling of the events. It was a bug that your syntax used to work.

For legacy HOTLINK event syntax (pre-7.25) you should have been using ON ^*:HOTLINK. Note the ^. This is a different event from the non-^ event.
Posted By: m0viefreak Re: 2 HOTLINK bugs - 14/06/12 01:45 PM
Oh, I forgot to mention:
I was using the old ^ syntax on 7.22, ofcourse.

I just wanted to migrate my scripts to the new 7.25 syntax, but now it doesnt work anymore.
Posted By: argv0 Re: 2 HOTLINK bugs - 14/06/12 11:41 PM
In your case you'll want to stick to the legacy syntax.

Or you can put the match part in the matchtext rather than have a catchall matchtext event. That way the event won't even trigger.

It is indeed a little odd that you can only *disable* hotlinking, but can't *enable* it. Enabling is only done by the existence of the event, rather than an explicit command. I would have liked to see the /hotlink command used to enable/disable linking, but that would have broken the old style syntax.
Posted By: Wims Re: 2 HOTLINK bugs - 15/06/12 12:07 AM
Remember he said he needs to have a catchall matchtext event, even if he might be possible for him to avoid using it, it's a common (slow) method used to make multiple words parsing possible
Posted By: argv0 Re: 2 HOTLINK bugs - 15/06/12 03:07 AM
That's why I gave alternatives. If you absolutely must use a catch-all, you're going to have to stick with the legacy syntax for now (if Khaled has a way to fix this). If you can figure out a way to not use a catch-all (and by the way, it's entirely possible to match multiple words without catch-alls since you can just as easily use $hotline on a specific matchtext to determine context), you can use that method instead.

Note that if it is possible to avoid catchalls (and it is), then you don't need the catchall, so I am contesting his assertion that he needs it in the first place.
Posted By: argv0 Re: 2 HOTLINK bugs - 15/06/12 03:43 AM
I can confirm issue #2 though.
Posted By: m0viefreak Re: 2 HOTLINK bugs - 15/06/12 06:13 AM
Originally Posted By: argv0
and by the way, it's entirely possible to match multiple words without catch-alls since you can just as easily use $hotline on a specific matchtext to determine context

Yes, but in that case the cursor is only shown on that specific part i put in the match text, but i want the whole line to do so.

And this isnt exactly limited to *, even more specific catches can interfere with each other, which likely results in scripts blocking each other.

imagine in one script i catch *asdf*, then decide on the context ($hotline) wether to show a cursor.
in a 2nd script i try to catch *hjkl*, and do something similar.

if the word is now asdfghjkl, the first triggers, but halts due to wrong context, the 2nd script wont work at all.

I will try to use the legacy syntax, and see if it sill works using^ in 7.25, but i think this should also be possible using the new syntax.

And i agree, i dont like the halt/return concept either

it should be something like

return $false - dont show cursor (but only for this script!)
return $true - show cursor
return - nothing, as if the event wasnt even in the script
Posted By: argv0 Re: 2 HOTLINK bugs - 15/06/12 06:48 AM
Originally Posted By: m0viefreak
it should be something like

return $false - dont show cursor (but only for this script!)
return $true - show cursor
return - nothing, as if the event wasnt even in the script


It should definitely not be this. There should be a /hotlink switch to enable/disable highlighting, and return/halt should be deprecated in the new event syntax. Relying on keywords in the language to implement event specific behaviour will come back to bite Khaled in the ass later-- as the original event design is clearly illustrating.

I think it should be possible to make /halt and /haltdef *not* halt the entire event chain inside the non-^ event, though, and that should actually be a fairly easy change-- and won't require any new commands/switches. but I still think we ought to move away from using return or halt for this event completely. It's fairly unprecedented to use "return" to add semantic meaning to an event, since it's purely a control flow based construct.
Posted By: m0viefreak Re: 2 HOTLINK bugs - 15/06/12 01:51 PM
I just tried the legacy syntax using ^ in mirc 7.25.
It still doesn't work as 7.22 did.

Sticking with 7.22 until this is fixed.
Posted By: ashlar Re: 2 HOTLINK bugs - 28/06/12 06:27 AM
I can't get any value for $hotlink(event) it's just blank.
Also, $mouse.key is always 0 in hotlink event now

I have no idea how to check for right mouse click on specific things now...

Back to 7.22 for me as well.
Posted By: argv0 Re: 2 HOTLINK bugs - 28/06/12 07:12 AM
Please post separate bugs in separate threads. This thread is not about $hotlink(event) or $mouse.key. On a sidenote, I can't reproduce either of your claims, which is all the more reason to start a separate thread with proper reproduction steps so it can have a proper conversation about whether your report is actually valid, and, if so, what it affects and what can be done. I should reiterate that this thread is not the proper place for such a discussion.
Posted By: ashlar Re: 2 HOTLINK bugs - 28/06/12 09:49 PM
<removed>
Posted By: argv0 Re: 2 HOTLINK bugs - 28/06/12 10:00 PM
If you realized that grouping bugs together in a post you didn't start would get flamed, why did you do it?

Provide the proper steps to reproduce in a proper (read: separate) bug report thread and the issue will get looked at in an equally proper manner. If you hijack someone else's thread to add your bug report, you shouldn't be surprised that you get ignored. If you want to be taken seriously, follow the proper etiquette of the forums (which you even admitted you are already intuitively aware of).

By the way, your bug is being ignored because there are no steps to reproduce it as much as the fact that you are hijacking. There are 2 strikes here, not one. Claiming that "other people have this issue" is not reliable evidence, and doesn't help to get a bug fixed. Reproducing it is the only way that Khaled can fix a bug. If he doesn't know what causes it, he can't know how to fix it.
Posted By: Riamus2 Re: 2 HOTLINK bugs - 28/06/12 10:05 PM
First off, asking you to create your own thread is hardly flaming. Neither is saying that he can't reproduce the problem. You appear to know that different bugs should be in different threads, so just do that. Putting a completely unrelated bug report in the middle of someone else's thread will just mean that your bug will get lost.

Next, whenever you post a bug report, you need to provide some details on how to reproduce it. Especially if it's not something that is happening to everyone. If no one can reproduce your problem, then your problem will be ignored. The best thing you can do is to show us your script that isn't working. That will let others test the exact same script and see if they can reproduce the problem or to see if you have any errors in your script. That is a very important step to any bug report. And it's not "flaming" to ask for it.
Posted By: Khaled Re: 2 HOTLINK bugs - 24/09/12 07:18 AM
Thanks for your bug report. The legacy support should work almost identically in 7.22 and 7.25. If you can provide a short example legacy script, I will try to reproduce the issue here.

Update: I was able to reproduce the issue and it should now be fixed for the next version.
© mIRC Discussion Forums