Basic Toggle On/Off with LED/Rumble feedback

Need a basic idea on how to turn On or Off your script? This one is very simple (ADS Trigger + D-Pad Left) to turn On or Off. Visual LED and Rumble feedback included. The combo RapidFire has been added to illustrate how this code works.
Version1.0
AuthorVendetta
Publish DateThu, 18 Aug 2016 - 20:40
Last UpdateThu, 18 Aug 2016 - 20:40
Downloads143
RATE


1

0

Code: Select all
 
/*
* ===============================================================================================================================================
 * Author: Vendetta
 * Game:
 * Weapon: 
 * System:  PS4
 * Controller:  SCUF PS4 (x,o Paddles)
 * Controller Game Settings:  Default
 * Script version:  1.0
 * Code: Contains code sourced from: The_Rabid_Taco
 * Website:  consoletuner.com
 
 * Featuring:
    * Toggle On/Off [ADS trigger + D-Pad left]
    * RED LED = Off
    * GREEN LED = On
    * Rumble Notifier when ON
    * RapidFire on ADS  (RapidFire is set for MIDA Multi-tool [Destiny]
* ===============================================================================================================================================
*/

 
int Enabled = FALSE;
 
 
main {
    if(get_val(PS4_L2) && event_press(PS4_LEFT)) {  //ads trigger + D-Pad left
        if(Enabled) {
            Enabled = FALSE;
            colorled(0,1,0,0)//red Off
        }  else if(!Enabled) {
            Enabled = TRUE;
            colorled(0,0,1,0)//green On
            combo_run(RumbleNotifier);
        }
    }
 
    if ((get_val(PS4_R2) > 0)  && (get_val(PS4_L2) > 0) &&  (Enabled)) {
        combo_run(RapidFire); // any combo can go here, RapidFire is just an example
    } else combo_stop(RapidFire);
}   
 
combo RapidFire {
    set_val(PS4_R2, 100);
    wait (150);
    set_val(PS4_R2, 0);
    wait (25);
}
 
combo RumbleNotifier {
    set_rumble(RUMBLE_A, 100); // 100 is max rumble
    wait(300);
    reset_rumble ();
}
 
function colorled(a,b,c,d) {
    set_led(LED_1,a);
    set_led(LED_2,b);
    set_led(LED_3,c);
    set_led(LED_4,d);
}