Destiny - The Taken King

This script is designed to allow players to Auto-throw grenades and automatically trigger Super-Charge while firing your weapon. There are separate mechanics for Sniper mode and Free Aim, including rapidfire and "charged, auto drop-shot, auto-zoom, auto-reload on weapon switch. Read script for details. This script is intended more for PvE/SP players but there is no reason PvP'ers cannot use it during combat. Give it a try and send me feedback on Console Tuner. I may be willing to add suggestions or features.
Version3.20
AuthorShadohz
Publish DateSat, 2 Apr 2016 - 09:36
Last UpdateTue, 7 Jun 2016 - 15:59
Downloads1066
RATE


3

0

Release Notes: Changed disable mods from DPAD-UP to LS/RS combination. Added a separate variable "Reload Delay". This will allow player to alter the amount of time the script will wait after switching weapons to perform an auto-reload. May be necessary to alter value for "slow draw" weapons that repeatedly fail to reload after switching. Added condition to ignore reloads not triggered by pressing Switch Weapons. Added Dual Anti-Recoil. Due to compatibility issues with Auto-Zoom, Anti-recoil is disabled when using Rapid Fire. I may address this at a later date but no promises.
Code: Select all
/*
* ===============================================================================================================================================
* Author:           Shadohz
* Game:             Destiny
* System:           All
* Controller:       All   
* Game Settings:    Default
* Website:          https://www.youtube.com/user/Shadohz75
* Copyright:        Copyright � 2015, 2016 Shadohz, 5Y5T3M 0V3RL04D. All Rights Reserved.
* Restrictions:     http://www.copyrighted.com/copyrights/view/7hsc-jknj-2l2d-pjzg. This source is not licensed under "open-source", "public
*                   domain", nor "source-available". Modification and redistribution requires prior approval. [email protected]
* ===============================================================================================================================================
*/

 
/*
* ===============================================================================================================================================
* HOW TO USE
*
* CONFIGURATION - The following options must be set after initializing the configuration setup.
*
* Press START and BACK to initialize the configuration setup. Press START and BACK again to disable the configuration setup. You will have 2
* seconds to respond before the configuration setup automatically closes. When selecting a configuration option below, the 2-second timer will
* reset after each button press to allow you plenty of time to set your cooldowns. Raise or lower this value with "ConfigTimeout".
*
*
* Press LEFT STICK to reset defaults.
* This option only works while configuring the setup. This will reset all cooldown times to zero (0) and power priorities removed.
*
*
* Press RIGHT STICK to quick-select your own custom configuration.
* Go to "QuickClick customization" and read the notes commented in the area. Adjust the settings to your liking. Try out the setting and re-adjust
* as necessary. Read the ENTIRE How to Use section first so that you understand how to do On-The-Fly changes as well.
*
*
* Move RIGHT STICK up/down to enable or disable AutoRun.
* Move the right analog (camera) stick up to enable AutoRun. Move the right analog (camera) stick down to disable AutoRun.
*
*
* Move RIGHT STICK left/right to enable or disable Auto-Zoom.
* Move the right analog (camera) stick left to enable Auto-Zoom. Move the right analog (camera) stick right to disable Auto-Zoom.
*
*
* Press GRENADE to enable and add cooldown time to auto-grenade throw.
* Each press adds one (1) second to the cooldown time for auto-grenade throw. The script is written to prevent tossing the grenade(s) when moving
* in backwards or forward manner. This is to reduce accidentally running into your own grenade. This works really well with passive grenade powers.
* Update: With v2.00 you are now able to control how the grenade is released based on movement stick's position.
*
*
* Press RELOAD to enable and add cooldown time to Reload.
* Each press adds one (1) second to cooldown time for reloading guns while firing your weapon. This is VERY risky feature to use as it can cause
* you to load too often or at an inappropiate time during combat. Test it out before going into full-on combat. Recommended setting the value in
* double-digits.
* Update: With v3.00 you this feature has been disabled. The code still exists but has been REM'd out.
*
*
* Press SWITCH to enable and add cooldown time to Auto-Reload after Switch.
* Each press adds one (1) second to cooldown time for automatically reloading you weapon after switching. The script automatically maxes the value
* at four (4) seconds even if you set it higher than that.
*
*
* Press MELEE to enable and add cooldown time to Super-Charge.
* Each press adds ten (10) seconds to cooldown time for Super-Charge. Setting the value too will result in Melee attack occurring too often
* during combat. Recommened setting the value to at least 60 seconds.
* Update: With version 2.00, you can set the requirement based on the movement stick's position.
*
*
* Press AIM/FIRE to select Sniper mode or Free Aim mode.
* Press AIM to select Sniper mode. This will prevent auto-grenade throw and Super-Charge from triggering while you are aiming at a target. The
* powers will only engage when you hip-fire. Select FIRE to select Free Aim mode. This will engage auto-grenade throw and Super-Charge while
* aiming or hip-firing. This is more useful for run-and-gun type of setups.
*
*
* Press D-PAD UP/DOWN to add cooldown time to Fire Modes 1 and 2.
* Press D-PAD UP to add cooldown time to Fire Mode 1. Press D-PAD DOWN to add cooldown time to Fire Mode 2. Max cooldown time is four (4) seconds
* either option. Both types by default are set to 0 (rapidfire). Recommended you set one or the other to one (1). It is not generally necessary
* to have a value higher than one (1) to use the "Charge-up" effect (e.i. fusion gun). You will have to set value to one (1) or higher to not
* sputter automatic weapons.
*
*
* Press D-PAD LEFT/RIGHT to add more range to Anti-Recoil Modes 1 and 2.
* The script is designed to allow two different Anti-Recoil settings. One is for Fire Mode 1, the other for Fire Mode 2. Press D-PAD LEFT to add
* more range for Fire Mode 1. Press D-PAD RIGHT to add more range for Fire Mode 2. The AR range is from 0-100. Each button press increases the
* setting in multiples of 5.
*
*
* Press CROUCH to enable Auto-Drop Shot
* This is a bare-bones version of Automatic Drop Shot. The player will drop down while shooting. The player will not automatically rise after
* disengaging. If you are already crouching then you will not be forced to rise. This feature works slightly better with Auto-Sprint enabled. 
*
* ===============================================================================================================================================
* HOW TO USE
* POST-CONFIGURATION (IN-GAME USE) - These are the features you will use after setting up your kit's configuration.
*
* Press LEFT STICK and RIGHT STICK to disable all configurations.
* This will disable all cooldowns and fire behavior. This is a quick-click in case you need to temporarilty disable everything. Press LEFT STICK
* and RIGHT STICK again to re-enable everything.
*
*
* Press RIGHT STICK (RS) to switch between Primary and Secondary Fire modes.
* Pressing the RIGHT STICK will allow you switch between the primary and secondary fire modes that you selected earlier (i.e. switching between
* rapidfire and burst modes). This button has been unmapped and will prevent you from using Highlight Character. You can comment out the UNMAP,
* set your own button by entering a value for Mode2 in DEFINES, or using SWAP to swap the variable "highlight" for another of your choosing. You
* REALLY want to use RIGHT STICK for quick-switching fire modes during combat. If you do not really care much for Emotes then you could/should
* unmap and swap one for Highlight Character.
*
*
* Press LEFT TRIGGER (LT) and RIGHT TRIGGER (RT) or just RIGHT TRIGGER (RT) to perform powers while shooting.
* Press LT+RT (Sniper firing mode) or just RT (Free Aim firing mode or "hip-fire") to have your powers trigger as you're shooting. This is
* activated based on which option you set during the configuration setup-fire mode. "Sniper firing mode" (LT + RT) setting is useful for sniper
* and scout rifle builds and some standard weapons. "Free Aim/hip fire" (RT) is the setting you are most likely to use on other kits.
*
*
* IMPORTANT: To add more cooldown time or to change the Fire Mode behavior, press START + BACK, then press the appropiate D-PAD, Y, LB, RB, or
* LT/RT button. If you have set the cooldown time too high on one or more powers/charge-up weapon then press START + BACK then LS to reset the
* entire setup.
*
* IMPORTANT: New script functionality has been added to DEFINES section. Set GRENADEMOTION and CHARGEMOTION. Set these options to 1-4. "Dead
* Center" will not trigger grenade/charge unless the movement stick is centered (i.e. you've come to a stop or moving lateral). "Free" will
* trigger grenade/charge regardless of movement. "Offensive" will trigger grenade/charge when movement stick is forward. "Defensive" will trigger
* grenade/charge when movement stick is backwards (retreating). GRENADEMOTION and CHARGEMOTION do not have to be set to the same value, so you
* mix the behavior based on your character build and playstyle. Be sure to test out the timing and behavior. Also added is Anti-AFK feature.
* Scroll to the bottom of script and add your custom AFK/FARM (default is Aiming). Set the timer (in seconds) in DEFINES section. The AAFK will
* not activate unless you have configured the script to run. It checks for button presses every second. If no buttons have been pressed by the
* time it reaches your set AAFK cooldown, then it will automatically been the AAFK behavior. You must press any button in order to make the AAFK
* stop performing.
*
* ===============================================================================================================================================
*/

 
/*
* ===============================================================================================================================================
* VERSION CHANGES
*
* 1.00 - First version includes my standard On-The-Fly customization. Features include: Auto-Run, Automatic Grenade Throw, Automatic Super-Charge
* Automatic Reload, Automatic Reload on Switch, User-Specific Quick Config.
*
* 1.10 - Fixed issue with Auto-Reload on Switch not disabling Sprint long enough to trigger Reload. Fixed manual Reload to correct pause Sprint
* long enough to initiate reload without breaking on Animation Cancel. BlockTimeout still impacts overall behavior for both features.
*
* 1.20 - Fixed Auto-Reload on Switch to capture player's current forward/back position to give a natural flow without breaking directional motion.
* Fixed formula error not correctly disabling powers when CoolDowns are added but powers are disabled by manual selection.
*
* 1.21 - Reduced Sniper mode Left Trigger to 20% to reduce chance of auto-grenade and Super-Charge going off while exiting Aim view.
*
* 2.00 - Replaced Left Trigger sensitivity. Fixed issue with cooldown time on Reload stopping timers for all powers. Added five (5) second
* penalty to Sniper mode aiming so that powers will not kick in immediately after releasing Aim button (fix for version 1.21). Added Anti-AFK
* feature and timer. Added option for grenade toss requirement. Added Super-Charge toss requirements. Moved AutoRun config from Movement stick to
* the Camera stick. Read the IMPORTANT statement added to the HOW TO USE section.
*
* 2.10 - Fixed AutoRun handling to reduce Aim and Reload breaking. Should result in better CQC (close quarter combat) performance and reloading
* successfully. Previously AutoRun would engage as player would aim/fire causing player to run into enemies. AutoRun functionality separated from
* reload and fire/aim behavior. Cleaned up arrays to allow more space for Anti-Away From Keyboard entries.
*
* 2.20 - Tightened up the logic so that AutoRun is priortized below Reloading and Aim/Fire. Aim/Fire uses the same cooldown as AutoSprint, while
* Reload uses the longer cooldown. This should result in less lull when breaking out of combat back into AutoSprint. This should also result in
* slightly better CQC performance since player is no blocked 2-3 seconds from engaging Sprint (in emergency situations). Reloading should be alot
* more successful when breaking out of AutoSprint. Default value is 3000 (3 seconds) on "ReloadTimeout". Less than 2500 tends to result in more
* failed reload attempts. SprintTimeout default value "1000" (1 second). If your character still AutoSprints alot while you're aiming/firing, try
* raising the value to "1500". Aim and Fire senstivity lowered to 10% to disable AutoSprint if you tap either button. AutoSprint remains disabled
* until SprintTimeout cooldown has passed. With any luck this should be the last version update.
*
* 2.21 - Error in script. Line in code for triggering Super-Charge was accidentally REM'd out.
*
* 3.00 - Added Auto-Drop Shot and Auto-Zoom. Remove Auto-Reload cooldown and feature.
*
* 3.10 - Realod on Switch cooldown added back by per user request. Player made a convincing argument that weapons such as shotguns are the ones
* that require the 3-4 second cooldown time and players should have the option to set their own cooldown if they are not using a slow-loading
* weapon. Moved QuickCustomization to top of MAIN section for easier access.
*
* 3.11 - Cleaned up code to get more space for Anti-Away From Keyboard. Replaced LED with Rumble notifier when entering Configuration Setup.
*
* 3.20 - Changed disable mods from DPAD-UP to LS/RS combination. Added a separate variable "Reload Delay". This will allow player to alter the
* amount of time the script will wait after switching weapons to perform an auto-reload. May be necessary to alter value for "slow draw" weapons
* that repeatedly fail to reload after switching. Added condition to ignore reloads not triggered by pressing Switch Weapons. Added Dual
* Anti-Recoil. Due to compatibility issues with Auto-Zoom, Anti-recoil is disabled when using Rapid Fire. I may address this at a later date but
* no promises.
*
* ===============================================================================================================================================
*/

 
/*
* ===============================================================================================================================================
* DEFINES
* ===============================================================================================================================================
*/

