Battlefield 4 and Hardline

Enjoy! Info on top of script.
Version1.1
Authorbonefisher
Publish DateFri, 8 Apr 2016 - 01:04
Last UpdateTue, 12 Apr 2016 - 21:01
Downloads616
RATE


3

0

Release Notes: Turned the Burst Fire into what ever you want. Rapid or Burst Fire it is all in how you adjust the settings.
Code: Select all
/*******************************************************************************************************************
*                Battlefield 4 and Hardline by bonefisher and a Special Thanks to The_Rabid_Taco.                  *
/*******************************************************************************************************************
*   If needing adjusting any Rapid/Burst Fires or Anti-Recoil just hold fire trigger which blocks the D-Pad keys   *
*   to allow easy adjustments without equipment coming out.                                                        *
*   Rapid Fire and Burst Fire even on same adjusting mod are seperate adjustments whatever which one your on       *
*   adjusts separately from the other and goes for the Anti-Recoil long as you follow sequence of button presses.  *
/*******************************************************************************************************************
*                           TURNS MODS ON/OFF:  RUMBLE ON  /  NO RUMBLE OFF                                        *
*  MOD:            RUMBLE:       COMBINATION OF BUTTON PRESSES OF TURNING ON/OFF MODS AND ADJUSTING:               *
*  Rapid Fire      Single        PS: L2 + D-Pad Left                       X-Box: LT + D-Pad Left                  *
*  Burst Fire      Double        PS: L2 + D-Pad Left                       X-Box: LT + D-Pad Left                  *
*  Adjusting Fires Rapid/Burst   PS: HOLD R2 + Click D-Pad Left for Decrease and D-Pad Right for Increase Fire     *
*  Adjusting Fires Rapid/Burst   XB: HOLD RT + Click D-Pad Left for Decrease and D-Pad Right for Increase Fire     * 
*  Adjust Burst Delay            PS: HOLD R2 + Click D-Pad DOWN for Decrease and D-Pad UP for Increase Delay       *
*  Adjust Burst Delay            XB: HOLD RT + Click D-Pad DOWN for Decrease and D-Pad UP for Increase Delay       * 
*  Anti-Recoil     Single        PS: L2 + D-Pad Down                       X-Box: LT + D-Pad Down                  * 
*  Anti-Recoil LT  Double        PS: L2 + D-Pad Down                       X-Box: LT + D-Pad Down                  *
*  Adjusting Anti Recoil         PS: HOLD L2 + R2 then click the direction on D-Pad for what pull is needed by one *
*  Adjusting Anti Recoil         XB: HOLD LT + RT then click the direction on D-Pad for what pull is needed by one *
*  Auto Spot ADS   Single        PS: L2 + R1                               X-Box: LT + RB                          *
*  Auto Spot       Double        PS: L2 + R1                               X-Box: LT + RB                          *
*  Auto Sprint     Single        PS: D-Pad UP + CIRCLE                     X-Box: D-Pad Up + B                     *
*  Quick Scope     Single        PS: D-Pad UP + CROSS                      X-Box: D-Pad Up + A                     *
*  Hold Breath     Double        PS: D-Pad UP + CROSS                      X-Box: D-Pad Up + A                     *
*  AimAssistStrafe Single        PS: D-Pad Left + SQUARE                   X-Box: D-Pad Left + X                   *
*  Light           Single        PS: D-Pad Left + TRIANGLE                 X-Box: D-Pad Left + Y                   *
*  Drop Shot       Single        PS: D-Pad Left + CIRCLE                   X-Box: D-Pad Left + B                   *
********************************************************************************************************************/

 
int QuickScopeTime = 140; // Change Time for different weapons.
int BurstDelay, HoldTime3;
int AutoRunOnOff;
int RapidFireOnOff;
int HoldTime, RateOfFire;
int BurstFireOnOff;
int HoldTime2, BurstOfFire;
int ToggleAntiRecoil;
int ToggleFireMods;
int DropShotOnOff;
int QuickScopeOnOff;
int prone_flag;
int AimAssistOnOff;
int AutoSpotOnOff;
int LightOnOff;
int Light_flag = FALSE;
int anti_recoil, anti_recoil_left, anti_recoil_right;
int ANTI_RECOIL, ANTI_RECOIL_LEFT, ANTI_RECOIL_RIGHT;
 
