CM BO4 AA and AntiRecoil + Simple Script Combination Request

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

Re: CM BO4 AA and AntiRecoil + Simple Script Combination Req

Postby SweatyPapi » Wed Apr 10, 2019 10:03 pm

I hope you and antithesis are proud of me , i figured it out :)!!!


if (bUseAimAbuse)
{
if (get_actual(BTN_ADS))
{
combo_run(AimAbuse);
}
else
{
bAutoAimPauseFire = FALSE;
combo_stop(AimAbuse);
}
if (get_actual(BTN_ADS)&& get_actual(BTN_SHOOT))
{
set_val(BTN_ADS, 100.0) ;
combo_stop(AimAbuse);}
User avatar
SweatyPapi
Sergeant Major
Sergeant Major
 
Posts: 85
Joined: Fri Feb 08, 2019 12:52 am

Re: CM BO4 AA and AntiRecoil + Simple Script Combination Req

Postby antithesis » Thu Apr 11, 2019 12:16 am

Good work trooper :salute:
Official Australian retailer for Titan One, Titan Two and XIM APEX at Mod Squad
User avatar
antithesis
Colonel
Colonel
 
Posts: 1716
Joined: Sat May 28, 2016 10:45 pm

Re: CM BO4 AA and AntiRecoil + Simple Script Combination Req

Postby bonefisher » Thu Apr 11, 2019 1:03 am

Ok I have update some issues with that script that you posted with the anti recoil!
bonefisher
Lieutenant General
Lieutenant General
 
Posts: 5366
Joined: Thu Jan 29, 2015 10:49 am

Re: CM BO4 AA and AntiRecoil + Simple Script Combination Req

Postby bonefisher » Thu Apr 11, 2019 7:23 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 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));
}
 
 
 
 

See how you like this!
bonefisher
Lieutenant General
Lieutenant General
 
Posts: 5366
Joined: Thu Jan 29, 2015 10:49 am

Re: CM BO4 AA and AntiRecoil + Simple Script Combination Req

Postby SweatyPapi » Fri Apr 12, 2019 11:53 am

Hey man just wanted to give you input on the script to see if we can make it better! Great overall and I tested it all night

- ADS Sprint stop- The sprint stop although is too long and shouldn't last after ads release. I can't ads then slide sprint out with easy slide and auto run. It stops both of these.
- The Easy Run should be quicker, maybe way less wait time
- Easy Slide is very short. Needs effect of sliding like pablo QOL script
- AA Increase: Needs to be lower X and Y Number to decrease shaking. Too much for long distance shots! lol I can only use on saug because it's so shaky.
- everything else pretty perfect.
User avatar
SweatyPapi
Sergeant Major
Sergeant Major
 
Posts: 85
Joined: Fri Feb 08, 2019 12:52 am

Re: CM BO4 AA and AntiRecoil + Simple Script Combination Req

Postby Rocky » Fri Apr 12, 2019 11:36 pm

antithesis wrote:There's no way to access code within a Gamepack. Gamepacks are system-locked within that device's app.

All aim abuse and anti-recoil scripts perform the same basic functions, don't believe the self-congratulatory hype. What differs between scripts is how cleanly the mod performs and how it adjusts to manual input.

For example, aim abuse either rotates the left or right stick, shakes the left or right stick or spams ADS. That's it, there's no magic. Likewise, anti-recoil simply adjusts the right stick position to offset a firing pattern.

Horizontal aim abuse (shaking side to side) would likely work fine with anti-recoil because it doesn't interfere or stack with vertical values.

From what I've seen, Sweet Evil's aim abuse is the most comprehensive, even though at its core it's just side-to-side right stick shaking. What he seems to be doing is suggesting to set in-game sensitivity low then multiply it using the sensitivity function on CM (also possible on T1, T2). Lower in-game sens elicits more AA, so this is an interesting slant on aim abuse, which may or may not have a positive net effect. Probably contraindicated with XIM Apex as STs are built on max in-game sens, but worth testing.

Add anti-recoil from AryanX (the newest AR, can be found on these forums) and you've got the best of both.

I'll have a quick look at the BO4 CM Gamepack to see how the mods behave. I have their previous aim assist scripts and there was nothing special about the AA code. Maybe they're using Sweet Evil's AA mod, I don't know.

Overengineering a script to automate easy to perform actions is a bad idea as it locks you into inflexible patterns and there are extra things to think about in the heat of battle.

