Full Destiny Script [Autofire, Rapid Mele, Auto Run, Quick Scope, and More]

This is a full script for Destiny that was written to include options for Full Rapid Fire, Turbo Mele, Auto Run, Quick Scope, and more! Please read through the comments both at the beginning of the code and throughout the script as it is heavily commented to allow for easy changing and explanation of what is taking place. I'd like to say thanks to whit77cali as a lot of my ideas and initial learning of the Titan One language came from his script (http://www.consoletuner.com/gpclib/?s=1105). Please let me know if you find this helpful or if there are any suggestions for changes / additions.
Version1.2
AuthorThe_Rabid_Taco
Publish DateThu, 17 Mar 2016 - 14:36
Last UpdateSun, 3 Apr 2016 - 16:40
Downloads1945
RATE


7

0

Release Notes: Replaced the values specific to PS4 with neutral button indicators that should allow this script to be used on all consoles. Please let me know if this is not working on your console.
Code: Select all
/*******************************************************************************
*   Full Destiny Script!                                                       *
*   Includes support for rapid fire, rapid mele, auto run,                     *
*   anti-recoil, and for shooters using the R1 / L1 for ADS and                *
*   fire it has support for easy swap in the script.  Primary                  *
*   and Special have seperately adjustable rate of fire and                    *
*   primary, special, and heavy have seperate anti-recoil settings,            * 
*   stored persistently so will not have to reset when loading script          *
*   next time, no rapid fire on heavy as it seems to slow it down.             *
*   Seperate adjustable anti-recoil on Primary, Special, and                   *
*   Heavy.  Turbo Mele can be toggled in game, auto run can                    *
*   be toggled in game, fire, ads, mele, and grendade can be                   *
*   swapped (script mapping only!) in game.  This will not change              *
*   your layout, but simply change the script to match your                    *
*   layout!  All values have persistant storage so they will be                *
*   remembered everytime you load the script, even after moving                *
*   or unpluging the Titan 1.  Easy LED indication of if the                   *
*   is enabled or disabled, Green is on, Red is off.  Comments                 *
*   throughout the script as to how to use it, but a short list                *
*   is here as well:                                                           *
*                                                                              *
*   Increase Fire Rate:  D-Pad Right while Shooting                            *
*   Decrease Fire Rate:  D-Pad Left while Shooting                             *     
*   Increase Anti-Recoil:  D-Pad Up while Shooting                             *
*   Decrease Anti-Recoil:  D-Pad Down while Shooting                           *
*   Reset Script:  Make sure primary is equiped and quickly tap R3             *
*   Disable Script:  Hold R3 for .5 seconds                                    *
*   Swap R1/R2 & L1/L2:  Press Options & Jump                                  *
*   Auto Run Enable/Disable:  Options & Circle                                 *
*   Turbo Mele Enable/Disable:  Options & Triangle                             *
*   Quick-Scope: Tap ADS for less than .4 seconds                              *
*   Increase Quick Scope Delay:  D-Pad Down while ADS is up (Not shooting!)    *
*   Decrease Quick Scope Delay:  D-Pad Up while ADS is up (Not shooting!)      *
*******************************************************************************/

 
// Sets the button layout used throughout the script.
 
define Left_X_Axis = 11;
define Left_Y_Axis = 12;
define Right_X_Axis = 9;
define Right_Y_Axis = 10;
define Sprint = 8;
define Auto_Fire_On_Off = 5;
 
int Shoot = 4;
int ADS = 7;
int Mele = 3;
int Grenade = 6;
 
int Primary_Auto_Fire_Delay, Secondary_Auto_Fire_Delay, Heavy_Auto_Fire_Delay;
int Primary_Anti_Recoil, Secondary_Anti_Recoil, Heavy_Anti_Recoil;
int Primary_Weapon, Secondary_Weapon, Heavy_Weapon;
int Right_Stick = 0
int Auto_Fire_Hold_Time = 40;
int Weapon_Switch_Check_Time = 0;
int Quick_Scope_Check_Time = 0;
int Auto_Fire_Check_Time = 0;
int Auto_Fire_Enabled = TRUE;
int Selected_Weapon = 1;
int Quick_Scope_Delay;
int Button_Swap;
int Auto_Sprint;
int Turbo_Mele;
 