define HoldTime = 50;               // Hold: How long to hold down the Combo button. Increase/decrease affects shooting speed/burst behavior.
define RestTime = 500;              // Rest: How long to wait before pressing the Combo button again. Increase/decrease affects reload behavior.
define CdMultiplier=1;              // The number of seconds to increase between D-PAD presses for Cooldown timers.
define ConfigTimeout=2;             // Amount of time before the Configuration Setup will close automatically.
define Mode1=8;                     // Button assigned to resetting configuration.
define Mode2=5;                     // Button assigned to switching Fire Modes
define SprintTimeout = 1000;        // Minimum time required before AutoSprint is re-enabled.
define ReloadDelay = 500;           // Amount of time (in milliseconds) script will delay after switching weapons to trigger a reload.
//define ReloadTimeout = 3000;         // Global Block Timeout
define AafkCdTime = 0;              // Anti-Away From Keyboard Cooldown time (in seconds).
define GrenadeMotion = 1;           // 1=Dead Center, 2=Free, 3=Offensive, 4=Defensive.   
define ChargeMotion = 1;            // 1=Dead Center, 2=Free, 3=Offensive, 4=Defensive.
 
// Controller Variables
define Dashboard = 0;               // XB1_XBOX    XB360_XBOX   PS4_PS           PS3_PS         WII_HOME    WII_HOME
define Status = 1;                  // XB1_VIEW    XB360_BACK   PS4_SHARE        PS3_SELECT     WII_MINUS   WII_MINUS
define Menu = 2;                    // XB1_MENU    XB360_START  PS4_OPTIONS      PS3_START      WII_PLUS    WII_PLUS
define Melee = 3;                   // XB1_RB      XB360_RB     PS4_R1           PS3_R1                     WII_RT
define Fire = 4;                    // XB1_RT      XB360_RT     PS4_R2           PS3_R2                     WII_ZR
define Highlight = 5;               // XB1_RS      XB360_RS     PS4_R3           PS3_R3         WII_ONE
define Grenade = 6;                 // XB1_LB      XB360_LB     PS4_L1           PS3_L1         WII_C       WII_LT
define Aim = 7;                     // XB1_LT      XB360_LT     PS4_L2           PS3_L2         WII_Z       WII_ZL
define Sprint = 8;                  // XB1_LS      XB360_LS     PS4_L3           PS3_L3         WII_TWO
define AnaCamSS = 9;                // XB1_RX      XB360_RX     PS4_RX           PS3_RX                     WII_RX
define AnaCamUD = 10;               // XB1_RY      XB360_RY     PS4_RY           PS3_RY                     WII_RY
define AnaMovSS = 11;               // XB1_LX      XB360_LX     PS4_LX           PS3_LX         WII_NX      WII_LX
define AnaMovUD = 12;               // XB1_LY      XB360_LY     PS4_LY           PS3_LY         WII_NY      WII_LY
define DPAD1 = 13;                  // XB1_UP      XB360_UP     PS4_UP           PS3_UP         WII_UP      WII_UP
define DPAD2 = 14;                  // XB1_DOWN    XB360_DOWN   PS4_DOWN         PS3_DOWN       WII_DOWN    WII_DOWN
define DPAD3 = 15;                  // XB1_LEFT    XB360_LEFT   PS4_LEFT         PS3_LEFT       WII_LEFT    WII_LEFT
define DPAD4 = 16;                  // XB1_RIGHT   XB360_RIGHT  PS4_RIGHT        PS3_RIGHT      WII_RIGHT   WII_RIGHT
define Switch = 17;                 // XB1_Y       XB360_Y      PS4_TRIANGLE     PS3_TRIANGLE               WII_X
define Crouch = 18;                 // XB1_B       XB360_B      PS4_CIRCLE       PS3_CIRCLE     WII_B       WII_B
define Jump = 19;                   // XB1_A       XB360_A      PS4_CROSS        PS3_CROSS      WII_A       WII_A
define Reload = 20;                 // XB1_X       XB360_X      PS4_SQUARE       PS3_SQUARE                 WII_Y
 