1. Snaking - doesn't work well and may kill you more often than not due to toggle. But, the code exists.
2. Easy sprint - there are times when you want to walk and this prevents it. Code exists, or simply bind Sprint to W in HIP on XIM Apex. Also, bind Sprint to ADS on the ADS page for auto-hold breath while sniping.
3. Easy slide - there are times when you want to crouch and this can mess it up. Code exists.
4. ADS spam - doesn't work in CoD (I could be wrong) as well as telegraphing your mods in killcams (a nice way to get reported). Code exists.
5. Insta-punch - I had the same combo as Option 3 in my Titan Fun Pack (while Sprinting > tap Slide > auto-Shoot > auto-Melee) - https://www.youtube.com/watch?v=3DaEDJBED84. Slide > Shoot > Melee can be fun. The others may mess with default behaviour and I doubt it'll override the game's ADS > Melee animation times. Why not bind Melee so it can be hit at the same time as Shoot?
6. Insta-break sprint - likely just sets LY to 0 momentarily when pressing ADS. I think this mod is already on the forums.

Hi, this is the aim assist script that I have acquired. I do not know if this is one that you do have, I do know that it works for me.

Code: Select all
#pragma METAINFO("cod_black_ops_4_-_strongest_aim_assist_&_aim_corrections.gpc", 1, 0, "Buffy's GPC Converter v0.23r2")
#include <titanone.gph>
 
 
// GPC Online Library
// cod_black_ops_4_-_strongest_aim_assist_&_aim_corrections.gpc
/*
*************************************************************************************                 
 
                          A GPC POWER SCRIPT BY CRESCENS:
                  __                     __   ___     __       ___     
                /  `  /\  |    |       /  \ |__     |  \ |  |  |  \ /
                \__, /~~\ |___ |___    \__/ |       |__/ \__/  |   |                                             
                 __             __           __   __   __             
                |__) |     /\  /  ` |__/    /  \ |__) /__`    | \  / 
                |__) |___ /~~\ \__, |  \    \__/ |    .__/    |  \/         
 
                   AIM ASSIST BY BATTS / AIM CORRECTIONS BY CRESCENS
 
*************************************************************************************
 
    AIM ASSIST IS ALWAYS ON
    AIM CORRECTIONS IS ON BY DEFAULT
 
    LEDS:
 
    BLUE                     NEUTRAL
    PINK WHEN FIRE           AIM CORRECTIONS IS ON
    PINK WHEN ADS            AIM ASSIST IS RUNNING
 
 
    TOGGLE ON/OFF AIM CORRECTIONS:
    HOLD ADS + TAP OPTIONS/MENU
 
    MANAGE SENS VALUES:
 
    int    ADS_SENS=95, GEN_SENS=100, HIP_SENS=100, ADS_FIRE_SENS=90, Use_sens
 
    GEN SENS         = GENERAL STICK SENSITIVITY - RECOMMENDED TO LEAVE ON DEFAULT VALUE 100.
                        100 EQUALS 100% OF YOUR IN GAME SENSITIVITY SETTINGS|RANGE = 0 - 327 (DEFAULT = 100).
    ADS SENS         = SENS WHEN AIMING - RECOMMENDED VALUE: 95 OR 90, OR ANY VALUE THAT KEEPS YOU
                       FROM OVER SWAYING YOUR WEAPON WHEN TARGETING MULTIPLE OR MOVING ENEMIES, BUT KEEPS YOU FAST     
                          ENOUGH TO KEEP MOMENTUM GOING. RANGE = 0 - 327 (DEFAULT = 100).
    HIP SENS         = SENS WHEN HIP FIRING - RECOMMENDED VALUE IS TO LEAVE IT ON DEFAULT 100. RANGE = 0 - 327.
    ADS FIRE SENS   = WHEN AIMING & FIRING     -YOU WANT TO STICK TO YOUR ENEMY AS GOOD AS YOU CAN ONCE YOU OPEN FIRE,.
                      RECOMMENDED VALUE 85 - 90. RANGE = 0 - 327 (DEFAULT = 100).
 
    In the game menu, leave the ADS Sensitivity in the game on 1X (so standard or default whatever you name it)
    because the script has the same option, but better. Hint: I am not referring to the Look Sensitivity, but to the newly
    added option ADS Sensitivity, so leave that on "1X."
    The values that I filled out in the script come recommended, but they are really personal for the individual player.
    To make it easy for yourself, you should program the script to 3 or more slots, and fill out different values on
    each of them to find your sweet spot.
    The aim assist will be strongest when sensitivity is low. This is why you should have the lowest sensitivity value
    under ADS FIRE SENS. I recommend a slightly lower value for ADS (so when you aiming). NB: the ADS SENS = exact the
    same option as the aim sens in the game, but much more customizable to your own preference. Instead of 4, you have
    378 sensitivity values to choose from. Of course, you are not trying all of them, I would stay in range of 75
    (being the lowest) and 95 (the highest). Value 100 means 100%, so the default in game sensitivity.
    So, for example, if you have game sens 6, and use values 100, 95 and 85 as do in the script, your game sens values
    will look like this:
 
    100     = game sens 6.0 | 100 X 6
    95       = game sens 5.7 | 0.95 X 6
    85       = game sens 5.1 | 0.85 X 6
 
 
    SCRIPT IS BUILT FOR TACTICAL BTN LAY OUT. IF DEFAULT BTN LAYOUT IS USED, CHANGE
    FALSE TO TRUE IN THE CONTROL SECTION
 
    define Default=FALSE;        //IF DEFAULT IS YOUR GAME BTN CONFIGURATION SET TO TRUE;
 
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| | | | |U|S|E|R| |C|O|N|F|I|G|U|R|A|T|I|O|N| | | | | | | | | | | | | | | | | | | | | |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 
 
/---------------------------/ START USER CONFIG---------------------------------------*/
// AIM CORRECTIONS 
/*
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| | | | |C|O|N|T|R|O|L|S| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 
----TACTICAL BTN LAY OUT BY DEFAULT------
*/
//IF DEFAULT IS YOUR GAME BTN CONFIGURATION SET TO TRUE;
//PS4_PS         / XB1_XBOX
//PS4_SHARE     / XB1_VIEW
//PS4_OPTIONS     / XB1_MENU
//PS4_R1         / XB1_RB
//PS4_R2         / XB1_RT
//PS4_R3         / XB1_RS
//PS4_L1         / XB1_LB
//PS4_L2         / XB1_LT
//PS4_L3         / XB1_LS
//PS4_RX         / XB1_RX
//PS4_RY         / XB1_RY
//PS4_LX         / XB1_LX
//PS4_LY         / XB1_LY
//PS4_UP         / XB1_UP
//PS4_DOWN         / XB1_DOWN
//PS4_LEFT         / XB1_LEFT
//PS4_RIGHT     / XB1_RIGHT
//PS4_TRIANGLE     / XB1_Y
//PS4_CIRCLE     / XB1_B
//PS4_CROSS     / XB1_A
//PS4_SQUARE     / XB1_X
/*---------------------------/ END USER CONFIG-----------------------------------------
 
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| | | | |L|E|D|S| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+*/
/*
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| | | | |D|A|T|A| | | | | | | | | | | | | | | | | | | | | | || | | | | | || | | | | | |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+*/
// GREEN                                                           
// PINK                                                             
// RED                                                               
// SKYBLUE                                                               
// YELLOW                                                           
// OFF
/*
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 | | | | | | | | |M|A|I|N| |B|L|O|C|K| |S|T|A|R|T|S| |H|E|R|E| | | | | | | | | | | | | |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+*/
/*
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| | | |M|E|N|U| |A|D|S| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+*/
//hold ADS button   
/*
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 | | | | | | | | |A|I|M| | |C|O|R|R|E|C|T|I|O|N|S| | | | | | | | | | | | | | | | | | | |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+*/
/*
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 | | | | | | | | |A|I|M| |A|S|S|I|S|T| | | | | | | | | | | | | | | | | | | | | | | | | |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+*/
/*
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 | | | | | | | | |L|E|D|S|&|R|U|M|B|L|E| | | | | | | | | | | | | | | | | | | | | | | | |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+*/
//--END OF MAIN
/*
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 | | | | | | | | |C|O|M|B|O| |S|E|C|T|I|O|N| | | | | | | | | | | | | | | | | | | | | | |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+*/

 
 
 
define Default = FALSE;
define HOME = 0;
define VIEW_reset = 1;
define MENU_save = 2;
define LETHAL = 3;
define FIRE = 4;
define PRONE = 5;
define TACTICAL = 6;
define ADS = 7;
define SPRINT = 8;
define RX = 9;
define RY = 10;
define LX = 11;
define LY = 12;
define UP = 13;
define DOWN = 14;
define LEFT = 15;
define RIGHT = 16;
define SW_WEAPON = 17;
define MELEE = 18;
define JUMP = 19;
define RELOAD = 20;
define Off = 0;
define Blue = 1;
define Pink = 2;
define Red = 3;
define SkyBlue = 4;
define White = 5;
 
