AutoRun and Auto Slide Activation Problem

GPC2 script programming for Titan Two. Code examples, questions, requests.

AutoRun and Auto Slide Activation Problem

Postby SweatyPapi » Wed Apr 24, 2019 1:06 am

I have a Xim Apex and two scripts I like to use with the titan two.
pablo script functions perfectly fine when it comes to movement, however by his choice there is no open scriptavailable, but however the script does not have the exact anti recoil and other mods I would like from bonefishers script.

What I basically need is the PabloScript featuring movement in Bonefisher's script. What happens is that After I ADS out and I am back on hip, bonefisher's script does not activate analog and also it does not let you auto slide either. I just need it how it is done in pablos script but I don't have the script to bsae it off of. Please help as this would be the last step to my ultimate script.

Pablo QOL BO4 script

Bonefisher custom script Below:
Code: Select all
 
#pragma METAINFO("BO4 Special Edtion", 1, 0, "bonefisher")
 
/* *****************************************************************************
<cfgdesc>
[BO4 Special Edtion]
color          = #008000
shortdesc      = <font color="green">Runtime operations Use Interactive Configurations for changes to settings.
control        = info
 
[RAPID FIRE SETTINGS:]
color          = #008000
collapsible    = 2
shortdesc      = <font color="brown">ENABLE:<font color="green">Rapid Fire?</font>
byteoffset     = 0
bitsize        = 8
control        = radiobox
default        = 0
item           = Rapidfire OFF
item           = Rapidfire ON
 
[RAPID FIRE OPTIONS:]
group          = true
shortdesc      = <font color="brown">SHOTS PER SECOND:</font> <font color="green">   Set to desired sps setting 1~25 sps.</font>
byteoffset     = 1
bitsize        = 32
control        = spinboxf
default        = 165
minimum        = 10
maximum        = 250
step           = 05
decimals       = 1
 
[ANTI RECOIL SETTINGS:]
color          = #008000
collapsible    = 2
shortdesc      = <font color="brown">ENABLE:<font color="green"> Anti Recoil?
byteoffset     = 10
bitsize        = 1
bitoffset      = 7
control        = checkbox
default        = 1
item           = Anti Recoil ON
 
[Min Anti Recoil Percent]
group          = true
shortdesc      = <font color="brown">Minimum Percentage:<font color="green"> Anti Recoil to apply during aim stick movement.
byteoffset     = 11
bitsize        = 32
control        = spinboxf
default        = 200
minimum        = 0
maximum        = 1000
step           = 10
decimals       = 1
 
[Stick Noise Remover]
group          = true
shortdesc      = <font color="brown">STICK NOISE:<font color="green"> Set to the resting dead zone values for your right stick.
byteoffset     = 15
bitsize        = 32
control        = spinboxf
default        = 800
minimum        = 0
maximum        = 10000
step           = 50
decimals       = 2
 
[Anti Recoil Delay]
group          = true
shortdesc      = <font color="brown">Anti Recoil Delay:<font color="green"> (In MS) after fire button is pressed.
byteoffset     = 19
bitsize        = 16
control        = slider
default        = 0
minimum        = 0
maximum        = 1000
step           = 5
 
[Standing Anti Recoil Settings]
group          = true
shortdesc      = <font color="brown">Anti Recoil:<font color="green"> vertical pull force compensation.
byteoffset     = 21
bitsize        = 32
control        = spinboxf
default        = 1800
minimum        = -10000
maximum        = 10000
step           = 10
decimals       = 2
 
[Standing Anti Recoil H Settings]
group          = true
shortdesc      = <font color="brown">Anti Recoil:<font color="green"> horizontal pull force compensation.
byteoffset     = 25
bitsize        = 32
control        = spinboxf
default        = 00000
minimum        = -10000
maximum        = 10000
step           = 10
decimals       = 2
 
[Anti Recoil Timed]
group          = true
shortdesc      = <font color="brown">Anti Recoil Timed:<font color="green"> (In MS) length of top setting compensation then applying second settings.
byteoffset     = 29
bitsize        = 16
control        = slider
default        = 500
minimum        = 0
maximum        = 2500
step           = 5
 
[Anti Recoil Settings]
group          = true
shortdesc      = <font color="brown">Anti Recoil:<font color="green"> vertical pull force compensation.
byteoffset     = 31
bitsize        = 32
control        = spinboxf
default        = 1800
minimum        = -10000
maximum        = 10000
step           = 10
decimals       = 2
 
[Anti Recoil H Settings]
group          = true
shortdesc      = <font color="brown">Anti Recoil:<font color="green"> horizontal pull force compensation.
byteoffset     = 35
bitsize        = 32
control        = spinboxf
default        = 00000
minimum        = -10000
maximum        = 10000
step           = 10
decimals       = 2
 
[AIM ASSIST SETTINGS:]
color       = #008000
collapsible = 2
 
[AIM ASSIST]
group       = true
shortdesc   = <font color="green">Works when ads is applied or fired.</font>
byteoffset  = 39
bitsize     = 1
bitoffset   = 7
control     = checkbox
default     = 1
item        =  Enable Aim assist
 
[TURBO MELEE SETTINGS:]
color       = #008000
collapsible = 2
 
[TURBO MELEE MODz]
group       = true
shortdesc   = <font color="green">Options for Turbo Melee.</font>
byteoffset  = 54
bitsize     = 8
control     = radiobox
default     = 2
item        = Disable
item        = Hold for normal press or double tap for turbo melee.
item        = Hold for turbo melee or double tap for normal press.
 
 
[AIM ABUSE SETTINGS:]
color       = #008000
collapsible = 2
 
[Aim_Abuse Settings]
group          = true
shortdesc      = <font color="green">Enable Aim Abuse?</font>
byteoffset     = 56
bitsize        = 1
bitoffset      = 7
control        = checkbox
default        = 0
item           = Aim Abuse
 
[Auto Aim Hold Time]
group          = true
shortdesc      = <font color="brown">Auto Aim Hold Time:</font> <font color="green">Configure the time period, in milli-seconds, of which the ADS(Scope) button should be pressed when the aim-assist abuse is activated.</font>
byteoffset     = 57
bitsize        = 16
control        = spinbox
default        = 150
minimum        = 20
maximum        = 5000
step           = 50
 
[Auto Aim Release Time]
group          = true
shortdesc      = <font color="brown">Auto Aim Release Time:</font> <font color="green">Configure the time period, in milli-seconds, of which the ADS(Scope) button should be released when the aim-assist abuse is activated.</font>
byteoffset     = 59
bitsize        = 16
control        = spinbox
default        = 50
minimum        = 10
maximum        = 5000
step           = 5
 
[Auto Aim Fire Pre Pause Time]
group          = true
shortdesc      = <font color="brown">Auto Aim Fire Pre Pause Time:</font> <font color="green">Configure the time period, in milli-seconds, to pause rapid fire for given time before ads release.</font>
byteoffset     = 61
bitsize        = 16
control        = spinbox
default        = 5
minimum        = 0
maximum        = 5000
step           = 5
 
[Auto Aim Fire Post Pause Time]
group          = true
shortdesc      = <font color="brown">Auto Aim Fire Post Pause Time:</font> <font color="green">Configure the time period, in milli-seconds, to pause rapid fire for given time after ads release.</font>
byteoffset     = 63
bitsize        = 16
control        = spinbox
default        = 50
minimum        = 0
maximum        = 5000
step           = 5
 
[AUTO SPRINT SETTINGS:]
color       = #008000
collapsible = 2
 
[Auto Sprint]
group          = true
shortdesc   = <font color="green">Easy walk/sprint: double tap forward for sprint to be on red led. once on just single press...ads trigger, reload button and crouch button shuts off sprint blue led. fire trigger turns sprint on incase you have to evade battle.</font>
byteoffset     = 67
bitsize        = 1
bitoffset      = 7
control        = checkbox
default        = 1
item           =  Enable Easy Sprint
 
[STRAFE SETTINGS:]
color       = #008000
collapsible = 2
 
[Strafe MODz]
group       = true
shortdesc   = <font color="green">Strafe option.</font>
byteoffset  = 115
bitsize     = 8
control     = radiobox
default     = 0
item        = Disabled
item        = Enabled Strafe (Adjustable)
item        = Enabled Strafe(Hip only)(Adjustable)
 
[Strafe Adjustable Setting]
group       = true
shortdesc   = <br><b><font color="green">Strafe Adjustable Setting:</font></b>
byteoffset  = 116
bitsize     = 32
control     = spinbox
default     = 200
minimum     = 0
maximum     = 2000
step        = 1
 
[ADS STOP SETTINGS:]
color       = #008000
collapsible = 2
 
[ADS Stop]
group       = true
shortdesc   = <font color="green">Stalls sprint when appling ADS.</font>
byteoffset  = 120
bitsize     = 1
bitoffset   = 7
control     = checkbox
default     = 1
item        =  Enable Auto Stop ADS
 
</cfgdesc>
***************************************************************************** */

 
#include <display.gph>
#define wait(a)  wait((int)a);
#define float  fix32
 
