help change rapid fire from first script to second script

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

help change rapid fire from first script to second script

Postby sebascu » Sun Oct 06, 2019 7:46 pm

PRIMER SCRIPT:
Code: Select all
data( 1, 
2, 0, 0, 0 ,
0, 2, 0, 0 ,
0, 0, 2, 0 ,
0, 0, 0, 2 ,
2, 0, 2, 0 ,
0, 2, 2, 0 ,
2, 2, 2, 2
);
 
define FIRE_BTN = PS4_R2;
define ADS_BTN = PS4_L2;
define CROUCH_BTN = PS4_CIRCLE;
define SPRINT_BTN = PS4_L3;
define JUMP_BTN = PS4_CROSS;
define NEXT_PIECE = PS4_R1;
define LEFT_BUMP = PS4_L1;
define SWAP_BTN = PS4_SHARE;
define BUILD_BTN = PS4_PS;
define RELOAD_BTN = PS4_SQUARE;
define SPOT = 900;
define SPOT_BUTTON = PS4_R3;
define Blue = 1;
define Red = 2;
define Green = 3;
define Pink = 4;
define SkyBlue = 5;
define Yellow = 6;
define White = 7;
 
 
int RF_onoff = FALSE;
int AimAssist_onoff = TRUE;
int shake = 38;
int AntiRecoil_onoff = TRUE;
int ANTI_RECOIL = 5;
int ANTI_RECOIL_H = 0;
int anti_recoil;
int anti_recoil_H;
 
main {
    if (RF_onoff) f_LED_CM(Red);
    else  f_LED_CM(Blue);
    if (get_val(ADS_BTN)) set_val(ADS_BTN, 100);
    if (get_val(FIRE_BTN)) set_val(FIRE_BTN, 100);
    if (abs(get_val(PS4_RY)) < 0 && abs(get_val(PS4_RX)) < 0) {
        set_val(PS4_RY, 0);
        set_val(PS4_RX, 0);
    }
    if (get_val(PS4_SHARE)) {
        if (event_press(PS4_PS)) {
            RF_onoff =! RF_onoff;
        }
        set_val(PS4_PS, 0);
    }
    if (get_val(PS4_L3)) {
        set_val(PS4_CIRCLE, 100);
    }
    if (get_val(7)) combo_run(c_AutoSpot);
    if (event_press(BUILD_BTN) || event_press(SWAP_BTN)) {
        RF_onoff =! RF_onoff;
    }
    if (RF_onoff) {
        if (get_val(FIRE_BTN) && get_val(ADS_BTN)) {
            combo_run(c_RAPID_FIRE);
        }
    }
    if (get_val(PS4_SHARE)) {
        if (event_press(PS4_PS)) {
            AimAssist_onoff =! AimAssist_onoff;
        }
        set_val(PS4_PS, 0);
    }
    if (AimAssist_onoff) {
        if (get_val(ADS_BTN)) combo_run(c_Auto_Aimm);
        else  combo_stop(c_Auto_Aimm);
        if (get_val(ADS_BTN)) {
            if (abs(get_val(9)) > 21 || abs(get_val(10)) > 21) {
                combo_stop(c_Auto_Aimm);
            }
        }
    }
    if (get_val(PS4_SHARE)) {
        if (event_press(PS4_PS)) {
            AntiRecoil_onoff =! AntiRecoil_onoff;
        }
        set_val(PS4_SHARE, 0);
    }
    if (AntiRecoil_onoff) {
        if (get_val(ADS_BTN) && get_val(FIRE_BTN)) {
            combo_run(c_AntiRecoil);
        }
    }
}
 
 
combo c_RAPID_FIRE {
    set_val(FIRE_BTN, 100);
    wait(18);
    set_val(FIRE_BTN, 0);
    wait(12);
}
 
combo c_AutoSpot {
    set_val(SPOT_BUTTON, 100);
    wait(50);
    set_val(SPOT_BUTTON, 0);
    wait(SPOT);
}
 
