Strafe request

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

Re: Strafe request

Postby Tahsin » Mon Aug 16, 2021 8:05 pm

Try this wile stop after 3 sec or when you stop ads
Tahsin wrote:And this works when ADS and doble tap L1

Code: Select all
 
 
main
{
    ///strafe ADS + doble tap L1
   if (get_actual(BUTTON_8)){
       if ( event_active(BUTTON_7) && time_release(BUTTON_7) <250 ) {
       combo_run(AutoStrafe);
     }
     }else {
           combo_stop(AutoStrafe);
     }
}
 
//Auto Strafe
combo AutoStrafe
{
    set_val(STICK_2_X, 100.0);
    wait(600);
    set_val(STICK_2_X, 0.0);
    wait(60);
    set_val(STICK_2_X, -100.0);
    wait(600);
    set_val(STICK_2_X, 0.0);
    wait(60);
    set_val(STICK_2_X, 100.0);
    wait(600);
    set_val(STICK_2_X, 0.0);
    wait(60);
    set_val(STICK_2_X, -100.0);
    wait(600);
    set_val(STICK_2_X, 0.0);
    wait(60);
    set_val(STICK_2_X, 100.0);
    wait(600);
    set_val(STICK_2_X, 0.0);
    wait(60);
    set_val(STICK_2_X, -100.0);
    wait(600);
    set_val(STICK_2_X, 0.0);
    wait(60);
 
   }
 
 
 
 
User avatar
Tahsin
Sergeant Major
Sergeant Major
 
Posts: 100
Joined: Wed May 15, 2019 7:57 am

Re: Strafe request

Postby Beryl » Mon Aug 16, 2021 10:34 pm

Will give it a try now! Cheers
User avatar
Beryl
Sergeant Major of the Army
Sergeant Major of the Army
 
Posts: 198
Joined: Fri Nov 27, 2020 7:47 pm

Re: Strafe request

Postby Beryl » Wed Aug 18, 2021 8:06 pm

Tahsin wrote:Try this wile stop after 3 sec or when you stop ads
Tahsin wrote:And this works when ADS and doble tap L1

Code: Select all
 
 
main
{
    ///strafe ADS + doble tap L1
   if (get_actual(BUTTON_8)){
       if ( event_active(BUTTON_7) && time_release(BUTTON_7) <250 ) {
       combo_run(AutoStrafe);
     }
     }else {
           combo_stop(AutoStrafe);
     }
}
 
//Auto Strafe
combo AutoStrafe
{
    set_val(STICK_2_X, 100.0);
    wait(600);
    set_val(STICK_2_X, 0.0);
    wait(60);
    set_val(STICK_2_X, -100.0);
    wait(600);
    set_val(STICK_2_X, 0.0);
    wait(60);
    set_val(STICK_2_X, 100.0);
    wait(600);
    set_val(STICK_2_X, 0.0);
    wait(60);
    set_val(STICK_2_X, -100.0);
    wait(600);
    set_val(STICK_2_X, 0.0);
    wait(60);
    set_val(STICK_2_X, 100.0);
    wait(600);
    set_val(STICK_2_X, 0.0);
    wait(60);
    set_val(STICK_2_X, -100.0);
    wait(600);
    set_val(STICK_2_X, 0.0);
    wait(60);
 
   }
 
 
 
 


Appreciate your kind help but it aint working for some reason?
User avatar
Beryl
Sergeant Major of the Army
Sergeant Major of the Army
 
Posts: 198
Joined: Fri Nov 27, 2020 7:47 pm

Re: Strafe request

Postby Tahsin » Wed Aug 18, 2021 9:59 pm

Beryl wrote:
Tahsin wrote:Try this wile stop after 3 sec or when you stop ads
Tahsin wrote:And this works when ADS and doble tap L1

Code: Select all
 
 
main
{
    ///strafe ADS + doble tap L1
   if (get_actual(BUTTON_8)){
       if ( event_active(BUTTON_7) && time_release(BUTTON_7) <250 ) {
       combo_run(AutoStrafe);
     }
     }else {
           combo_stop(AutoStrafe);
     }
}
 
//Auto Strafe
combo AutoStrafe
{
    set_val(STICK_2_X, 100.0);
    wait(600);
    set_val(STICK_2_X, 0.0);
    wait(60);
    set_val(STICK_2_X, -100.0);
    wait(600);
    set_val(STICK_2_X, 0.0);
    wait(60);
    set_val(STICK_2_X, 100.0);
    wait(600);
    set_val(STICK_2_X, 0.0);
    wait(60);
    set_val(STICK_2_X, -100.0);
    wait(600);
    set_val(STICK_2_X, 0.0);
    wait(60);
    set_val(STICK_2_X, 100.0);
    wait(600);
    set_val(STICK_2_X, 0.0);
    wait(60);
    set_val(STICK_2_X, -100.0);
    wait(600);
    set_val(STICK_2_X, 0.0);
    wait(60);
 
   }
 
 
 
 


Appreciate your kind help but it aint working for some reason?

I've tested it and it works without issue maybe you put the code in the wrong place
When you ADS dobble tap L1 to get it work
My ADS is on hold .
User avatar
Tahsin
Sergeant Major
Sergeant Major
 
Posts: 100
Joined: Wed May 15, 2019 7:57 am

Re: Strafe request

Postby bonefisher » Thu Aug 19, 2021 1:21 am

Code: Select all
 
#pragma METAINFO("AutoStrafe", 1, 0, "bonefisher")
 
int    strafe_change;
int    t;
uint32 strafe_timeout = 3000;// Change timeout time
 
main {
    if(event_active(BUTTON_8)
    & !strafe_change || (t > strafe_timeout)){
        t = 0,
        strafe_change = !strafe_change;
    }
    if (strafe_change && is_release(STICK_2_X)){
      ++t;
    if (event_active(BUTTON_8)|| (strafe_timeout == 0))
    { t = 0; }
      ...
        combo_run(strafe);
    }
    if(is_release(BUTTON_8)){
        combo_stop(strafe);
    }
}
 
combo strafe
{
    set_val(STICK_2_X, 100f);
    wait(300);
    set_val(STICK_2_X, -100f);
    wait(300);
}
 

Hold ADS trigger to strafe!
bonefisher
Lieutenant General
Lieutenant General
 
Posts: 5413
Joined: Thu Jan 29, 2015 10:49 am

Re: Strafe request

Postby Beryl » Thu Aug 19, 2021 3:25 pm

Thanks alot to you both youv been very kind and helpful
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 107 guests