uint8 rapid_fire;
fix32 sps;
fix32 hold_time, rest_time;
uint8 bUseAntiRecoil;
float ARecoil_H;
float ARecoil_V;
uint16 ARecoilDelay;
float ARecoil_H2;
float ARecoil_V2;
uint16 ARecoilTimed;
float MinARecoilPercent;
float StickNoise;
//Aim Abuse
bool bUseAimAbuse = FALSE;
int AutoAimHoldTime;
int AutoAimReleaseTime;
int AutoAimFirePrePauseTime;
int AutoAimFirePostPauseTime;
bool bAutoAimPauseFire = FALSE;
bool sprint_toggle;
bool AimAssist;
//Turbo Melee
uint8 bUseTurboMelee = 2;
bool turboMelee = TRUE;
bool  fast_melee;
bool ADSstop;
uint8   STRAFE_MODz;
uint32  STRAFE_SHUFFLE;
init
{
    pmem_load();
    rapid_fire = pmem_read(0);
    pmem_read(1, &sps);
    printf("<center><font style='color:blue;font-size:14px;',><br>RAPID FIRE: %u", rapid_fire);
    update_rapidfire();
 
    bUseAntiRecoil = (pmem_read(10) >> 7) & 0b1;
    printf("<center><font style='color:red;font-size:14px;',><br>ANTI RECOIL: %d", bUseAntiRecoil);
    pmem_read(11, &MinARecoilPercent);
    pmem_read(15, &StickNoise);
    pmem_read(19, &ARecoilDelay);
    pmem_read(21, &ARecoil_V);
    pmem_read(25, &ARecoil_H);
    pmem_read(29, &ARecoilTimed);
    pmem_read(31, &ARecoil_V2);
    pmem_read(35, &ARecoil_H2);
    update_anti_recoil();
    AimAssist = (pmem_read(39) >> 7) & 0b1;
    bUseTurboMelee = pmem_read(54);
    bUseAimAbuse = (pmem_read(56) >> 7) & 0b1;
    pmem_read(57, &AutoAimHoldTime);
    pmem_read(59, &AutoAimReleaseTime);
    pmem_read(61, &AutoAimFirePrePauseTime);
    pmem_read(63, &AutoAimFirePostPauseTime);
    sprint_toggle = (pmem_read(67) >> 7) & 0b1;
    STRAFE_MODz = pmem_read(115);
    pmem_read(116, &STRAFE_SHUFFLE);
    ADSstop = (pmem_read(120) >> 7) & 0b1;
}
 
main {
 
    // - RAPIDFIRE - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    if(get_actual(BUTTON_5)) {
    if (bAutoAimPauseFire == FALSE)
    {
        set_val(BUTTON_5, 100.0);
    if(rapid_fire == 1)
        combo_run(RapidFire);
    }
    }else combo_stop(RapidFire);
 
    if (bUseAntiRecoil)
    {
 
        if (abs(get_actual(STICK_1_X)) < StickNoise) set_val(STICK_1_X, 0.0);
        if (abs(get_actual(STICK_1_Y)) < StickNoise) set_val(STICK_1_Y, 0.0);
        if (abs(get_actual(STICK_2_X)) < StickNoise) set_val(STICK_2_X, 0.0);
        if (abs(get_actual(STICK_2_Y)) < StickNoise) set_val(STICK_2_Y, 0.0);
 
        if (event_active(BUTTON_5))
        {
            combo_run(recoil_compensation);
        }
        if(event_release(BUTTON_5))
        {
            combo_stop(recoil_compensation);
        }
    }
    if(AimAssist == 1)
    {
    if(get_val(BUTTON_8)&& !get_actual(BUTTON_5)) {
        combo_run(ARA);
    } else
    if(get_val(BUTTON_5)) {
        combo_run(ARAF);
    }
    if(is_active(STICK_1_X)){combo_stop(ARA);combo_stop(ARAF);}
    if(is_active(STICK_1_Y)){combo_stop(ARA);combo_stop(ARAF);}
    }
    if(turboMelee == 1)
    {
    if(bUseTurboMelee == 1)
        {
        if(fast_melee)
              {
            if(get_val(BUTTON_6))
                    {
                combo_run(TurboMelee);
 
            }else
                        {
                fast_melee = 0;
            }
            }else if(event_active(BUTTON_6) && time_release(BUTTON_6) < 140)
                        {
                fast_melee = 1;
            }
        }
    if(bUseTurboMelee == 2)
        {
          if(get_actual(BUTTON_6))
              {
            combo_run(TurboMelee);
 
        }else if(event_release(BUTTON_6))
                {
            combo_stop(TurboMelee);
        }
        if(event_active(BUTTON_6) && time_release(BUTTON_6) < 140)
                {
            fast_melee = !fast_melee;
 
        }else if(event_release(BUTTON_6) && time_active(BUTTON_6) <= 140)
                {
            fast_melee = !fast_melee;
        }
        if(fast_melee)
        {
            if(get_actual(BUTTON_6))
            {
                combo_stop(TurboMelee);
 
                set_val(BUTTON_6, 100.0);
 
            }else if(event_release(BUTTON_6))
                        {
                fast_melee = FALSE;
            }
        }
    }
    }
    if (bUseAimAbuse)
    {
        if (get_actual(BUTTON_8) && !get_actual(BUTTON_5))
        {
            combo_run(AimAbuse);
        }
        else
        {
            bAutoAimPauseFire = FALSE;
            combo_stop(AimAbuse);
        }
    }
    if(sprint_toggle)
    {
    // - SPRINT MOD - - - - - - - - - - - - - - - - - - - - - - - - - - -
    #define SPRINT_OFF     0
    #define SPRINT_ON      1
    static uint8 sprint;
    if(event_active(BUTTON_16)|| event_active(BUTTON_14)||
        event_active(BUTTON_5)|| event_active(BUTTON_9)||
        event_active(STICK_2_Y))
    {
        sprint = SPRINT_ON;
        goto SPRINT_LIGHTBAR;
    }
    else if(event_active(BUTTON_8)|| event_active(BUTTON_17))
    {
        sprint = SPRINT_OFF;
        goto SPRINT_LIGHTBAR;
 
        if(sprint || !sprint)
        {
            switch(sprint)
            {
                case SPRINT_OFF: sprint = SPRINT_OFF;break;
                case SPRINT_ON:  sprint = SPRINT_ON; break;
            }
    } else sprint = SPRINT_OFF;
        SPRINT_LIGHTBAR:
        switch(sprint)
        {
            case SPRINT_OFF: display_overlay(_W_, 500); break;
            case SPRINT_ON:  display_overlay(_R_, 500); break;
        }
    }
    if(sprint == SPRINT_ON && get_val(STICK_2_Y) < -98.0){
        combo_run(easy_sprint);
    }
    if(sprint == SPRINT_OFF){
        set_val(STICK_2_X, get_val(STICK_2_X) / 1.03);
        set_val(STICK_2_Y, get_val(STICK_2_Y) / 1.03);
    }
    }
    if(STRAFE_MODz == 1) {
    if(get_val(BUTTON_5)) {
        combo_run(strafe);
    }else if(event_release(BUTTON_5)) {
        combo_stop(strafe);
    }
    if(is_active(STICK_2_X) || is_active(STICK_2_Y)) {
        combo_stop(strafe);
    }
    }
    if(STRAFE_MODz == 2) {
    if((!get_val(BUTTON_8) && get_val(BUTTON_5)) || (event_release(BUTTON_8) && get_val(BUTTON_5))) {
        combo_run(strafe);
    }else if(event_release(BUTTON_5)) {
        combo_stop(strafe);
    }
    if(is_active(STICK_2_X) || is_active(STICK_2_Y)) {
        combo_stop(strafe);
    }
    }
    if(ADSstop == 1)
    {
    if(get_val(BUTTON_8)) {
        if(event_active(BUTTON_8)) {
            combo_run(ADSShot);
        }
    }
    }
}
 