/*
* ===============================================================================================================================================
* MAPPINGS
* ===============================================================================================================================================
*/

//unmap Mode2;
//unmap DPAD1;
//unmap DPAD2;
 
/*
* ===============================================================================================================================================
* INITIALIZED VARIABLES
* ===============================================================================================================================================
*/

// No need to change anything else
int CdPTime0,CdPTime1,CdPTime2,CdPTime3,CdGTime0,CdGTime1,CdCheck,CdWait;
int led, currentled, run;
int seconds0,seconds1,seconds2,seconds3;
int configsetup, Reset;
int timelimit=1000;
int Start_at=FALSE;
int Finish_at=TRUE;
int refresh=FALSE;
int ConfigSelect=0;
int FirePrimary=TRUE;
int AutoRun=FALSE;
int ConfigSeconds,position,snipe;
int AafkSeconds,AutoZoom=FALSE;
int AutoDrop=FALSE,ADIsSet;
int ARSet1,ARSet2,ARComp,SwitchUp;
 
init {
    led = 0;
    reset_leds();
    while(led<4){
        if(get_led(led)==1) currentled = led;
        led = led+1;
    }
} // End Initialization
 
/*
* ===============================================================================================================================================
* MAIN
* ===============================================================================================================================================
*/

main {
// QuickClick customization
    if(event_press(Mode2) && configsetup == TRUE)  {
        ConfigSelect = 1;       // Fire Mode: Set to 1 for Sniper mode. Set to 2 for Free Aim mode.
        CdPTime0=5;             // Grenade: Set the countdown time for how often the script will check if grenade is okay to throw.
        CdPTime1=0;             // Reload: Set the amount of time to pass before script attempts to reload as you fire.
        CdPTime2=240;           // Super-charge: Set the amount of time script performs a check for Super-charge. Do not set this too low or else your character will constantly throw melees in combat. 60 seconds or higher should be sufficient.
        CdPTime3=2;             // Switch-reload: Set the amount of time the script will wait before it attempts to automatically reload after you switch weapons. Recommended: 2. 1 is too low. Higher than 2 will act as delayed reload.
        CdGTime0=0;             // Fire mode type 1: 0 is rapid fire. 1 or higher creates a burst delay (in seconds). Recommended: 0 for pistols, semi-autos, etc. 1 for autos and charged weapons. Recommended to leave one of these set to 0 and the other to 1.
        CdGTime1=1;             // Fire mode type 1: 0 is rapid fire. 1 or higher creates a burst delay (in seconds). Recommended: 0 for pistols, semi-autos, etc. 1 for autos and charged weapons. Recommended to leave one of these set to 0 and the other to 1.
        seconds0=120;           // Do not change
        seconds1=120;           // Do not change
        seconds2=120;           // Do not change
        seconds3=120;           // Do not change
        FirePrimary = TRUE;     // Do not change
        AutoRun = TRUE;         // AutoRun: Set to FALSE to disable. Set to TRUE to enable. Enabling will cause your character to automatically sprint when you press forward on the controller. AutoRun can cause infrequent animation cancels of Reload. Try raising or lowering the SprintTimeout (max 4000) in Defines to see if it makes a difference for your character.
        AutoZoom = TRUE;        // Autozoom: Set to FALSE to disable. Set to TRUE to enable. Enabled will cause player to automatically zoom while shooting.
        AutoDrop = FALSE;       // AutoDrop: Set to FALSE to disable. Set to TRUE to enable. Enable will cause player to drop/crouch when firing weapon. Sprint/AutoSprint and Jump automatically disables crouch. Manually pressing crouch will not be broken when firing.
        ARSet1=0;               // Anti-Recoil 1: Anti-recoil value setting for Fire mode type 1.
        ARSet2=100;             // Anti-Recoil 2: Anti-recoil value setting for Fire mode type 2.
        ConfigSeconds=0;        // Do not change
    }
 
/*   
    set_val(TRACE_1,AafkSeconds);
    set_val(TRACE_2,CdPTime1);
    set_val(TRACE_3,CdPTime2);
    set_val(TRACE_4,seconds0);
    set_val(TRACE_5,seconds1);
    set_val(TRACE_6,seconds2);
*/
   
    if(CdCheck == 0){Start_at=TRUE;Finish_at=FALSE;timelimit=1000;}
    else refresh=FALSE;
    if(Start_at )
    {// Timer count seconds, minutes, hour
       timelimit=timelimit- get_rtime();
        if( timelimit<=0) {
            ConfigSeconds=ConfigSeconds+1;
            seconds0=seconds0+1;
            seconds1=seconds1+1;
            seconds2=seconds2+1;
            seconds3=seconds3+1;
            AafkSeconds=AafkSeconds+1
            timelimit=1000;
        } // seconds count
    }
 
    if((event_press(Menu) && get_val(Status)> 0) || (get_val(Menu)>0 && event_press(Status))) {
        if(!configsetup) {
            set_led(currentled,2);
            configsetup = TRUE;
            CdCheck=1;
            combo_run(RumbleStrong);
            ConfigSeconds=0;
        }
    }
 
    if (configsetup == TRUE) {
        if (ConfigSeconds>=ConfigTimeout) {
            configsetup = FALSE;
            combo_run(RumbleStrong);
            reset_leds();
        }
 
        if(event_press(Mode1))  {
            ConfigSelect = 0;
            CdPTime0=0;
            CdPTime1=0;
            CdPTime2=0;
            CdPTime3=0;
            CdGTime0=0;
            CdGTime1=0;
            FirePrimary = TRUE;
            AutoRun = FALSE;
            ConfigSeconds=0;
            AutoZoom = FALSE;
            AutoDrop = FALSE;
            ARSet1 = 0;
            ARSet2 = 0;
        }
        if (get_val(AnaCamUD)<-90) {
            AutoRun = TRUE;
            ConfigSeconds=0;
        } else if (get_val(AnaCamUD)>90) {
            AutoRun = FALSE;
            ConfigSeconds=0;
        }
 
        if (get_val(AnaCamSS)<-90) {
            AutoZoom = TRUE;
            ConfigSeconds=0;
        } else if (get_val(AnaCamSS)>90) {
            AutoZoom = FALSE;
            ConfigSeconds=0;
        }
 
        if (event_press(Grenade)) {
            CdPTime0 = CdPTime0 + CdMultiplier;
            ConfigSeconds=0;
        /*} else if (event_press(Reload)) {
            CdPTime1 = CdPTime1 + CdMultiplier;
            ConfigSeconds=0;
        */
} else if (event_press(Melee)) {
            CdPTime2 = CdPTime2 + (CdMultiplier * 10);
            ConfigSeconds=0;
        } else if (event_press(Switch)) {
            CdPTime3 = CdPTime3 + CdMultiplier;
            ConfigSeconds=0;
        } // END IF
 
        if (event_press(DPAD1))  {
            CdGTime0 = CdGTime0 + CdMultiplier;
            ConfigSeconds=0;
        }
        if (event_press(DPAD2))  {
            CdGTime1 = CdGTime1 + CdMultiplier;
            ConfigSeconds=0;
        }
        if (event_press(DPAD3))  {
            ARSet1 = ARSet1 + (CdMultiplier * 5);
            ConfigSeconds=0;
        }
        if (event_press(DPAD4))  {
            ARSet2 = ARSet2 + (CdMultiplier * 5);
            ConfigSeconds=0;
        }
        if(event_press(Aim))  {
            ConfigSelect = 1;
            ConfigSeconds=0;
            //set_ledx(LED_1, 10);
        }
        if(event_press(Fire))  {
            ConfigSelect = 2;
            ConfigSeconds=0;
            //set_ledx(LED_1, 10);
        }
        if (event_press(Crouch)) {
            AutoDrop = !AutoDrop;
            ConfigSeconds=0;
        }
    } //End Configuration Setup
 
 
    if (configsetup == FALSE) {
        if((event_press(Mode1) && get_val(Mode2)) || (get_val(Mode2) && event_press(Mode1))) {
            if (ConfigSelect == 2) {
                Reset = 2;
                ConfigSelect = 0;
            } else if (ConfigSelect == 1) {
                Reset = 1;
                ConfigSelect = 0;
            } else if (Reset == 1) {
                Reset = 0;
                ConfigSelect = 1;
            } else if (Reset == 2) {
                Reset = 0;
                ConfigSelect = 2;
            }
        }
 
        if (AafkCdTime > 0 && ConfigSelect>0) {
            if (get_val(0) || get_val(1) || get_val(2) || get_val(3) ||
            get_val(4) || get_val(5) || get_val(6) || get_val(7) ||
            get_val(8) || get_val(13) || get_val(14) || get_val(15) ||
            get_val(16) || get_val(17) || get_val(18) || get_val(19) ||
            get_val(20)) {
                AafkSeconds=0;
            } else if (AafkSeconds>AafkCdTime) {
                combo_run(AAFK);
            }
        }
 
        if(event_press(Grenade)) {
            seconds0=0;
/*      } else if(event_press(Reload)) {
            seconds1=0;
*/
      } else if((event_press(Grenade) && get_val(Melee)>0) || (event_press(Melee) && get_val(Grenade)>0)) {
            seconds2=0;
        }
 
        if(event_press(Switch) && ConfigSelect > 0) { // Auto-reload after switching weapons
            if(CdPTime3>0) {
                SwitchUp = 1;
                combo_run(AutoReload);
            }
        } else if(event_press(Reload) && ConfigSelect > 0) {  // Disables Autorun after pressing Reload
            if(AutoRun == TRUE ) {
                combo_run(AutoReload);
            }
        } else if(AutoRun == TRUE && (get_val(Aim)>10 || get_val(Fire)>10) && ConfigSelect > 0) { // Disables AutoRun immediately after pressing Aim or Fire
            set_val(Sprint,0);
            AutoRun=4;
            seconds3=0;
        } else if (AutoRun==3 && seconds3>=CdPTime3) {
            AutoRun=TRUE;
        } else if (AutoRun==4 && seconds3>=(SprintTimeout/1000)) {
            AutoRun=TRUE;
        } else if (get_val(AnaMovUD) < -90 && AutoRun == TRUE && ConfigSelect > 0) { // Auto-Sprint when moving forward. Triggers every 3 seconds (or SprintTimeout setting) when pressing forward.
            combo_run(AutoSprint);
        }
 
        if (event_press(Mode2) && ConfigSelect >0 ) {
            if(FirePrimary == TRUE) {
                FirePrimary = FALSE;
            } else {
                FirePrimary = TRUE;
            }
        }
 
        if ((event_press(Crouch) ||event_press(Sprint) ||event_press(Jump)) && ConfigSelect >0) {
            if (ADIsSet==0){ADIsSet= 1;}
            else if (ADIsSet==1) {ADIsSet=0}
/*      } else if (event_release(Fire) && ADIsSet == 1 && configsetup == FALSE && ConfigSelect >0) {
            ADIsSet=0;
            combo_run(AutoDropShot);
*/
      }
 
        if (ConfigSelect == 1 && get_val(Aim) >90 && get_val(Fire)>90) {
            snipe=1;
            combo_run(Control);         // Does not use powers while aiming and firing in Sniper mode
        } else if (ConfigSelect == 1 && get_val(Aim)<90 && get_val(Fire)>90) {     // Removed from line: && AllSet == TRUE 
            snipe=0;
            combo_run(Control);         // Uses powers and RF when NOT aiming in Sniper mode
        } else if (ConfigSelect == 2 && get_val(Fire)>90) {                 // Removed from line: && AllSet == TRUE
            snipe=0;
            combo_run(Control);         // Uses powers and RF when not using Sniper mode
        }
    } //End RealTime options
 
}// End Main   
 
