Battlefield 4 / Hardline

Rapid Fire, Burst Fire, Anti-Recoil, Auto Sprint and Sniper Breath. Info in script!
Version1.2
Authorbonefisher
Publish DateThu, 23 Jun 2016 - 22:25
Last UpdateFri, 24 Jun 2016 - 20:32
Downloads1119
RATE


2

0

Release Notes: anti-recoil settings changed to also use for hip fire.
Code: Select all
 
 
 
 
define RATE_OF_FIRE              = 20;      // Range: 1 to 25 SPS. Rapid Fire
define SHOTS_PER_BURST           = 5;       // Shots per Burst
 
define ANTI_RECOIL               = 40;      // Change this value to compensate to the vertical recoil
define ANTI_RECOIL_LEFT          = 0;       // Change this value to compensate to the left
define ANTI_RECOIL_RIGHT         = 0;       // Change this value to compensate to the right
define ONLY_WITH_SCOPE           = FALSE;   // Anti-recoil will only be applied with ADS
 
define SPOT                      = 975 ;    // auto-spot modifier will only be applied with ADS
 
int rapid1_onoff                 = FALSE;
int rapid2_onoff                 = FALSE;
int autospot                     = FALSE;
int AntiRecoilON                 = FALSE;
 
int hold_time, rest_time;
int hold_time2, rest_time2;
int anti_recoil;
int anti_recoil_left;
int anti_recoil_right;
 
init {
    hold_time = 500 / RATE_OF_FIRE;
    rest_time = hold_time;
    if(rest_time < 0) rest_time = 0;
 
    hold_time2 = 65 * SHOTS_PER_BURST;      // Adjust this number depending on RPM of the weapon to match shots per burst in define section.
    rest_time2 = 160;                       // Adjust this number on much delay you want.
    if(rest_time2 < 0) rest_time2 = 0;
}
 
main {
    vm_tctrl(-7);
 
    swap(7,6); swap(4,3);
 
    if((event_press(7) && get_val(15)) || (event_press(15) && get_val(7))){               // Turns ON/OFF Rapid Fire  PS4_L1 + PS4_LEFT (PS4)
        rapid1_onoff = !rapid1_onoff;                                                     // Change RATE_OF_FIRE in define section.
    if(rapid1_onoff) combo_run(RumbleNotifier);
        rapid2_onoff = FALSE;
    }
    if(rapid1_onoff && get_val(4)) {combo_run(RapidFire); }
 
    if((event_press(7) && get_val(13)) || (event_press(13) && get_val(7))){               // Turns ON/OFF  Shot per burst.
        rapid2_onoff = !rapid2_onoff;                                                     // Change in define section. PS4_L1 + PS4_UP (PS4)
    if(rapid2_onoff) combo_run(RumbleNotifier);
        rapid1_onoff = FALSE;
    }
    if(rapid2_onoff && get_val(4)) {combo_run(RapidFire2); }
 
    if(get_val(7) && event_press(14)) {                                                  // This turns on/off Anti-Recoil. PS4_L1 + PS4_DOWN(PS4)
        AntiRecoilON = !AntiRecoilON;
        if(AntiRecoilON) combo_run(RumbleNotifier);
    }
    if(AntiRecoilON && get_val(4)) {
        combo_run(AntiRecoil);
    }
    if(ONLY_WITH_SCOPE || get_val(7)) {
        combo_run(AutoSpot);
    }
 
    if(get_val(7)) { set_val(13,0);set_val(14,0);set_val(15,0);}
 
// AUTOBREATH
    if(get_val(XB1_LT) > 99) {combo_run(AutoBreath);}
    if(get_val(XB1_LT) < 99) {combo_stop(AutoBreath);}
 
// AUTORUN
    if(get_val(XB1_LY) < -99) { set_val(XB1_LS, 100)}
    else if(get_val(XB1_LY) > -99) {set_val(XB1_LS, 0)
    }
 
}
 
combo RapidFire {
    set_val(4, 100);
    wait(hold_time);
    set_val(4, 0);
    wait(rest_time);
    set_val(4, 0);
}
 
combo RapidFire2 {
    set_val(4, 100);
    wait(hold_time2);
    set_val(4, 0);
    wait(rest_time2);
    set_val(4, 0);
}
 
combo AutoBreath {
    wait(200);
    set_val(XB1_LS, 100);
    wait(4000);
}
 
combo AutoSpot {
    set_val(3, 100);
    wait(50);
    set_val(3, 0);
    wait(SPOT);
 }
 
 combo RumbleNotifier {
    set_rumble(RUMBLE_A, 100);
    wait(200);
    reset_rumble();
}
 
combo AntiRecoil {
    if(get_val(4) && AntiRecoilON) {
      anti_recoil = get_val(10) + ANTI_RECOIL;
      if(anti_recoil > 100) anti_recoil = 100;
      set_val(10, anti_recoil);
      anti_recoil_left = get_val(9) - ANTI_RECOIL_LEFT;
      if(anti_recoil_left < -100) anti_recoil_left = -100;
      set_val(9, anti_recoil_left);
      anti_recoil_right = get_val(9) + ANTI_RECOIL_RIGHT;
      if(anti_recoil_right > 100) anti_recoil_right = 100;
      set_val(9, anti_recoil_right);
    }
}