Auto Strafe Request

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

Re: Auto Strafe Request

Postby Beryl » Sat May 14, 2022 6:45 am

That looks perfect but could you give me a version that just has RT fire in it purely for just hip fire but that looks good. Your the best
User avatar
Beryl
Sergeant Major of the Army
Sergeant Major of the Army
 
Posts: 198
Joined: Fri Nov 27, 2020 7:47 pm

Re: Auto Strafe Request

Postby Mad » Sat May 14, 2022 8:04 am

Code: Select all
#include <xb1.gph>
#define STRAFE_TIME 500
#define THROWABLE_DELAY 1500
bool toggle;
main {
    if(event_active(XB1_MENU)) toggle = !toggle;
    if(toggle) {
        if(is_release(XB1_LX) * is_release(XB1_LY)) {
            if(check_release(XB1_RIGHT, THROWABLE_DELAY)) {
                if(is_active(XB1_RT)) combo_run(Strafe);
                else if(Strafe) combo_stop(Strafe);
            }
        }
        else if(Strafe) combo_stop(Strafe);
    }
}
combo Strafe {
    set_val(XB1_LX, -100);
    wait(STRAFE_TIME);
    set_val(XB1_LX, 100);
    wait(STRAFE_TIME);
}
ConsoleTuner Support Team || ConsoleTuner Discord || InputSense Discord (2K / FPS)
Mad
Major General
Major General
 
Posts: 4533
Joined: Wed May 22, 2019 5:39 am

Re: Auto Strafe Request

Postby Beryl » Sat May 14, 2022 7:04 pm

Can you remove the toggle so its on when i fire as its clashing with another script? I did try myself but getting warning msgs, thankyou
User avatar
Beryl
Sergeant Major of the Army
Sergeant Major of the Army
 
Posts: 198
Joined: Fri Nov 27, 2020 7:47 pm

Re: Auto Strafe Request

Postby Mad » Mon May 16, 2022 9:33 pm

Code: Select all
#include <xb1.gph>
#define STRAFE_TIME 500
#define THROWABLE_DELAY 1500
main {
    if(is_release(XB1_LX) * is_release(XB1_LY)) {
        if(check_release(XB1_RIGHT, THROWABLE_DELAY)) {
            if(is_active(XB1_RT)) combo_run(Strafe);
            else if(Strafe) combo_stop(Strafe);
        }
    }
    else if(Strafe) combo_stop(Strafe);
}
combo Strafe {
    set_val(XB1_LX, -100);
    wait(STRAFE_TIME);
    set_val(XB1_LX, 100);
    wait(STRAFE_TIME);
}
ConsoleTuner Support Team || ConsoleTuner Discord || InputSense Discord (2K / FPS)
Mad
Major General
Major General
 
Posts: 4533
Joined: Wed May 22, 2019 5:39 am

Re: Auto Strafe Request

Postby Beryl » Tue May 17, 2022 6:12 am

Thankyou! i did try myself but i kept getting warnings so in the in the end i changed a few buttons and got it to work but ill now use this version! Wish there was an easier way where we could just build a script instead of writing it. But im learning slowly!
User avatar
Beryl
Sergeant Major of the Army
Sergeant Major of the Army
 
Posts: 198
Joined: Fri Nov 27, 2020 7:47 pm

Previous

Return to GPC2 Script Programming

Who is online

Users browsing this forum: No registered users and 93 guests