mIRC Home    About    Download    Register    News    Help

Print Thread
mIRC 7.23 Beta: hotlink command always fails. #236904 01/04/12 12:59 PM
Joined: Sep 2003
Posts: 30
O
Ook Offline OP
Ameglian cow
OP Offline
Ameglian cow
O
Joined: Sep 2003
Posts: 30
When using the new /hotlink command I always get this error:

* /hotlink: invalid parameters (line etc..

It makes no difference what flags i use -m or -md.
Even tho I get this error the menu is still added.

Here is some example code.
Code:
menu @test.hotlink {
  TestSubmenu
  .EchoSomething: echo -as $mouse.x $mouse.y $1-
}
on *:hotlink:*.jpg:*: {
  echo -s test hot: $hotlink(match)
  hotlink -md @test.hotlink
  return
}


Windows 7 x64 Ultimate
mIRC v7.23Beta

Re: mIRC 7.23 Beta: hotlink command always fails. [Re: Ook] #236905 01/04/12 01:47 PM
Joined: Feb 2006
Posts: 181
C
Crinul Offline
Vogon poet
Offline
Vogon poet
C
Joined: Feb 2006
Posts: 181
Originally Posted By: Ook

Code:
menu @test.hotlink {
  TestSubmenu
  .EchoSomething: echo -as $mouse.x $mouse.y $1-
}
on *:hotlink:*.jpg:*: {
  echo -s test hot: $hotlink(match)
  hotlink -md @test.hotlink
  return
}



Originally Posted By: mIRC v7.23 beta
/hotlink -md [@menu]

The -m switch displays the popup @menu in the rclick event
The -d switch is used with the -m switch and includes the default popup menu for a match type


Code:
menu @test.hotlink {
  TestSubmenu
  .EchoSomething: echo -as $mouse.x $mouse.y $1-
}
on *:hotlink:*.jpg:*: {
  ;echo -s test hot: $hotlink(match)
  ;rclick event
  if ($hotlink(event) == rclick) hotlink -md @test.hotlink
  return
}

Re: mIRC 7.23 Beta: hotlink command always fails. [Re: Crinul] #236908 01/04/12 04:21 PM
Joined: Sep 2003
Posts: 30
O
Ook Offline OP
Ameglian cow
OP Offline
Ameglian cow
O
Joined: Sep 2003
Posts: 30
aha now it works fine, thx Crinul

Re: mIRC 7.23 Beta: hotlink command always fails. [Re: Ook] #237273 21/04/12 05:10 PM
Joined: Mar 2010
Posts: 57
W
Wiz126 Offline
Babel fish
Offline
Babel fish
W
Joined: Mar 2010
Posts: 57
This doesn't make much sense. If the -m switch is suppose to make the popup work only on right click - at least that's what the version log implies, you shouldn't need the if statement. Otherwise the switch is completely superfluous. But then again the -d switch depends on the -m switch. Something doesn’t make sense in this whole setup. Ideally his original code should just work.

Last edited by Wiz126; 21/04/12 05:19 PM.
Re: mIRC 7.23 Beta: hotlink command always fails. [Re: Wiz126] #237294 24/04/12 07:01 AM
Joined: Oct 2003
Posts: 3,918
A
argv0 Offline
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
I agree with this, but it is by design.

What happens is this:

mIRC triggers ON HOTLINK multiple times for different event types, very similar to the way ON DIALOG works. So you will get multiple triggers of ON HOTLINK, sometimes with the "event type" == mouse, sometimes lclick, sometimes rclick. The only difference is, unlike ON DIALOG, there is no "event type" match in the event definition to filter the triggers by type. It would be as if you had an ON DIALOG:*:*: definition that just catches all events.

Anyhow, in a "mouse" event type, /hotlink -m is not valid, and raises an error (this is the important part). So, to get around this, you need to ensure you're calling /hotlink -m from the right event. As far as I know, this is an explicit choice and by design.

IMO the real problem is that /hotlink raises an error and doesn't just quietly ignore invalid parameters. If it did so, we would need no if to handle this, and we could fill all our parameters into a single hotlink command, greatly simplifying the interface. Again, in my opinion, I don't see the rationale behind being so strict about switches; it certainly seems a little unprecedented, behaviour-wise, and it really makes things much more awkward and unfriendly to new users who don't understand the internal workings of the event.

Either that, or we should have an event type filter in the event definition like ON DIALOG so we can explicitly specify ON HOTLINK:*:rclick:hotlink -m ...

Of course, ignoring the invalid params would be useful either way, the 2nd suggestion is just a loosely related enhancement.


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"