init {
    Primary_Auto_Fire_Delay = get_pvar(SPVAR_1, 0, 4000, 40);
    Secondary_Auto_Fire_Delay = get_pvar(SPVAR_2, 0, 4000, 40);
    Heavy_Auto_Fire_Delay = get_pvar(SPVAR_3, 0, 4000, 40);
    Primary_Anti_Recoil = get_pvar(SPVAR_5, 01000);
    Secondary_Anti_Recoil = get_pvar(SPVAR_6, 01000);
    Heavy_Anti_Recoil = get_pvar(SPVAR_7, 01000);
    Quick_Scope_Delay = get_pvar(SPVAR_9, 0, 4000, 50)
    Button_Swap = get_pvar(SPVAR_10, 0, 1, 0);
    Auto_Sprint = get_pvar(SPVAR_11, 0, 1, 0);
    Turbo_Mele = get_pvar(SPVAR_12, 0, 1, 0);
 
    Primary_Weapon = 1;
    Secondary_Weapon = 2;
    Heavy_Weapon = 3;
}
 
main {
    // Sets the speed of the virtual machine loop to 4ms.
    vm_tctrl (-6);
 
    if (Button_Swap == 0) {
        Shoot = 4;
        ADS = 7;
        Mele = 3;
        Grenade = 6;
    } else if (Button_Swap == 1) {
        Shoot = 3;
        ADS = 6;
        Mele = 4;
        Grenade = 7;
    } else {
        Button_Swap = 0;
    }
 
    // Used to change the button configuration if you use R1 to shoot and L1 to
    // airm just press Options + X to switch values in the script.
    if ((get_val(PS4_OPTIONS)) && (get_val(19))) {
        if (Button_Swap == 0) {
            Button_Swap = 1;
            set_pvar(SPVAR_10, Button_Swap);
        } else if (Button_Swap == 1) {
            Button_Swap = 0;
            set_pvar(SPVAR_10, Button_Swap);
        } else {
            Button_Swap = 0;
            set_pvar(SPVAR_10, Button_Swap);
        }
    }
 
    // Used to enable or disable auto sprint.
    if ((get_val(PS4_OPTIONS)) && (get_val(PS4_CIRCLE))) {
        if (Auto_Sprint == 0) {
            Auto_Sprint = 1;
            set_pvar(SPVAR_11, Auto_Sprint);
        } else if (Auto_Sprint == 1) {
            Auto_Sprint = 0;
            set_pvar(SPVAR_11, Auto_Sprint);
        } else {
            Auto_Sprint = 0;
            set_pvar(SPVAR_11, Auto_Sprint);
        }
    }
 
    // If auto sprint is enabled then make sure we are running the combo.
    if ((get_val(Left_Y_Axis) < -95) && (Auto_Sprint == 1) && (!combo_running(Auto_Run)) && (Auto_Fire_Enabled)) {
        combo_run(Auto_Run);
    }
 
    // Used to enable or disable turbo mele.
    if ((get_val(PS4_OPTIONS)) && (get_val(17))) {
        if (Turbo_Mele == 0) {
            Turbo_Mele = 1;
            set_pvar(SPVAR_12, Turbo_Mele);
        } else if (Turbo_Mele == 1) {
            Turbo_Mele = 0;
            set_pvar(SPVAR_12, Turbo_Mele);
        } else {
            Turbo_Mele = 0;
        }
    }
 
    // If Turbo Mele is enabled and mele is pressed run the combo.
    if ((get_val(Mele)) && (Turbo_Mele == 1) && (!combo_running(TurboMele)) && (Auto_Fire_Enabled)) {
        combo_run(TurboMele);
    }
 
    // Sets a LED indicator to show wheter the script is enabled or not.
    // Green is enabled, red is disabled.
    if (Auto_Fire_Enabled) {
        set_led(LED_1, 0);
        set_led(LED_2, 0);
        set_led(LED_3, 1);
        set_led(LED_4, 0);
    } else if (!Auto_Fire_Enabled) {
        set_led(LED_1, 0);
        set_led(LED_2, 1);
        set_led(LED_3, 0);
        set_led(LED_4, 0);
    }
 
    // Check to see if reseting to primary weapon or turning off script.
    if (get_val(Auto_Fire_On_Off)) {
        combo_run (Reset_Button_Timer);
    }
 
    // Togle button has been released, based on time will reset to primary or
    // will disable the script.  Holding R3 for .5 seconds will disable, less
    // than that will reset script to primary weapon.
    if (event_release(Auto_Fire_On_Off) && !combo_running(Auto_Fire_Reset) && !combo_running(Auto_Fire_Togle)) {
        if (Auto_Fire_Check_Time < 500) {
            combo_run(Auto_Fire_Reset);
        } else if (Auto_Fire_Check_Time >= 500) {
            combo_run(Auto_Fire_Togle);
        }
    }
 
    // Checks to see what weapon is equiped and runs the rapid fire / anti recoil
    // for that weapon if script is enabled.
    if (get_val(Shoot) && !combo_running(Primary_Rapid_Fire) && !combo_running(Secondary_Rapid_Fire) && !combo_running(Heavy_Rapid_Fire)) {
        if ((Selected_Weapon == Primary_Weapon) && (Auto_Fire_Enabled)) {
            combo_run (Primary_Rapid_Fire);
        } else if ((Selected_Weapon == Secondary_Weapon) && (Auto_Fire_Enabled)) {
            combo_run (Secondary_Rapid_Fire);
        } else if ((Selected_Weapon == Heavy_Weapon) && (Auto_Fire_Enabled)) {
            combo_run (Heavy_Rapid_Fire);
        }
    }
 
 
    // Checks to see how long the ADS was pressed for, if a quick tap, less than
    // .4 seconds will perform a quick scope.
    if (get_val(ADS)) {
        combo_run(Get_ADS_Time);
    }
 
    // If the ADS was pressed for less than .4 seconds runs the quick scope code.
    if (event_release(ADS) && !combo_running(Quick_Scope)) {
        if ((Quick_Scope_Check_Time <= 400) && (Selected_Weapon == Secondary_Weapon) && (Auto_Fire_Enabled)) {
            combo_run(Quick_Scope);
        }
    }
 
    // Measures the amount of time the button was pressed to switch weapons. 
    // This is used to track which weapon is equiped.
    if (get_val(17)) {
        combo_run(Get_Weapon_Switch_Time);
    }
 
    // Uses the time recorded and checks to see what weapon was switched to.
    if (event_release(17) && !combo_running(Check_Heavy_Weapon_Change)){
        combo_run(Check_Heavy_Weapon_Change);
    }
 
    // Pressing left on the D-Pad while shooting adds to the delay between
    // shots.  For every time the left D-Pad is pressed while shooting we
    // increase the delay time by 10 miliseconds.  This value is then stored in
    // a persistent variable that is automatically loaded nex time the script
    // is ran.
    if (event_press(15) && get_val(Shoot)) {
        if ((Selected_Weapon == Primary_Weapon) && (Auto_Fire_Enabled)) {
            Primary_Auto_Fire_Delay = Primary_Auto_Fire_Delay + 10;
            set_pvar(SPVAR_1, Primary_Auto_Fire_Delay);
        }
        if ((Selected_Weapon == Secondary_Weapon) && (Auto_Fire_Enabled)) {
            Secondary_Auto_Fire_Delay = Secondary_Auto_Fire_Delay + 10;
            set_pvar(SPVAR_2, Secondary_Auto_Fire_Delay);
        }
    }
 
    // Pressing right on the D-Pad while shooting shortens the delay between
    // shots.  For every time the right D-Pad is pressed while shooting we
    // decrease the delay time by 10 miliseconds.  This value is then stored in
    // a persistent variable that is automatically loaded nex time the script
    // is ran.
    if (event_press(16) && get_val(Shoot)) {
        if ((Selected_Weapon == Primary_Weapon) && (Primary_Auto_Fire_Delay >= 10) && (Auto_Fire_Enabled)) {
            Primary_Auto_Fire_Delay = Primary_Auto_Fire_Delay - 10;
            set_pvar(SPVAR_1, Primary_Auto_Fire_Delay);
        }
        if ((Selected_Weapon == Secondary_Weapon) && (Secondary_Auto_Fire_Delay >= 10) && (Auto_Fire_Enabled)) {
            Secondary_Auto_Fire_Delay = Secondary_Auto_Fire_Delay - 10;
            set_pvar(SPVAR_2, Secondary_Auto_Fire_Delay);
        }
    }
 
    // Pressing down on the D-Pad while shooting strengthens the anti recoil
    // setting.  For every time the down D-Pad is pressed while shooting we
    // increase the amount of anti recoil by 2.  This value is then stored in
    // a persistent variable that is automatically loaded nex time the script
    // is ran.
    if (event_press(14) && get_val(Shoot)) {
        if ((Selected_Weapon == Primary_Weapon) && (Primary_Anti_Recoil <= 98) && (Auto_Fire_Enabled)) {
            Primary_Anti_Recoil = Primary_Anti_Recoil + 2;
            set_pvar(SPVAR_5, Primary_Anti_Recoil);
        }
        if ((Selected_Weapon == Secondary_Weapon) && (Secondary_Anti_Recoil <= 98) && (Auto_Fire_Enabled)) {
            Secondary_Anti_Recoil = Secondary_Anti_Recoil + 2;
            set_pvar( SPVAR_6, Secondary_Anti_Recoil);
        }
        if ((Selected_Weapon == Heavy_Weapon) && (Heavy_Anti_Recoil <= 98) && (Auto_Fire_Enabled)) {
            Heavy_Anti_Recoil = Heavy_Anti_Recoil + 2;
            set_pvar(SPVAR_7, Heavy_Anti_Recoil);
        }
    }
 
    // Pressing up on the D-Pad while shooting weakens the anti recoil
    // setting.  For every time the up D-Pad is pressed while shooting we
    // decrease the amount of anti recoil by 2.  This value is then stored in
    // a persistent variable that is automatically loaded nex time the script
    // is ran.
    if (event_press(13) && get_val(Shoot)) {
        if ((Selected_Weapon == Primary_Weapon) && (Primary_Anti_Recoil >= 2) && (Auto_Fire_Enabled)) {
            Primary_Anti_Recoil = Primary_Anti_Recoil - 2;
            set_pvar(SPVAR_5, Primary_Anti_Recoil);
        }
        if ((Selected_Weapon == Secondary_Weapon) && (Secondary_Anti_Recoil >= 2) && (Auto_Fire_Enabled)) {
            Secondary_Anti_Recoil = Secondary_Anti_Recoil - 2;
            set_pvar(SPVAR_6, Secondary_Anti_Recoil);
        }
        if ((Selected_Weapon == Heavy_Weapon) && (Heavy_Anti_Recoil >= 2) && (Auto_Fire_Enabled)) {
            Heavy_Anti_Recoil = Heavy_Anti_Recoil - 2;
            set_pvar(SPVAR_7, Heavy_Anti_Recoil);
        }
    }
 
    // Pressing up on the D-Pad while ADS is held and not shooting increases 
    // the delay for the quick scope setting.  For every time the up D-Pad is
    // pressed while in ADS and not shooting we increase the delay between 
    // pulling up sights and firing by five miliseconds.  This value is then
    // stored in a persistent variable that is automatically loaded nex time 
    // the script is ran.
    if (event_press(13) && get_val(ADS)) {
        if ((Selected_Weapon == Secondary_Weapon)  && (Auto_Fire_Enabled)) {
            Quick_Scope_Delay = Quick_Scope_Delay + 5;
            set_pvar(SPVAR_9, Quick_Scope_Delay);
        }
    }
 
    // Pressing down on the D-Pad while ADS is held and not shooting decreases 
    // the delay for the quick scope setting.  For every time the down D-Pad is
    // pressed while in ADS and not shooting we decrease the delay between 
    // pulling up sights and firing by five miliseconds.  This value is then
    // stored in a persistent variable that is automatically loaded nex time 
    // the script is ran.
    if (event_press(14) && get_val(ADS)) {
        if ((Selected_Weapon == Secondary_Weapon)  && (Auto_Fire_Enabled)) {
            Quick_Scope_Delay = Quick_Scope_Delay - 5;
            set_pvar(SPVAR_9, Quick_Scope_Delay);
        }
    }
}
 
