UltraScript

Does lots of things including full LED customization and others. Is not done yet, read the comments at the beginning of the script.
Version0.1b
Authorrenfrozodiac
Publish DateWed, 9 Jul 2014 - 00:55
Last UpdateWed, 9 Jul 2014 - 00:55
Downloads371
RATE


0

0

Release Notes: Beta.
Code: Select all
/* US- UltraScript
        by renfrozodiac   
 
 
                This is a prototype for something I'm building. It's not done yet. Honestly, I'm only uploading this because of easy access.
 
 
Contact: [email protected] -- contact me here if you have any problems with the script.
 
 
Enjoy.
*/

 
 
 
define INITIAL_STATE = FALSE; //Do not change
define BRIGHT = 1; //Do not change
define ZERO = 0; //DO not change
define Prone = PS4_R3; //Change this to whichever button you want
define RFR2Delay = 40; /*This is the rate of fire for how fast the rapid fire mod will function. Change the number to whatever you want, but keep
                       in mind if it's faster than a 30ms delay your console may not recognize it. */

define RFL2Delay = 40; //Same as RFR2 delay
define DropshotTrigger = PS4_R2;//Change this to whichever button you want. This is the button that will trigger the dropshot.
define SoundshotTrigger = PS4_R2; //Same concept as the dropshot trigger.
define XDelay = 30; //Rate of fire for the XMash combo. Once again, you should keep it at 30ms or slower.
define QSDelay = 20; //Delay for quickscope.
define QSTrigger = PS4_L2; //Button for quickscope. Change to whatever you want.
 
//Start of int block. Don't change anything here.
int DELAY = 400;
int a = 0;
int b = 0;
int c = 0;
int d = 0;
int LED = INITIAL_STATE;
int RFR2 = INITIAL_STATE;
int RU = INITIAL_STATE;
int XON = INITIAL_STATE;
int DSON = INITIAL_STATE;
int RFL2 = INITIAL_STATE;
int SS = INITIAL_STATE;
int QS = INITIAL_STATE;
int XTOL1 = INITIAL_STATE;
//End of int block.
 
 
 
 
 
