Medium Script Request for Xim Apex (With examples and links)

GPC script programming for Titan Two device. Code examples, how to, questions, requests.

Moderators: The_Rabid_Taco, pablosscripts, bonefisher

Medium Script Request for Xim Apex (With examples and links)

Postby SweatyPapi » Sat Mar 16, 2019 10:51 pm

I would really appreciate if this script was made as it would be really useful to me as a ximmer. Thank you so much in advanced!


SNAKING BO4 – Going Prone then before hitting the ground cancelling with sprint out, do this repeatedly until I can press B to Cancel it. Designated button combination to start it.
EX: https://www.youtube.com/watch?v=-FmUhSPer_I

STRAFING WHEN FIRING AND ADS (ADJUSTABLE)
ADS SPAM When Pressing ADS button, but stops when ADS and FIRE is pressed at the same time.
EASY RUN
Anti Recoil- Antithesis version. (DEADZONE COMPENSATION)

Script to get out to ADS faster= Gung Ho perk without having gung ho on.
EX: viewtopic.php?f=26&t=11291
But It Should function like I can’t even tell. Should not go into too much depth like example, but just do something where when I press ADS while running, it will decrease the Sprint out and ADS speed. If this is impossible then just have a option to disable it on script so I can.

EASY SLIDE
EX: viewtopic.php?f=26&t=11678
RAPID FIRE script.
User avatar
SweatyPapi
Sergeant First Class
Sergeant First Class
 
Posts: 24
Joined: Fri Feb 08, 2019 12:52 am

Re: Medium Script Request for Xim Apex (With examples and li

Postby SweatyPapi » Sun Mar 17, 2019 7:25 pm

Can no one make this for me? and scripts I have found regarding just some of the requested Items:

Qol slide,recoil
Strafe


viewtopic.php?f=26&t=11678


Code: Select all
#pragma METAINFO("BO4 BLACKOUT", 1, 0, "bonefisher")
 
#include <display.gph>
#define wait(a)  wait((int)a);
#define float  fix32
float rf_active, rf_release;
uint8 bUseAntiRecoil    = 1;
uint16 ARecoilDelay     = 0;
float MinARecoilPercent = 18.0;
float StickNoise        = 6.50;
int psv;
int arv;
int   i;
int   b;
const fix32 wcfg[] =
{
/*rf_active| rf_release*/
    76.0,    0.0//blink 0
    37.5,    37.5, //blink 1
    64.0,    16.3, //blink 2
    40.5,    120.0,//blink 3
    60.0,    120.0,//blink 4
    80.0,    120.0,//blink 5
    240.0,    40.0,//blink 6
    340.0,    80.0,//blink 7
    540.0,    80.0 //blink 8
};
const fix32 warcfg[] =
{ //anti_recoil
/*vertical| horizontal*/
    16.00.0,//blink 0
    20.00.0,//blink 1
    24.00.0,//blink 2
    26.00.0,//blink 3
    28.00.0,//blink 4
    30.00.0,//blink 5
    32.00.0,//blink 6
    36.00.0,//blink 7
    40.00.0 //blink 8
};
init
{
    psv = 0;
    i = 0;
    arv = 0;
    b = 0;
}
 
main {
    // - WEAPON TRACKING - - - - - - - - - - - - - - - - - - - - - - - - - - -
    #define WEAPON_PRIMARY      0
    #define WEAPON_SECONDARY    1
    static uint8 weapon;
    if(event_active(BUTTON_5) && time_release(BUTTON_5) <= 200) {
        weapon = WEAPON_SECONDARY;
        display_overlay(_P_, 500);
    } else if(event_release(BUTTON_5)) {
        weapon = WEAPON_PRIMARY;
        display_overlay(_S_, 500);
    }
    if(is_active(BUTTON_8))
    {
        set_val(BUTTON_10, 0.0);
    if(event_active(BUTTON_10)){
        psv = psv + 1;
        i = i + 1;
    if(psv > 8) psv = 0;
    if(i > 8) i = 0;
        pmem_write(1, psv);
        pmem_write(18, i);
        pmem_save();
        Blink(i);
    }
    }
    // - RAPIDFIRE - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    if(get_actual(BUTTON_5)) {
        if(weapon) {                                              // SECONDARY
            if(event_active(BUTTON_5)) {
                rf_active = 37.5;
                rf_release = 37.5;
            } combo_run(Rapidfire);
        } else {                                                  // PRIMARY
            if(event_active(BUTTON_5)) {
                rf_active = wcfg[2*psv+0];
                rf_release = wcfg[2*psv+1];
            } combo_run(Rapidfire);
        }
    } else combo_stop(Rapidfire);
 
    // - ANTI RECOIL - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    if(is_active(BUTTON_8))
    {
         set_val(BUTTON_11, 0.0);
    if(event_active(BUTTON_11)){
        arv = arv + 1;
        b = b + 1;
    if(arv > 8) arv = 0;
    if(b > 8) b = 0;
        pmem_write(5, arv);
        pmem_write(22, b);
        pmem_save();
        Blinks(b);
    }
    }
    if (get_actual(BUTTON_5) && time_active(BUTTON_5) >= ARecoilDelay)
    {
        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 (bUseAntiRecoil == 1)
    {
        if (get_actual(BUTTON_8) && get_val(BUTTON_5))
        {
            AntiRecoil(STICK_1_Y, warcfg[2*arv+0]);
            AntiRecoil(STICK_1_X, warcfg[2*arv+1]);
        }
    }
    }
    // - COMMON MODS - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    if(get_actual(BUTTON_5)) {
        set_val(BUTTON_5, 100.0);                             // HAIR TRIGGGER
    }
    if(get_actual(BUTTON_8)) {
        if(get_actual(BUTTON_8) && time_active(BUTTON_8)>= 140) {
            set_val(BUTTON_9, 100.0);                         // HOLD BREATH
        }
        set_val(BUTTON_8, 100.0);                             // HAIR TRIGGGER
    }
    // - SPRINT MOD - - - - - - - - - - - - - - - - - - - - - - - - - - -
    #define SPRINT_OFF     0
    #define SPRINT_ON      1
    static uint8 sprint;
    if(event_active(BUTTON_16)|| event_active(BUTTON_5)||
        event_active(BUTTON_9)|| is_active(STICK_2_Y)
        && time_release(STICK_2_Y) < 250)
    {
        sprint = SPRINT_ON;
        goto SPRINT_LIGHTBAR;
    }
    else if(event_active(BUTTON_8)|| event_active(BUTTON_15)||
        event_active(BUTTON_17))
    {
        if(sprint || !sprint)
        {
            switch(sprint)
            {
                case SPRINT_OFF: sprint = SPRINT_ON;  break;
                case SPRINT_ON:  sprint = SPRINT_OFF; break;
            }
    } else sprint = SPRINT_OFF;
        SPRINT_LIGHTBAR:
        led_reset();
        switch(sprint)
        {
            case SPRINT_OFF: display_overlay(_0_, 500); break;
            case SPRINT_ON:  display_overlay(_1_, 500); break;
        }
    }
    if(sprint == SPRINT_ON && get_actual(STICK_2_Y) < -95.0){
        combo_run(easy_sprint);
    }
    if(sprint == SPRINT_OFF){
        set_val(STICK_2_X, get_val(STICK_2_X) / 1.1);
        set_val(STICK_2_Y, get_val(STICK_2_Y) / 1.1);
    }
    if(get_actual(STICK_2_Y) < -75.0 &&
       event_release(BUTTON_15) && time_active(BUTTON_15) < 160)
    {
        combo_run(BO4_Slide);
    }
}
 