// Records the time that the R3 button was pressed.  Used to determine whether
// reset or enable / disable the script.
combo Reset_Button_Timer {
    Auto_Fire_Check_Time = get_ptime(Auto_Fire_On_Off);
}
 
// If pressed for less than half a second then reset the script.
combo Auto_Fire_Reset {
    if (Auto_Fire_Check_Time < 500) {
        Selected_Weapon = 1;
    }
}
 
// If pressed for a half second or longer then enable / disable the script.
combo Auto_Fire_Togle {
    if (Auto_Fire_Check_Time >= 500) {
        if (Auto_Fire_Enabled) {
            Auto_Fire_Enabled = FALSE;
            set_led(LED_1, 0);
            set_led(LED_2, 1);
            set_led(LED_3, 0);
            set_led(LED_4, 0);
        } else if (!Auto_Fire_Enabled) {
            Auto_Fire_Enabled = TRUE;
            set_led(LED_1, 0);
            set_led(LED_2, 0);
            set_led(LED_3, 1);
            set_led(LED_4, 0);
        }
    }
}
 
// Used to auto run, no more mashing L3!
combo Auto_Run {
    set_val(Sprint, 100);
    wait(40);
    set_val(Sprint, 0);
    wait(30);
    set_val(Sprint, 0);
}
 