combo easy_sprint
{
    set_val(BUTTON_9, 0.0);
    wait(100);
    set_val(BUTTON_9, 100.0);
    wait(100);
    set_val(BUTTON_9, 100.0);
}
 
combo RapidFire
{
    set_val(BUTTON_5, hold_time ? 100.0 : 0.0);
    wait(hold_time);
    set_val(BUTTON_5, rest_time ? 0.0 : 100.0);
    wait(rest_time);
    set_val(BUTTON_5, rest_time ? 0.0 : 100.0);
}
 
combo recoil_compensation
{
    wait(ARecoilDelay);
    AntiRecoil(STICK_1_X, ARecoil_H);
    AntiRecoil(STICK_1_Y, ARecoil_V);
    wait(ARecoilTimed);
    AntiRecoil(STICK_1_X, ARecoil_H2);
    AntiRecoil(STICK_1_Y, ARecoil_V2);
    wait(2000);
}
 
combo AimAbuse
{
    bAutoAimPauseFire = FALSE;
    set_val(BUTTON_8, 100);
    wait(AutoAimHoldTime - AutoAimFirePrePauseTime);
    bAutoAimPauseFire = TRUE;
    wait(AutoAimFirePrePauseTime);
    set_val(BUTTON_8, 0.0);
    wait(AutoAimReleaseTime);
    set_val(BUTTON_8, 100);
    wait(AutoAimFirePostPauseTime);   
}
 
combo ARA
{
    set_val(STICK_1_Y, irand(40, 16));
    set_val(STICK_1_X, irand(40, 16));
    set_val(STICK_1_X, irand(-40, -16));
    wait(40);
    set_val(STICK_1_Y, irand(-40, -16));
    set_val(STICK_1_X, irand(-40, -16));
    set_val(STICK_1_X, irand(40, 16));
    wait(40);
}
combo ARAF
{
    set_val(STICK_1_Y, irand(50, 16));
    set_val(STICK_1_X, irand(50, 16));
    set_val(STICK_1_X, irand(-50, -16));
    wait(40);
    set_val(STICK_1_Y, irand(-50, -16));
    set_val(STICK_1_X, irand(-50, -16));
    set_val(STICK_1_X, irand(50, 16));
    wait(40);
}
 
combo TurboMelee
{
    set_val(BUTTON_6, 100.0);
    wait(40);
    set_val(BUTTON_6, 0.0);
    wait(40);
    set_val(BUTTON_6, 0.0);
}
 
combo strafe
{
    set_val(STICK_2_X, -100);
    wait(STRAFE_SHUFFLE/2);
    set_val(STICK_2_X, 100);
    wait(STRAFE_SHUFFLE);
    set_val(STICK_2_X, 100);
    set_val(STICK_2_X, -100);
    wait(STRAFE_SHUFFLE);
    set_val(STICK_2_X, 100);
    wait(STRAFE_SHUFFLE);
    set_val(STICK_2_X, 100);
    set_val(STICK_2_X, -100);
    wait(STRAFE_SHUFFLE/2);
    set_val(STICK_2_X, 100);
}
 
combo ADSShot
{
    combo_stop(easy_sprint);
    set_val(STICK_2_Y,0.0);
    wait(320);
    combo_run(easy_sprint);
}
 
void update_rapidfire() {
    printf("<center><font style='color:blue;font-size:14px;',><br>SHOTS PER SECOND: %.04f", sps);
 
    hold_time = 500.0 / sps;
    rest_time = hold_time - 1.0;
    if(rest_time < 0.0) rest_time = 0.0;   
 
    return;
}
 
void update_anti_recoil(){
    printf("<center><font style='color:red;font-size:14px;',><br>VERTICAL RECOIL COMPENSATION: %.04f", ARecoil_V);
    printf("<center><font style='color:brown;font-size:14px;',><br>HORIZONTAL RECOIL COMPENSATION: %.04f", ARecoil_H);
    printf("<center><font style='color:red;font-size:14px;',><br>VERTICAL RECOIL COMPENSATION 2: %.04f", ARecoil_V2);
    printf("<center><font style='color:brown;font-size:14px;',><br>HORIZONTAL RECOIL COMPENSATION 2: %.04f", ARecoil_H2);
 
    return;
}
 
int irand(int vmin, int vmax) {
    return(((int)(rand() * (fix32)(vmax + 1 - vmin))) + vmin);
}
 
void AntiRecoil(uint8 AxisToApply, float ARecoilToApply)
{
    float CurrentX = get_val(STICK_1_X);
    float CurrentY = get_val(STICK_1_Y);
    float MinARecoilFactor = MinARecoilPercent / 100.0;
    float MinARecoilToApply = MinARecoilFactor * ARecoilToApply;
    //This sets the ARecoil to be dependent on both X and Y axis movement. With more emphasis on Y
    float MovementARecoilToApply = (1.0 - MinARecoilFactor) * ((ARecoilToApply * (100.0 - sqrt(CurrentX*CurrentX + CurrentY*CurrentY))) / (100.0 + abs(CurrentX) + (CurrentY*CurrentY*0.5)));
    set_val(AxisToApply,clamp(MinARecoilToApply + MovementARecoilToApply + get_val(AxisToApply),-100.00,100.00 - MinARecoilToApply));
}
 
 
 
 
User avatar
SweatyPapi
Sergeant Major
Sergeant Major
 
Posts: 91
Joined: Fri Feb 08, 2019 12:52 am

Re: AutoRun and Auto Slide Activation Problem

Postby bonefisher » Thu Apr 25, 2019 12:36 am

Code: Select all
 
#pragma METAINFO("BO4 Special Edtion", 1, 0, "bonefisher")
 