main {
    //Start of function enablers.
 
    if(get_val(PS4_DOWN) && get_val(PS4_R1) && event_press(PS4_CROSS)){
        XTOL1 = !XTOL1;
    } //Makes L1 behave like CROSS. Turns this on.
 
 
    if(get_val(PS4_UP) && get_val(PS4_R2) && event_press(PS4_CROSS)){
        QS = !QS; //Toggles quickscope. When on, L2 triggers the combo.
    }
 
    if(get_val(PS4_DOWN) && get_val(PS4_L2) && event_press(PS4_TRIANGLE)){
        SS = !SS; //Toggles soundshot. When on, R2 triggers the combo.
    }
 
    if(get_val(PS4_DOWN) && get_val(PS4_R2) && event_press(PS4_CROSS)){
        RFR2 = !RFR2; //Toggles rapid fire for R2.
    }
 
    if(get_val(PS4_DOWN) && get_val(PS4_L2) && event_press(PS4_CROSS)){
        RFL2 = !RFL2; //Toggles rapid fire for L2.
    }
 
    if(get_val(PS4_DOWN) && get_val(PS4_L2) && event_press(PS4_CIRCLE)){
        DSON = !DSON; //Toggles dropshot. Will disable dropshot when L2 is pressed.
    }
 
    if(get_val(PS4_DOWN) && get_val(PS4_L2) && event_press(PS4_SQUARE)){
        RU = !RU; //Toggles rumble.
    }
 
    if(get_val(PS4_TOUCH) && event_press(PS4_CROSS)){
        XON = !XON; //Toggles X mash or rapid fire for the CROSS button.
    }
 
    //End of function enablers.
 
    if(QS && get_val(QSTrigger)) combo_run(QuickScope);
 
    if(QS && get_val(QSTrigger)){
    set_val(QSTrigger, 0);
    }
 
    if(XON && get_val(PS4_CROSS)) combo_run(XMash);
 
 
    if(RFR2 && get_val(PS4_R2)) combo_run(RapidFireR2);
 
    if(RFL2 && get_val(PS4_L2)) combo_run(RapidFireL2);
 
    if(RU && get_val(PS4_R2)){
    set_rumble(RUMBLE_A, 86);
    set_rumble(RUMBLE_B, 66);
    }
 
    else {
    set_rumble(RUMBLE_A, 0);
    set_rumble(RUMBLE_B, 0);
    }
 
 
    if(get_val(PS4_L2) && get_val(PS4_R2) && event_press(PS4_TOUCH)){
        LED = !LED;
    }
 
    if(DSON && !get_val(PS4_L2) && get_val(DropshotTrigger)){
    set_val(PS4_R3, 100);
    }
 
    if(SS && get_val(SoundshotTrigger)) combo_run(Soundshot);
 
    if(XTOL1 && get_val(PS4_L1)){
        set_val(PS4_CROSS, 100);
        set_val(PS4_L1, 0);
    }
 
//Start of quickscope delay changes.
 
    if(QS && get_val(PS4_DOWN)) combo_run(QuickScopeLEDTest);
 
    if(QS && !get_val(PS4_DOWN) && combo_running(QuickScopeLEDTest)){
        combo_stop(QuickScopeLEDTest);
    }
 
    if(QS && get_val(PS4_DOWN) && event_press(PS4_L1)){
        DELAY = DELAY - QSDelay;
    }
 
    if(QS && get_val(PS4_DOWN) && event_press(PS4_R1)){
        DELAY = DELAY + QSDelay;
    }
 
    if(DELAY > 1200) DELAY = 1200;
    if(DELAY < 200) DELAY = 200;
 
//End of quickscope delay changes.   
 
 
 
//Start of LED block. You won't need to change anything here.
 
led(a,b,c,d)
 
 
 
    //LED 1
    if(LED && event_press(PS4_CROSS)){
        a = a + BRIGHT;
    }
 
    if(LED && event_press(PS4_DOWN)){
        a = a - BRIGHT;
    }
    //LED 1
 
    //LED 2
    if(LED && event_press(PS4_CIRCLE)){
        b = b + BRIGHT;
    }
 
    if(LED && event_press(PS4_RIGHT)){
        b = b - BRIGHT;
    }
    //LED 2
 
    //LED 3
    if(LED && event_press(PS4_TRIANGLE)){
        c = c + BRIGHT;
    }
 
    if(LED && event_press(PS4_UP)){
        c = c - BRIGHT;
    }
    //LED 3
 
    //LED 4
    if(LED && event_press(PS4_SQUARE)){
        d = d + BRIGHT;
    }
 
    if(LED && event_press(PS4_LEFT)){
        d = d - BRIGHT;
    }
    //LED 4
 
 
}
 
//End of main and LED block.
 
 
//Start of combo block.
    combo RapidFireR2 {
    set_val(PS4_R2, 100);
    wait(RFR2Delay);
    set_val(PS4_R2, 0);
    wait(RFR2Delay);
    }
 
    combo XMash {
    set_val(PS4_CROSS, 100);
    wait(XDelay);
    set_val(PS4_CROSS, 0);
    wait(XDelay);
    }
 
    combo RapidFireL2 {
    set_val(PS4_L2, 100);
    wait(RFL2Delay);
    set_val(PS4_L2, 0):
    wait(RFL2Delay);
    }
 
    combo Soundshot {
    set_val(PS4_R2, 100);
    wait(30);
    set_val(PS4_R1, 100);
    set_val(PS4_R2, 100);
    wait(250);
    set_val(PS4_R1, 100);
    set_val(PS4_R2, 0);
    wait(410);
    set_val(PS4_R1, 100);
    set_val(PS4_TRIANGLE, 100);
    wait(170);
    set_val(PS4_R1, 0);
    set_val(PS4_TRIANGLE, 100);
    wait(10);
    set_val(PS4_TRIANGLE, 0);
 
}
 
    combo QuickScope {
    set_val(PS4_L2, 100);
    wait(DELAY);
    set_val(PS4_R2, 100);
    set_val(PS4_L2, 100);
    wait(100);
    set_val(PS4_R2, 100);
    set_val(PS4_L2, 0);
    wait(40);
    set_val(PS4_R2, 0);
}
    combo QuickScopeLEDTest {
    led(0,3,0,0);
    wait(DELAY);
    led(0,0,3,0);
    wait(90);
    led(0,0,0,0);
    wait(600);
    }
//End of combo block. Don't change anything below this.
 
 
 
function led(a,b,c,d) {
set_led(LED_1,a);
set_led(LED_2,b);
set_led(LED_3,c);
set_led(LED_4,d);
}