#pragma METAINFO("RainbowSixSiege_ModPack_byDerivates", 1, 0, "Derivates")
#include <keyboard.gph>
#include "xkeys.gph"
init {
// Load an Keyboard Mapping to reproduce the default BF1 layout
const uint8 map[] = {
KEY_W, STICK_2_Y | KEYMAP_NEGATIVE, // Forward
KEY_A, STICK_2_X | KEYMAP_NEGATIVE, // Left
KEY_S, STICK_2_Y, // Backwards
KEY_D, STICK_2_X, // Right
KEY_R, BUTTON_17, // Square
KEY_SPACEBAR, BUTTON_16, // Cross (X)
KEY_C, BUTTON_15, // Circle (O)
KEY_1, BUTTON_14, // Triangle
KEY_LEFTALT, BUTTON_9, // L3
KEY_Q, BUTTON_9, // L3
KEY_E, BUTTON_6, // R3
KEY_K, BUTTON_7, // L1
KEY_L, BUTTON_4, // R1
KEY_B, BUTTON_10, // D-Pad-Up
KEY_Z, BUTTON_12, // D-Pad-Left
KEY_6, BUTTON_13, // D-Pad-Right
KEY_5, BUTTON_11, // D-Pad-Down
KEY_TAB, BUTTON_2, // Touch-Pad
KEY_PRINTSCREEN, BUTTON_18, // Share
KEY_ESCAPE, BUTTON_3, // Options
KEY_RIGHTGUI, BUTTON_1, // PS-Button
};
keymapping(map);
}
// DEFINES
#define SLOW_WALK_KEY KEY_LEFTCONTROL // LEFT_CONTROL used to reduce left stick movent (no toggle)// (SETTINGS)
#define SPIN_KEY_180 KEY_X // Press "T" to perform a 180 spin // (SETTINGS)
#define SPIN_KEY_360 KEY_T // Press "T" to perform a 360 spin // (SETTINGS)
#define RAPID_FIRE_KEY KEY_F1 // F1 enables/disables Rapid-Fire //
#define ANTI_RECOIL_KEY KEY_F2 // F2 " Anti-Recoil //
#define CROUCH_SPAM_KEY KEY_F3 // F3 " Crouch-Spam //
#define LEAN_SPAM_KEY KEY_F4 // F4 " Lean-Spam //
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// TOGGLES
bool RapidFire = TRUE;
bool AntiRecoil = TRUE;
bool CrouchSpam = FALSE;
bool LeanSpam = FALSE;
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// VARIABLES & DEFINES [SETTINGS]
fix32 RECOIL_V = 6.0;
#define SLOW_WALK_SPEED 60.0
#define SPIN_TIME_360 400 // Adjust for correct spin //
#define SPIN_TIME_180 235 // Adjust for correct spin //
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Slow-Movement
main {
if(key_status(SLOW_WALK_KEY)) {
if(get_val(STICK_2_X) <= -SLOW_WALK_SPEED) { set_val(STICK_2_X, -SLOW_WALK_SPEED); }
if(get_val(STICK_2_X) >= SLOW_WALK_SPEED) { set_val(STICK_2_X, SLOW_WALK_SPEED); }
if(get_val(STICK_2_Y) <= -SLOW_WALK_SPEED) { set_val(STICK_2_Y, -SLOW_WALK_SPEED); }
if(get_val(STICK_2_Y) >= SLOW_WALK_SPEED) { set_val(STICK_2_Y, SLOW_WALK_SPEED); }
}
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Spinning 180
main {
if (key_status(SPIN_KEY_180)) {
combo_run(cSpin180);
}
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Spinning 360
main {
if (key_status(SPIN_KEY_360)) {
combo_run(cSpin360);
}
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Rapid-Fire
main {
// toggle
if (key_status(RAPID_FIRE_KEY)) RapidFire = !RapidFire;
// run only when it is enabled and you press BUTTON_5
if (RapidFire) {
if (get_actual(BUTTON_8) && get_actual(BUTTON_5)) combo_run(cRapidFire);
if (event_release(BUTTON_5)) combo_stop(cRapidFire);
}
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Anti-Recoil
main {
// toggle
if (key_status(ANTI_RECOIL_KEY)) AntiRecoil = !AntiRecoil;
// run only when it is enabled and you press BUTTON_5
if (AntiRecoil && get_val(BUTTON_5)) {
set_val(STICK_1_Y,(RECOIL_V * (100.0 - abs(get_val(STICK_1_Y)))) / 100.0 + get_val(STICK_1_Y));
}
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Crouch-Spam
main {
// toggle
if (key_status(CROUCH_SPAM_KEY)) CrouchSpam = !CrouchSpam;
// run only when it is enabled and you press BUTTON_5
if (CrouchSpam) {
if (get_actual(BUTTON_8) && get_actual(BUTTON_5)) combo_run(cCrouchSpam);
if (event_release(BUTTON_5)) combo_stop(cCrouchSpam);
}
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Lean-Spam
main {
// toggle
if (key_status(LEAN_SPAM_KEY)) LeanSpam = !LeanSpam;
// run only when it is enabled and you press BUTTON_5
if (LeanSpam) {
if (get_actual(BUTTON_8) && get_actual(BUTTON_5)) combo_run(cLeanSpam);
if (event_release(BUTTON_5)) combo_stop(cLeanSpam);
}
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Parkour Mod
main {
if (check_active(BUTTON_16,960)) combo_run(cParkour);
if (event_release(BUTTON_16)) combo_stop(cParkour);
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// COMBOS
combo cRapidFire {
set_val(BUTTON_5,100);
wait(64);
set_val(BUTTON_5,0);
wait(17);
}
combo cCrouchSpam {
set_val(BUTTON_15,100);
wait(25);
set_val(BUTTON_15,0);
wait(25);
}
combo cLeanSpam {
set_val(BUTTON_9,100);
wait(100);
set_val(BUTTON_6,100);
wait(100);
}
combo cParkour {
set_val(BUTTON_16,0);
wait(80);
set_val(BUTTON_16,100);
wait(80);
}
combo cSpin180 {
set_val(STICK_1_X,100);
wait(SPIN_TIME_180); // Adjust settings at top of script //
wait(0);
}
combo cSpin360 {
set_val(STICK_1_X,100);
wait(SPIN_TIME_360); // Adjust settings at top of script //
wait(0);
}