// Used to turbo mele, just hold to keep punching!
combo TurboMele {
    set_val(Mele, 100);
    wait(40);
    set_val(Mele, 0);
    wait(20);
    set_val(Mele, 0);
}
 
// Runs the primary rapid fire & anti-recoil using the settings stored.  Can
// be fine tuned to different weapons.
combo Primary_Rapid_Fire {
    set_val(Shoot, 100);
 
    if ((get_val(Right_Y_Axis) < 70) && (get_val(Right_Y_Axis) > -70)) {
        Right_Stick = get_val(Right_Y_Axis) + Primary_Anti_Recoil;
 
        if (Right_Stick > 100) {
            Right_Stick = 100;
        }
 
        set_val(Right_Y_Axis, Right_Stick);
    }
 
    wait (Auto_Fire_Hold_Time);
    set_val(Shoot, 0);
    wait (Primary_Auto_Fire_Delay);
}
 
// Runs the secondary rapid fire & anti-recoil using the settings stored.  Can
// be fine tuned to different weapons.
combo Secondary_Rapid_Fire {
    set_val(Shoot, 100);
 
    if ((get_val(Right_Y_Axis) < 70) && (get_val(Right_Y_Axis) > -70)) {
        Right_Stick = get_val(Right_Y_Axis) + Secondary_Anti_Recoil;
 
        if (Right_Stick > 100) {
            Right_Stick = 100;
        }
 
        set_val(Right_Y_Axis, Right_Stick);
    }
 
    wait (Auto_Fire_Hold_Time);
    set_val(Shoot, 0);
    wait (Secondary_Auto_Fire_Delay);
}
 
