destiny scripting

Titan One general support. Questions, firmware update, feature request.

destiny scripting

Postby Jared777 » Wed Mar 30, 2016 8:48 pm

im on the xbox one and l was wanting to know can you make a script for destiny where your sensitivity is high but when you aim your sensitivity is very low?
User avatar
Jared777
Corporal
Corporal
 
Posts: 4
Joined: Tue Mar 22, 2016 3:23 am

Re: destiny scripting

Postby J2Kbr » Wed Mar 30, 2016 11:55 pm

this should to the trick :)

You can adjust the AIM_SENSITIVITY value for you need. Lower the value, less sensitivity. higher the value, more sensitivity.

Code: Select all
define AIM_BUTTON       = PS4_L2;
define AIM_AXIS_X       = PS4_RX;
define AIM_AXIS_Y       = PS4_RY;

define AIM_SENSITIVITY  = 60;

main {
    if(get_val(AIM_BUTTON)) {
        sensitivity(AIM_AXIS_X, NOT_USE, AIM_SENSITIVITY);
        sensitivity(AIM_AXIS_Y, NOT_USE, AIM_SENSITIVITY);
    }
}
ConsoleTuner Support Team
User avatar
J2Kbr
General of the Army
General of the Army
 
Posts: 20323
Joined: Tue Mar 18, 2014 1:39 pm

Re: destiny scripting

Postby Mortomis » Fri Apr 01, 2016 11:34 pm

Hi J2kbr I have an question for you which is probably simple how do i add this script onto another script. i.e I am using the destiny script by rabid taco and i tried copy and pasting this onto his one but it just gives me an error

syntax error near unexpected token 'define'.
Build failed with 1 errors ...

when i try to compile it.
apologies for my lack of coding/newbish questions
User avatar
Mortomis
Sergeant
Sergeant
 
Posts: 6
Joined: Fri Mar 25, 2016 1:13 pm

Re: destiny scripting

Postby bonefisher » Fri Apr 01, 2016 11:48 pm

Code: Select all

// GPC Online Library
// full_destiny_script_autofire_rapid_mele_auto_run_quick_scope_and_more.gpc

/*******************************************************************************
*   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 Change_Gun = PS4_TRIANGLE;
define Jump = PS4_CROSS;
define Reload = PS4_SQUARE;
define D_Pad_Right = PS4_RIGHT;
define D_Pad_Left = PS4_LEFT;
define D_Pad_Up = PS4_UP;
define D_Pad_Down = PS4_DOWN;
define Left_X_Axis = PS4_LX;
define Left_Y_Axis = PS4_LY;
define Right_X_Axis = PS4_RX;
define Right_Y_Axis = PS4_RY;
define Sprint = PS4_L3;
define Auto_Fire_On_Off = PS4_R3;
define AIM_BUTTON       = PS4_L2;
define AIM_AXIS_X       = PS4_RX;
define AIM_AXIS_Y       = PS4_RY;

define AIM_SENSITIVITY  = 60;


int Shoot = PS4_R2;
int ADS = PS4_L2;
int Mele = PS4_R1;
int Grenade = PS4_L1;

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(get_val(AIM_BUTTON)) {
        sensitivity(AIM_AXIS_X, NOT_USE, AIM_SENSITIVITY);
        sensitivity(AIM_AXIS_Y, NOT_USE, AIM_SENSITIVITY);
    }
   
    if (Button_Swap == 0) {
        Shoot = PS4_R2;
        ADS = PS4_L2;
        Mele = PS4_R1;
        Grenade = PS4_L1;
    } else if (Button_Swap == 1) {
        Shoot = PS4_R1;
        ADS = PS4_L1;
        Mele = PS4_R2;
        Grenade = PS4_L2;
    } 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(Jump))) {
        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(Change_Gun))) {
        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(Change_Gun)) {
        combo_run(Get_Weapon_Switch_Time);
    }
   
    // Uses the time recorded and checks to see what weapon was switched to.
    if (event_release(Change_Gun) && !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(D_Pad_Left) && 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(D_Pad_Right) && 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(D_Pad_Down) && 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(D_Pad_Up) && 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(D_Pad_Up) && 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(D_Pad_Down) && 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(Change_Gun);
    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;
}
Mortomis wrote:Hi J2kbr I have an question for you which is probably simple how do i add this script onto another script. i.e I am using the destiny script by rabid taco and i tried copy and pasting this onto his one but it just gives me an error

syntax error near unexpected token 'define'.
Build failed with 1 errors ...

when i try to compile it.
apologies for my lack of coding/newbish questions

Here you go! No errors.
bonefisher
Lieutenant General
Lieutenant General
 
Posts: 5413
Joined: Thu Jan 29, 2015 10:49 am

Re: destiny scripting

Postby J2Kbr » Mon Apr 04, 2016 8:21 am

bonefisher wrote:Here you go! No errors.
Thanks! :)
ConsoleTuner Support Team
User avatar
J2Kbr
General of the Army
General of the Army
 
Posts: 20323
Joined: Tue Mar 18, 2014 1:39 pm

Re: destiny scripting

Postby Mortomis » Tue Apr 12, 2016 1:15 am

great thanks guys working like a dream
User avatar
Mortomis
Sergeant
Sergeant
 
Posts: 6
Joined: Fri Mar 25, 2016 1:13 pm


Return to Titan One Device

Who is online

Users browsing this forum: No registered users and 131 guests