/*
* ===============================================================================================================================================
* COMBINATIONS
* ===============================================================================================================================================
*/

combo Control {
    set_led(currentled, 0);
    if (snipe==1) {
        if (seconds0 >= CdPTime0 && seconds0>0) {
            seconds0=CdPTime0-5;
        } else if (seconds1 >= CdPTime1 && seconds1>0) {
            seconds1=CdPTime1-5;
        } else if (seconds2 >= CdPTime2 && seconds2>0) {
            seconds2=CdPTime2-5;
        } else combo_run (Control2);
    } else if (AutoDrop==TRUE && ADIsSet ==0) {
        combo_run(AutoDropShot);
    } else if (snipe==0) {
    /*} else*/ if ((seconds0 > CdPTime0) && GrenadeMotion == 1 && abs(get_val(AnaMovUD))<=10 /*&& CdCheck == 1*/ && (CdPTime0 > 0)) {
            combo_run (Power1Sub); // AnaMovUD set to only throw grenades when controller is dead center
        } else if ((seconds0 > CdPTime0) && GrenadeMotion == 2 && abs(get_val(AnaMovUD))<=100 /*&& CdCheck == 1*/ && (CdPTime0 > 0)) {
            combo_run (Power1Sub); // AnaMovUD set to throw grenades regardless of controller direction
        } else if ((seconds0 > CdPTime0) && GrenadeMotion == 3 && get_val(AnaMovUD)<=-90 /*&& CdCheck == 1*/ && (CdPTime0 > 0)) {
            combo_run (Power1Sub); // AnaMovUD set to only throw grenade while moving forward
        } else if ((seconds0 > CdPTime0) && GrenadeMotion == 4 && get_val(AnaMovUD)>=90 /*&& CdCheck == 1*/ && (CdPTime0 > 0)) {
            combo_run (Power1Sub); // AnaMovUD set to throw grenades while moving backwards direction
 /*     } else if (PowerIsSet1==1 && (seconds1 > CdPTime1) && (CdPTime1 > 0)) {
            combo_run (Power2Sub);       
*/
      } else if ((seconds2 > CdPTime2) && ChargeMotion == 1 && abs(get_val(AnaMovUD))<=10 /*&& CdCheck == 1*/ && (CdPTime2 > 0)) {
            combo_run (Power3Sub); // AnaMovUD set to only activate when controller is dead center
        } else if ((seconds2 > CdPTime2) && ChargeMotion == 2 && abs(get_val(AnaMovUD))<=100 /*&& CdCheck == 1*/ && (CdPTime2 > 0)) {
            combo_run (Power3Sub); // AnaMovUD set to activate Charge regardless of controller direction
        } else if ((seconds2 > CdPTime2) && ChargeMotion == 3 && get_val(AnaMovUD)<=-90 /*&& CdCheck == 1*/ && (CdPTime2 > 0)) {
            combo_run (Power3Sub); // AnaMovUD set to activate Charge while moving forward
        } else if ((seconds2 > CdPTime2) && ChargeMotion == 4 && get_val(AnaMovUD)>=90 /*&& CdCheck == 1*/ && (CdPTime2 > 0)) {
            combo_run (Power3Sub); // AnaMovUD set to activate Charge while moving backwards
        } else combo_run (Control2);
    }
} // End combo
 