/* *****************************************************************************
<cfgdesc>
[BO4 Special Edtion]
color          = #008000
shortdesc      = <font color="green">Runtime operations Use Interactive Configurations for changes to settings.
control        = info
 
[RAPID FIRE SETTINGS:]
color          = #008000
collapsible    = 2
shortdesc      = <font color="brown">ENABLE:<font color="green">Rapid Fire?</font>
byteoffset     = 0
bitsize        = 8
control        = radiobox
default        = 0
item           = Rapidfire OFF
item           = Rapidfire ON
 
[RAPID FIRE OPTIONS:]
group          = true
shortdesc      = <font color="brown">SHOTS PER SECOND:</font> <font color="green">   Set to desired sps setting 1~25 sps.</font>
byteoffset     = 1
bitsize        = 32
control        = spinboxf
default        = 165
minimum        = 10
maximum        = 250
step           = 05
decimals       = 1
 
[ANTI RECOIL SETTINGS:]
color          = #008000
collapsible    = 2
shortdesc      = <font color="brown">ENABLE:<font color="green"> Anti Recoil?
byteoffset     = 10
bitsize        = 1
bitoffset      = 7
control        = checkbox
default        = 1
item           = Anti Recoil ON
 
[Min Anti Recoil Percent]
group          = true
shortdesc      = <font color="brown">Minimum Percentage:<font color="green"> Anti Recoil to apply during aim stick movement.
byteoffset     = 11
bitsize        = 32
control        = spinboxf
default        = 200
minimum        = 0
maximum        = 1000
step           = 10
decimals       = 1
 
[Stick Noise Remover]
group          = true
shortdesc      = <font color="brown">STICK NOISE:<font color="green"> Set to the resting dead zone values for your right stick.
byteoffset     = 15
bitsize        = 32
control        = spinboxf
default        = 800
minimum        = 0
maximum        = 10000
step           = 50
decimals       = 2
 
[Anti Recoil Delay]
group          = true
shortdesc      = <font color="brown">Anti Recoil Delay:<font color="green"> (In MS) after fire button is pressed.
byteoffset     = 19
bitsize        = 16
control        = slider
default        = 0
minimum        = 0
maximum        = 1000
step           = 5
 
[Standing Anti Recoil Settings]
group          = true
shortdesc      = <font color="brown">Anti Recoil:<font color="green"> vertical pull force compensation.
byteoffset     = 21
bitsize        = 32
control        = spinboxf
default        = 1800
minimum        = -10000
maximum        = 10000
step           = 10
decimals       = 2
 
[Standing Anti Recoil H Settings]
group          = true
shortdesc      = <font color="brown">Anti Recoil:<font color="green"> horizontal pull force compensation.
byteoffset     = 25
bitsize        = 32
control        = spinboxf
default        = 00000
minimum        = -10000
maximum        = 10000
step           = 10
decimals       = 2
 
[Anti Recoil Timed]
group          = true
shortdesc      = <font color="brown">Anti Recoil Timed:<font color="green"> (In MS) length of top setting compensation then applying second settings.
byteoffset     = 29
bitsize        = 16
control        = slider
default        = 500
minimum        = 0
maximum        = 2500
step           = 5
 
[Anti Recoil Settings]
group          = true
shortdesc      = <font color="brown">Anti Recoil:<font color="green"> vertical pull force compensation.
byteoffset     = 31
bitsize        = 32
control        = spinboxf
default        = 1800
minimum        = -10000
maximum        = 10000
step           = 10
decimals       = 2
 
[Anti Recoil H Settings]
group          = true
shortdesc      = <font color="brown">Anti Recoil:<font color="green"> horizontal pull force compensation.
byteoffset     = 35
bitsize        = 32
control        = spinboxf
default        = 00000
minimum        = -10000
maximum        = 10000
step           = 10
decimals       = 2
 
[AIM ASSIST SETTINGS:]
color       = #008000
collapsible = 2
 
[AIM ASSIST]
group       = true
shortdesc   = <font color="green">Works when ads is applied or fired.</font>
byteoffset  = 39
bitsize     = 1
bitoffset   = 7
control     = checkbox
default     = 1
item        =  Enable Aim assist
 
[TURBO MELEE SETTINGS:]
color       = #008000
collapsible = 2
 
[TURBO MELEE MODz]
group       = true
shortdesc   = <font color="green">Options for Turbo Melee.</font>
byteoffset  = 54
bitsize     = 8
control     = radiobox
default     = 2
item        = Disable
item        = Hold for normal press or double tap for turbo melee.
item        = Hold for turbo melee or double tap for normal press.
 
 
[AIM ABUSE SETTINGS:]
color       = #008000
collapsible = 2
 
[Aim_Abuse Settings]
group          = true
shortdesc      = <font color="green">Enable Aim Abuse?</font>
byteoffset     = 56
bitsize        = 1
bitoffset      = 7
control        = checkbox
default        = 0
item           = Aim Abuse
 
[Auto Aim Hold Time]
group          = true
shortdesc      = <font color="brown">Auto Aim Hold Time:</font> <font color="green">Configure the time period, in milli-seconds, of which the ADS(Scope) button should be pressed when the aim-assist abuse is activated.</font>
byteoffset     = 57
bitsize        = 16
control        = spinbox
default        = 150
minimum        = 20
maximum        = 5000
step           = 50
 
[Auto Aim Release Time]
group          = true
shortdesc      = <font color="brown">Auto Aim Release Time:</font> <font color="green">Configure the time period, in milli-seconds, of which the ADS(Scope) button should be released when the aim-assist abuse is activated.</font>
byteoffset     = 59
bitsize        = 16
control        = spinbox
default        = 50
minimum        = 10
maximum        = 5000
step           = 5
 
[Auto Aim Fire Pre Pause Time]
group          = true
shortdesc      = <font color="brown">Auto Aim Fire Pre Pause Time:</font> <font color="green">Configure the time period, in milli-seconds, to pause rapid fire for given time before ads release.</font>
byteoffset     = 61
bitsize        = 16
control        = spinbox
default        = 5
minimum        = 0
maximum        = 5000
step           = 5
 
[Auto Aim Fire Post Pause Time]
group          = true
shortdesc      = <font color="brown">Auto Aim Fire Post Pause Time:</font> <font color="green">Configure the time period, in milli-seconds, to pause rapid fire for given time after ads release.</font>
byteoffset     = 63
bitsize        = 16
control        = spinbox
default        = 50
minimum        = 0
maximum        = 5000
step           = 5
 
[AUTO SPRINT SETTINGS:]
color       = #008000
collapsible = 2
 
[Auto Sprint]
group          = true
shortdesc   = <font color="green">Easy sprint: hold left stick forward too sprint. Adjust reload delay for weapon so you don't sprint cancel reload. Adjust reload cancel the same as delay just incase anytime of reloading and enemy is near engage stick forward fast to get out of reloading.</font>
byteoffset     = 67
bitsize        = 1
bitoffset      = 7
control        = checkbox
default        = 1
item           =  Enable Easy Sprint
 
[Reload Delay]
group          = true
shortdesc      = <font color="brown">Reload Delay:<font color="green"> (In MS) length that it takes when you first press reload to when magazine clicks in weapon.
byteoffset     = 68
bitsize        = 16
control        = slider
default        = 2000
minimum        = 0
maximum        = 3500
step           = 5
 
[Reload Cancel]
group          = true
shortdesc      = <font color="brown">Reload Cancel:<font color="green"> (In MS) length of time you sprint cancel reloading in case needing break out to fire on enemy.
byteoffset     = 70
bitsize        = 16
control        = slider
default        = 2000
minimum        = 0
maximum        = 3500
step           = 5
 
[STRAFE SETTINGS:]
color       = #008000
collapsible = 2
 
[Strafe MODz]
group       = true
shortdesc   = <font color="green">Strafe option.</font>
byteoffset  = 115
bitsize     = 8
control     = radiobox
default     = 0
item        = Disabled
item        = Enabled Strafe (Adjustable)
item        = Enabled Strafe(Hip only)(Adjustable)
 
[Strafe Adjustable Setting]
group       = true
shortdesc   = <br><b><font color="green">Strafe Adjustable Setting:</font></b>
byteoffset  = 116
bitsize     = 32
control     = spinbox
default     = 200
minimum     = 0
maximum     = 2000
step        = 1
 
[ADS STOP SETTINGS:]
color       = #008000
collapsible = 2
 
[ADS Stop]
group       = true
shortdesc   = <font color="green">Stalls sprint when appling ADS.</font>
byteoffset  = 120
bitsize     = 1
bitoffset   = 7
control     = checkbox
default     = 1
item        =  Enable Auto Stop ADS
 
</cfgdesc>
***************************************************************************** */

 
#include <display.gph>
#define wait(a)  wait((int)a);
#define float  fix32
 
uint8 rapid_fire;
fix32 sps;
fix32 hold_time, rest_time;
uint8 bUseAntiRecoil;
float ARecoil_H;
float ARecoil_V;
uint16 ARecoilDelay;
float ARecoil_H2;
float ARecoil_V2;
uint16 ARecoilTimed;
float MinARecoilPercent;
float StickNoise;
//Aim Abuse
bool bUseAimAbuse = FALSE;
int AutoAimHoldTime;
int AutoAimReleaseTime;
int AutoAimFirePrePauseTime;
int AutoAimFirePostPauseTime;
bool bAutoAimPauseFire = FALSE;
bool sprint_toggle;
bool AimAssist;
//Turbo Melee
uint8 bUseTurboMelee = 2;
bool turboMelee = TRUE;
bool  fast_melee;
bool ADSstop;
uint8   STRAFE_MODz;
uint32  STRAFE_SHUFFLE;
uint16 reload_cancel;
uint16 reload_delay;
init
{
    pmem_load();
    rapid_fire = pmem_read(0);
    pmem_read(1, &sps);
    printf("<center><font style='color:blue;font-size:14px;',><br>RAPID FIRE: %u", rapid_fire);
    update_rapidfire();
 
    bUseAntiRecoil = (pmem_read(10) >> 7) & 0b1;
    printf("<center><font style='color:red;font-size:14px;',><br>ANTI RECOIL: %d", bUseAntiRecoil);
    pmem_read(11, &MinARecoilPercent);
    pmem_read(15, &StickNoise);
    pmem_read(19, &ARecoilDelay);
    pmem_read(21, &ARecoil_V);
    pmem_read(25, &ARecoil_H);
    pmem_read(29, &ARecoilTimed);
    pmem_read(31, &ARecoil_V2);
    pmem_read(35, &ARecoil_H2);
    update_anti_recoil();
    AimAssist = (pmem_read(39) >> 7) & 0b1;
    bUseTurboMelee = pmem_read(54);
    bUseAimAbuse = (pmem_read(56) >> 7) & 0b1;
    pmem_read(57, &AutoAimHoldTime);
    pmem_read(59, &AutoAimReleaseTime);
    pmem_read(61, &AutoAimFirePrePauseTime);
    pmem_read(63, &AutoAimFirePostPauseTime);
    sprint_toggle = (pmem_read(67) >> 7) & 0b1;
    pmem_read(68, &reload_delay);
    pmem_read(70, &reload_cancel);
    STRAFE_MODz = pmem_read(115);
    pmem_read(116, &STRAFE_SHUFFLE);
    ADSstop = (pmem_read(120) >> 7) & 0b1;
}
 
