Macro help
3 posts
• Page 1 of 1
Macro help
Hello all.
I am trying to tweak this so i can control it a bit easier. Id like the ability to break the macro from running its entirety if i need to.
also wanted to require the dpad left and dpad right be held down for a second before the macro runs
im unsure if this would work but my idea would be : hold down dpad left or dpad right for a second which toggles a bool !on
if !on run macro
if half way through the macro i need it to stop can i simply toggle the bool to !off to have it stop the macro?
I am trying to tweak this so i can control it a bit easier. Id like the ability to break the macro from running its entirety if i need to.
also wanted to require the dpad left and dpad right be held down for a second before the macro runs
im unsure if this would work but my idea would be : hold down dpad left or dpad right for a second which toggles a bool !on
if !on run macro
if half way through the macro i need it to stop can i simply toggle the bool to !off to have it stop the macro?
- Code: Select all
main {
if (event_active(BUTTON_12)) macro_run("macrp5A.gmk");
if (event_active(BUTTON_13)) macro_run("macrp6A.gmk");
}
-
teckx - Sergeant Major of the Army
- Posts: 194
- Joined: Tue Mar 27, 2018 1:53 pm
Re: Macro help
use check_active(button,time) to check if a button is pressed for that time set or longer, you can start the macro directly from there. you have to stop the macro with macro_stop() , without a file name.
-
Scachi - Brigadier General
- Posts: 3044
- Joined: Wed May 11, 2016 6:25 am
- Location: Germany
Re: Macro help
Scachi wrote:use check_active(button,time) to check if a button is pressed for that time set or longer, you can start the macro directly from there. you have to stop the macro with macro_stop() , without a file name.
Thanks again for all the help! This works perfectly
- Code: Select all
main {
if (check_active(BUTTON_12,1000)) macro_run("macrp5A.gmk");
if (check_active(BUTTON_13,1000)) macro_run("macrp6A.gmk");
if (check_active(BUTTON_9,500)) macro_stop();
}
-
teckx - Sergeant Major of the Army
- Posts: 194
- Joined: Tue Mar 27, 2018 1:53 pm
3 posts
• Page 1 of 1
Return to GPC2 Script Programming
Who is online
Users browsing this forum: A pile of bricks and 109 guests