Rapid Fire Toggle Support
4 posts
• Page 1 of 1
Rapid Fire Toggle Support
Hello All. I am trying to create a toggle key (Button_20) so that I can toggle on and off my rapid fire combo.
I am a new titan 2 user and have a very basic understanding of scripting. I would also like an LED indictor so I know if the rapid fire is on or off. Right now my rapid fire works fine but I need to hold down Button_20 for the rapid fire to stop. I anyone could help me create a toggle button (that doesn't need to be pressed while firing) with LED indicator I would appreciate it. Thank you
I am a new titan 2 user and have a very basic understanding of scripting. I would also like an LED indictor so I know if the rapid fire is on or off. Right now my rapid fire works fine but I need to hold down Button_20 for the rapid fire to stop. I anyone could help me create a toggle button (that doesn't need to be pressed while firing) with LED indicator I would appreciate it. Thank you
- Code: Select all
main {
if(get_val(BUTTON_5)) {
combo_run(Rapidfire);
}
if(get_val(BUTTON_20)) {
combo_stop(Rapidfire);
}
}
combo Rapidfire {
set_val(BUTTON_5, 100);
wait(12);
set_val(BUTTON_5, 0);
wait(12);
set_val(BUTTON_5, 0);
}
-
Lifty - Corporal
- Posts: 4
- Joined: Tue Aug 13, 2019 12:23 am
Re: Rapid Fire Toggle Support
- Code: Select all
#define RF_HOLD 33
#define RF_RELEASE 64
bool rapidfire;
init {
led(255,0,0);
}
main {
if (event_active(19)) {
rapidfire = !rapidfire;
if(rapidfire) led(0,255,0);
else led(255,0,0);
}
if(rapidfire && get_actual(4)) combo_run(RapidFire);
}
void led(int8 r, int8 g, int8 b) {
led_set(LED_1, (fix32)b, 0);
led_set(LED_2, (fix32)r, 0);
led_set(LED_3, (fix32)g, 0);
return;
}
combo RapidFire {
set_val(4, 100);
wait(RF_HOLD);
set_val(4, 0);
wait(RF_RELEASE);
}
ConsoleTuner Support Team || ConsoleTuner Discord || InputSense Discord
- Mad
- Major General
- Posts: 4536
- Joined: Wed May 22, 2019 5:39 am
Re: Rapid Fire Toggle Support
Thank you for the reply Mad.The scripts works beautifully! I appreciate you getting back to me!
-
Lifty - Corporal
- Posts: 4
- Joined: Tue Aug 13, 2019 12:23 am
Re: Rapid Fire Toggle Support
You're welcome
ConsoleTuner Support Team || ConsoleTuner Discord || InputSense Discord
- Mad
- Major General
- Posts: 4536
- Joined: Wed May 22, 2019 5:39 am
4 posts
• Page 1 of 1
Return to GPC2 Script Programming
Who is online
Users browsing this forum: No registered users and 102 guests