main {
 
    // - RAPIDFIRE - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    if(get_actual(BUTTON_5)) {
    if (bAutoAimPauseFire == FALSE)
    {
        set_val(BUTTON_5, 100.0);
    if(rapid_fire == 1)
        combo_run(RapidFire);
    }
    }else combo_stop(RapidFire);
 
    if (bUseAntiRecoil)
    {
 
        if (abs(get_actual(STICK_1_X)) < StickNoise) set_val(STICK_1_X, 0.0);
        if (abs(get_actual(STICK_1_Y)) < StickNoise) set_val(STICK_1_Y, 0.0);
        if (abs(get_actual(STICK_2_X)) < StickNoise) set_val(STICK_2_X, 0.0);
        if (abs(get_actual(STICK_2_Y)) < StickNoise) set_val(STICK_2_Y, 0.0);
 
        if (event_active(BUTTON_5))
        {
            combo_run(recoil_compensation);
        }
        if(event_release(BUTTON_5))
        {
            combo_stop(recoil_compensation);
        }
    }
    if(AimAssist == 1)
    {
    if(get_val(BUTTON_8)&& !get_actual(BUTTON_5)) {
        combo_run(ARA);
    } else
    if(get_val(BUTTON_5)) {
        combo_run(ARAF);
    }
    if(is_active(STICK_1_X)){combo_stop(ARA);combo_stop(ARAF);}
    if(is_active(STICK_1_Y)){combo_stop(ARA);combo_stop(ARAF);}
    }
    if(turboMelee == 1)
    {
    if(bUseTurboMelee == 1)
        {
        if(fast_melee)
              {
            if(get_val(BUTTON_6))
                    {
                combo_run(TurboMelee);
 
            }else
                        {
                fast_melee = 0;
            }
            }else if(event_active(BUTTON_6) && time_release(BUTTON_6) < 140)
                        {
                fast_melee = 1;
            }
        }
    if(bUseTurboMelee == 2)
        {
          if(get_actual(BUTTON_6))
              {
            combo_run(TurboMelee);
 
        }else if(event_release(BUTTON_6))
                {
            combo_stop(TurboMelee);
        }
        if(event_active(BUTTON_6) && time_release(BUTTON_6) < 140)
                {
            fast_melee = !fast_melee;
 
        }else if(event_release(BUTTON_6) && time_active(BUTTON_6) <= 140)
                {
            fast_melee = !fast_melee;
        }
        if(fast_melee)
        {
            if(get_actual(BUTTON_6))
            {
                combo_stop(TurboMelee);
 
                set_val(BUTTON_6, 100.0);
 
            }else if(event_release(BUTTON_6))
                        {
                fast_melee = FALSE;
            }
        }
    }
    }
    if (bUseAimAbuse)
    {
        if (get_actual(BUTTON_8) && !get_actual(BUTTON_5))
        {
            combo_run(AimAbuse);
        }
        else
        {
            bAutoAimPauseFire = FALSE;
            combo_stop(AimAbuse);
        }
    }
    if(sprint_toggle)
    {
    if(is_active(STICK_2_X) && event_active(BUTTON_15))
    {
        combo_run(auto_slide);
 
    }
    // - SPRINT MOD - - - - - - - - - - - - - - - - - - - - - - - - - - -
    if(get_val(STICK_2_Y) < -90.0) {
        combo_run(EasySprint);
    }
    if(get_actual(BUTTON_5) || get_actual(BUTTON_8) ||
       get_actual(BUTTON_4) || get_actual(BUTTON_7)) {
        combo_stop(EasySprint);
    }
    if(is_release(BUTTON_17) && time_active(BUTTON_17) <= reload_delay) {
        combo_stop(EasySprint);
    }
    if(is_active(STICK_2_Y) && time_active(STICK_2_Y) < reload_cancel)reload_delay = 0;
    }
    if(STRAFE_MODz == 1) {
    if(get_val(BUTTON_5)) {
        combo_run(strafe);
    }else if(event_release(BUTTON_5)) {
        combo_stop(strafe);
    }
    if(is_active(STICK_2_X) || is_active(STICK_2_Y)) {
        combo_stop(strafe);
    }
    if(is_active(STICK_2_X) && event_active(BUTTON_15))
    {
        combo_run(auto_slide);
 
    }
    }
    if(STRAFE_MODz == 2) {
    if((!get_val(BUTTON_8) && get_val(BUTTON_5)) || (event_release(BUTTON_8) && get_val(BUTTON_5))) {
        combo_run(strafe);
    }else if(event_release(BUTTON_5)) {
        combo_stop(strafe);
    }
    if(is_active(STICK_2_X) || is_active(STICK_2_Y)) {
        combo_stop(strafe);
    }
    }
    if(ADSstop == 1)
    {
    if(get_val(BUTTON_8)) {
        if(event_active(BUTTON_8)) {
            combo_run(ADSShot);
        }
    }else combo_stop(ADSShot);
    }
}
 
combo RapidFire
{
    set_val(BUTTON_5, hold_time ? 100.0 : 0.0);
    wait(hold_time);
    set_val(BUTTON_5, rest_time ? 0.0 : 100.0);
    wait(rest_time);
    set_val(BUTTON_5, rest_time ? 0.0 : 100.0);
}
 
combo recoil_compensation
{
    wait(ARecoilDelay);
    AntiRecoil(STICK_1_X, ARecoil_H);
    AntiRecoil(STICK_1_Y, ARecoil_V);
    wait(ARecoilTimed);
    AntiRecoil(STICK_1_X, ARecoil_H2);
    AntiRecoil(STICK_1_Y, ARecoil_V2);
    wait(2000);
}
 
combo AimAbuse
{
    bAutoAimPauseFire = FALSE;
    set_val(BUTTON_8, 100);
    wait(AutoAimHoldTime - AutoAimFirePrePauseTime);
    bAutoAimPauseFire = TRUE;
    wait(AutoAimFirePrePauseTime);
    set_val(BUTTON_8, 0.0);
    wait(AutoAimReleaseTime);
    set_val(BUTTON_8, 100);
    wait(AutoAimFirePostPauseTime);   
}
 
combo ARA
{
    set_val(STICK_1_Y, irand(24, 16));
    set_val(STICK_1_X, irand(24, 16));
    set_val(STICK_1_X, irand(-24, -16));
    wait(40);
    set_val(STICK_1_Y, irand(-24, -16));
    set_val(STICK_1_X, irand(-24, -16));
    set_val(STICK_1_X, irand(24, 16));
    wait(40);
}
combo ARAF
{
    set_val(STICK_1_Y, irand(40, 16));
    set_val(STICK_1_X, irand(40, 16));
    set_val(STICK_1_X, irand(-40, -16));
    wait(40);
    set_val(STICK_1_Y, irand(-40, -16));
    set_val(STICK_1_X, irand(-40, -16));
    set_val(STICK_1_X, irand(40, 16));
    wait(40);
}
 
combo TurboMelee
{
    set_val(BUTTON_6, 100.0);
    wait(40);
    set_val(BUTTON_6, 0.0);
    wait(40);
    set_val(BUTTON_6, 0.0);
}
 
combo EasySprint
{
    set_val(BUTTON_9, 100.0);
    wait(40);
    set_val(BUTTON_9, 0.0);
    wait(40);
    set_val(BUTTON_9, 0.0);
    reload_delay = 2000;
}
 
combo auto_slide {
    set_val(BUTTON_9, 100.00);
    set_val(BUTTON_15, 0.00);
    set_val(STICK_2_X, 100.00);
    set_val(STICK_2_Y, -100.00);
    wait(20);
    set_val(BUTTON_9, 100.00);
    set_val(BUTTON_15, 100.00);
    set_val(STICK_2_Y, -100.00);
    wait(20);
    set_val(BUTTON_9, 0.00);
    set_val(BUTTON_15, 100.00);
    set_val(STICK_2_Y, -100.00);
    wait(40);
    set_val(BUTTON_9, 100.00);
    set_val(BUTTON_15, 100.00);
    set_val(STICK_2_Y, -100.00);
    wait(20);
    set_val(BUTTON_9, 0.00);
    set_val(BUTTON_15, 100.00);
    set_val(STICK_2_Y, -100.00);
    wait(60);
}
 
combo strafe
{
    set_val(STICK_2_X, -100);
    wait(STRAFE_SHUFFLE/2);
    set_val(STICK_2_X, 100);
    wait(STRAFE_SHUFFLE);
    set_val(STICK_2_X, 100);
    set_val(STICK_2_X, -100);
    wait(STRAFE_SHUFFLE);
    set_val(STICK_2_X, 100);
    wait(STRAFE_SHUFFLE);
    set_val(STICK_2_X, 100);
    set_val(STICK_2_X, -100);
    wait(STRAFE_SHUFFLE/2);
    set_val(STICK_2_X, 100);
}
 
