// Made by Excalibur and Blitznos
// PS4 ONLY
// Only meant for Dualshock 4
// colorled(0,0,0,0); // Off / No LED light
// colorled(1,0,0,0); // Dim Blue
// colorled(0,1,0,0); // Dim Red
// colorled(0,0,1,0); // Dim Lime/Green
// colorled(0,0,0,1); // Dim Fuchsia/Pink
// colorled(1,0,1,0); // Dim SkyBlue
// colorled(0,1,1,0); // Dim Yellow
// colorled(1,1,1,1); // Dim White
// colorled(2,0,0,0); // Blue
// colorled(0,2,0,0); // Red
// colorled(0,0,2,0); // Lime/Green
// colorled(0,0,0,2); // Fuchsia/Pink
// colorled(2,0,2,0); // SkyBlue
// colorled(0,2,2,0); // Yellow
// colorled(2,2,2,2); // White
// colorled(3,0,0,0); // Bright Blue
// colorled(0,3,0,0); // Bright Red
// colorled(0,0,3,0); // Bright Lime/Green
// colorled(0,0,0,3); // Bright Fuchsia/Pink
// colorled(3,0,3,0); // Bright SkyBlue
// colorled(0,3,3,0); // Bright Yellow
// colorled(3,3,3,3); // Bright white
// ColorLed (1) Dim light
// ColorLed (2) Normal/Medium
// ColorLed (3) Bright light
// *If you edit more than '3' for LED brightness is useless i tested already*
// My LED setup for normal and rapid fire:
// *Normal: Dim Lime/Green* *Rapid Fire: Bright SkyBlue*
// If you don't know how to change the button heres the link down below:
// http://consoletuner.com/forums/attachment.php?attachmentid=289&d=1396970207
// To turn on the Rapid Fire mod (SQUARE + R2) press together to turn up for WHAT?
//--------------------------------------------------------------
define RAPIDFIRE_BUTTON = PS4_R2;
define SELECT = PS4_SQUARE; //*You can change whatever button*
define START = PS4_R2; //*You can change whatever button also*
define RATE_OF_FIRE = 20; // Range: 1 to 25 RPS (Round/s)
//--------------------------------------------------------------
// *DO NOT EDIT/DELETE THIS SECTION*
int rapid_onoff = FALSE;
int hold_time;
int rest_time;
//INITIALIZATION - init
//--------------------------------------------------------------
init {
hold_time = 500 / RATE_OF_FIRE;
rest_time = hold_time - 20;
if(rest_time < 0) rest_time = 0;
}
//MAIN BLOCK RUTINES
//--------------------------------------------------------------
main { // Start of MAIN BLOCK
if(get_val(SELECT) && event_press(START)) rapid_onoff = !rapid_onoff; //sets variable to TRUE or FALSE when both buttons are pressed.
// COLOR INDICATION FOR the RAPID FIRE ON / OFF
if(!rapid_onoff)colorled(0,0,1,0); // OFF (Dim Lime/Green) *you can edit here*
if(rapid_onoff)colorled(3,0,3,0); // (Bright SkyBlue) *you can edit here*
if(get_val(RAPIDFIRE_BUTTON) && rapid_onoff) { //Now Looks for a "TRUE" value of rapid_onoff
combo_run(RapidFire);
} else if(combo_running(RapidFire)) {
combo_stop(RapidFire);
}
}// End of MAIN BLOCK
//COMBO BLOCKS
//--------------------------------------------------------------
combo RapidFire {
set_val(RAPIDFIRE_BUTTON, 100);
wait(hold_time);
set_val(RAPIDFIRE_BUTTON, 0);
wait(rest_time);
set_val(RAPIDFIRE_BUTTON, 0);
}
// COLOR LED INDICATION for PS4 *NO NEED TO EDIT BELOW*
//--------------------------------------------------------------
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);
}