Akimbo Rapid Fire

Change the rate of fire values to your liking
Version1.00
AuthorGLaDOS
Publish DateSun, 12 Jan 2014 - 21:24
Last UpdateSun, 12 Jan 2014 - 21:24
Downloads211
RATE


2

0

Code: Select all
  define RAPIDFIRE_BUTTON1 = XB360_RT;
    define RAPIDFIRE_BUTTON2 = XB360_LT;
 
    define RATE_OF_FIRE1 = 20// Range: 1 to 25 RPS (Round/s)
    define RATE_OF_FIRE2 = 20// Values higher than 25 would be so
                                // fast that the game probably will
                                // not detect 100% of the events.
 
    //
    // No need to make changes in the code below.
    //
 
    int hold_time1, rest_time1;
    int hold_time2, rest_time2;
 
    init {
        hold_time1 = 500 / RATE_OF_FIRE1;
        rest_time1 = hold_time1 - 20;
        if(rest_time1 < 0) rest_time1 = 0;
 
        hold_time2 = 500 / RATE_OF_FIRE2;
        rest_time2 = hold_time2 - 20;
        if(rest_time2 < 0) rest_time2 = 0;
    }
 
    main {
        if(get_val(RAPIDFIRE_BUTTON1)) {
            combo_run(RapidFire1);
        } else if(combo_running(RapidFire1)) {
            combo_stop(RapidFire1);
        }
 
        if(get_val(RAPIDFIRE_BUTTON2)) {
            combo_run(RapidFire2);
        } else if(combo_running(RapidFire2)) {
            combo_stop(RapidFire2);
        }
    }
 
    combo RapidFire1 {
        set_val(RAPIDFIRE_BUTTON1, 100);
        wait(hold_time1);
        set_val(RAPIDFIRE_BUTTON1, 0);
        wait(rest_time1);
        set_val(RAPIDFIRE_BUTTON1, 0);
    }
 
    combo RapidFire2 {
        set_val(RAPIDFIRE_BUTTON2, 100);
        wait(hold_time2);
        set_val(RAPIDFIRE_BUTTON2, 0);
        wait(rest_time2);
        set_val(RAPIDFIRE_BUTTON2, 0);
    }