combo ADSShot
{
    combo_stop(EasySprint);
    set_val(STICK_2_Y,0.0);
    wait(320);
    combo_run(EasySprint);
}
 
void update_rapidfire() {
    printf("<center><font style='color:blue;font-size:14px;',><br>SHOTS PER SECOND: %.04f", sps);
 
    hold_time = 500.0 / sps;
    rest_time = hold_time - 1.0;
    if(rest_time < 0.0) rest_time = 0.0;   
 
    return;
}
 
void update_anti_recoil(){
    printf("<center><font style='color:red;font-size:14px;',><br>VERTICAL RECOIL COMPENSATION: %.04f", ARecoil_V);
    printf("<center><font style='color:brown;font-size:14px;',><br>HORIZONTAL RECOIL COMPENSATION: %.04f", ARecoil_H);
    printf("<center><font style='color:red;font-size:14px;',><br>VERTICAL RECOIL COMPENSATION 2: %.04f", ARecoil_V2);
    printf("<center><font style='color:brown;font-size:14px;',><br>HORIZONTAL RECOIL COMPENSATION 2: %.04f", ARecoil_H2);
 
    return;
}
 
int irand(int vmin, int vmax) {
    return(((int)(rand() * (fix32)(vmax + 1 - vmin))) + vmin);
}
 
void AntiRecoil(uint8 AxisToApply, float ARecoilToApply)
{
    float CurrentX = get_val(STICK_1_X);
    float CurrentY = get_val(STICK_1_Y);
    float MinARecoilFactor = MinARecoilPercent / 100.0;
    float MinARecoilToApply = MinARecoilFactor * ARecoilToApply;
    //This sets the ARecoil to be dependent on both X and Y axis movement. With more emphasis on Y
    float MovementARecoilToApply = (1.0 - MinARecoilFactor) * ((ARecoilToApply * (100.0 - sqrt(CurrentX*CurrentX + CurrentY*CurrentY))) / (100.0 + abs(CurrentX) + (CurrentY*CurrentY*0.5)));
    set_val(AxisToApply,clamp(MinARecoilToApply + MovementARecoilToApply + get_val(AxisToApply),-100.00,100.00 - MinARecoilToApply));
}
 
 
 
 

try this out!
bonefisher
Lieutenant General
Lieutenant General
 
Posts: 5413
Joined: Thu Jan 29, 2015 10:49 am

Re: AutoRun and Auto Slide Activation Problem

Postby bonefisher » Thu Apr 25, 2019 12:37 am

For the auto slide to work either strafe left or right and tap crouch button....
bonefisher
Lieutenant General
Lieutenant General
 
Posts: 5413
Joined: Thu Jan 29, 2015 10:49 am

Re: AutoRun and Auto Slide Activation Problem

Postby bonefisher » Thu Apr 25, 2019 5:22 am

Code: Select all
 
#pragma METAINFO("BO4 Special Edtion", 1, 0, "bonefisher")
 
/* *****************************************************************************
<cfgdesc>
[BO4 Special Edtion]
color          = #008000
shortdesc      = <font color="green">Runtime operations Use Interactive Configurations for changes to settings.
control        = info
 
[RAPID FIRE SETTINGS:]
color          = #008000
collapsible    = 2
shortdesc      = <font color="brown">ENABLE:<font color="green">Rapid Fire?</font>
byteoffset     = 0
bitsize        = 8
control        = radiobox
default        = 0
item           = Rapidfire OFF
item           = Rapidfire ON
 
[RAPID FIRE OPTIONS:]
group          = true
shortdesc      = <font color="brown">SHOTS PER SECOND:</font> <font color="green">   Set to desired sps setting 1~25 sps.</font>
byteoffset     = 1
bitsize        = 32
control        = spinboxf
default        = 165
minimum        = 10
maximum        = 250
step           = 05
decimals       = 1
 
[ANTI RECOIL SETTINGS:]
color          = #008000
collapsible    = 2
shortdesc      = <font color="brown">ENABLE:<font color="green"> Anti Recoil?
byteoffset     = 10
bitsize        = 1
bitoffset      = 7
control        = checkbox
default        = 1
item           = Anti Recoil ON
 
[Min Anti Recoil Percent]
group          = true
shortdesc      = <font color="brown">Minimum Percentage:<font color="green"> Anti Recoil to apply during aim stick movement.
byteoffset     = 11
bitsize        = 32
control        = spinboxf
default        = 200
minimum        = 0
maximum        = 1000
step           = 10
decimals       = 1
 
[Stick Noise Remover]
group          = true
shortdesc      = <font color="brown">STICK NOISE:<font color="green"> Set to the resting dead zone values for your right stick.
byteoffset     = 15
bitsize        = 32
control        = spinboxf
default        = 800
minimum        = 0
maximum        = 10000
step           = 50
decimals       = 2
 
[Anti Recoil Delay]
group          = true
shortdesc      = <font color="brown">Anti Recoil Delay:<font color="green"> (In MS) after fire button is pressed.
byteoffset     = 19
bitsize        = 16
control        = slider
default        = 0
minimum        = 0
maximum        = 1000
step           = 5
 
[Standing Anti Recoil Settings]
group          = true
shortdesc      = <font color="brown">Anti Recoil:<font color="green"> vertical pull force compensation.
byteoffset     = 21
bitsize        = 32
control        = spinboxf
default        = 1800
minimum        = -10000
maximum        = 10000
step           = 10
decimals       = 2
 
[Standing Anti Recoil H Settings]
group          = true
shortdesc      = <font color="brown">Anti Recoil:<font color="green"> horizontal pull force compensation.
byteoffset     = 25
bitsize        = 32
control        = spinboxf
default        = 00000
minimum        = -10000
maximum        = 10000
step           = 10
decimals       = 2
 
[Anti Recoil Timed]
group          = true
shortdesc      = <font color="brown">Anti Recoil Timed:<font color="green"> (In MS) length of top setting compensation then applying second settings.
byteoffset     = 29
bitsize        = 16
control        = slider
default        = 500
minimum        = 0
maximum        = 2500
step           = 5
 
[Anti Recoil Settings]
group          = true
shortdesc      = <font color="brown">Anti Recoil:<font color="green"> vertical pull force compensation.
byteoffset     = 31
bitsize        = 32
control        = spinboxf
default        = 1800
minimum        = -10000
maximum        = 10000
step           = 10
decimals       = 2
 
[Anti Recoil H Settings]
group          = true
shortdesc      = <font color="brown">Anti Recoil:<font color="green"> horizontal pull force compensation.
byteoffset     = 35
bitsize        = 32
control        = spinboxf
default        = 00000
minimum        = -10000
maximum        = 10000
step           = 10
decimals       = 2
 
[AIM ASSIST SETTINGS:]
color       = #008000
collapsible = 2
 
[AIM ASSIST]
group       = true
shortdesc   = <font color="green">Works when ads is applied or fired.</font>
byteoffset  = 39
bitsize     = 1
bitoffset   = 7
control     = checkbox
default     = 1
item        =  Enable Aim assist
 
[TURBO MELEE SETTINGS:]
color       = #008000
collapsible = 2
 
[TURBO MELEE MODz]
group       = true
shortdesc   = <font color="green">Options for Turbo Melee.</font>
byteoffset  = 54
bitsize     = 8
control     = radiobox
default     = 2
item        = Disable
item        = Hold for normal press or double tap for turbo melee.
item        = Hold for turbo melee or double tap for normal press.
 
 
[AIM ABUSE SETTINGS:]
color       = #008000
collapsible = 2
 
[Aim_Abuse Settings]
group          = true
shortdesc      = <font color="green">Enable Aim Abuse?</font>
byteoffset     = 56
bitsize        = 1
bitoffset      = 7
control        = checkbox
default        = 0
item           = Aim Abuse
 
[Auto Aim Hold Time]
group          = true
shortdesc      = <font color="brown">Auto Aim Hold Time:</font> <font color="green">Configure the time period, in milli-seconds, of which the ADS(Scope) button should be pressed when the aim-assist abuse is activated.</font>
byteoffset     = 57
bitsize        = 16
control        = spinbox
default        = 150
minimum        = 20
maximum        = 5000
step           = 50
 
[Auto Aim Release Time]
group          = true
shortdesc      = <font color="brown">Auto Aim Release Time:</font> <font color="green">Configure the time period, in milli-seconds, of which the ADS(Scope) button should be released when the aim-assist abuse is activated.</font>
byteoffset     = 59
bitsize        = 16
control        = spinbox
default        = 50
minimum        = 10
maximum        = 5000
step           = 5
 
[Auto Aim Fire Pre Pause Time]
group          = true
shortdesc      = <font color="brown">Auto Aim Fire Pre Pause Time:</font> <font color="green">Configure the time period, in milli-seconds, to pause rapid fire for given time before ads release.</font>
byteoffset     = 61
bitsize        = 16
control        = spinbox
default        = 5
minimum        = 0
maximum        = 5000
step           = 5
 
[Auto Aim Fire Post Pause Time]
group          = true
shortdesc      = <font color="brown">Auto Aim Fire Post Pause Time:</font> <font color="green">Configure the time period, in milli-seconds, to pause rapid fire for given time after ads release.</font>
byteoffset     = 63
bitsize        = 16
control        = spinbox
default        = 50
minimum        = 0
maximum        = 5000
step           = 5
 
[AUTO SPRINT SETTINGS:]
color       = #008000
collapsible = 2
 
[Auto Sprint]
group          = true
shortdesc   = <font color="green">Easy sprint: hold left stick forward too sprint. Adjust reload delay for weapon so you don't sprint cancel reload. Adjust reload cancel the same as delay just incase anytime of reloading and enemy is near engage stick forward fast to get out of reloading.</font>
byteoffset     = 67
bitsize        = 1
bitoffset      = 7
control        = checkbox
default        = 1
item           =  Enable Easy Sprint
 
[Reload Delay]
group          = true
shortdesc      = <font color="brown">Reload Delay:<font color="green"> (In MS) length that it takes when you first press reload to when magazine clicks in weapon.
byteoffset     = 68
bitsize        = 16
control        = slider
default        = 2000
minimum        = 0
maximum        = 3500
step           = 5
 
[Reload Cancel]
group          = true
shortdesc      = <font color="brown">Reload Cancel:<font color="green"> (In MS) length of time you sprint cancel reloading in case needing break out to fire on enemy.
byteoffset     = 70
bitsize        = 16
control        = slider
default        = 2000
minimum        = 0
maximum        = 3500
step           = 5
 
[STRAFE SETTINGS:]
color       = #008000
collapsible = 2
 
[Strafe MODz]
group       = true
shortdesc   = <font color="green">Strafe option.</font>
byteoffset  = 115
bitsize     = 8
control     = radiobox
default     = 0
item        = Disabled
item        = Enabled Strafe (Adjustable)
item        = Enabled Strafe(Hip only)(Adjustable)
 
[Strafe Adjustable Setting]
group       = true
shortdesc   = <br><b><font color="green">Strafe Adjustable Setting:</font></b>
byteoffset  = 116
bitsize     = 32
control     = spinbox
default     = 200
minimum     = 0
maximum     = 2000
step        = 1
 
[ADS STOP SETTINGS:]
color       = #008000
collapsible = 2
 
[ADS Stop]
group       = true
shortdesc   = <font color="green">Stalls sprint when appling ADS.</font>
byteoffset  = 120
bitsize     = 1
bitoffset   = 7
control     = checkbox
default     = 1
item        =  Enable Auto Stop ADS
 
</cfgdesc>
***************************************************************************** */

 
#include <display.gph>
#define wait(a)  wait((int)a);
#define float  fix32
 
