Please help spam 4 buttons same time

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

Please help spam 4 buttons same time

Postby Mike11111 » Thu Jun 23, 2022 10:34 pm

Hi im trying to spam a,b,x,y buttons on xbox 1 at the same time after pressing the ls button for the titan 2. could someone please look at my code and tell me how to adjust it. if 4 buttons cannot be pressed at the same time to achieve turbo buttons for all 4. then how can i rapidly press one then move onto the next and so on..on a loop until the button is released. thanks for any help

Code: Select all
#pragma METAINFO("<WWE 2K22 D-PAD REMAP>", 1, 0, "Barrie Ellis")
#include <xb1.gph>         // XB1 terms
 
main
{
if (get_actual(XB1_UP)) { set_val(XB1_RT, 100.0);set_val(XB1_X, 100.0);set_val(XB1_UP, 0.0); }
if (get_actual(XB1_DOWN)) { set_val(XB1_RT, 100.0);set_val(XB1_Y, 100.0);set_val(XB1_X, 100.0);set_val(XB1_DOWN, 0.0); }
if (get_actual(XB1_LEFT)) { set_val(XB1_RT, 100.0);set_val(XB1_A, 100.0);set_val(XB1_LEFT, 0.0); }
if (get_actual(XB1_RIGHT)) { set_val(XB1_RT, 100.0);set_val(XB1_B, 100.0);set_val(XB1_RIGHT, 0.0); }
if(get_actual(XB1_LS)) {
    combo_run(Spam);
  }
}
 
combo Spam {
  set_val(XB1_A, 100);
  set_val(XB1_B, 100);
    set_val(XB1_Y, 100);
     set_val(XB1_X, 100);
  wait(40);
  set_val(XB1_A, 0);
  set_val(XB1_B, 0);
    set_val(XB1_Y, 0);
    set_val(XB1_X, 0);
  wait(40);   
}
User avatar
Mike11111
Sergeant
Sergeant
 
Posts: 7
Joined: Sun Apr 24, 2022 3:16 am

Re: Please help spam 4 buttons same time

Postby Mad » Thu Jun 23, 2022 10:44 pm

Your code works fine for me. What's the issue you're having?
If they're not pressing in game increase the wait() times in the spam combo. It is currently set to hold the buttons for 40 ms then released for 40ms
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: Please help spam 4 buttons same time

Postby Mike11111 » Thu Jun 23, 2022 10:53 pm

hey thanks for responding..for some reason only the a button is activated
User avatar
Mike11111
Sergeant
Sergeant
 
Posts: 7
Joined: Sun Apr 24, 2022 3:16 am

Re: Please help spam 4 buttons same time

Postby Mad » Thu Jun 23, 2022 10:59 pm

If you take a look at the device monitor tab in Gtuner you can hold LS and watch all 4 buttons get spammed.

40ms may be to quick for the game to register correctly.
Try slowly increasing it until you find the right timing;
Code: Select all
combo Spam {
    set_val(XB1_A, 100);
    set_val(XB1_B, 100);
    set_val(XB1_Y, 100);
    set_val(XB1_X, 100);
    wait(60);
    set_val(XB1_A, 0);
    set_val(XB1_B, 0);
    set_val(XB1_Y, 0);
    set_val(XB1_X, 0);
    wait(60);   
}
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: Please help spam 4 buttons same time

Postby Mike11111 » Thu Jun 23, 2022 11:21 pm

.thanks for your help. so far ive tried it on 60 and 70 ms and still only the a button works....
its a 2k22 wwe wrestling game..and the buttons a,b,x,y have to be tapped repeatedly as they change from a to x or b or y on the game...maybe it stops at a since thats the first command being called?
User avatar
Mike11111
Sergeant
Sergeant
 
Posts: 7
Joined: Sun Apr 24, 2022 3:16 am

Re: Please help spam 4 buttons same time

Postby Mad » Fri Jun 24, 2022 1:17 am

Probably just how the game works then so you'll need to do them separately.
You can do something like this. LS+the button you want to spam;
Code: Select all
#pragma METAINFO("<WWE 2K22 D-PAD REMAP>", 1, 0, "Barrie Ellis")
#include <xb1.gph>         // XB1 terms
main {
    if(is_active(XB1_UP)) {
        set_val(XB1_RT, 100.0);
        set_val(XB1_X, 100.0);
        set_val(XB1_UP, 0.0);
    }
    if(is_active(XB1_DOWN)) {
        set_val(XB1_RT, 100.0);
        set_val(XB1_Y, 100.0);
        set_val(XB1_X, 100.0);
        set_val(XB1_DOWN, 0.0);
    }
    if(is_active(XB1_LEFT)) {
        set_val(XB1_RT, 100.0);
        set_val(XB1_A, 100.0);
        set_val(XB1_LEFT, 0.0);
    }
    if(is_active(XB1_RIGHT)) {
        set_val(XB1_RT, 100.0);
        set_val(XB1_B, 100.0);
        set_val(XB1_RIGHT, 0.0);
    }
 
    if(is_active(XB1_LS)) {
        if(is_active(XB1_A)) {
            set_val(XB1_A, time_active(XB1_A)%100<40);
        }
        if(is_active(XB1_X)) {
            set_val(XB1_X, time_active(XB1_X)%100<40);
        }   
        if(is_active(XB1_B)) {
            set_val(XB1_B, time_active(XB1_B)%100<40);
        }   
        if(is_active(XB1_Y)) {
            set_val(XB1_Y, time_active(XB1_Y)%100<40);
        }
    }
}
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: Please help spam 4 buttons same time

Postby Mike11111 » Fri Jun 24, 2022 1:52 am

Thanks for taking the time...ill try this out
User avatar
Mike11111
Sergeant
Sergeant
 
Posts: 7
Joined: Sun Apr 24, 2022 3:16 am

Re: Please help spam 4 buttons same time

Postby Mike11111 » Fri Jun 24, 2022 2:55 am

You sir are a super boss. Thank you so much. Its working now. To make it press the button faster do i increase the 100 or the 40.. sorry big learning curve for me. And thanks again
User avatar
Mike11111
Sergeant
Sergeant
 
Posts: 7
Joined: Sun Apr 24, 2022 3:16 am


Return to GPC2 Script Programming

Who is online

Users browsing this forum: kubawaz and 128 guests