Is it possible (script)

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

Is it possible (script)

Postby I yoshimitsu l » Sun Feb 10, 2019 5:22 pm

Is it possible to write a script so that when you press a button the Titan two device automatically presses another button before the one you’ve pressed! Example:
I’d wish for when I press either b, x, y, rb, or lb that it would execute the right trigger first then quickly auctioning the button on which I actually pressed..... is this possible?
Thanks
User avatar
I yoshimitsu l
Corporal
Corporal
 
Posts: 5
Joined: Sun Dec 23, 2018 7:30 pm

Re: Is it possible (script)

Postby J2Kbr » Mon Feb 11, 2019 8:41 am

Yes, this is possible: :smile0517:
Code: Select all
uint8 button;
 
main {
    // when I press either b, x, y, rb, or lb
    if(event_active(BUTTON_15)) {
        button = BUTTON_15;
    } else if(event_active(BUTTON_17)) {
        button = BUTTON_17;
    } else if(event_active(BUTTON_14)) {
        button = BUTTON_14;
    } else if(event_active(BUTTON_4)) {
        button = BUTTON_4;
    } else if(event_active(BUTTON_7)) {
        button = BUTTON_7;
    }
    // that it would execute the right trigger first then quickly
    // auctioning the button on which I actually pressed
    if(button) {
        set_val(button, 0.0);
        combo_run(RightTriggerAndButton);
    }
}
 
combo RightTriggerAndButton {
    set_val(BUTTON_5, 100.0);
    wait(50);
    set_val(BUTTON_5, 0.0);
    wait(50);
    set_val(button, 100.0);
    wait(50);
    button = 0;
}
 
ConsoleTuner Support Team
User avatar
J2Kbr
General of the Army
General of the Army
 
Posts: 20323
Joined: Tue Mar 18, 2014 1:39 pm

Re: Is it possible (script)

Postby I yoshimitsu l » Fri Feb 15, 2019 1:40 pm

Thank again, your ace!
User avatar
I yoshimitsu l
Corporal
Corporal
 
Posts: 5
Joined: Sun Dec 23, 2018 7:30 pm


Return to GPC2 Script Programming

Who is online

Users browsing this forum: No registered users and 211 guests