Short combo script help

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

Short combo script help

Postby Jazzin » Sun Jun 05, 2022 5:53 am

Hi, I hate to request a new script for something like this, but I haven't tried making a script in like 2-3 years, and also got a new PC and dont have any previous scripts to go off of.

Can someone help with a script that would let me press a button to automatically run a short combo

For example: I manually press [Left D-Pad] and the script automatically presses [LT] -> 30 ms -> [RB]

Any help would be greatly appreciated!
User avatar
Jazzin
Staff Sergeant
Staff Sergeant
 
Posts: 11
Joined: Wed Jul 16, 2014 8:35 pm

Re: Short combo script help

Postby Mad » Sun Jun 05, 2022 6:08 am

Code: Select all
#include <xb1.gph>
main {
    if(event_active(XB1_LEFT)) {
        combo_run(myCombo);
    }
}
combo myCombo {
    set_val(XB1_LT, 100);
    wait(30);
    set_val(XB1_RB, 100);
    wait(30);
}
ConsoleTuner Support Team || ConsoleTuner Discord || InputSense Discord
Mad
Major General
Major General
 
Posts: 4536
Joined: Wed May 22, 2019 5:39 am

Re: Short combo script help

Postby Jazzin » Mon Jun 06, 2022 5:00 am

Mad wrote:
Code: Select all
#include <xb1.gph>
main {
    if(event_active(XB1_LEFT)) {
        combo_run(myCombo);
    }
}
combo myCombo {
    set_val(XB1_LT, 100);
    wait(30);
    set_val(XB1_RB, 100);
    wait(30);
}


Wow, thank you for the quick reply and the help.

I realized after trying out the script that LT should be held down instead of just pressed. I guess it doesn't need to be held too long, like 150 ms.

Your help is very appreciated
User avatar
Jazzin
Staff Sergeant
Staff Sergeant
 
Posts: 11
Joined: Wed Jul 16, 2014 8:35 pm

Re: Short combo script help

Postby Mad » Tue Jun 07, 2022 12:52 am

Code: Select all
#include <xb1.gph>
main {
    if(event_active(XB1_LEFT)) {
        combo_run(myCombo);
    }
}
combo myCombo {
    set_val(XB1_LT, 100);
    wait(150);
    wait(30);
    set_val(XB1_RB, 100);
    wait(30);
}
ConsoleTuner Support Team || ConsoleTuner Discord || InputSense Discord
Mad
Major General
Major General
 
Posts: 4536
Joined: Wed May 22, 2019 5:39 am


Return to GPC2 Script Programming

Who is online

Users browsing this forum: No registered users and 140 guests