combo c_Auto_Aimm {
    set_val(10, shake *- 1);
    wait(20);
    set_val(9, shake);
    wait(20);
    set_val(10, shake);
    wait(20);
    set_val(9, shake *- 1);
    wait(20);
}
 
combo c_AntiRecoil {
    anti_recoil = get_val(10) + ANTI_RECOIL;
    if (anti_recoil > 100) anti_recoil = 100;
    set_val(10, anti_recoil);
    anti_recoil_H = get_val(9) + ANTI_RECOIL_H;
    if (anti_recoil_H > 100) anti_recoil_H = 100;
    set_val(9, anti_recoil_H);
}
 
 
function f_LED_CM(Colour) {
    set_led(LED_1, dbyte((Colour * 4) - 3));
    set_led(LED_2, dbyte(((Colour * 4) - 3) + 1));
    set_led(LED_3, dbyte(((Colour * 4) - 3) + 2));
    set_led(LED_4, dbyte(((Colour * 4) - 3) + 3));
}
 


SEGUNDO SCRIPT:
Code: Select all
// colorled(0,0,0,0); // Off / No LED light
// colorled(1,0,0,0); // Dim Blue
// colorled(0,1,0,0); // Dim Red
// colorled(0,0,1,0); // Dim Lime/Green
// colorled(0,0,0,1); // Dim Fuchsia/Pink
// colorled(1,0,1,0); // Dim SkyBlue
// colorled(0,1,1,0); // Dim Yellow
// colorled(1,1,1,1); // Dim White
// colorled(2,0,0,0); // Blue 
// colorled(0,2,0,0); // Red
// colorled(0,0,2,0); // Lime/Green
// colorled(0,0,0,2); // Fuchsia/Pink
// colorled(2,0,2,0); // SkyBlue
// colorled(0,2,2,0); // Yellow
// colorled(2,2,2,2); // White
// colorled(3,0,0,0); // Bright Blue
// colorled(0,3,0,0); // Bright Red
// colorled(0,0,3,0); // Bright Lime/Green
// colorled(0,0,0,3); // Bright Fuchsia/Pink
// colorled(3,0,3,0); // Bright SkyBlue
// colorled(0,3,3,0); // Bright Yellow
// colorled(3,3,3,3); // Bright white
// ColorLed (1) Dim light
// ColorLed (2) Normal/Medium
// ColorLed (3) Bright light
 
//DECLARARATIONS
//--------------------------------------------------------------
define SHOOT_BUTTON      = PS4_R2;
define RAPIDFIRE_BUTTON = PS4_L2;
define RATE_OF_FIRE       = 180; // Range: 1 to 25 RPS (Round/s)
define AUTOSPOT_BUTTON  = PS4_L2;
define SPOT_BUTTON      =PS4_R3;
//VARIABLES
//--------------------------------------------------------------
 
    int AP = 22;
    int AM = -22;
    int Delay = 20
    int Release = 23;
 
    int GEN_SENS = 100;
    int ADS_SENS = 100;
    int FIRE_SENS = 100;
    int ADS_FIRE_SENS = 100;
    int USE_SENS;
 
 
//             *DO NOT EDIT/DELETE THIS SECTION*
int hold_time;
int rest_time;
int Attack                   = FALSE;
 
int Timeout_Melee            = 0;
int DbleClick_Square         = 0;
  define RT   = PS4_R1;
    define LT   = PS4_L1;
    define RX   = PS4_RX;                             
    define RY   = PS4_RY;
 
    int value   = 27;
    int value2  = -28;
    int delay   = 20;
 
 
 
//INITIALIZATION - init
//--------------------------------------------------------------
init {
     hold_time = 5450 / RATE_OF_FIRE;
     rest_time = hold_time - 5450;
     if(rest_time < 23) rest_time = 0;
}
 
