Stop a script running on any button pressed?

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

Stop a script running on any button pressed?

Postby kenshyn » Thu Sep 09, 2021 11:42 pm

Any easy way that this can be done????
User avatar
kenshyn
Sergeant First Class
Sergeant First Class
 
Posts: 25
Joined: Tue Jun 20, 2017 11:03 pm

Re: Stop a script running on any button pressed?

Postby Mad » Fri Sep 10, 2021 7:55 am

You can run a loop to check if a button is pressed:
Code: Select all
main {
    uint8 i = 0;
    do {
        if(is_active(i)) {
            // stop script stuff here
        }
    } while (++i < 20);
}
ConsoleTuner Support Team || Discord || YouTube || Twitter
Mad
Major General
Major General
 
Posts: 3807
Joined: Wed May 22, 2019 5:39 am

Re: Stop a script running on any button pressed?

Postby kenshyn » Wed Sep 15, 2021 2:18 pm

Thank you!!!!!
User avatar
kenshyn
Sergeant First Class
Sergeant First Class
 
Posts: 25
Joined: Tue Jun 20, 2017 11:03 pm


Return to GPC2 Script Programming

Who is online

Users browsing this forum: Haures and 25 guests