init {
    AutoRunOnOff = get_pvar(SPVAR_1, 1, 2, 2);
    RateOfFire = get_pvar(SPVAR_2, 0, 25, 20);
    HoldTime = get_pvar(SPVAR_3, 0, 500, 25);
    BurstOfFire = get_pvar(SPVAR_5, 20, 125, 40);
    BurstDelay = get_pvar(SPVAR_6, 1, 125, 40);
    ToggleAntiRecoil = get_pvar(SPVAR_7, 1, 3, 1);
    ANTI_RECOIL = get_pvar(SPVAR_8, 0, 100, 30);
    ANTI_RECOIL_LEFT = get_pvar(SPVAR_9, 0, 100, 2);
    ANTI_RECOIL_RIGHT = get_pvar(SPVAR_10, 0, 100, 0);
    ToggleFireMods = get_pvar(SPVAR_11, 1, 3, 1);
    DropShotOnOff = get_pvar(SPVAR_12, 1, 2, 2);
    QuickScopeOnOff = get_pvar(SPVAR_13, 1, 3, 1);
    AimAssistOnOff = get_pvar(SPVAR_14, 1, 1, 2);
    AutoSpotOnOff = get_pvar(SPVAR_15, 1, 3, 1);
    LightOnOff = get_pvar(SPVAR_16, 1, 2, 2);
}
 