combo Rapidfire
{
    set_val(BUTTON_5, 100.0);
    wait(rf_active);
    set_val(BUTTON_5, rf_release ? 0.0 : 100.0);
    wait(rf_release);
    set_val(BUTTON_5, rf_release ? 0.0 : 100.0);
}
 
combo easy_sprint
{
    set_val(BUTTON_9, 0.0);
    wait(200);
    set_val(BUTTON_9, 100.0);
    wait(80);
    set_val(BUTTON_9, 100.0);
}
 
combo BO4_Slide
{
    set_val(STICK_2_Y,-100.0);
    wait(20);
    set_val(STICK_2_Y,-100.0);
    set_val(BUTTON_9,100.0);
    wait(50);
    set_val(STICK_2_Y,-100.0);
    set_val(BUTTON_15,100.0);
    wait(200);
    set_val(STICK_2_Y,-100.0);
    wait(300);
}
 
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, MinARecoilToApply + MovementARecoilToApply + get_val(AxisToApply));
}
 
bool blinking;
void Blink(uint8 no) {
    led_reset();
    if(no) led_vmset(LED_1, 150, 500, i+1);
    blinking = 1;
}
bool blinker;
void Blinks(uint8 nos) {
    led_reset();
    if(nos) led_vmset(LED_1, 150, 500, b+1);
    blinker = 1;
}
 
 
main {
    if(blinking && !led_vmget(LED_1)) {
    led_reset();
    blinking = 0;
    }
    if(blinker && !led_vmget(LED_1)) {
    led_reset();
    blinker = 0;
    }
}
 
 
 
 
ADS DELAY
https://www.consoletuner.com/forum/viewtopic.php?f=26&t=11291
 
 
merging scripts:
https://www.consoletuner.com/forum/viewtopic.php?f=26&t=11528
 
