BF4 Vehicle/Recon

Just something I whipped up to suit my needs with MaxAim. See comments in script for details.
Version.93
AuthorEODCM
Publish DateThu, 2 Jan 2014 - 03:38
Last UpdateSun, 19 Jan 2014 - 03:55
Downloads472
RATE


2

0

Release Notes: Dumbed down the autospot portion of the script. Less chance (if any now) of it not working properly.
Code: Select all
/*
* AUTOSPOT and REDUCED SECONDARY SENSITIVITY(device)
* INFANTRY_BUTTON is used to set which class you are. This will change your sensitivity to normal
* VEHICLE_BUTTON is used to increase your sensitivity when in a vehicle. Shorter mouse movement for more turrent movement.
* RECON_KEY is used for zeroing a rifle, also used with DMR's.  This will DECREASE your sensitivity by value of "DECREASE_BY"
*           -Every time you push ZERO (Default is D-Pad Down) your sensitivity will DECREASE. And will reset when you loop back to ZERO
*           -If you die, quick press RECON_KEY (like activating it) to reset zero and counter.
* VEH_SLOWMO is used like a REDUCED SECONDARY SENSITIVITY but for vehicles.
* CHANGE_WEAPON is used to reset your zero counter if you're being_recon and switch to your secondary...sensitivity goes back to normal.
*           -Don't forget to reset your zero when you're out of trouble.
* VEH_SENS_X is a multiplier for the original sensitivity for when you're in a vehicle. 327 is maxed allowed by GPC
* VEH_SENS_Y same as X, but for up/down
* DECREASE_BY is how much you want your sensitivity to decrease by, on each push of ZERO.
*
* *********************************************************** */

define RUMBLE_ENABLED = FALSE; //Broke with 1.42?
 
define SENS_REDUCE_BY = 28;
 
////BUTTONS/KEYS////
define SPOT_BUTTON = XB1_RB;
define INFANTRY_BUTTON = CEMU_EXTRA1;
define VEHICLE_BUTTON = CEMU_EXTRA2;
define RECON_KEY = CEMU_EXTRA4;
define ZERO = XB1_DOWN;
define VEH_SLOWMO = XB1_B;
define CHANGE_WEAPON = XB1_Y;
////VALUES////
define VEH_SENS_X = 225;
define VEH_SENS_Y = 150;
define DECREASE_BY = 10;
 
 
int zero_increase;
int zero_reset;
int intveh_setval = 0;
int mpoint;
 
int autospot = FALSE;
int infantry = TRUE; //start as infantry
int vehicle = FALSE;
int being_recon = FALSE;
 
init {
 
    if(!RUMBLE_ENABLED){
        block_rumble();
    }
}
 
main {
////////////REDUCED SECONDARY SENSITIVITY//////
    if(being_recon){
        mpoint = 70; //The higher, the more sensitive for zooming in when being_recon is active
    }
    else{
        mpoint = 50; //50 is default.
    }
 
    if(get_val(XB1_LT) && infantry){
 
            sensitivity(XB1_RX, mpoint, 100 - SENS_REDUCE_BY + zero_increase); //Reduced sensitivity as zero gets higher.
            sensitivity(XB1_RY, mpoint, 100 - SENS_REDUCE_BY + zero_increase);
    }
 
    if(event_press(CHANGE_WEAPON)){ //Resets your zero values to 0 in case you switch to secondary.
        zero_reset = 0;
        zero_increase = 0;
    }
 
    if(event_press(VEH_SLOWMO) && vehicle) intveh_setval = !intveh_setval;
 
    //if(event_release(VEH_SLOWMO) && vehicle) intveh_setval = TRUE;
 
////////////AUTO_SPOT/////////////////////////
    if(event_release(SPOT_BUTTON) && get_ptime(SPOT_BUTTON) < 200){
        autospot = !autospot;
    }
    if(autospot) combo_run(AutoSpot);
    if(!autospot) combo_stop(AutoSpot);
 
///////////CLASS/VEHICLE SELECT////////////////
    if(event_release(INFANTRY_BUTTON)){
        infantry = TRUE;
        vehicle = FALSE;
        being_recon = FALSE;
        intveh_setval = FALSE;
    }
 
    if(event_release(VEHICLE_BUTTON)){
        infantry = FALSE;
        vehicle = TRUE;
        being_recon = FALSE;
        intveh_setval = TRUE;
    }
    if(intveh_setval){
        sensitivity(XB1_RX, 40, VEH_SENS_X);
        sensitivity(XB1_RY, 40, VEH_SENS_Y);
 
    }
///////////RECON, AUTO SENSITIVITY ADJUST///////
//Also used as a reset if death occurs
    if(event_release(RECON_KEY) && get_ptime(RECON_KEY) < 1000){ //quick press (<1 second) turns on recon class
        being_recon = TRUE;
        zero_reset = 0//reset counter
        zero_increase = 0; //reset, just incase.
    }
    if(event_release(RECON_KEY) && get_ptime(RECON_KEY) > 1000){ //long press (>1 seconds) turns off recon class
        being_recon = FALSE;
        zero_increase = 0;
    }
 
        if(event_release(ZERO) && being_recon){
            if(zero_reset <= 4){
                zero_increase = zero_increase + DECREASE_BY;
                zero_reset = zero_reset + 1 //increment counter
            }
            else if(zero_reset > 4){
                zero_increase = 0; //The rifle zero has cycled back to zero
                zero_reset = 0;
            }
 
 
        }
///////////////////////////////////////////////////
 
}
 
combo AutoSpot { 
    set_val(SPOT_BUTTON, 100);   
    wait(40);     
    set_val(SPOT_BUTTON, 0)
    wait(960);
}