Rapid Fire Help Requested

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

Rapid Fire Help Requested

Postby NightmareNM » Sun Jan 17, 2021 7:19 pm

Hello to all that are reading this, I am reaching out to this great community in hopes of getting this script to operate correctly. I am having trouble in understanding how to write code and how to read code. I have been reading up (googling) on how to do this but like I stated earlier, I just cannot understand how to implement this code to my custom script. Basically here is what I am trying to accomplish; on my Xbox controller when I press the VIEW button and DOWN on the d-pad it'll activate with a red LED light, I want Rapid Fire enabled ONLY when holding down the LT. This is primarily for when I play Call of Duty so whenever I go to aim down sights (LT) I want rapid fire for the RT but ONLY when I am holding down the LT. Now here is the issue I am running across, for a secondary command I want it to be where when I press the VIEW button and the UP on the d-pad it'll activate with a pink LED light, I want RT to have rapid fire enabled. This command will be used for games that use the RT like dungeon crawlers or rogue games that require you to use your weapon. I am hoping I am making sense as to what I am trying to accomplish but here is what is I have scripted so far and of course its not working like intended. I hope I pasted the code correctly down below. Thanks for taking the time to read this and thanks if anyone is able to help me.
Code: Select all
int Enabled;
 
main {
    if(get_val(XB1_VIEW) && event_press(XB1_DOWN)) {
        Enabled = !Enabled;
        if(Enabled) colorled(0,2,0,0);
        else colorled(0,0,0,0);
    }
     if(Enabled && get_val(XB1_RT))  {
        if(get_val(XB1_LT)) {
            if(FALSE) {
                combo_run(Turbo_1);
            } else {
                combo_run(Turbo_2);
            }
        } else {
        }
    }
    if(get_val(XB1_VIEW) && event_press(XB1_UP)) {
            Enabled = !Enabled;
        if(Enabled) colorled(0,1,0,0);
        else colorled(0,0,0,0);
    }
    if(Enabled && get_val(XB1_RT)) {
        combo_run(Turbo_3);
    }
}
combo Turbo_1 {
    set_val(XB1_RT, 100);
    wait(40);
    set_val(XB1_RT, 0);
    wait(120);
    set_val(XB1_RT, 0);
}
combo Turbo_2 {
    set_val(XB1_RT, 100);
    wait(40);
    set_val(XB1_RT, 0);
    wait(40);
    set_val(XB1_RT, 0);
}
combo Turbo_3 {
    set_val(XB1_RT, 100);
    wait(40);
    set_val(XB1_RT, 0);
    wait(40);
    set_val(XB1_RT, 0);
}
function colorled(a,b,c,d) {
    set_led(LED_1,a);
    set_led(LED_2,b);
    set_led(LED_3,c);
    set_led(LED_4,d);
}
User avatar
NightmareNM
Corporal
Corporal
 
Posts: 4
Joined: Tue Oct 06, 2020 8:15 pm

Re: Rapid Fire Help Requested

Postby Mad » Sun Jan 17, 2021 9:32 pm

Code: Select all
int RT;
int LT_only;
 
main {
    if(get_val(XB1_VIEW) && event_press(XB1_DOWN)) {
        LT_only = !LT_only;
        if(LT_only) colorled(0,2,0,0);
        else colorled(0,0,0,0);
    }
 
    if(get_val(XB1_VIEW) && event_press(XB1_UP)) {
        RT = !RT;
        if(RT) colorled(0,1,0,0);
        else colorled(0,0,0,0);
    }
 
    if(get_val(XB1_RT)) {
        if(LT_only && get_val(XB1_LT) || RT) {
            combo_run(RF);
        }
    }
}
 
combo RF {
    set_val(XB1_RT, 100);
    wait(40);
    set_val(XB1_RT, 0);
    wait(40);
}
 
function colorled(a,b,c,d) {
    set_led(LED_1,a);
    set_led(LED_2,b);
    set_led(LED_3,c);
    set_led(LED_4,d);
}
ConsoleTuner Support Team || ConsoleTuner Discord || InputSense Discord
Mad
Major General
Major General
 
Posts: 4536
Joined: Wed May 22, 2019 5:39 am


Return to GPC1 Script Programming

Who is online

Users browsing this forum: No registered users and 84 guests