Key Pressing

Need some help with that macro you're working on or aren't quite sure how to get your macro to do something? Ask here!

Moderator: MacroQuest Developers

lpmko
orc pawn
orc pawn
Posts: 17
Joined: Thu Jun 20, 2002 11:00 pm

Key Pressing

Post by lpmko » Sun Mar 07, 2004 3:16 am

Hi, I am wondering how I could make it so that if I hit the F7 key for example, it would go to a subroutine.

ml2517
a grimling bloodguard
a grimling bloodguard
Posts: 1216
Joined: Wed Nov 12, 2003 1:12 am

Post by ml2517 » Sun Mar 07, 2004 7:38 am

The only way I could think of achieving that is to:

Map F7 to one of your hotkeys within EQ.

In the Hotkey make it something like:
/echo DoSub

Then make your sub, but make it an event sub:

Code: Select all

|
| Example Macro
|

#turbo 50
#Event DoSub "[MQ2] DoSub"

Sub Main
:MainLoop
/doevents
/delay 0
/goto :MainLoop
/return

Sub Event_DoSub
    all of your code here
/return

lpmko
orc pawn
orc pawn
Posts: 17
Joined: Thu Jun 20, 2002 11:00 pm

Post by lpmko » Sun Mar 07, 2004 12:17 pm

Thanks a ton...not quite what I was looking for but it will definately work for now :D

theafkxper
a hill giant
a hill giant
Posts: 207
Joined: Sun Sep 08, 2002 6:41 pm

Post by theafkxper » Sun Mar 07, 2004 7:52 pm

or hmake the hotbutton assign a variable a value and do somehting like...

Code: Select all

/if n @SomeVariable==1  /call SomeSub

/return


Sub SomeSub 
blah blah blah
..
...
/varset SomeVariable 0
/return