//SpaceBall's BF4 XIM4 & M/K COMMUNITY SCRIPT//
//Version 1.0//
//****************SCRIPT Includes************************/
//
//////TOGGLE BURST FIRE (SCOPE ONLY) & RAPID FIRE ONOFF///
//////////////////TOGGLE AUTOSPOT/////////////////////////
/////////////////////AUTORUN//////////////////////////////
///////////////////QUICK MELEE////////////////////////////
///////////////////LED GUIDANCE///////////////////////////
//Credit given to all of the consoletuner.com community///
////////////////////scripters/////////////////////////////
/////////////////////DEFINES//////////////////////////
define SENSITIVITY = 135;
define SHOOT_BTN = PS4_R2;
define TRIGGER_BTN = PS4_L2;
define MELEE_BTN = PS4_R3;
define SPRINT_BTN = PS4_L3;
define BURSTSWITCH = PS4_UP;
define ONLY_WITH_SCOPE = TRUE;
define SPOT=900;
define SPOT_BTN=3; // Spot Button R1 button
define BURST_TIME = 36; // Burst fire setting
define TIME_NEXT_BURST = 50;
define FIRE_RATE = 8; // Range: 1 to 25 RPS (Round/s)
define ANTIRECOIL_FORCE = 35;
define GAME_Y_AIM = 0; // LY
define fire_button = 4; // RT
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 ANTIRECOIL_RES = 1;
define ANTIRECOIL_DEF = 35;
define ANTIRECOIL_MAX = 100;
define PVAR_ANTIRECOIL = SPVAR_7; // Persistent Vars
define PVAR_AR_ADJUST = SPVAR_8;
/////////////////////INSTANCES//////////////////////////
int hold_time, rest_time;
int run;
int BurstFireOff = FALSE;
int BurstFireOn = TRUE;
int ButtonHold = TRUE;
int autospot=TRUE;
int scope_button;
int DbleClick_R2 = 0;
int DbleClick_MI = 0;
int anti_recoil;
int anti_recoil_left;
int anti_recoil_right;
int ar_tmp, antirecoil;
init {
if(get_console() == PIO_PS3) {
scope_button = 6;}
else { // Natural Trigger & Bumper
scope_button = 7;}
hold_time = 500 / FIRE_RATE;
rest_time = hold_time - 20;
if(rest_time < 0) rest_time = 0;
antirecoil = get_pvar(PVAR_AR_ADJUST, ANTIRECOIL_RES, ANTIRECOIL_MAX, ANTIRECOIL_DEF);
}
//////////////////////MAIN//////////////////////////////
main {
set_led(LED_3, 0);
sensitivity(PS4_LY, NOT_USE, SENSITIVITY);
if (!ONLY_WITH_SCOPE || get_val(scope_button) && get_val(SHOOT_BTN)) {
combo_run(AntiRecoil);
}
//Double click UP to turn on/off BurstFire.
if(DbleClick_R2 > 0) DbleClick_R2 = DbleClick_R2 - get_rtime();
if(event_press(BURSTSWITCH) && DbleClick_R2 <= 0) {
DbleClick_R2 = 300; }
else if(event_press(BURSTSWITCH) && DbleClick_R2 > 0) {
BurstFireOn = !BurstFireOn;
}
//BurstFire/Anti Recoil Function Scope Only. Rapid Fire Hip Non Anti Recoil
if(BurstFireOn && get_val(SHOOT_BTN) && get_val (scope_button)) {
combo_run(BurstFire); combo_run(AntiRecoil); set_val(SHOOT_BTN, 0);
} else combo_stop(BurstFire); reset_leds();
if(BurstFireOn) { combo_run(BurstFireNotifier); colorled(0,3,0,0);
if(combo_running(BurstFireNotifier) && get_val(TRIGGER_BTN) || get_val(SHOOT_BTN)) combo_stop(BurstFireNotifier); }
if(BurstFireOn && get_val(SHOOT_BTN)) {combo_run(RapidFire);
} else if(combo_running(RapidFire)) { combo_stop(RapidFire);
}
if(BurstFireOff && get_val(SHOOT_BTN)) {combo_stop(AntiRecoil);
}
//?vertical change test?//
// AutoSpot Tap R1 To Toggle(Reminder Turn off Toggle In Respawn Screen)
if(event_release(3) && get_ptime(3) < 1000) {autospot = !autospot;set_val(1,0);}
if ((autospot && !get_val(SPOT_BTN)) && (SPOT > 0 ) && get_val(scope_button)) combo_run(AutoSpot);
if(BurstFireOff && get_val(SHOOT_BTN)) {combo_stop(RapidFire);
}
// QuickMelee
if(get_val(MELEE_BTN)) combo_run(TurboMelee);
// AutoSprint
if(get_val(PS4_LY) < -95) { combo_run(AutoSprint); }
else if(get_val(PS4_LY) > -95) { combo_stop(AutoSprint); }
}
////////////////////////COMBOS///////////////////////////
combo BurstFire {
// 1st shot
set_val(SHOOT_BTN, 100);
wait(BURST_TIME);
set_val(SHOOT_BTN, 0);
wait(BURST_TIME);
// 2nd shot
set_val(SHOOT_BTN, 100);
wait(BURST_TIME);
set_val(SHOOT_BTN, 0);
wait(BURST_TIME);
// 3rd shot
set_val(SHOOT_BTN, 100);
wait(BURST_TIME);
set_val(SHOOT_BTN, 0);
wait(BURST_TIME);
// time for the next burst sequence
wait(TIME_NEXT_BURST);
}
combo RapidFire {
set_val(SHOOT_BTN, 100);
wait(hold_time);
set_val(SHOOT_BTN, 0);
wait(rest_time);
set_val(SHOOT_BTN, 0);
}
combo BurstFireNotifier {
set_led(LED_3, 2);
wait(200);
set_led(LED_3, 0);
wait(4000);
}
combo TurboMelee {
set_val(MELEE_BTN, 100);
wait(40);
set_val(MELEE_BTN, 0);
wait(20);
set_val(MELEE_BTN, 0);
}
//AUTOSPOT
combo AutoSpot {
set_led(LED_3, 0);
set_val(SPOT_BTN, 100);
wait(50);
set_led(LED_3, 1);
set_val(SPOT_BTN, 0);
wait(SPOT);
}
//AUTOSPRINT
combo AutoSprint {
set_val(SPRINT_BTN, 100);
wait(10);
set_val(SPRINT_BTN, 100);
}
//ANTIRECOIL COMBO
combo AntiRecoilTest {
set_val(scope_button, 100);
set_val(fire_button, 100);
combo_run(AntiRecoil);
}
combo AntiRecoil { // This combo must be the last one
ar_tmp = get_val(GAME_Y_AIM) + ANTIRECOIL_FORCE;
if(ar_tmp > 100) ar_tmp = 100;
else if(ar_tmp < -100) ar_tmp = -100;
set_val(PS4_RY, ar_tmp);
wait(20);
set_val(PS4_LY, 100);
if(get_val(fire_button)) {
anti_recoil = get_val(GAME_Y_AIM) + ANTIRECOIL_FORCE;
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);}
}
//FUNCTIONS
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); }
//END