[Request] PS4 Adjustable Rapid Fire

GPC1 script programming for Titan One. Code examples, questions, requests.

[Request] PS4 Adjustable Rapid Fire

Postby K240X » Wed Nov 20, 2019 3:15 am

Hello,

I've been looking for a script that allows me to have both R2 and "x" buttons to adjust the amount of times they are pressed like a hair trigger mod.Already tryed turbo max but the game doesnt even register max speed..

The R2 main purpose is to be pressed half way down between 5 and 7 times per second.

For the X is just to avoid ruining another controller :cry: as to move around your horse fast i have to press the x alot..

Can you guys build a script where i can adjust the speed times? Also a way to activate and deactivate the script by pressing L2+DPAD UP.

Thank you for your time.

I hope you guys can help me out. :smile0202:
User avatar
K240X
Sergeant First Class
Sergeant First Class
 
Posts: 20
Joined: Fri May 12, 2017 9:00 pm

Re: [Request] PS4 Adjustable Rapid Fire

Postby Mad » Wed Nov 20, 2019 3:38 am

Did you want rapidfire for R2 and then another one to spam cross?

Or is R2 and cross supposed to be pressed together?
Code: Select all
define RF_HOLD    = 33; // Rapidfire hold
define RF_RELEASE = 64; // Rapidfire release
define X_SPEED    = 60; // Cross hold/release
 
int x, rf;
 
main {
  if(get_val(PS4_L2) && event_press(PS4_UP)) rf=!rf; // L2 + DPAD UP for rapidfire
  if(get_val(PS4_L2) && event_press(PS4_DOWN)) x=!x; // L2 + DPAD DOWN for x spam
 
  if(x) combo_run(Spam_X);
 
  if(rf && get_val(PS4_R2)) combo_run(RapidFire);
}
 
combo RapidFire {
  set_val(PS4_R2, 100);
  wait(RF_HOLD);
  set_val(PS4_R2, 0);
  wait(RF_RELEASE);
}
 
combo Spam_X {
  set_val(PS4_CROSS, 100);
  wait(X_SPEED);
  set_val(PS4_CROSS, 0);
  wait(X_SPEED);
}
ConsoleTuner Support Team || ConsoleTuner Discord || InputSense Discord
Mad
Major General
Major General
 
Posts: 4536
Joined: Wed May 22, 2019 5:39 am

Re: [Request] PS4 Adjustable Rapid Fire

Postby K240X » Wed Nov 20, 2019 11:04 am

Thank you very much, can you change the X spam to actually spam when only pressed?

"Did you want rapidfire for R2 and then another one to spam cross?" - The answer is yes please.

It spams right after i activate it without pressing it, just want to hold it down and have it pressed like 5 times per second would be perfect.

1 more thing, and really don't want want to push my luck here, LED Lights to change when i activate Rapid fire to RED?

Once again, thank you.
User avatar
K240X
Sergeant First Class
Sergeant First Class
 
Posts: 20
Joined: Fri May 12, 2017 9:00 pm

Re: [Request] PS4 Adjustable Rapid Fire

Postby Mad » Wed Nov 20, 2019 3:36 pm

Code: Select all
define RF_HOLD    = 33; // Rapidfire hold
define RF_RELEASE = 64; // Rapidfire release
define X_SPEED    = 60; // Cross hold/release
 
data( 1,                 
2,0,0,0 , //1. Blue                 
0,2,0,0 , //2. Red                   
0,0,2,0 , //3. Green                 
0,0,0,2 , //4. Pink                 
2,0,2,0 , //5. SkyBlue               
0,2,2,0 , //6. Yellow               
2,2,2,2   //7. White                 
);
 
int x, rf;
 
main {
  if(get_val(PS4_L2) && event_press(PS4_UP)) { // L2 + DPAD UP for rapidfire
    rf=!rf;
    if(rf) LED(2);
    else reset_leds();
  }
 
  if(get_val(PS4_L2) && event_press(PS4_DOWN)) x=!x; // L2 + DPAD DOWN for x spam
 
  if(x && get_val(PS4_CROSS)) combo_run(Spam_X);
 
  if(rf && get_val(PS4_R2)) combo_run(RapidFire);
}
 
combo RapidFire {
  set_val(PS4_R2, 100);
  wait(RF_HOLD);
  set_val(PS4_R2, 0);
  wait(RF_RELEASE);
}
 
combo Spam_X {
  set_val(PS4_CROSS, 100);
  wait(X_SPEED);
  set_val(PS4_CROSS, 0);
  wait(X_SPEED);
}
 
function LED(Colour) {           
  set_led(LED_1,dbyte(( Colour * 4)- 3     ));
  set_led(LED_2,dbyte(((Colour * 4)- 3) + 1));
  set_led(LED_3,dbyte(((Colour * 4)- 3) + 2));
  set_led(LED_4,dbyte(((Colour * 4)- 3) + 3));
}
ConsoleTuner Support Team || ConsoleTuner Discord || InputSense Discord
Mad
Major General
Major General
 
Posts: 4536
Joined: Wed May 22, 2019 5:39 am

Re: [Request] PS4 Adjustable Rapid Fire

Postby K240X » Wed Nov 20, 2019 5:12 pm

Thanks alot, working as intended. Cheers.
User avatar
K240X
Sergeant First Class
Sergeant First Class
 
Posts: 20
Joined: Fri May 12, 2017 9:00 pm


Return to GPC1 Script Programming

Who is online

Users browsing this forum: No registered users and 133 guests

cron