combo Control2 {
    if (FirePrimary == TRUE) {
        combo_run (Shoot1Sub);
    } else {
        combo_run (Shoot2Sub);
    }
}
 
combo Shoot1Sub {
    set_led(currentled, 1);
    if (CdGTime0 > 4) {
        CdWait=4000;
    } else if (CdGTime0 == 0) {
        CdWait=10;
    } else CdWait = CdGTime0 * 1000;
    if (get_val(Fire)>90 && CdGTime0>0 && AutoZoom==TRUE) {set_val(Aim,100);}
    wait(CdWait) ;
    if (get_val(Fire)>90 && CdGTime0==0 && AutoZoom==TRUE) {set_val(Aim,100);}
    if (get_val(Fire)>90) {set_val(Fire, 0);}
    wait(HoldTime);
    if(CdGTime0>0) {combo_run(AntiRecoil);}
} //End Combo
 
combo Shoot2Sub {
    set_led(currentled, 1);
    if (CdGTime1 > 4) {
        CdWait=4000;
    } else if (CdGTime1 == 0) {
        CdWait=10;
    } else CdWait = CdGTime1 * 1000;
    if (get_val(Fire)>90 && CdGTime1>0 && AutoZoom==TRUE) {set_val(Aim,100);}
    wait(CdWait);
    if (get_val(Fire)>90 && CdGTime1==0 && AutoZoom==TRUE) {set_val(Aim,100);}
    if (get_val(Fire)>90) {set_val(Fire, 0);}
    wait(HoldTime);
    if(CdGTime1>0) {combo_run(AntiRecoil);}
} // End Combo
 
