Please Help convert for Titan One

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

Please Help convert for Titan One

Postby sebascu » Fri Oct 11, 2019 3:17 am

Code: Select all
//Posted : Friday 11th of October, 2019 1:36 UTC  
 
 
 
 define RECOIL_POWER=25;// Range: 1 to 25 RPS (Rounds)
 define RT=XB1_RT;
 define LT=XB1_LT;
 define R_X=XB1_RX;
 define R_Y=XB1_RY;
 define L_X=XB1_LX;
 define L_Y=XB1_LY;
 define RIGHT_STICK_VERTIKAL=XB1_RY;
 define RIGHT_STICK_HORIZONTAL=XB1_RX;
 define TWENTY=20;
 define ZERO=0;
 define FIVEH=500;
 define SHOOT_BUTTON=PS4_R2;
 define RAPIDFIRE_BUTTON=PS4_L2;
 define RATE_OF_FIRE=180;
 define AUTOSPOT_BUTTON=PS4_L2;
 define SPOT_BUTTON=PS4_R3;
 
 
 
 
 int hold=0;
 int rest=0;
 int hold_time=0;
 int rest_time=0;
 int Attack=FALSE;
 int Timeout_Melee=0;
 int DbleClick_Square=0;
init{
 
 
     hold_time = 5450 / RATE_OF_FIRE;
     rest_time = hold_time - 5450;
     if(rest_time < 23) rest_time = 0;
 
 
            hold = FIVEH /
            rest = hold - TWENTY;
            if(rest < ZERO) rest = ZERO;
}
main{
//s1-Main
 
 
 
            if(get_val(RT) && get_val(LT)) {
                combo_run(AR_C);
            }
 
 
            if(get_val(LT)) {
                combo_run(Auto_Aimm);
            }
 
            else if(combo_running(Auto_Aimm)) {   
                combo_stop (Auto_Aimm);
            }
 
            else if(combo_running(Auto_Aimm2)) {   
                combo_stop (Auto_Aimm);
            }
 
            if (get_val(R_X)) {
                combo_run(Auto_Aimm1);
            }
 
            else if(combo_running(Auto_Aimm)) {   
                combo_stop (Auto_Aimm1);
            }
 
            else if(combo_running(Auto_Aimm2)) {   
                combo_stop (Auto_Aimm1);
            }
 
            if (get_val(LT)>0 && get_val(RT)>0) {
                combo_run(Auto_Aimm2);
            }   
 
            else if(combo_running(Auto_Aimm2)) {   
                combo_stop (Auto_Aimm2);
            }
 
            if (get_val(LT)&& get_val(R_X)< -45) {
                combo_stop(Auto_Aimm)
            }
 
            if (get_val(LT)&& get_val(R_X)> +45) {
                combo_stop(Auto_Aimm)
            }
 
            if (get_val(LT)&& get_val(R_Y)< -45) {
                combo_stop(Auto_Aimm)
            }
 
            if (get_val(LT)&& get_val(R_Y)> +45) {
                combo_stop(Auto_Aimm)
            }
 
            if ( get_val(R_X)< -45) {
                combo_stop(Auto_Aimm1)
            }
 
            if ( get_val(R_X)> +45){
                combo_stop(Auto_Aimm1)
            }
 
            if ( get_val(R_Y)< -45){
                combo_stop(Auto_Aimm1)
            }
 
            if ( get_val(R_Y)> +45){
                combo_stop(Auto_Aimm1)
            }
 
            if ( get_val(R_X)< -45){
                combo_stop(Auto_Aimm2)
            }
 
            if ( get_val(R_X)> +45){
                combo_stop(Auto_Aimm2)
            }
 
            if ( get_val(R_Y)< -45){
                combo_stop(Auto_Aimm2)
            }
 
            if ( get_val(R_Y)> +45){
                combo_stop(Auto_Aimm2)
            }
 
//s2-Main
 
 
 
 
    // COLOR INDICATION FOR the RAPID SPOT ON / OFF
    if(get_val(RAPIDFIRE_BUTTON)) {
        combo_run(RapidSpot);
    } else if(combo_running(RapidSpot)) {
        combo_stop(RapidSpot);
        reset_leds(); }
 
   // Rapid fire on Square button.
    if(get_val(PS4_SQUARE)) { combo_run(Action); }
    else if(combo_running(Action)) { combo_stop(Action); }
}
//s1-combos
 
 
        combo Auto_Aimm {     
           set_val(R_Y,-25);           
           wait(25)
           set_val(R_X,+25);
           set_val(R_Y,+15);
           wait(25)
           set_val(R_Y,+15);
           wait(25)                 
           set_val(R_X,-25);
           set_val(R_Y,+15);
           wait(25)
        }
 
        combo Auto_Aimm1 {     
           set_val(R_Y,-20);               
           wait(25)
           set_val(R_X,+20);
           set_val(R_Y,+10);
           wait(25)
           set_val(R_Y,+10);
           wait(25)                 
           set_val(R_X,-20);
           set_val(R_Y,+10);
           wait(25)
        }
 
        combo Auto_Aimm2 {     
           set_val(R_Y,-25);             
           wait(25)
           set_val(R_X,+25);
           set_val(R_Y,+25);
           wait(25)
           set_val(R_Y,+25);
           wait(25)                 
           set_val(R_X,-25);
           set_val(R_Y,+25);
           wait(25)
        }
 
 
        combo AR_C {
            if(get_val(RIGHT_STICK_HORIZONTAL) > -50 && get_val(RIGHT_STICK_HORIZONTAL) < 50 && get_val(RIGHT_STICK_VERTIKAL) > -15 && get_val(RIGHT_STICK_VERTIKAL) < 15) {
                set_val(RIGHT_STICK_VERTIKAL, RECOIL_POWER);
            }
        }
