tactical strobe light with auto spot for ps4.

A combo of to script, remember to press R3 to stop the strobe light for working.
Version1.00
AuthorNEB3002
Publish DateFri, 16 May 2014 - 17:56
Last UpdateFri, 16 May 2014 - 17:56
Downloads27
RATE


1

0

Release Notes: remember the idea for the strobe is mess up the other aim and shoots on, to win face to face firefights.
Code: Select all
define StartButton = PS4_R1;
define ComboButton = PS4_R1;
int rapidFireButton = PS4_L2;
define ComboButton1 = PS4_UP;
int rapid_onoff = TRUE;
int hold_time, rest_time;
define RATE_OF_FIRE = 8; // Range: 1 to 25 RPS (Round/s)
 
define HoldTime = 100;
define RestTime = 100;
 
int run;
init {
      hold_time = 500 / RATE_OF_FIRE;
      rest_time = hold_time - 20;
      if(rest_time < 0) rest_time = 0;
 
}
 
main {
     if(event_press(PS4_R3)) rapid_onoff = !rapid_onoff;
     if(get_val(PS4_L2) && rapid_onoff) {combo_run(RapidFire);
     } else if(combo_running(RapidFire)) {combo_stop(RapidFire);
 
}
    if(run > 0) {
        combo_run(AutomatedCombo);
    } else {
        combo_stop(AutomatedCombo);
 
    }
 
    if(event_press(StartButton)) {
        if(run == 1) {
            run = 0;
        } else {
            run = 1;
        }
    }
}
 
combo AutomatedCombo {
    set_val(ComboButton, 1);
    wait(HoldTime);
    set_val(ComboButton, 0);
    wait(RestTime);
    set_val(ComboButton, 0);
    set_val(ComboButton, 0);
}
 
combo RapidFire {
    set_val(PS4_UP, 100);
    wait(hold_time);
    set_val(PS4_UP, 0);
    wait(rest_time);
    set_val(PS4_UP, 0);
}