uint8 rapid_fire;
fix32 sps;
fix32 hold_time, rest_time;
uint8 bUseAntiRecoil;
float ARecoil_H;
float ARecoil_V;
uint16 ARecoilDelay;
float ARecoil_H2;
float ARecoil_V2;
uint16 ARecoilTimed;
float MinARecoilPercent;
float StickNoise;
//Aim Abuse
bool bUseAimAbuse = FALSE;
int AutoAimHoldTime;
int AutoAimReleaseTime;
int AutoAimFirePrePauseTime;
int AutoAimFirePostPauseTime;
bool bAutoAimPauseFire = FALSE;
bool sprint_toggle;
bool AimAssist;
//Turbo Melee
uint8 bUseTurboMelee = 2;
bool turboMelee = TRUE;
bool  fast_melee;
bool ADSstop;
uint8   STRAFE_MODz;
uint32  STRAFE_SHUFFLE;
uint16 reload_cancel;
uint16 reload_delay;
init
{
    pmem_load();
    rapid_fire = pmem_read(0);
    pmem_read(1, &sps);
    printf("<center><font style='color:blue;font-size:14px;',><br>RAPID FIRE: %u", rapid_fire);
    update_rapidfire();
 
    bUseAntiRecoil = (pmem_read(10) >> 7) & 0b1;
    printf("<center><font style='color:red;font-size:14px;',><br>ANTI RECOIL: %d", bUseAntiRecoil);
    pmem_read(11, &MinARecoilPercent);
    pmem_read(15, &StickNoise);
    pmem_read(19, &ARecoilDelay);
    pmem_read(21, &ARecoil_V);
    pmem_read(25, &ARecoil_H);
    pmem_read(29, &ARecoilTimed);
    pmem_read(31, &ARecoil_V2);
    pmem_read(35, &ARecoil_H2);
    update_anti_recoil();
    AimAssist = (pmem_read(39) >> 7) & 0b1;
    bUseTurboMelee = pmem_read(54);
    bUseAimAbuse = (pmem_read(56) >> 7) & 0b1;
    pmem_read(57, &AutoAimHoldTime);
    pmem_read(59, &AutoAimReleaseTime);
    pmem_read(61, &AutoAimFirePrePauseTime);
    pmem_read(63, &AutoAimFirePostPauseTime);
    sprint_toggle = (pmem_read(67) >> 7) & 0b1;
    pmem_read(68, &reload_delay);
    pmem_read(70, &reload_cancel);
    STRAFE_MODz = pmem_read(115);
    pmem_read(116, &STRAFE_SHUFFLE);
    ADSstop = (pmem_read(120) >> 7) & 0b1;
}
 
main {
 
    // - RAPIDFIRE - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    if(get_actual(BUTTON_5)) {
    if (bAutoAimPauseFire == FALSE)
    {
        set_val(BUTTON_5, 100.0);
    if(rapid_fire == 1)
        combo_run(RapidFire);
    }
    }else combo_stop(RapidFire);
 
    if (bUseAntiRecoil)
    {
 
        if (abs(get_actual(STICK_1_X)) < StickNoise) set_val(STICK_1_X, 0.0);
        if (abs(get_actual(STICK_1_Y)) < StickNoise) set_val(STICK_1_Y, 0.0);
        if (abs(get_actual(STICK_2_X)) < StickNoise) set_val(STICK_2_X, 0.0);
        if (abs(get_actual(STICK_2_Y)) < StickNoise) set_val(STICK_2_Y, 0.0);
 
        if (event_active(BUTTON_5))
        {
            combo_run(recoil_compensation);
        }
        if(event_release(BUTTON_5))
        {
            combo_stop(recoil_compensation);
        }
    }
    if(AimAssist == 1)
    {
    if(get_val(BUTTON_8)&& !get_actual(BUTTON_5)) {
        combo_run(ARA);
    } else
    if(get_val(BUTTON_5)) {
        combo_run(ARAF);
    }
    if(is_active(STICK_1_X)){combo_stop(ARA);combo_stop(ARAF);}
    if(is_active(STICK_1_Y)){combo_stop(ARA);combo_stop(ARAF);}
    }
    if(turboMelee == 1)
    {
    if(bUseTurboMelee == 1)
        {
        if(fast_melee)
              {
            if(get_val(BUTTON_6))
                    {
                combo_run(TurboMelee);
 
            }else
                        {
                fast_melee = 0;
            }
            }else if(event_active(BUTTON_6) && time_release(BUTTON_6) < 140)
                        {
                fast_melee = 1;
            }
        }
    if(bUseTurboMelee == 2)
        {
          if(get_actual(BUTTON_6))
              {
            combo_run(TurboMelee);
 
        }else if(event_release(BUTTON_6))
                {
            combo_stop(TurboMelee);
        }
        if(event_active(BUTTON_6) && time_release(BUTTON_6) < 140)
                {
            fast_melee = !fast_melee;
 
        }else if(event_release(BUTTON_6) && time_active(BUTTON_6) <= 140)
                {
            fast_melee = !fast_melee;
        }
        if(fast_melee)
        {
            if(get_actual(BUTTON_6))
            {
                combo_stop(TurboMelee);
 
                set_val(BUTTON_6, 100.0);
 
            }else if(event_release(BUTTON_6))
                        {
                fast_melee = FALSE;
            }
        }
    }
    }
    if (bUseAimAbuse)
    {
        if (get_actual(BUTTON_8) && !get_actual(BUTTON_5))
        {
            combo_run(AimAbuse);
        }
        else
        {
            bAutoAimPauseFire = FALSE;
            combo_stop(AimAbuse);
        }
    }
    if(sprint_toggle)
    {
    if(is_active(STICK_2_X) && event_active(BUTTON_15))
    {
        combo_run(auto_slide);
 
    }
    // - SPRINT MOD - - - - - - - - - - - - - - - - - - - - - - - - - - -
    if(get_val(STICK_2_Y) < -90.0) {
        combo_run(EasySprint);
    }
    if(get_actual(BUTTON_5) || get_actual(BUTTON_8) ||
       get_actual(BUTTON_4) || get_actual(BUTTON_7)) {
        combo_stop(EasySprint);
    }
    if(is_release(BUTTON_17) && time_active(BUTTON_17) <= reload_delay) {
        combo_stop(EasySprint);
    }
    if(is_active(STICK_2_Y) && time_active(STICK_2_Y) < reload_cancel)reload_delay = 0;
    }
    if(STRAFE_MODz == 1) {
    if(get_val(BUTTON_5)) {
        combo_run(strafe);
    }else if(event_release(BUTTON_5)) {
        combo_stop(strafe);
    }
    if(is_active(STICK_2_X) || is_active(STICK_2_Y)) {
        combo_stop(strafe);
    }
    if(is_active(STICK_2_X) && event_active(BUTTON_15))
    {
        combo_run(auto_slide);
 
    }
    }
    if(STRAFE_MODz == 2) {
    if((!get_val(BUTTON_8) && get_val(BUTTON_5)) || (event_release(BUTTON_8) && get_val(BUTTON_5))) {
        combo_run(strafe);
    }else if(event_release(BUTTON_5)) {
        combo_stop(strafe);
    }
    if(is_active(STICK_2_X) || is_active(STICK_2_Y)) {
        combo_stop(strafe);
    }
    }
    if(ADSstop == 1)
    {
    if(get_val(BUTTON_8)) {
        if(event_active(BUTTON_8)) {
            combo_run(ADSShot);
        }
    }else combo_stop(ADSShot);
    }
}
 
