How can i make this macro run in a loop

GPC2 script programming for Titan Two. Code examples, questions, requests.

How can i make this macro run in a loop

Postby teckx » Mon Sep 14, 2020 8:02 pm

How can i make this macro run in a loop until i decide to stop it?

Code: Select all
main {
 
    if (check_active(BUTTON_12,500)) macro_run("macrp9A.gmk");
    if (check_active(BUTTON_13,500)) macro_stop();
}
 
User avatar
teckx
Sergeant Major of the Army
Sergeant Major of the Army
 
Posts: 194
Joined: Tue Mar 27, 2018 1:53 pm

Re: How can i make this macro run in a loop

Postby Mad » Mon Sep 14, 2020 8:43 pm

Code: Select all
bool loop;
 
main {
    if(event_active(BUTTON_12)) loop = !loop;
    if(loop) macro_run("macrp9A.gmk");
    else macro_stop();
}
ConsoleTuner Support Team || ConsoleTuner Discord || InputSense Discord
Mad
Major General
Major General
 
Posts: 4536
Joined: Wed May 22, 2019 5:39 am

Re: How can i make this macro run in a loop

Postby teckx » Mon Sep 14, 2020 8:46 pm

Thank you !
User avatar
teckx
Sergeant Major of the Army
Sergeant Major of the Army
 
Posts: 194
Joined: Tue Mar 27, 2018 1:53 pm


Return to GPC2 Script Programming

Who is online

Users browsing this forum: No registered users and 45 guests