mIRC Home    About    Download    Register    News    Help

Print Thread
#237911 14/06/12 03:05 AM
Joined: Apr 2010
Posts: 30
M
Ameglian cow
OP Offline
Ameglian cow
M
Joined: Apr 2010
Posts: 30
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.

Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
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.


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
argv0 #237921 14/06/12 01:45 PM
Joined: Apr 2010
Posts: 30
M
Ameglian cow
OP Offline
Ameglian cow
M
Joined: Apr 2010
Posts: 30
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.

Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
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.


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
argv0 #237937 15/06/12 12:07 AM
Joined: Jul 2006
Posts: 4,145
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,145
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


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Wims #237938 15/06/12 03:07 AM
Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
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.


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
I can confirm issue #2 though.


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
argv0 #237943 15/06/12 06:13 AM
Joined: Apr 2010
Posts: 30
M
Ameglian cow
OP Offline
Ameglian cow
M
Joined: Apr 2010
Posts: 30
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

Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
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.


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
argv0 #237947 15/06/12 01:51 PM
Joined: Apr 2010
Posts: 30
M
Ameglian cow
OP Offline
Ameglian cow
M
Joined: Apr 2010
Posts: 30
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.

Joined: Aug 2003
Posts: 16
A
Pikka bird
Offline
Pikka bird
A
Joined: Aug 2003
Posts: 16
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.

ashlar #238080 28/06/12 07:12 AM
Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
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.


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
argv0 #238086 28/06/12 09:49 PM
Joined: Aug 2003
Posts: 16
A
Pikka bird
Offline
Pikka bird
A
Joined: Aug 2003
Posts: 16
<removed>

ashlar #238087 28/06/12 10:00 PM
Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
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.


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
ashlar #238088 28/06/12 10:05 PM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
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.


Invision Support
#Invision on irc.irchighway.net
Joined: Dec 2002
Posts: 5,411
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 5,411
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.


Link Copied to Clipboard