I need a script PLEASE

GPC1 script programming for Titan One. Code examples, questions, requests.

I need a script PLEASE

Postby ARPANET » Sat May 30, 2020 9:14 am

The script should work as follows:

Every time the L2 button is being pressed and a double click on the "X" is performed, the following should happen:

L2 remains pressed and the "R1" button is pressed and released every 20ms

To deactivate: A new click on the X ends the combo.
User avatar
ARPANET
Private
Private
 
Posts: 1
Joined: Fri May 29, 2020 8:08 am

Re: I need a script PLEASE

Postby J2Kbr » Tue Jun 02, 2020 2:52 pm

Your script. :smile0517:
Code: Select all
int cross_rtime;
int toggle;
 
main {
    if(toggle) {
        // To deactivate: A new click on the X ends the combo.
        if(event_press(PS4_CROSS)) {
            combo_stop(TurboR1);
            toggle = FALSE;
        } else {
            // L2 remains pressed
            set_val(PS4_L2, 100);
            // and the "R1" button is pressed and released every 20ms
            combo_run(TurboR1);
        }
    } else
    // Every time the L2 button is being pressed
    if(get_val(PS4_L2)) {
        // and a double click on the "X" is performed
        if(event_press(PS4_CROSS) && cross_rtime < 150) {
            toggle = TRUE;
        } else if(event_release(PS4_CROSS)) {
            cross_rtime = 0;
        } else if(cross_rtime < 200) {
            cross_rtime = cross_rtime + get_rtime();
        }
    }
}
 
combo TurboR1 {
    set_val(PS4_R1, 100);
    wait(20);
    set_val(PS4_R1, 0);
    wait(10);
    set_val(PS4_R1, 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


Return to GPC1 Script Programming

Who is online

Users browsing this forum: No registered users and 109 guests