main {
 
    vm_tctrl(-8);
 
    // Set hair triggers
    if (get_val(4)) set_val(4, 100);
    if (get_val(7)) set_val(7, 100);
 
    if (get_val(7) && event_press(15) && !get_val(4)) {
        if (ToggleFireMods == 3) {
            ToggleFireMods = 1;
            set_pvar(SPVAR_11, ToggleFireMods);
        } else if (ToggleFireMods == 1) {
            ToggleFireMods = 2;
            set_pvar(SPVAR_11, ToggleFireMods);
            combo_run(RumbleNotifier);
        } else if (ToggleFireMods == 2) {
            ToggleFireMods = 3;
            set_pvar(SPVAR_11, ToggleFireMods);
            combo_run(DoubleRumbleNotifier);
        }
    }
    if (ToggleFireMods == 2 && get_val(4)) {
        combo_run(RapidFire);
    } else if (ToggleFireMods == 3 && get_val(4)) {
        combo_run(BurstFire);
    }   if(event_release(4)) { combo_stop(BurstFire);
    }
    // This portion of the script allows for fine tune adjustment of the fire
    // rate.  Pressing right on the dpad will increase the rate of fire by one,
    // and pressing left on the dpad while shooting will decrease the rate of
    // fire by one.  Do not use ADS while adjusting rate of fire or it will
    // adjust the anti recoil settings instead.  Again these are stored in
    // persistent variables and will be stored across sessions.
    if (ToggleFireMods == 2 && get_val(4) && !get_val(7)) {
        if (event_press(16)) {
            if (RateOfFire < 25) {
                RateOfFire = RateOfFire + 1;
            } else if (RateOfFire >= 25) {
                RateOfFire = 25;
            }
            set_pvar(SPVAR_2, RateOfFire);
        }
        if (event_press(15)) {
            if (RateOfFire > 0) {
                RateOfFire = RateOfFire - 1;
            } else if (RateOfFire <= 0) {
                RateOfFire = 0;
            }
            set_pvar(SPVAR_2, RateOfFire);
        }
        HoldTime = 500 / RateOfFire;
        set_pvar(SPVAR_3, HoldTime);
    }
    if (ToggleFireMods == 3 && get_val(4) && !get_val(7)) {
        if (event_press(16)) {
            if (BurstOfFire < 125) {
                BurstOfFire = BurstOfFire + 1;
            } else if (BurstOfFire >= 125) {
                BurstOfFire = 125;
            }
            set_pvar(SPVAR_5, BurstOfFire);
        }
        if (event_press(15)) {
            if (BurstOfFire > 0) {
                BurstOfFire = BurstOfFire - 1;
            } else if (BurstOfFire <= 0) {
                BurstOfFire = 0;
            }
            set_pvar(SPVAR_5, BurstOfFire);
        }
        HoldTime2 = 5 * BurstOfFire;
    }
    if (ToggleFireMods == 3 && get_val(4) && !get_val(7)) {
        if (event_press(13)) {
            if (BurstDelay < 125) {
                BurstDelay = BurstDelay + 1;
            } else if (BurstDelay >= 125) {
                BurstDelay = 125;
            }
            set_pvar(SPVAR_6, BurstDelay);
        }
        if (event_press(14)) {
            if (BurstDelay > 0) {
                BurstDelay = BurstDelay - 1;
            } else if (BurstDelay <= 0) {
                BurstDelay = 0;
            }
            set_pvar(SPVAR_6, BurstDelay);
        }
        HoldTime3 = 5 * BurstDelay;
    }
 
    // This checks to see if ADS is on and down is pressed on the D-Pad.  This
    // actually has multiple functions, the first being an always on anti recoil
    // with the second being a ADS only anti recoil.  A rumble notification is
    // used to distinguish which one is being used.  A single rumble is always
    // use anti recoil.  A double rumble is used for ADS only anti recoil. 
    // Pressing down while in ADS a third time disables this function.
    if (get_val(7) && event_press(14) && !get_val(4)) {                                 
        if (ToggleAntiRecoil == 3) {
            ToggleAntiRecoil = 1;
            set_pvar(SPVAR_7, ToggleAntiRecoil);
        } else if (ToggleAntiRecoil == 1) {
            ToggleAntiRecoil = 2;
            set_pvar(SPVAR_7, ToggleAntiRecoil);
            combo_run(RumbleNotifier);
        } else if (ToggleAntiRecoil == 2) {
            ToggleAntiRecoil = 3;
            set_pvar(SPVAR_7, ToggleAntiRecoil);
            combo_run(DoubleRumbleNotifier);
        }
    }
    // This checks to see which (if any) anti recoil is turned on and runs the
    // appropriate combo for that anti recoil.
    if (ToggleAntiRecoil == 2 && get_val(4)) {
        combo_run(AntiRecoil);
    } else if (ToggleAntiRecoil == 3 && get_val(7) && get_val(4)) {
        combo_run(AntiRecoil);
    }
    // This section is used to fine tune the anti recoil if it is set to on.
    // So while shooting and having ADS up pressing up on the dpad will reduce
    // anti recoil by one, pressing down on the dpad will increase the down pull
    // by one, pressing right on the dpad will increase right pull by one, while
    // pressing left on the dpad will increase the left pull by one.  These
    // values are stored in persistent variable allowing them to be used every
    // time a new session is started, the script is reloaded, or even if the
    // Titan One looses power.
    if ((ToggleAntiRecoil == 2 || ToggleAntiRecoil == 3) && get_val(4) && get_val(7)) {
        if (event_press(13)) {
            ANTI_RECOIL = ANTI_RECOIL - 1;
 
            if (ANTI_RECOIL < 0) {
                ANTI_RECOIL = 0;
            }
            set_pvar(SPVAR_8, ANTI_RECOIL);
        }
        if (event_press(14)) {
            ANTI_RECOIL = ANTI_RECOIL + 1;
 
            if (ANTI_RECOIL > 100) {
                ANTI_RECOIL = 100;
            }
            set_pvar(SPVAR_8, ANTI_RECOIL);
        }
        if (event_press(15)) {
            if (ANTI_RECOIL_RIGHT > 0) {
                ANTI_RECOIL_RIGHT = ANTI_RECOIL_RIGHT - 1;
                ANTI_RECOIL_LEFT = 0;
            } else if (ANTI_RECOIL_RIGHT <= 0 && ANTI_RECOIL_LEFT < 100) {
                ANTI_RECOIL_LEFT = ANTI_RECOIL_LEFT + 1;
                ANTI_RECOIL_RIGHT = 0;
            } else if (ANTI_RECOIL_LEFT >= 100) {
                ANTI_RECOIL_LEFT = 100;
                ANTI_RECOIL_RIGHT = 0;
            }
            set_pvar(SPVAR_9, ANTI_RECOIL_LEFT);
            set_pvar(SPVAR_10, ANTI_RECOIL_RIGHT);
        }
        if (event_press(16)) {
            if (ANTI_RECOIL_LEFT > 0) {
                ANTI_RECOIL_LEFT = ANTI_RECOIL_LEFT - 1;
                ANTI_RECOIL_RIGHT = 0;
            } else if (ANTI_RECOIL_LEFT <= 0 && ANTI_RECOIL_RIGHT < 100) {
                ANTI_RECOIL_RIGHT = ANTI_RECOIL_RIGHT + 1;
                ANTI_RECOIL_LEFT = 0;
            } else if (ANTI_RECOIL_RIGHT >= 100) {
                ANTI_RECOIL_RIGHT = 100;
                ANTI_RECOIL_LEFT = 0;
            }
            set_pvar(SPVAR_9, ANTI_RECOIL_LEFT);
            set_pvar(SPVAR_10, ANTI_RECOIL_RIGHT);
        }
    }
    if ((event_press(13) && get_val(18)) || (event_press(18) && get_val(13))) {
        if (AutoRunOnOff == 1) {
            AutoRunOnOff = 2;
        } else if (AutoRunOnOff == 2) {
            AutoRunOnOff = 1;
        }
        set_pvar(SPVAR_1, AutoRunOnOff);
 
        if (AutoRunOnOff == 1) {
            combo_run(RumbleNotifier);
        }
    }
    if (AutoRunOnOff == 1) {
        if (get_val(12) < -97) { combo_run(AutoSprint);
        }
    }
    if ((event_press(15) && get_val(18)) || (event_press(18) && get_val(15))){         
        if (DropShotOnOff == 1) {
            DropShotOnOff = 2;
        } else if (DropShotOnOff == 2) {
            DropShotOnOff = 1;
        }
 
        set_pvar(SPVAR_12, DropShotOnOff);
 
        if (DropShotOnOff == 1) {
            combo_run(RumbleNotifier);
        }
    }
    if (DropShotOnOff == 1) {
            if((!get_val(7) && event_press(4)) || (event_release(7) && get_val(4))) {
            combo_run(Prone);
            combo_stop(AutoSprint);
        } else if(event_release(4)) {
            if(prone_flag) combo_run(Stand);
               combo_stop(AutoSprint);
        }
    }
    if (get_val(13) && event_press(19) && !get_val(4)) {                                 
        if (QuickScopeOnOff == 3) {
            QuickScopeOnOff = 1;
            set_pvar(SPVAR_13, QuickScopeOnOff);
        } else if (QuickScopeOnOff == 1) {
            QuickScopeOnOff = 2;
            set_pvar(SPVAR_13, QuickScopeOnOff);
            combo_run(RumbleNotifier);
        } else if (QuickScopeOnOff == 2) {
            QuickScopeOnOff = 3;
            set_pvar(SPVAR_13, QuickScopeOnOff);
            combo_run(DoubleRumbleNotifier);
        }
    }
    if (QuickScopeOnOff == 2) {
        if(get_val(7) && get_ptime(7) >=QuickScopeTime) set_val(4, 100);
        } else if (QuickScopeOnOff == 3 && get_val(7)) {
            combo_run(HoldBreath);
        }
        if(event_release(7)) {combo_stop(HoldBreath);
        }
    if ((event_press(15) && get_val(20)) || (event_press(20) && get_val(15))){         
        if (AimAssistOnOff == 1) {
            AimAssistOnOff = 2;
        } else if (AimAssistOnOff == 2) {
            AimAssistOnOff = 1;
        }
        set_pvar(SPVAR_14, AimAssistOnOff);
 
        if (AimAssistOnOff == 1) {
            combo_run(RumbleNotifier);
        }
    }
    if (AimAssistOnOff == 1 && get_val(4)) {
        combo_run(Strafe);
    }
    if (get_val(7) && event_press(3)) {                                 
        if (AutoSpotOnOff == 3) {
            AutoSpotOnOff = 1;
            set_pvar(SPVAR_15, AutoSpotOnOff);
        } else if (AutoSpotOnOff == 1) {
            AutoSpotOnOff = 2;
            set_pvar(SPVAR_15, AutoSpotOnOff);
            combo_run(RumbleNotifier);
        } else if (AutoSpotOnOff == 2) {
            AutoSpotOnOff = 3;
            set_pvar(SPVAR_15, AutoSpotOnOff);
            combo_run(DoubleRumbleNotifier);
        }
    }
    if (AutoSpotOnOff == 2 && get_val(7)) {
        combo_run(AutoSpot);
    } else if (AutoSpotOnOff == 3) {
        combo_run(AutoSpot);
    }
    if ((event_press(15) && get_val(17)) || (event_press(17) && get_val(15))) {
        if (LightOnOff == 1) {
            LightOnOff = 2;
        } else if (LightOnOff == 2) {
            LightOnOff = 1;
        }
        set_pvar(SPVAR_16, LightOnOff);
 
        if (LightOnOff == 1) {
            combo_run(RumbleNotifier);
        }
    }
    if (LightOnOff == 1) {
        if (!Light_flag && get_val(7)) { combo_run(Light);
            Light_flag = TRUE;
        }
        if(event_release(7)) { combo_run(Light);
            Light_flag = FALSE;
        }
    }
    if (get_val(4)) {
            block(13, 1000); block(14, 1000); block(15, 1000); block(16, 1000);
    }
}
 