//MAIN BLOCK RUTINES
//--------------------------------------------------------------
main {
 
    if(get_val(7)) combo_run(AS);
 
    if(!get_val(7) && !get_val(4)) {
    USE_SENS=GEN_SENS;}
    else if(get_val(7) && !get_val(4)) {
    USE_SENS=ADS_SENS;}   
    else if(!get_val(7) && get_val(4)) {
    USE_SENS=FIRE_SENS;}
    else if(get_val(7) && get_val(4)) {
    USE_SENS=ADS_FIRE_SENS;}
    sensitivity(10,NOT_USE,USE_SENS);
    sensitivity(9,NOT_USE,USE_SENS);
 
 
    // AIM ASSIST
     if(get_val(LT)) {
            combo_run(LT_C);
        }
 
        if(get_val(RT) && get_val(LT)) {
            combo_stop(LT_C);
            combo_run(RT_C);
        }
 
        if(get_val(RX) < value2 || get_val(RX) > value || get_val(RY) < value2 || get_val(RY) > value || get_val(RX) < value2 || get_val(RX) > value || get_val(RY) < value2 || get_val(RY) > value) {
            combo_stop(LT_C);
            combo_stop(RT_C);
        }
 
 
    // COLOR INDICATION FOR the RAPID FIRE ON / OFF
    if(get_val(RAPIDFIRE_BUTTON) && get_val(SHOOT_BUTTON)) {
        colorled(0,0,1,0)// OFF (Dim Lime/Green) *you can edit here*
        colorled(3,3,3,3); // (White) *you can edit here*
        combo_run(RapidFire);
    } else if(combo_running(RapidFire)) {
        combo_stop(RapidFire);
        reset_leds(); }
 
    // 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); }
}
 
//COMBO BLOCKS
//--------------------------------------------------------------
 
    combo AS {
    set_val(10,a_f(10,AP));
    wait(Delay)
    set_val(9,a_f(9,AP));
    wait(Delay)
    set_val(10,a_f(10,AM));
    wait(Delay)
    set_val(9,a_f(9,AM));
    wait(Delay)}
 
 
combo RapidFire {
    set_val(SHOOT_BUTTON, 150);
    wait(hold_time);
    set_val(SHOOT_BUTTON, 0);
    wait(rest_time);
    set_val(SHOOT_BUTTON, 0);
}
 
  combo LT_C {
       set_val(RY, -30);         
       wait(delay)
       set_val(RX, 30);
       set_val(RY, 20);
       wait(delay)
       set_val(RY, 20);
       wait(delay)                 
       set_val(RX, -30);
       set_val(RY, 20);
       wait(delay)
    }
 
    combo RT_C {
       set_val(RY, -40);             
       wait(delay)
       set_val(RX, 40);
       set_val(RY, 30);
       wait(delay)
       set_val(RY, 30);
       wait(delay)                 
       set_val(RX, -40);
       set_val(RY, 30);
       wait(delay)
    }
 
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 StrongAttack {
    set_val(PS4_TRIANGLE, 100);
    wait(100);
    set_val(PS4_TRIANGLE, 0);
    Timeout_Melee = 0;
}
 
combo Action {
    set_val(PS4_SQUARE, 100);
    wait(40);
    set_val(PS4_SQUARE, 0);
    wait(20);
    set_val(PS4_SQUARE, 0);
}
 
    function a_f(p,m) {
    if(abs(get_val(p)) < Release)
    return m;
    return get_val(p);}
 
// COLOR LED INDICATION for PS4 *NO NEED TO EDIT BELOW*
//--------------------------------------------------------------
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: help change rapid fire from first script to second scrip

Postby Mad » Mon Oct 07, 2019 1:20 am

It already has rapidfire.
ConsoleTuner Support Team || ConsoleTuner Discord || InputSense Discord
Mad
Major General
Major General
 
Posts: 4536
Joined: Wed May 22, 2019 5:39 am

Re: help change rapid fire from first script to second scrip

Postby sebascu » Mon Oct 07, 2019 2:02 am

why is it very slow
User avatar
sebascu
Sergeant Major
Sergeant Major
 
Posts: 68
Joined: Sat Aug 03, 2019 5:32 pm


Return to GPC1 Script Programming

Who is online

Users browsing this forum: No registered users and 63 guests