Help - Search - Members - Calendar
Full Version: Need Help on Ending a Macro
AC Tools Everything Macro > AC Tool Macros > Macro Development
lewdyboy
Is there a way to end AC Tool macros from the game (I play EQ2) by pressing a key? I tried the Global Hotkeys function in the AC Tool preferences but it does not seem to stop / pause. Thanks for any help!
Ahk
Do you just want to stop the macro or close the program altogether?

You can use the {GlobalHotkeys} variable within the macro to do either, but in order to close AcTools you have to use another program, or VBS script to actually close the program. I was able to do this using VBS, and there's a lot of information out there on how to write one, you have to ExecProgram the script, and the script must delay a couple of seconds (the VBS), and then have the macro stop itself...otherwise AcTool will prompt you to stop the macro first and will effectively stop the macro...but it's waiting for you to click yes or no.

If {GlobalHotkeys} contains $StopKey
TimeStamp stopping
//To close Tool...ExecProgram //Script file
Stop
End
lewdyboy
I would like to start the macro by pressing "F2" in another active program and end the macro by pressing "F3" in that same program. Need some assistance with how to put these two conditions together (such as which commands to use, etc.). Thanks!

edit: right now I have to alt-tab to ac tool and press F2 to start, alt-tab and press F3 to stop macro from running.
Ahk
QUOTE
With ProcessMessages you could make a procedure like follows that would run if the hotkey was pressed, and you run the ProcessMessages command.

CODE
//Put ProcessMessages in your code whenever/wherever you want to check for HotKey
ProcessMessages

Procedure Hotkey1 When {GlobalKeys} contains $Hotkey
While 1 = 1
TimeStamp Hotkey pressed

If {GlobalKeys} contains $StopKey
Exit
Else
Delay 50 //Always include a delay when running infinite loops
End
End
ClearGlobalKeys //Keep procedure from running repetitively when the hotkey isn't pressed
End


Call is pretty much the same idea if you've only got one procedure to run. ProcessMessages allows you to go through any procedure with When, On, and Every keywords. These are all listed in the help under Procedure and ProcessMessages.


This will need some hefty changes, but it was from one of my other posts about hotkeys. It looks like if you hit the hotkey, it only waits for you to hit the stop key (pretty worthless except as example).
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.