data(
0, 0, 0, 0,
2, 0, 0, 0,
0, 0, 0, 2,
0, 2, 0, 0,
2, 0, 2, 0,
2, 2, 2, 2
);
 
int AIM__CORRECT = TRUE;
int ADS_SENS = 90,  GEN_SENS = 100,  HIP_SENS = 100,  ADS_FIRE_SENS = 90,  Use_sens;
int rumble;
 
main {
    if (Default) swap(18, 5);
    if (get_val(ADS)) {
        if (event_press(2)) {
            AIM__CORRECT =! AIM__CORRECT;
            f_rumble(AIM__CORRECT);
        }
        set_val(2, 0);
    }
    if (AIM__CORRECT) {
        if (get_val(FIRE) && get_val(ADS)) {
            Use_sens = ADS_FIRE_SENS;
        }
        if (get_val(FIRE) && !get_val(ADS)) {
            Use_sens = HIP_SENS;
        }
        if (!get_val(FIRE) && !get_val(ADS)) {
            Use_sens = GEN_SENS;
        }
        if (!get_val(FIRE) && get_val(ADS)) {
            Use_sens = ADS_SENS;
        }
        sensitivity(9, NOT_USE, Use_sens);
        sensitivity(10, NOT_USE, Use_sens);
    }
    if (get_val(ADS)) combo_run(c_AA_XY);
    else  combo_stop(c_AA_XY);
    if (rumble) combo_run(c_RUMBLE);
    combo_run(c_leds);
}
 
 
combo c_AA_XY {
    set_val(10, f_xy_val(10, 24));
    wait(20);
    set_val(9, f_xy_val(9, 24));
    set_val(11, f_xy_val(11, 24));
    wait(20);
    set_val(10, f_xy_val(10, 24 *- 1));
    wait(20);
    set_val(9, f_xy_val(9, 24 *- 1));
    set_val(11, f_xy_val(11, 24 *- 1));
    wait(20);
}
 
