// GPC Online Library
// multiplatform_antirecoil__rapid_fire.gpc
/* *
Features; Rapid Fire (Adjustable), Anti-Recoil Vertical + Horizontal
Author: JaggedDiamond
System: MULTI
Controller: MULTI - Optimized for MOUSE & KEYBOARD
GAME: Battlefield series - COD series - Black Ops series
************************************************************/
define ONLY_WITH_SCOPE = TRUE;// Use Anti-recoil only when scoping
define ANTI_RECOIL = 0; //change "0" to compensate vertical recoil (0 - 100)
define ANTI_RECOIL_LEFT = 0; //change this value to compensate to the left (0 - 100)
define ANTI_RECOIL_RIGHT = 0; //change this value to compensate to the right (0 - 100)
/* *
* SIMPLE RAPID FIRE
* *************************************************************************** */
define RAPIDFIRE_BUTTON = XB360_RT;
define RATE_OF_FIRE = 16; // Range: 1 to 25 RPS (Round/s) between 16 and 18, rapid fire works best if you are planning on using it for the Five-Seven in BO2
// Values higher than 25 would be so fast that the
// Game probably will not detect 100% of the events.
///////////////////////////////////////////////////////////////////////////////////////////
int fire_button, scope_button;
int anti_recoil;
int anti_recoil_left;
int anti_recoil_right;
int hold_time, rest_time;
init {
if(get_console() == PIO_XB360) { // Xbox 360 Trigger & Bumper
fire_button = 3;
scope_button = 6;
} else { // Natural Trigger & Bumper
fire_button = 4;
scope_button = 7;
}
hold_time = 500 / RATE_OF_FIRE;
rest_time = hold_time - 20;
if(rest_time < 0) rest_time = 0;
}
main {
if(!ONLY_WITH_SCOPE || get_val(scope_button)) {
combo_run(AntiRecoil);
}
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);
}
combo AntiRecoil { // This combo must be the last one
if(get_val(fire_button)) {
anti_recoil = get_val(10) + ANTI_RECOIL;
if(anti_recoil > 100) anti_recoil = 100;
set_val(10, anti_recoil);
anti_recoil_left = get_val(9) -ANTI_RECOIL_LEFT;
if(anti_recoil_left > 100) anti_recoil_left = 100;
set_val(9, anti_recoil_left);
anti_recoil_right = get_val(9) +ANTI_RECOIL_RIGHT;
if(anti_recoil_right > 100) anti_recoil_right = 100;
set_val(9, anti_recoil_right);
}
}