// Runs the heavy anti-recoil using the settings stored.  Can
// be fine tuned to different weapons.
combo Heavy_Rapid_Fire {
    set_val(Shoot, 100);
 
    if ((get_val(Right_Y_Axis) < 70) && (get_val(Right_Y_Axis) > -70)) {
        Right_Stick = get_val(Right_Y_Axis) + Heavy_Anti_Recoil;
 
        if (Right_Stick > 100) {
            Right_Stick = 100;
        }
 
        set_val(Right_Y_Axis, Right_Stick);
    }
}
 
// Records the amount of time that the ADS button was held for.  This is used
// to determine whether or not to quick scope.
combo Get_ADS_Time {
    Quick_Scope_Check_Time = get_ptime(ADS);
}
 
// Combo sets the ADS value to 100 then delays the pre-determined time and then
// fires a single shot.  This only works if the ADS button was quickly tapped.
// If held for more than .4 seconds this will not run and regular ADS will be
// used.
combo Quick_Scope {
    set_val(ADS, 100);
    wait(Quick_Scope_Delay);
    set_val(Shoot, 100);
    wait(40);
    set_val(ADS, 0);
    set_val(Shoot, 0);
 
    Quick_Scope_Check_Time = 0;
}
 
// Combo records the time that the change weapon button was pressed to be used
// to determine what weapon is equiped.
combo Get_Weapon_Switch_Time {
    Weapon_Switch_Check_Time = get_ptime(17);
    set_val(TRACE_5, 100);
}
 
// Combo checks the time the change weapon button was pressed.  If greater than
// .2 seconds then it was a switch to heavy, if not then it was a switch to
// either primary or secondary.
combo Check_Heavy_Weapon_Change {   
    if (Weapon_Switch_Check_Time <= 200) {
        if (Selected_Weapon == Primary_Weapon){
            Selected_Weapon = Secondary_Weapon;
        }
        else if (Selected_Weapon == Heavy_Weapon){
            Selected_Weapon = Primary_Weapon;
        }
        else {
            Selected_Weapon = Primary_Weapon;
        }
    }
    else {
            Selected_Weapon = Heavy_Weapon;
    }
 
    wait (10);
    Weapon_Switch_Check_Time = 0;
}