combo c_leds {
    f_color_led(Blue);
    if (AIM__CORRECT && get_val(FIRE)) f_color_led(Pink);
    if (combo_running(c_AA_XY) && get_val(ADS)) f_color_led(Pink);
}
 
combo c_RUMBLE {
    set_rumble(RUMBLE_B, 100);
    wait(150);
    reset_rumble();
    wait(150);
    rumble -- ;
}
 
 
function f_xy_val(f_axis, f_val) {
    if (abs(get_val(f_axis)) < 25)
        return f_val;
    return get_val(f_axis);
}
 
function f_rumble(f_bln) {
    if (f_bln) rumble = 2;
    else  rumble = 1;
}
 
function f_color_led(colour) {
    set_led(LED_1, dbyte(colour * 4));
    set_led(LED_2, dbyte((colour * 4) + 1));
    set_led(LED_3, dbyte((colour * 4) + 2));
    set_led(LED_4, dbyte((colour * 4) + 3));
}
 
 
 
User avatar
Rocky
Sergeant Major
Sergeant Major
 
Posts: 82
Joined: Thu Nov 10, 2016 8:11 pm

Re: CM BO4 AA and AntiRecoil + Simple Script Combination Req

Postby bonefisher » Fri Apr 12, 2019 11:48 pm

You might want to try my aim assist! :smile0517:
bonefisher
Lieutenant General
Lieutenant General
 
Posts: 5366
Joined: Thu Jan 29, 2015 10:49 am

Re: CM BO4 AA and AntiRecoil + Simple Script Combination Req

Postby bonefisher » Sat Apr 13, 2019 12:01 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 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);
        }
    }else combo_stop(ADSShot);
    }
}
 
combo easy_sprint
{
    set_val(BUTTON_9, 0.0);
    wait(40);
    set_val(BUTTON_9, 100.0);
    wait(40);
    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(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 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));
}
 
 
 
 

Here I turned down AA and speed run and stop ADS at release!
bonefisher
Lieutenant General
Lieutenant General
 
Posts: 5366
Joined: Thu Jan 29, 2015 10:49 am

Re: CM BO4 AA and AntiRecoil + Simple Script Combination Req

Postby SweatyPapi » Sat Apr 13, 2019 6:46 pm

One thing missing Bonefisher! Easy Slide and Easy Slide Cancel by moving back on analog. I am going to get you a answer to the new code you provided!
User avatar
SweatyPapi
Sergeant Major
Sergeant Major
 
Posts: 85
Joined: Fri Feb 08, 2019 12:52 am

Re: CM BO4 AA and AntiRecoil + Simple Script Combination Req

Postby bonefisher » Sat Apr 13, 2019 9:37 pm

Code: Select all
 
main
{
    if(get_actual(STICK_2_Y) < -80.0)combo_run(easySprint);
 
    if(is_active(BUTTON_5) || is_active(BUTTON_8))combo_stop(easySprint);
 
    if(easySprint)
    {
    if(is_release(BUTTON_15) && time_active(BUTTON_15)<= 580)
    {
        set_val(BUTTON_15, 100.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);
}
 

Try this easy sprint and slide....
bonefisher
Lieutenant General
Lieutenant General
 
Posts: 5366
Joined: Thu Jan 29, 2015 10:49 am

PreviousNext

Return to GPC2 Script Programming

Who is online

Users browsing this forum: DontAtMe and 31 guests