The Division

Something simple to for starters! Info in script how to turn on/off mods.
Version1.5
Authorbonefisher
Publish DateFri, 11 Mar 2016 - 00:04
Last UpdateWed, 16 Mar 2016 - 14:08
Downloads1547
RATE


9

0

Release Notes: Added on/off toggles for sprint and slide down ladder. Added a all mods off toggle. Switched auto marking to only in ADS.
Code: Select all
 
 
define FIRE_BUTTON               = 4;
 
define RATE_OF_FIRE              = 20;      // Range: 1 to 25 SPS. Rapid Fire
define SHOTS_PER_BURST           = 5;       // Shots per Burst. May have to adjust below depending on weapons RPM.
 
define ANTI_RECOIL               = 66;      // Change this value to compensate to the vertical recoil
define ANTI_RECOIL_LEFT          = 2;       // 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           = TRUE;    // Anti-recoil will only be applied with ADS
 
int Reset_Time                   = 300;
 
int hold_time, rest_time;
int hold_time2, rest_time2;
int anti_recoil;
int anti_recoil_left;
int anti_recoil_right;
 
int AntiRecoilON                 = FALSE;
int rapid_onoff                  = FALSE;
int rapid2_onoff                 = FALSE;
int scope_auto_onoff             = FALSE;
int run_flag                     = FALSE;
int aim_assist                   = FALSE;
int ads_flag                     = FALSE;
int AutoMarkingTargetON          = FALSE;
int Sprint_SlideOnOff            = FALSE;
 
 
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(-8);
 
    if((event_press(7) && get_val(15)) || (event_press(15) && get_val(7))){         // Turns ON/OFF Rapid Fire  LT + D-Pad LEFT
        rapid_onoff = !rapid_onoff;                                                 // Change RATE_OF_FIRE2 in define section.
        if(rapid_onoff) combo_run(RumbleNotifier);
            rapid2_onoff = FALSE;
    }
 
    if(rapid_onoff && get_val(4)) {combo_run(RapidFire); }
 
    if((event_press(7) && get_val(16)) || (event_press(16) && get_val(7))){         // Turns ON/OFF Rapid Fire  LT + D-Pad RIGHT
        rapid2_onoff = !rapid2_onoff;                                               // Change SHOTS PER BURST in define section.
        if(rapid2_onoff) combo_run(RumbleNotifier);
            rapid_onoff = FALSE;
    }
    if(rapid2_onoff && get_val(4)) {combo_run(RapidFire2); }
 
    if((event_press(7) && get_val(8)) || (event_press(8) && get_val(7))){           // Turns ON/OFF Sprint & SlideDownLadder
        Sprint_SlideOnOff = !Sprint_SlideOnOff;                                     // LT + LS click turns on/off
        if(Sprint_SlideOnOff) combo_run(RumbleNotifier);
    }
    if(Sprint_SlideOnOff) {
    if(!run_flag && get_val(12) < -97) {                                            // When scoped in flick stick forward to switch sides
        run_flag = TRUE;
        combo_run(AutoSprint);
    } else if(get_val(12) > -97) {
                run_flag = FALSE;
    }
    if(get_val(12) > 99) {combo_run(SlideDownLadder); }                             // When climbing down ladder it will automatically slide down when applying down movement.
    }
 
    if((event_press(7) && get_val(18)) || (event_press(18) && get_val(7))){         // When applying ADS this auto scopes in.
        scope_auto_onoff = !scope_auto_onoff;                                       // LT + B button turns on/off
        if(scope_auto_onoff) combo_run(RumbleNotifier);
    }
    if(scope_auto_onoff) {
        if(!ads_flag && get_val(7)) {
        ads_flag = TRUE;
        combo_run(scope);
    } else if(!get_val(7)) {
        ads_flag = FALSE; }
    }
    if((event_press(7) && get_val(13)) || (event_press(13) && get_val(7))){         // AutoMarkingTarget ON/OFF LT + D-Pad UP
        AutoMarkingTargetON = !AutoMarkingTargetON;
        if(AutoMarkingTargetON) combo_run(RumbleNotifier);
    }
        if(AutoMarkingTargetON && get_val(7)) {                                     // When ADS is activated is when auto marking will start.
            combo_run(MarkTargets); }
 
    if((event_press(7) && get_val(19)) || (event_press(19) && get_val(7))){         // aim assist strafe on/off LT + A button.
        aim_assist = !aim_assist;
        if(aim_assist) combo_run(RumbleNotifier);
    }
    if(aim_assist && get_val(4)) {combo_run(strafe); }
 
    if(get_val(7) && event_press(14)) {                                             // This turns on/off Anti-Recoil. LT+ D-Pad DOWN
        AntiRecoilON = !AntiRecoilON;
        if(AntiRecoilON) combo_run(RumbleNotifier);
    }
    if(!ONLY_WITH_SCOPE || get_val(7)) {combo_run(AntiRecoil); }
 
    if((event_press(7) && get_val(1)) || (event_press(1) && get_val(7))){           // Turns OFF All MODS  LT + VIEW Button
        AntiRecoilON = FALSE;rapid_onoff = FALSE;rapid2_onoff = FALSE;
        scope_auto_onoff = FALSE;aim_assist = FALSE;
        AutoMarkingTargetON = FALSE;Sprint_SlideOnOff = FALSE; }
}
 
combo RapidFire {
    set_val(FIRE_BUTTON, 100);
    wait(hold_time);
    set_val(FIRE_BUTTON, 0);
    wait(rest_time);
    set_val(FIRE_BUTTON, 0);
}
 
combo RapidFire2 {
    set_val(FIRE_BUTTON, 100);
    wait(hold_time2);
    set_val(FIRE_BUTTON, 0);
    wait(rest_time2);
    set_val(FIRE_BUTTON, 0);
}
 
combo AutoSprint {
    set_val(8, 0);
    wait(100);
    set_val(8, 100);
    wait(200);
}
 
combo MarkTargets {
    set_val(13, 100);
    wait(50);
    set_val(13, 0);
    wait(1000);
}
 
combo SlideDownLadder {
    set_val(8, 100);
}
 
combo scope {
    set_val(5, 0);
    wait(100);
    set_val(5, 100);
    wait(200);
}
 
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 RumbleNotifier {
    set_rumble(RUMBLE_A, 100);
    wait(200);
    reset_rumble();
}
 
combo AntiRecoil {
    if(get_val(FIRE_BUTTON) && 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);
    }
}