Simple Rapid Fire

Easily configure the "Rapid Fire" feature in one button of your controller. You just need to enter which button you want the "Rapid Fire", and the value of the rate of fire.
Versionv1.00
AuthorConsoleTuner
Publish DateWed, 11 Jan 2012 - 09:32
Last UpdateWed, 11 Jan 2012 - 09:32
Downloads2827
RATE


8

0

Code: Select all
/* *
*  SIMPLE RAPID FIRE
* *************************************************************************** */

 
define RAPIDFIRE_BUTTON = XB360_RT;
 
define RATE_OF_FIRE = 15;   // Range: 1 to 25 RPS (Round/s)
                            // 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_time, rest_time;
 
init {
    hold_time = 500 / RATE_OF_FIRE;
    rest_time = hold_time - 20;
    if(rest_time < 0) rest_time = 0;
}
 
main {
    if(get_val(RAPIDFIRE_BUTTON)) {
        combo_run(RapidFire);
    } else if(combo_running(RapidFire)) {
        combo_stop(RapidFire);
    }
}
 
combo RapidFire {
    set_val(RAPIDFIRE_BUTTON, 100);
    wait(hold_time);
    set_val(RAPIDFIRE_BUTTON, 0);
    wait(rest_time);
    set_val(RAPIDFIRE_BUTTON, 0);
}