combo RumbleNotifier {
    set_rumble(RUMBLE_A, 100);
    wait(200);
    reset_rumble();
}
combo DoubleRumbleNotifier {
    set_rumble(RUMBLE_A, 100);
    wait(200);
    set_rumble(RUMBLE_A, 0);
    wait(200);
    set_rumble(RUMBLE_A, 100);
    wait(200);
    reset_rumble();
}
combo RapidFire {
    set_val(4, 100);
    wait(HoldTime);
    set_val(4, 0);
    wait(HoldTime);
    set_val(4, 0);
}
combo BurstFire {
    set_val(4, 100);
    wait(HoldTime2);
    set_val(4, 0);
    wait(HoldTime3);
    set_val(4, 0);
}
combo AutoSprint {
    set_val(XB1_LS, 100);
    wait(40);
    set_val(XB1_LS, 0);
    wait(40);
}
combo Prone {
    set_val(XB1_LX, 0);
    set_val(XB1_LY, 0);
    wait(50);
    set_val(XB1_LX, 0);
    set_val(XB1_LY, 0);
    set_val(18, 100);
    wait(380);
    prone_flag = TRUE;
}
combo Stand {
    set_val(18, 100);
    wait(380);
    prone_flag = FALSE;
}
combo Strafe {
    set_val(11, 100);
    wait(300);
    set_val(11, 0);
    wait(100);
    set_val(11, -100);
    wait(300);
    set_val(11, 0);
    wait(100);
}
combo HoldBreath {
    wait(100);
    set_val(8, 100);
    wait(3200);
}
combo AutoSpot {
    set_val(3, 100);
    wait(50);
    set_val(3, 0);
    wait(600);
 }
combo Light {
    set_val(13, 100);
    wait(100);
}
combo AntiRecoil {
    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);
}