combo RapidFire
{
    set_val(BUTTON_5, hold_time ? 100.0 : 0.0);
    wait(hold_time);
    set_val(BUTTON_5, rest_time ? 0.0 : 100.0);
    wait(rest_time);
    set_val(BUTTON_5, rest_time ? 0.0 : 100.0);
}
 
combo recoil_compensation
{
    wait(ARecoilDelay);
    AntiRecoil(STICK_1_X, ARecoil_H);
    AntiRecoil(STICK_1_Y, ARecoil_V);
    wait(ARecoilTimed);
    AntiRecoil(STICK_1_X, ARecoil_H2);
    AntiRecoil(STICK_1_Y, ARecoil_V2);
    wait(2000);
}
 
combo AimAbuse
{
    bAutoAimPauseFire = FALSE;
    set_val(BUTTON_8, 100);
    wait(AutoAimHoldTime - AutoAimFirePrePauseTime);
    bAutoAimPauseFire = TRUE;
    wait(AutoAimFirePrePauseTime);
    set_val(BUTTON_8, 0.0);
    wait(AutoAimReleaseTime);
    set_val(BUTTON_8, 100);
    wait(AutoAimFirePostPauseTime);   
}
 
combo ARA
{
    set_val(STICK_1_X, irand(24, 16));
    wait(40);
    set_val(STICK_1_Y, irand(24, 16));
    wait(40);
    set_val(STICK_1_X, irand(-24, -16));
    wait(40);
    set_val(STICK_1_Y, irand(-24, -16));
    wait(40);
}
combo ARAF
{
    set_val(STICK_1_X, irand(40, 16));
    wait(40);
    set_val(STICK_1_Y, irand(40, 16));
    wait(40);
    set_val(STICK_1_X, irand(-40, -16));
    wait(40);
    set_val(STICK_1_Y, irand(-40, -16));
    wait(40);
}
 
combo TurboMelee
{
    set_val(BUTTON_6, 100.0);
    wait(40);
    set_val(BUTTON_6, 0.0);
    wait(40);
    set_val(BUTTON_6, 0.0);
}
 
combo EasySprint
{
    set_val(BUTTON_9, 100.0);
    wait(40);
    set_val(BUTTON_9, 0.0);
    wait(40);
    set_val(BUTTON_9, 0.0);
    reload_delay = 2000;
}
 
combo auto_slide {
    set_val(BUTTON_9, 100.00);
    set_val(BUTTON_15, 0.00);
    set_val(STICK_2_X, 100.00);
    set_val(STICK_2_Y, -100.00);
    wait(20);
    set_val(BUTTON_9, 100.00);
    set_val(BUTTON_15, 100.00);
    set_val(STICK_2_Y, -100.00);
    wait(20);
    set_val(BUTTON_9, 0.00);
    set_val(BUTTON_15, 100.00);
    set_val(STICK_2_Y, -100.00);
    wait(40);
    set_val(BUTTON_9, 100.00);
    set_val(BUTTON_15, 100.00);
    set_val(STICK_2_Y, -100.00);
    wait(20);
    set_val(BUTTON_9, 0.00);
    set_val(BUTTON_15, 100.00);
    set_val(STICK_2_Y, -100.00);
    wait(60);
}
 
combo strafe
{
    set_val(STICK_2_X, -100);
    wait(STRAFE_SHUFFLE/2);
    set_val(STICK_2_X, 100);
    wait(STRAFE_SHUFFLE);
    set_val(STICK_2_X, 100);
    set_val(STICK_2_X, -100);
    wait(STRAFE_SHUFFLE);
    set_val(STICK_2_X, 100);
    wait(STRAFE_SHUFFLE);
    set_val(STICK_2_X, 100);
    set_val(STICK_2_X, -100);
    wait(STRAFE_SHUFFLE/2);
    set_val(STICK_2_X, 100);
}
 
combo ADSShot
{
    combo_stop(EasySprint);
    set_val(STICK_2_Y,0.0);
    wait(320);
    combo_run(EasySprint);
}
 
void update_rapidfire() {
    printf("<center><font style='color:blue;font-size:14px;',><br>SHOTS PER SECOND: %.04f", sps);
 
    hold_time = 500.0 / sps;
    rest_time = hold_time - 1.0;
    if(rest_time < 0.0) rest_time = 0.0;   
 
    return;
}
 
void update_anti_recoil(){
    printf("<center><font style='color:red;font-size:14px;',><br>VERTICAL RECOIL COMPENSATION: %.04f", ARecoil_V);
    printf("<center><font style='color:brown;font-size:14px;',><br>HORIZONTAL RECOIL COMPENSATION: %.04f", ARecoil_H);
    printf("<center><font style='color:red;font-size:14px;',><br>VERTICAL RECOIL COMPENSATION 2: %.04f", ARecoil_V2);
    printf("<center><font style='color:brown;font-size:14px;',><br>HORIZONTAL RECOIL COMPENSATION 2: %.04f", ARecoil_H2);
 
    return;
}
 
int irand(int vmin, int vmax) {
    return(((int)(rand() * (fix32)(vmax + 1 - vmin))) + vmin);
}
 
void AntiRecoil(uint8 AxisToApply, float ARecoilToApply)
{
    float CurrentX = get_val(STICK_1_X);
    float CurrentY = get_val(STICK_1_Y);
    float MinARecoilFactor = MinARecoilPercent / 100.0;
    float MinARecoilToApply = MinARecoilFactor * ARecoilToApply;
    //This sets the ARecoil to be dependent on both X and Y axis movement. With more emphasis on Y
    float MovementARecoilToApply = (1.0 - MinARecoilFactor) * ((ARecoilToApply * (100.0 - sqrt(CurrentX*CurrentX + CurrentY*CurrentY))) / (100.0 + abs(CurrentX) + (CurrentY*CurrentY*0.5)));
    set_val(AxisToApply,clamp(MinARecoilToApply + MovementARecoilToApply + get_val(AxisToApply),-100.00,100.00 - MinARecoilToApply));
}
 
 
 
 

try this aim assist!
bonefisher
Lieutenant General
Lieutenant General
 
Posts: 5413
Joined: Thu Jan 29, 2015 10:49 am


Return to GPC2 Script Programming

Who is online

Users browsing this forum: No registered users and 127 guests