combo Power1Sub {
    set_led(currentled, 1);
    set_val(Grenade, 100);
    wait(HoldTime);
    seconds0=0;
} // End Combo
 
/*combo Power2Sub {
    set_led(currentled, 1);
    set_val(Reload, 100);
    wait(HoldTime);
    seconds1=0;
} // End Combo
*/

combo Power3Sub {
    set_led(currentled, 1);
    set_val(Grenade, 100);
    set_val(Melee, 100);
    wait(HoldTime);
    seconds2=0;
} // End Combo
 
combo AutoReload {
    if(AutoRun==TRUE) {
        AutoRun=3;
        position=get_val(AnaMovUD);
        set_val(AnaMovUD,0);
        set_val(AnaMovUD,position);
        seconds3=0;
    }
    wait(ReloadDelay);
    if (SwitchUp == 1) {set_val(Reload,100);}
    wait(HoldTime);
    SwitchUp = 0;
    seconds3=0;
} // End Combo
 
combo AAFK {
    set_val(AnaCamSS,100);
    wait(RestTime);
    set_val(AnaCamUD,100);
    wait(RestTime);
    set_val(AnaMovSS,100);
    wait(RestTime);
    set_val(AnaMovUD,100);
    wait(RestTime);
    set_val(Aim,100);
    wait(RestTime);
    set_val(Melee,100);
    wait(RestTime);
    set_val(Crouch,100);
    wait(RestTime);
} // End Combo
 
combo AutoSprint{
    set_val(Sprint,100);
    block(Sprint,SprintTimeout);
    ADIsSet=0;
//    block(Crouch,SprintTimeout);
//  set_val(Jump,100);
//  wait(RestTime);
//  set_val(Jump,0);
//  wait(RestTime);
}
 
combo AutoDropShot {
    set_val(Crouch,100);
    wait(HoldTime);
    ADIsSet=1;
}
 
combo RumbleStrong {
    set_rumble(RUMBLE_A, 100);
    wait(RestTime);
    set_rumble(RUMBLE_A, 0);
}
/*
combo RumbleWeak {
    set_rumble(RUMBLE_B, 100);
    wait(RestTime);
    set_rumble(RUMBLE_B, 0);
}
*/

combo AntiRecoil {
    if (FirePrimary == TRUE) {
        ARComp = get_val(AnaCamUD) + ARSet1;
        if(ARComp > 100) ARComp = 100;
        set_val(AnaCamUD, ARComp);
    }
    else {
        ARComp = get_val(AnaCamUD) + ARSet2;
        if(ARComp > 100) ARComp = 100;
        set_val(AnaCamUD, ARComp);
    }
    wait(50);
}
\0