//s2-combos
 
 
 
combo RapidSpot {
    set_val(SPOT_BUTTON, 100);
    wait(hold_time);
    set_val(SPOT_BUTTON, 0);
    wait(rest_time);
    set_val(SPOT_BUTTON, 0);
}
 
combo Brawl {
    set_val(PS4_SQUARE, 100);
    set_led(LED_4, 2);
    wait(80);
    set_val(PS4_SQUARE, 0);
    set_led(LED_2, 0);
    wait(60);
    set_val(PS4_SQUARE, 0);
    set_led(LED_4, 0);
}   
 
 
combo Action {
    set_val(PS4_SQUARE, 100);
    wait(40);
    set_val(PS4_SQUARE, 0);
    wait(20);
    set_val(PS4_SQUARE, 0);
}
 
// COLOR LED INDICATION for PS4 *NO NEED TO EDIT BELOW*
//--------------------------------------------------------------
//s1-funcs
 
 
//s2-funcs
 
 
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
sebascu
Sergeant Major
Sergeant Major
 
Posts: 68
Joined: Sat Aug 03, 2019 5:32 pm

Re: Please Help convert for Titan One

Postby Mad » Fri Oct 11, 2019 8:11 pm

Code: Select all
//Posted : Friday 11th of October, 2019 1:36 UTC  
 
 
 
 define RECOIL_POWER=25;// Range: 1 to 25 RPS (Rounds)
 define RT=XB1_RT;
 define LT=XB1_LT;
 define R_X=XB1_RX;
 define R_Y=XB1_RY;
 define L_X=XB1_LX;
 define L_Y=XB1_LY;
 define RIGHT_STICK_VERTIKAL=XB1_RY;
 define RIGHT_STICK_HORIZONTAL=XB1_RX;
 define TWENTY=20;
 define ZERO=0;
 define FIVEH=500;
 define SHOOT_BUTTON=PS4_R2;
 define RAPIDFIRE_BUTTON=PS4_L2;
 define RATE_OF_FIRE=180;
 define AUTOSPOT_BUTTON=PS4_L2;
 define SPOT_BUTTON=PS4_R3;
 
 
 
 
 int hold=0;
 int rest=0;
 int hold_time=0;
 int rest_time=0;
 int Attack=FALSE;
 int Timeout_Melee=0;
 int DbleClick_Square=0;