SLIDE MELEE
https://www.consoletuner.com/forum/viewtopic.php?f=26&t=11310
 
AUTOSTRAFE
https://www.consoletuner.com/forum/viewtopic.php?f=26&t=11222
 
main {
    if(get_val(BUTTON_8) && event_active(BUTTON_5)) {
        combo_run(AutoStrafe);
    }
}
 
combo AutoStrafe {
    set_val(STICK_2_Y, -100.0);
    wait(50);
    set_val(STICK_2_Y, -100.0);
    set_val(BUTTON_9, 100.0);
    wait(50);
    set_val(STICK_2_Y, -100.0);
    wait(50);
    set_val(STICK_2_Y, -100.0);
    set_val(BUTTON_15, 100.0);
    wait(50);
}
User avatar
SweatyPapi
Sergeant First Class
Sergeant First Class
 
Posts: 24
Joined: Fri Feb 08, 2019 12:52 am

Re: Medium Script Request for Xim Apex (With examples and li

Postby SweatyPapi » Mon Mar 18, 2019 6:54 am

Can anybody reply with a working script?
User avatar
SweatyPapi
Sergeant First Class
Sergeant First Class
 
Posts: 24
Joined: Fri Feb 08, 2019 12:52 am

Re: Medium Script Request for Xim Apex (With examples and li

Postby bonefisher » Mon Mar 18, 2019 5:30 pm

Code: Select all
 
#pragma METAINFO("BO4 snaking", 1, 0, "bonefisher")
 
main
{
    // hold crouch button plus press d-pad down to toggle on/off.
    // when on use ADS trigger to activate and fire trigger to cancel.
    static bool snake;
    if(get_actual(BUTTON_15) && event_active(BUTTON_11))
    {
        snake = !snake;
    }
    if(snake)
    {
        if(get_actual(BUTTON_8) && !get_actual(BUTTON_5))
        {
            combo_run(Snaking);
        }
        else if(get_actual(BUTTON_5))
        {
            combo_stop(Snaking);
        }
        if(event_active(BUTTON_5)) combo_run(stand);
    }
}
combo Snaking
{
    set_val(BUTTON_15, 100.0);
    wait(290);
    set_val(STICK_2_Y, -100.0);
    set_val(BUTTON_9, 100.0);
    wait(40);
}
combo stand
{
    set_val(BUTTON_16, 100.0);
    wait(50);
}
 

this should not be called snaking because it is not but give it a try to see if it works for you!
bonefisher
Major General
Major General
 
Posts: 4888
Joined: Thu Jan 29, 2015 10:49 am

Re: Medium Script Request for Xim Apex (With examples and li

Postby bonefisher » Mon Mar 18, 2019 6:00 pm

Code: Select all
 
#pragma METAINFO("snake", 1, 0, "bonefisher")
 
main
{
    // hold crouch button for 1 second to toggle on.
    // fire trigger or ads trigger to cancel turn off.
    static bool snake;
    if(event_release(BUTTON_15) && time_active(BUTTON_15) > 1000)
    {
        snake = 1;
    }
    if(snake == 1)
    {
        combo_run(Snaking);
    }
    if(get_actual(BUTTON_5) || get_actual(BUTTON_8))
    {
        snake = 0;
    }
}
combo Snaking
{
    set_val(BUTTON_15, 100.0);
    wait(600);
    set_val(STICK_2_Y, -100.0);
    set_val(BUTTON_9, 100.0);
    wait(180);
}
 

or try this one and tell me which one works best!
bonefisher
Major General
Major General
 
Posts: 4888
Joined: Thu Jan 29, 2015 10:49 am

Re: Medium Script Request for Xim Apex (With examples and li

Postby SweatyPapi » Wed Mar 20, 2019 3:40 am

Can you combine the ones I stated above please? I desperately want this script
User avatar
SweatyPapi
Sergeant First Class
Sergeant First Class
 
Posts: 24
Joined: Fri Feb 08, 2019 12:52 am

Re: Medium Script Request for Xim Apex (With examples and li

Postby SweatyPapi » Wed Mar 20, 2019 3:43 am

thank you so much for the snaking script though!
User avatar
SweatyPapi
Sergeant First Class
Sergeant First Class
 
Posts: 24
Joined: Fri Feb 08, 2019 12:52 am


Return to GPC Script Programming (Titan Two)

Who is online

Users browsing this forum: Buffy and 6 guests