mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Feb 2003
Posts: 106
L
Vogon poet
OP Offline
Vogon poet
L
Joined: Feb 2003
Posts: 106
The following code sets up a window with a custom menu, and also an alias which contains the same code as does the custom menu, but the code executes differently when called as an alias compared to being called from the dclick item.
In fact, the sendkeys command inside the menu definition does not get past opening the scripts editor within mirc, whereas alias 't' opens the scripts editor and activates the file menu also.
What do I need to do to get the custom menu to complete the sendkeys command?

cheers.

Code:
alias menuTesting {
  window -l @menuTesting
  %count = 10
  while %count {
    aline @menuTesting count = %count    
    dec %count
  }
}

menu @menuTesting {
  dclick: sendkeys % $+ r  % $+ f   
}

alias t {
  sendkeys % $+ r  % $+ f   
}




-
Just because it never happened doesn't mean it isn't true.
Joined: Nov 2006
Posts: 1,559
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
Though I'm not able to explain this behaviour - You can "fix" it if you delay the dclick command with a timer, like:
Code:
menu @test { 
  dclick  : .timer -m 1 250 T
  test of T : T
}

alias T { sendkeys % $+ r $+ % $+ f }

Note that I added an extra "$+" to the sendkey string because you've been sending an extra space char to the scripts editor, which may corrupt whatever script is currently displayed wink

Smaller delays (e.g. 150ms) work fine for me; at aprox. 100ms however it started to be unreliable - thus I picked "250" to play safe a bit.

Joined: Feb 2003
Posts: 106
L
Vogon poet
OP Offline
Vogon poet
L
Joined: Feb 2003
Posts: 106
Thanks Horstl. I had noticed the extraneous spaces my code was generating, and thanks for the advice re using a timer.

cheers


-
Just because it never happened doesn't mean it isn't true.

Link Copied to Clipboard