init{
 
 
     hold_time = 5450 / RATE_OF_FIRE;
     rest_time = hold_time - 5450;
     if(rest_time < 23) rest_time = 0;
 
 
            hold = FIVEH;
            rest = hold - TWENTY;
            if(rest < ZERO) rest = ZERO;
}
main{
//s1-Main
 
 
 
            if(get_val(RT) && get_val(LT)) {
                combo_run(AR_C);
            }
 
 
            if(get_val(LT)) {
                combo_run(Auto_Aimm);
            }
 
            else if(combo_running(Auto_Aimm)) {   
                combo_stop (Auto_Aimm);
            }
 
            else if(combo_running(Auto_Aimm2)) {   
                combo_stop (Auto_Aimm);
            }
 
            if (get_val(R_X)) {
                combo_run(Auto_Aimm1);
            }
 
            else if(combo_running(Auto_Aimm)) {   
                combo_stop (Auto_Aimm1);
            }
 
            else if(combo_running(Auto_Aimm2)) {   
                combo_stop (Auto_Aimm1);
            }
 
            if (get_val(LT)>0 && get_val(RT)>0) {
                combo_run(Auto_Aimm2);
            }   
 
            else if(combo_running(Auto_Aimm2)) {   
                combo_stop (Auto_Aimm2);
            }
 
            if (get_val(LT)&& get_val(R_X)< -45) {
                combo_stop(Auto_Aimm)
            }
 
            if (get_val(LT)&& get_val(R_X)> +45) {
                combo_stop(Auto_Aimm)
            }
 
            if (get_val(LT)&& get_val(R_Y)< -45) {
                combo_stop(Auto_Aimm)
            }
 
            if (get_val(LT)&& get_val(R_Y)> +45) {
                combo_stop(Auto_Aimm)
            }
 
            if ( get_val(R_X)< -45) {
                combo_stop(Auto_Aimm1)
            }
 
            if ( get_val(R_X)> +45){
                combo_stop(Auto_Aimm1)
            }
 
            if ( get_val(R_Y)< -45){
                combo_stop(Auto_Aimm1)
            }
 
            if ( get_val(R_Y)> +45){
                combo_stop(Auto_Aimm1)
            }
 
            if ( get_val(R_X)< -45){
                combo_stop(Auto_Aimm2)
            }
 
            if ( get_val(R_X)> +45){
                combo_stop(Auto_Aimm2)
            }
 
            if ( get_val(R_Y)< -45){
                combo_stop(Auto_Aimm2)
            }
 
            if ( get_val(R_Y)> +45){
                combo_stop(Auto_Aimm2)
            }
 
//s2-Main
 
 
 
 
    // COLOR INDICATION FOR the RAPID SPOT ON / OFF
    if(get_val(RAPIDFIRE_BUTTON)) {
        combo_run(RapidSpot);
    } else if(combo_running(RapidSpot)) {
        combo_stop(RapidSpot);
        reset_leds(); }
 
   // Rapid fire on Square button.
    if(get_val(PS4_SQUARE)) { combo_run(Action); }
    else if(combo_running(Action)) { combo_stop(Action); }
}
//s1-combos
 
 
        combo Auto_Aimm {     
           set_val(R_Y,-25);           
           wait(25)
           set_val(R_X,+25);
           set_val(R_Y,+15);
           wait(25)
           set_val(R_Y,+15);
           wait(25)                 
           set_val(R_X,-25);
           set_val(R_Y,+15);
           wait(25)
        }
 
        combo Auto_Aimm1 {     
           set_val(R_Y,-20);               
           wait(25)
           set_val(R_X,+20);
           set_val(R_Y,+10);
           wait(25)
           set_val(R_Y,+10);
           wait(25)                 
           set_val(R_X,-20);
           set_val(R_Y,+10);
           wait(25)
        }
 
        combo Auto_Aimm2 {     
           set_val(R_Y,-25);             
           wait(25)
           set_val(R_X,+25);
           set_val(R_Y,+25);
           wait(25)
           set_val(R_Y,+25);
           wait(25)                 
           set_val(R_X,-25);
           set_val(R_Y,+25);
           wait(25)
        }
 
 
        combo AR_C {
            if(get_val(RIGHT_STICK_HORIZONTAL) > -50 && get_val(RIGHT_STICK_HORIZONTAL) < 50 && get_val(RIGHT_STICK_VERTIKAL) > -15 && get_val(RIGHT_STICK_VERTIKAL) < 15) {
                set_val(RIGHT_STICK_VERTIKAL, RECOIL_POWER);
            }
        }
//s2-combos
 
 
 
combo RapidSpot {
    set_val(SPOT_BUTTON, 100);
    wait(hold_time);
    set_val(SPOT_BUTTON, 0);
    wait(rest_time);
    set_val(SPOT_BUTTON, 0);
}
 
combo Brawl {
    set_val(PS4_SQUARE, 100);
    set_led(LED_4, 2);
    wait(80);
    set_val(PS4_SQUARE, 0);
    set_led(LED_2, 0);
    wait(60);
    set_val(PS4_SQUARE, 0);
    set_led(LED_4, 0);
}   
 
 
combo Action {
    set_val(PS4_SQUARE, 100);
    wait(40);
    set_val(PS4_SQUARE, 0);
    wait(20);
    set_val(PS4_SQUARE, 0);
}
 
// COLOR LED INDICATION for PS4 *NO NEED TO EDIT BELOW*
//--------------------------------------------------------------
//s1-funcs
 
 
//s2-funcs
 
 
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 (2K / FPS)
Mad
Major General
Major General
 
Posts: 4532
Joined: Wed May 22, 2019 5:39 am


Return to GPC1 Script Programming

Who is online

Users browsing this forum: No registered users and 61 guests