// GPC Online Library
// BLACK OPS 6 & APEX LEGENDS 1.0.gpc
// Author: SIB3tv
// Link: https://forums.cronusmax.com/gpclib/13905
// Script was generated with | ZEN Scripter # Author: Excalibur | ver. 4.4|
Date :03/14/25| Time: 21:35:18
//
===================================================================================
=====
// Special thanks to Batts, noozbar, DoNotAtMe and all community staff
//
===================================================================================
=====
// Very Special thanks to TAYLORDRIFT who helped me a lot with all new staff in
this app.
//
===================================================================================
=====
// Credits to noozbar for his basic script : Template script with OLED menu -
toggle - editable values - save for 3 profiles
// Credits to Batts for all example script for Cronus ZEN device.
//
===================================================================================
======
//
===================================================================================
======
// Credits to DoNotAtMe for : Polar Aim Assist
//
===================================================================================
======
//
===================================================================================
======
// Credits to LegitCloudzzz for : Polar Antirecoil
//
===================================================================================
======
//
===================================================================================
======
// Credits : NukeOne, Skadezy, SUPA93 for : Auto SLide Cancel
//
===================================================================================
======
//===============================================================
// BUTTON LAYOUT
//===============================================================
define FIRE_BTN = XB360_RB;
define ADS_BTN = XB360_LB;
define SPRINT_BTN = XB360_LS;
define PRONE_BTN = XB360_B;
define JUMP_BTN = XB360_LT;
define SWITCHWEAPON_BTN = XB360_Y;
define RELOAD_BTN = XB360_X;
define MELEE_BTN = XB360_RS;
define TACTICAL_BTN = XB360_A;
define GRANADE_BTN = XB360_RT;
define UP = XB360_UP;
define RIGHT = XB360_RIGHT;
define DOWN = XB360_DOWN;
define LEFT = XB360_LEFT;
define RX = XB360_RX;
define RY = XB360_RY;
define LX = XB360_LX;
define LY = XB360_LY;
//---------------------------------------------------------------------------------
----------
define Blue = 1;
define Red = 2;
define Green = 3;
define Pink = 4;
define SkyBlue = 5;
define Yellow = 6;
define White = 7;
define ColorOFF = 8;
//--------------------------------------
//---------------------------------------------------------------------------------
----------
define AR_Release = 30; // change this value to set when antirecoil stops working
(min: antirecoil value + 10)
define Scope_only = TRUE; // if TRUE Antirecoil IS ON only when scoping - if FALSE,
is always ON
//---------------------------------------------------------------------------------
----------
int RF_hold;
int RF_release;
int AR_vertical;
int AR_horizontal;
int polar_ar_val;
int polar_aasist_radius;
int polar_aasist_steps;
int aabuse_hold;
int aabuse_rest;
//---------------------------------------------------------------------------------
----------
int stick_noise = 5;
int i;
int a;
int a1;
int a2;
int ARVal;
int AR_b_max;
int b_ARVal = 20;
//---------------------------------------------------------------------------------
----------
const int8
Polar_Array[]={100,100,100,100,100,100,100,100,99,99,99,99,98,98,97,97,97,96,95,95,
94,94,93,92,92,91,90,89,89,88,87,86,85,84,83,82,81,
80,79,78,77,75,74,73,72,71,70,69,67,66,65,63,62,61,59,58,56,55,53,52,50,49,47,46,44
,43,41,40,38,36,35,33,31,30,28,26,25,23,21,20,18,16,14,13,11,9,7,
6,4,2,0,-1,-3,-5,-7,-8,-10,-12,-13,-15,-17,-19,-20,-22,-24,-25,-27,-29,-30,-32,-
34,-35,-37,-39,-40,-42,-43,-45,-46,-48,-50,-51,-53,-54,-55,-57,-58,
-60,-61,-62,-64,-65,-66,-68,-69,-70,-71,-73,-74,-75,-76,-77,-78,-79,-80,-81,-82,-
83,-84,-85,-86,-87,-88,-89,-89,-90,-91,-92,-92,-93,-93,-94,-95,-95,
-96,-96,-97,-97,-97,-98,-98,-99,-99,-99,-99,-100,-100,-100,-100,-100,-100,-100,-
100,-100,-100,-100,-100,-100,-100,-99,-99,-99,-98,-98,-98,-97,-97,
-96,-96,-95,-94,-94,-93,-93,-92,-91,-90,-90,-89,-88,-87,-86,-85,-84,-83,-82,-81,-
80,-79,-78,-77,-76,-75,-74,-72,-71,-70,-69,-67,-66,-65,-63,-62,-61,
-59,-58,-56,-55,-53,-52,-50,-49,-47,-46,-44,-43,-41,-40,-38,-36,-35,-33,-31,-30,-
28,-26,-25,-23,-21,-20,-18,-16,-14,-13,-11,-9,-7,-6,-4,-2,0,2,4,6,7,
9,11,13,14,16,18,20,21,23,25,26,28,30,31,33,35,36,38,40,41,43,44,46,47,49,51,52,54,
55,56,58,59,61,62,63,65,66,67,69,70,70,72,73,74,75,77,78,79,80,81,
82,83,84,85,86,87,88,89,89,90,91,92,92,93,94,94,95,95,96,97,97,97,98,98,99,99,99,99
,100,100,100,100,100,100,100};
define X = XB1_RX;
define Y = XB1_RY;
define ACTIVE_WHEN_ADS = TRUE;
define ACTIVE_WHEN_FIRING = TRUE;
define RADIUS = 10 ;
define STEPS = 15;
define STEP_INTERVAL = 1;
define VM_INTERVAL = -2;
int time;
int angle, cos_angle, sin_angle;
int actual_X, actual_Y, actual_Magnitude, max_Magnitude;
data(1,// begin of data segment--------
2,0,0,0, //1. Blue
0,2,0,0, //2. Red
0,0,2,0, //3. Green
0,0,0,2, //4. Pink
2,0,2,0, //5. SkyBlue
0,2,2,0, //6. Yellow
2,2,2,2, //7. White
0,0,0,0 //8. Color OFF
); // end of data segment--------------
// Refresh OLED
int display_title = TRUE;
int display_black;
int refresh_OLED;
int ModMenu;
int ModEdit;
int display_EDIT;
//////////////////////////////////////
///////////////////////////////////////
int count_black;
int need_to_be_save;
int BlinckColor = 3;
int Col_ind;
int ANTI_RECOIL = 20;
int ANTI_RECOIL_H = 0;
int anti_recoil;
int anti_recoil_H;
//---------------------------------//
//const string TITLE = "My Game"; // 18 char max
const string TITLE = " SIB3tV "; // 11 char max
const string OFF = "OFF";
const string ON = "ON";
// Index to find Mod Name string - switchable in game with left/right in ModMenu
int modName_idx;
// modName # of the last Mod Name string - Used for cycle modName_idx
define MAX_MODS_COUNT = 6;
// Mod Name - Text to Display
const string RAPIDFIRE = "Rapid Fire" ;
const string ANTIRECOIL = "Antirecoil" ;
const string POLARANTIRECOIL = "Polar AR" ;
const string POLARAIMASSIST = "Polar AA" ;
const string AIMABUSE = "Aim Abuse" ;
const string AUTOSLIDEEASY = "ASlide Easy" ;
const string AUTOSLIDE = "Auto Slide" ;
// Toggles
int rapidfire_onoff = FALSE ;
int antirecoil_onoff = FALSE ;
int polar_antirecoil_onoff = FALSE ;
int polar_aim_assist_onoff = FALSE ;
int aim_abuse_onoff = FALSE ;
int AutoSlideCancelEasy = TRUE ;
int AutoSlideCancel = FALSE ;
// Mod VALUES - Text to Display
const string RAPIDFIRE_HOLD = "RF Hold";
const string RAPIDFIRE_RELEASE = "RF Release" ;
const string ANTIRECOIL_VERTICAL = "AR Vertical" ;
const string ANTIRECOIL_HORIZONTAL = "AR Horizont" ;
const string POLAR_AR_VAL = "Polar AR" ;
const string POLAR_AA_RADIUS = "AA Radius" ;
const string POLAR_AA_STEPS = "AA Steps" ;
const string AIM_ABUSE_HOLD = "Abuse Hold" ;
const string AIM_ABUSE_REST = "Abuse Rest" ;
// Index to find Value Name string - switchable in game with left/right in ModEdit
int valName_idx;
define AMOUNT_OF_VALNAME_IDX = 8;
// Constant bytes - Convert numbers array - ASCII_NUM[column number]
const int8 ASCII_NUM[] =
// 0 1 2 3 4 5 6 7 8 9 (column numbers)
{48,49,50,51,52,53,54,55,56,57};
// Variables for function number_to_string()
int s;
int c,c_val;
const string NO_EDIT_VAR1 = "No Edit Variables";// 17
const string NO_EDIT_VAR2 = "for this MOD";// 12
const byte Options [] = {
1 , // RAPIDFIRE # 1
1 , // ANTIRECOIL # 2
1 , // POLARANTIRECOIL # 3
1 , // POLARAIMASSIST # 4
1 , // AIMABUSE # 5
0 , // AUTOSLIDEEASY # 6
0 // AUTOSLIDE # 7
};
const byte OptRange [][] = {
{ 0 , 1 }, // RAPIDFIRE # 1
{ 2 , 3 }, // ANTIRECOIL # 2
{ 4 , 4 }, // POLARANTIRECOIL # 3
{ 5 , 6 }, // POLARAIMASSIST # 4
{ 7 , 8 }, // AIMABUSE # 5
{ 0 , 0 }, // AUTOSLIDEEASY # 6
{ 0 , 0 } // AUTOSLIDE # 7
};
const byte Min_Max_Options [][]={
{ 0 , 1 }, // RAPIDFIRE # 1
{ 0 , 1 }, // ANTIRECOIL # 2
{ 0 , 1 }, // POLARANTIRECOIL # 3
{ 0 , 1 }, // POLARAIMASSIST # 4
{ 0 , 1 }, // AIMABUSE # 5
{ 0 , 1 }, // AUTOSLIDEEASY # 6
{ 0 , 1 } // AUTOSLIDE # 7
};
/////////////////////////////////////////////////////////////////////////////
/// INITIALIZATION BLOCK
/////////////////////////////////////////////////////////////////////////////
init {
rapidfire_onoff = get_pvar(SPVAR_1,0,1,0);
antirecoil_onoff = get_pvar(SPVAR_2,0,1,0);
polar_antirecoil_onoff = get_pvar(SPVAR_3,0,1,0);
polar_aim_assist_onoff = get_pvar(SPVAR_4,0,1,0);
aim_abuse_onoff = get_pvar(SPVAR_5,0,1,0);
AutoSlideCancelEasy = get_pvar(SPVAR_6,0,1,1);
AutoSlideCancel = get_pvar(SPVAR_7,0,1,0);
RF_hold = get_pvar(SPVAR_8, 1,1000, 20);
RF_release = get_pvar(SPVAR_9, 1,1000, 30);
AR_vertical = get_pvar(SPVAR_10, 1,99, 20);
AR_horizontal = get_pvar(SPVAR_11, 1,99, 0);
polar_ar_val = get_pvar(SPVAR_12, 1,99, 20);
polar_aasist_radius = get_pvar(SPVAR_13, 1,99, 10);
polar_aasist_steps = get_pvar(SPVAR_14, 1,99, 15);
}// end of init block
/////////////////////////////////////////////////////////////////////////////
/// MAIN BLOCK
/////////////////////////////////////////////////////////////////////////////
main {//---------------------------------
/////////////////////////////////////////
if(display_EDIT){
// Clear OLED screen
cls_oled(0);
// display_edit(f_idx, f_string, f_print, f_val)
if(Options[ modName_idx ] == 0 ){
//--- print label
line_oled(1,45,127,45,1,0);
printf( center_x( 17, OLED_FONT_SMALL_WIDTH ), 20, OLED_FONT_SMALL,
1, NO_EDIT_VAR1[0] );
printf( center_x( 12, OLED_FONT_SMALL_WIDTH ), 33, OLED_FONT_SMALL,
1, NO_EDIT_VAR2[0] );
}
else {//---- ELSE BEGIN --------------
/////////////////////////////////////////////
if(valName_idx == 0){
display_edit(center_x(sizeof(RAPIDFIRE_HOLD )-
1,OLED_FONT_MEDIUM_WIDTH),RAPIDFIRE_HOLD [0],RF_hold[0]);
RF_hold = edit_val(RF_hold,1,1000 );
}
/////////////////////////////////////////////
if(valName_idx == 1){
display_edit(center_x(sizeof(RAPIDFIRE_RELEASE )-
1,OLED_FONT_MEDIUM_WIDTH),RAPIDFIRE_RELEASE [0],RF_release[0]);
RF_release = edit_val(RF_release,1,1000 );
}
/////////////////////////////////////////////
if(valName_idx == 2){
display_edit(center_x(sizeof(ANTIRECOIL_VERTICAL )-
1,OLED_FONT_MEDIUM_WIDTH),ANTIRECOIL_VERTICAL [0],AR_vertical[0]);
AR_vertical = edit_val(AR_vertical, 0,99 );
}
/////////////////////////////////////////////
if(valName_idx == 3){
display_edit(center_x(sizeof(ANTIRECOIL_HORIZONTAL )-
1,OLED_FONT_MEDIUM_WIDTH),ANTIRECOIL_HORIZONTAL [0],AR_horizontal[0]);
AR_horizontal = edit_val(AR_horizontal,-99,99 );
}
/////////////////////////////////////////////
if(valName_idx == 4){
display_edit(center_x(sizeof(POLAR_AR_VAL )-
1,OLED_FONT_MEDIUM_WIDTH),POLAR_AR_VAL [0],polar_ar_val[0]);
polar_ar_val = edit_val(polar_ar_val, 0,99);
}
/////////////////////////////////////////////
if(valName_idx == 5){
display_edit(center_x(sizeof(POLAR_AA_RADIUS )-
1,OLED_FONT_MEDIUM_WIDTH),POLAR_AA_RADIUS [0],polar_aasist_radius[0]);
polar_aasist_radius = edit_val(polar_aasist_radius, 0,99);
}
/////////////////////////////////////////////
if(valName_idx == 6){
display_edit(center_x(sizeof(POLAR_AA_STEPS )-
1,OLED_FONT_MEDIUM_WIDTH),POLAR_AA_STEPS [0],polar_aasist_steps[0]);
polar_aasist_steps = edit_val(polar_aasist_steps, 0,99);
}
/////////////////////////////////////////////
if(valName_idx == 7){
display_edit(center_x(sizeof(AIM_ABUSE_HOLD )-
1,OLED_FONT_MEDIUM_WIDTH),AIM_ABUSE_HOLD [0],aabuse_hold[0]);
aabuse_hold = edit_val(aabuse_hold, 0,300);
}
/////////////////////////////////////////////
if(valName_idx == 8){
display_edit(center_x(sizeof(AIM_ABUSE_REST )-
1,OLED_FONT_MEDIUM_WIDTH),AIM_ABUSE_REST [0],aabuse_rest[0]);
aabuse_rest = edit_val(aabuse_rest, 0,300);
}
}//--- ELSE END -----------
}// end of display edit
if(refresh_OLED)
{
// Clear OLED screen
cls_oled(0);
line_oled(1,25,127,25,1,1);
rect_oled(0, 0,OLED_WIDTH,64,FALSE,1);
// Display Value Name and value
// Mods that can have different values depending the active Profile
//display_edit( corresponding valName_idx ,
center_x(sizeof(corresponding_string_to_display) - 1, MEDIUM) ,
corresponding_string_to_display[0] , val_I_want_to_be_displayed[0] );
// Display Mod Name and togle status : ON/OFF
//display_mod( corresponding modName_idx ,
center_x(sizeof(corresponding_string_to_display) - 1, OLED_FONT_MEDIUM_WIDTH) ,
corresponding_string_to_display[0] , toggle_I_want_to_be_displayed[profile]);
if(modName_idx == 0)display_mod(0, center_x(sizeof(RAPIDFIRE )- 1,
OLED_FONT_MEDIUM_WIDTH) ,RAPIDFIRE [0],rapidfire_onoff ,1);
if(modName_idx == 1)display_mod(1, center_x(sizeof(ANTIRECOIL )- 1,
OLED_FONT_MEDIUM_WIDTH) ,ANTIRECOIL [0],antirecoil_onoff ,1);
if(modName_idx == 2)display_mod(2, center_x(sizeof(POLARANTIRECOIL)- 1,
OLED_FONT_MEDIUM_WIDTH) ,POLARANTIRECOIL[0],polar_antirecoil_onoff,1);
if(modName_idx == 3)display_mod(3, center_x(sizeof(POLARAIMASSIST )- 1,
OLED_FONT_MEDIUM_WIDTH) ,POLARAIMASSIST [0],polar_aim_assist_onoff,1);
if(modName_idx == 4)display_mod(4, center_x(sizeof(AIMABUSE )- 1,
OLED_FONT_MEDIUM_WIDTH) ,AIMABUSE [0],aim_abuse_onoff ,1);
if(modName_idx == 5)display_mod(5, center_x(sizeof(AUTOSLIDEEASY )- 1,
OLED_FONT_MEDIUM_WIDTH) ,AUTOSLIDEEASY [0],AutoSlideCancelEasy ,1);
if(modName_idx == 6)display_mod(6, center_x(sizeof(AUTOSLIDE )- 1,
OLED_FONT_MEDIUM_WIDTH) ,AUTOSLIDE [0],AutoSlideCancel ,1);
refresh_OLED = FALSE;
}
if(display_title){
// clear OLED screen
cls_oled(0);
printf(center_x(sizeof(TITLE) - 1,
OLED_FONT_MEDIUM_WIDTH),13,OLED_FONT_MEDIUM,OLED_WHITE,TITLE[0]);
//printf(center_x(sizeof(TITLE) - 1,
OLED_FONT_SMALL_WIDTH),13,OLED_FONT_SMALL,OLED_WHITE,TITLE[0]);
// screen saver
ModMenu = FALSE;
display_title = FALSE;
display_black = TRUE;
//-----------------------------
// Screen saver (OLED off)
if(display_black )
{
count_black += get_rtime();
if(count_black >= 5000)
{
cls_oled(0);
count_black = 0;
display_black = FALSE;
}
}
/////////////////////////////////////////////////////////
// MENU EDIT VALUES
if(ModEdit){
block_all_inputs();
//--- Exit from EDIT MENU
if(event_release(XB360_B)){
ModEdit = FALSE;
display_EDIT = FALSE;
ModMenu = TRUE;
refresh_OLED = TRUE; // display MODS
}
///////////////////////////////////////////////////////////////////////////
/////
// GO FORWARD
if(!get_val(PS4_L2) && event_press(XB360_DOWN)){
valName_idx ++;
if(valName_idx > OptRange[ modName_idx ][ 1 ]) valName_idx =
OptRange[ modName_idx ][ 1 ];
refresh_OLED = FALSE;
display_EDIT = TRUE;
}
///////////////////////////////////////////////////////////////////////////
////
// GO BACK
if(!get_val(PS4_L2) && event_press(XB360_UP)){
valName_idx --;
if(valName_idx < OptRange[ modName_idx ][ 0 ]) valName_idx =
OptRange[ modName_idx ][ 0 ];
refresh_OLED = FALSE;
display_EDIT = TRUE;
}
///////////////////////////////////////////////////////
}// end of EDIT MENU
/////////////////////////////////////////////////////////
// EDIT MENU ON/OFF
if(get_val(XB360_LT) && event_press(XB360_START)){
ModMenu = TRUE;
// toggle EditMenu ON/OFF
modName_idx = 0;
refresh_OLED = TRUE; // display Title
display_EDIT = FALSE;
}
/////////////////////////////////////////////////////////
// MENU SYSTEM
if(ModMenu){
block_all_inputs();
//--- Exit from MENU
if(event_press(XB360_B)){
ModMenu = FALSE;
ModEdit = FALSE;
combo_run(MESSAGE);
}
//--- Enter in EDIT MENU
if(event_press(XB360_A)){
ModMenu = FALSE;
valName_idx = OptRange[ modName_idx ][ 0 ];
ModEdit = TRUE;
display_EDIT= TRUE;
}
//Display MOD NAME and togle status
// Switch MODs
if( !get_val(PS4_L2) && event_press(XB360_DOWN)){
modName_idx ++;
if(modName_idx > 6) modName_idx = 0;
//////////////////////////////////////
if(modName_idx == 0 ) {
blinck( rapidfire_onoff );
}
/////////////////////////////////////
//////////////////////////////////////
if(modName_idx == 1 ) {
blinck( antirecoil_onoff );
}
/////////////////////////////////////
//////////////////////////////////////
if(modName_idx == 2 ) {
blinck( polar_antirecoil_onoff);
}
/////////////////////////////////////
//////////////////////////////////////
if(modName_idx == 3 ) {
blinck( polar_aim_assist_onoff);
}
/////////////////////////////////////
//////////////////////////////////////
if(modName_idx == 4 ) {
blinck( aim_abuse_onoff );
}
/////////////////////////////////////
//////////////////////////////////////
if(modName_idx == 5 ) {
blinck( AutoSlideCancelEasy );
}
/////////////////////////////////////
//////////////////////////////////////
if(modName_idx == 6 ) {
blinck( AutoSlideCancel );
}
/////////////////////////////////////
}
if(!get_val(PS4_L2) && event_press(XB360_UP)){
modName_idx --;
if(modName_idx < 0) modName_idx = 6;
//////////////////////////////////////
if(modName_idx == 0 ) {
blinck( rapidfire_onoff );
}
/////////////////////////////////////
//////////////////////////////////////
if(modName_idx == 1 ) {
blinck( antirecoil_onoff );
}
/////////////////////////////////////
//////////////////////////////////////
if(modName_idx == 2 ) {
blinck( polar_antirecoil_onoff);
}
/////////////////////////////////////
//////////////////////////////////////
if(modName_idx == 3 ) {
blinck( polar_aim_assist_onoff);
}
/////////////////////////////////////
//////////////////////////////////////
if(modName_idx == 4 ) {
blinck( aim_abuse_onoff );
}
/////////////////////////////////////
//////////////////////////////////////
if(modName_idx == 5 ) {
blinck( AutoSlideCancelEasy );
}
/////////////////////////////////////
//////////////////////////////////////
if(modName_idx == 6 ) {
blinck( AutoSlideCancel );
}
/////////////////////////////////////
}
//////////////////////////
// screen saver
display_black = FALSE;
display_title = FALSE;
//////////////////////////////
// display mod name and Toggle ON/OFF | Scroll Options
if(!get_val(PS4_L2) ){
if(event_press(XB360_A)){ // go back
if(modName_idx == 0 ) {
rapidfire_onoff = f_go_back( rapidfire_onoff );
}
if(modName_idx == 1 ) {
antirecoil_onoff = f_go_back( antirecoil_onoff );
}
if(modName_idx == 2 ) {
polar_antirecoil_onoff = f_go_back( polar_antirecoil_onoff );
if(modName_idx == 3 ) {
polar_aim_assist_onoff = f_go_back( polar_aim_assist_onoff );
if(modName_idx == 4 ) {
aim_abuse_onoff = f_go_back( aim_abuse_onoff );
}
if(modName_idx == 5 ) {
AutoSlideCancelEasy = f_go_back( AutoSlideCancelEasy );
}
if(modName_idx == 6 ) {
AutoSlideCancel = f_go_back( AutoSlideCancel );
}
}// go back
if(event_press(XB360_RIGHT)){// go forward
if(modName_idx == 0 ) {
rapidfire_onoff = f_go_forward( rapidfire_onoff);
}
if(modName_idx == 1 ) {
antirecoil_onoff = f_go_forward( antirecoil_onoff);
}
if(modName_idx == 2 ) {
polar_antirecoil_onoff =
f_go_forward( polar_antirecoil_onoff);
}
if(modName_idx == 3 ) {
polar_aim_assist_onoff =
f_go_forward( polar_aim_assist_onoff);
}
if(modName_idx == 4 ) {
aim_abuse_onoff = f_go_forward( aim_abuse_onoff);
}
if(modName_idx == 5 ) {
AutoSlideCancelEasy = f_go_forward( AutoSlideCancelEasy);
}
if(modName_idx == 6 ) {
AutoSlideCancel = f_go_forward( AutoSlideCancel);
}
}// go forward
}
refresh_OLED = TRUE;
set_val(XB360_DOWN,0);
set_val(XB360_UP,0);
set_val(XB360_A,0);
}
/////////////////////////////////////////////////////////////
/// END OF MENU /////////////////////////////////////////
/////////////////////////////////////////////////////////////
///////////////////////////////////////////////
// RAPID FIRE
if(get_ival(XB360_LT) && event_press(XB360_UP)){
rapidfire_onoff = !rapidfire_onoff;
set_rumble_tipe(rapidfire_onoff);
}
if(rapidfire_onoff ) {
/////////////////////////////////////////
if(get_val(FIRE_BTN)) {
combo_run(RAPID_FIRE_cmb);
}
/////////////////////////////////////////
}
/////////////////////////////////////////////////
// ANTIRECOIL
if(get_ival(XB360_LT) && event_press(XB360_DOWN)){
antirecoil_onoff = !antirecoil_onoff;
set_rumble_tipe(antirecoil_onoff);
}
if(antirecoil_onoff){
if( get_val(ADS_BTN) && get_val(FIRE_BTN )) {
combo_run(AntiRecoil);
}
if( abs(get_val(10)) > AR_Release || abs(get_val(9)) > AR_Release) {
combo_stop (AntiRecoil);
}
}
/////////////////////////////////////////////////
// Polar Anti Recoil
if(polar_antirecoil_onoff){
ARVal = b_ARVal + AR_b_max;
AR_b_max = 0;
AR_b_max = AR_b_max + (get_ptime(FIRE_BTN) / 250);
//Deadzone
if(isqrt(pow(get_ival(XB1_RX),2) + pow(get_ival(XB1_RY),2)) <
stick_noise){
if(abs(get_ival(XB1_RX)) < stick_noise) set_val(XB1_RX,0);
if(abs(get_ival(XB1_RY)) < stick_noise) set_val(XB1_RY,0);
}
//Anti Recoil
if(get_ival(FIRE_BTN)){
f_anti_recoil();
if(AR_b_max > 10){
AR_b_max = 0;
}
if(event_release(FIRE_BTN)){
AR_b_max = 0;
}
}
}
if(polar_aim_assist_onoff){
vm_tctrl(VM_INTERVAL);
actual_X = get_val(X);
actual_Y = get_val(Y);
actual_Magnitude = isqrt(pow(actual_X, 2) + pow(actual_Y, 2));
max_Magnitude = (actual_Magnitude < 100);
if(!(time++ % STEP_INTERVAL)){
angle += polar_aasist_steps;
}
angle = angle % 360;
sin_angle = Polar_Array[angle % 360];
cos_angle = Polar_Array[(angle + 270) % 360];
cos_angle = (cos_angle * polar_aasist_radius) / 100;
sin_angle = (sin_angle * polar_aasist_radius) / 100;
if((ACTIVE_WHEN_ADS && get_val(XB1_LT)) || (ACTIVE_WHEN_FIRING &&
get_val(XB1_RT))){
if(actual_Magnitude <= polar_aasist_radius){
sin_angle -= actual_Y;
cos_angle -= actual_X;
}else {
sin_angle = (sin_angle * (200 - ((abs(actual_Y) + actual_Magnitude)
/ 10) * 10) / 200) * max_Magnitude;
cos_angle = (cos_angle * (200 - ((abs(actual_X) + actual_Magnitude)
/ 10) * 10) / 200) * max_Magnitude;
}
set_val(X, calculate(actual_X + cos_angle, -100, 100));
set_val(Y, calculate(actual_Y + sin_angle, -100, 100));
}
}
/////////////////////////////////////////////////
// AIM ABUSE
if(aim_abuse_onoff){
if(get_val(ADS_BTN) && !get_val(FIRE_BTN)){
combo_run(AIM_ABUSE_cmb);
}
}
//===============================================
//--- Auto Slide Cancel with custom slide lenth (recommended for low skill
players)ASCE
//===============================================
if((event_press(XB360_LT) && get_val(XB360_Y)) || (event_press(XB1_Y) &&
get_val(XB360_LT))) {//
AutoSlideCancelEasy = !AutoSlideCancelEasy;
set_rumble_tipe (AutoSlideCancelEasy);
if(AutoSlideCancelEasy)AutoSlideCancel = FALSE;
if(AutoSlideCancelEasy){
if(get_ival (PRONE_BTN)){
combo_run(ASCE);
}
}
//===============================================
//--- Auto Slide Cancel with the ability to choose the length of your slide.
//===============================================
if((event_press(XB360_LT) && get_val(XB360_BACK )) ||
(event_press(XB360_BACK ) && get_val(XB360_LT))) {//-
AutoSlideCancel = !AutoSlideCancel;
if(AutoSlideCancel)AutoSlideCancelEasy = FALSE;
set_rumble_tipe (AutoSlideCancelEasy);
}
if(AutoSlideCancel) {
if((get_val(PS4_LY) < -60) || (get_val(PS4_LY) > 60) || (get_val(PS4_LX) < -
60) || (get_val(PS4_LX) > 60)){
if(event_release (PRONE_BTN)){
combo_run(ASC)
}
}
}
} // end of main block
/////////////////////////////////////////////////////////////////////////////
/// COMBO BLOCK
/////////////////////////////////////////////////////////////////////////////
int exit_wait = 1500;
combo EXIT {
wait(exit_wait);
cls_oled(0);
ModMenu = FALSE;
ModEdit = FALSE;
display_EDIT = FALSE;
display_title = TRUE;
}
int LED_OnOff;
int rumble_tipe = RUMBLE_A;
//===============================================
// LED BLINK
//===============================================
combo LED_BLINK {
colourled(LED_OnOff);
wait(200);
colourled(ColorOFF);
wait(100);
colourled(LED_OnOff);
wait(200);
colourled(ColorOFF);
wait(100);
}
//===============================================
// VIBRATE SET_UP
//===============================================
combo vibrate {
set_rumble(rumble_tipe, 100);
wait(300);
reset_rumble();
}
//===============================================
// RUMBLE_TIPE
//===============================================
function set_rumble_tipe ( val) {
if( val){ rumble_tipe = RUMBLE_A ; LED_OnOff = Green;}
else { rumble_tipe = RUMBLE_B ; LED_OnOff = Red ;}
combo_run(vibrate);
combo_run(LED_BLINK);
}
int b_dblclick;int dblclick_msecs;
int dblclick_count;
//int onoff = FALSE;
define time_to_dblclick = 300;// time in ms for second click to occur
function double_click (button) {
if (b_dblclick) {
dblclick_msecs = dblclick_msecs + get_rtime();
if ( dblclick_msecs > time_to_dblclick ) {
dblclick_count = 0;
dblclick_msecs = 0;
b_dblclick = FALSE;
}
}
if (event_release(button) && get_ptime(button) < 250) {
if (dblclick_count == 0) {
b_dblclick = TRUE;
} else if (dblclick_count == 1) {
dblclick_count = 0;
return 1;
}
dblclick_count = dblclick_count + 1;
}
return 0;
}
function f_go_forward (f_variable) {
f_variable +=1;
if(f_variable > Min_Max_Options[modName_idx][1] )f_variable =
Min_Max_Options[modName_idx][1]; // max option
need_to_be_save = TRUE;
blinck( f_variable );
return f_variable;
}
function f_go_back (f_variable) {
f_variable -=1;
if(f_variable < Min_Max_Options[modName_idx][0] )f_variable =
Min_Max_Options[modName_idx][0];
need_to_be_save = TRUE;
blinck( f_variable );
return f_variable;
}
//===============================================
// ASC_PRO_MOD
//===============================================
combo ASC { // Professional Slide Cancel.
wait(14); // If this becomes an issue, change it to 12 or 15. Worked fine here.
set_val(PRONE_BTN, 100);
wait(14); // If this becomes and issue, change to anything between 11-20.
set_val(PRONE_BTN, 100);
set_val(JUMP_BTN, 100);
wait(12);
set_val(PRONE_BTN, 0);
set_val(JUMP_BTN, 100);
wait(12);
set_val(JUMP_BTN, 0);
}
//===============================================
// ESC
//===============================================
combo ASCE { //--- Easy Slide Cancel.
set_val(PRONE_BTN, 100);
wait(380);
set_val(PRONE_BTN, 0);
wait(60);
set_val(PRONE_BTN, 100);
wait(50);
set_val(PRONE_BTN, 100);
set_val(JUMP_BTN, 100);
wait(60);
set_val(PRONE_BTN, 0);
set_val(JUMP_BTN, 100);
wait(10);
set_val(JUMP_BTN, 0);
}
combo AIM_ABUSE_cmb {
set_val(ADS_BTN,100);
wait(aabuse_hold);
set_val(ADS_BTN, 0);
wait(aabuse_rest);
}
combo RAPID_FIRE_cmb {
set_val(FIRE_BTN, 100);
wait(RF_hold);
set_val(FIRE_BTN, 0);
wait(RF_release);
}
combo AntiRecoil {
anti_recoil = get_val(10) + AR_vertical;
if(anti_recoil > 100) anti_recoil = 100;
set_val(10, anti_recoil);
anti_recoil_H = get_val(9) + AR_horizontal;
if(anti_recoil_H > 100) anti_recoil_H = 100;
set_val(9, anti_recoil_H);
}
//Anti Recoil
function f_anti_recoil() {
i = get_val(XB1_RY) + ARVal;
a = (ARVal) / 100;
a1 = 1 + (a);
a2 = 1 - (a);
if(get_ival(XB1_RY) > 0){
i = i * a2 + ARVal - pow(10,2) * (a2 * (a1 - 1));
} else {
i = i * a1 - ARVal * (1 - a2);
}
set_polar(POLAR_RS,clamp(i, -100, 100),90);
return;
}
//Clamp
function f_clamp(f_val,f_min,f_max) {
if(f_val < f_min) return f_min;
if(f_val > f_max) return f_max;
return f_val;
}
function calculate(int v, int lo, int hi) {
if(v < lo) return lo;
if(v > hi) return hi;
return v;
}
define FONT_STATS_INDEX_WIDTH = 0;
define FONT_STATS_INDEX_HEIGHT = 1;
define FONT_STATS_INDEX_MAXCHARS = 2;
////////////////////////////////////////////////////////////////
function horizontal_center_offset(number_characters, font_size) {
return (128 - number_characters * FONT_STATS[font_size]
[FONT_STATS_INDEX_WIDTH]) / 2;
}
const string EXIT_TXT1 = "SETTINGS";
const string EXIT_TXT2 = "WAS SAVED";
//////////////////////////////////////////////////////////////////////////////
/// SAVE
function save_toggles () {
set_pvar(SPVAR_1,rapidfire_onoff );
set_pvar(SPVAR_2,antirecoil_onoff );
set_pvar(SPVAR_3,polar_antirecoil_onoff);
set_pvar(SPVAR_4,polar_aim_assist_onoff);
set_pvar(SPVAR_5,aim_abuse_onoff );
set_pvar(SPVAR_6,AutoSlideCancelEasy );
set_pvar(SPVAR_7,AutoSlideCancel );
set_pvar(SPVAR_8,RF_hold);
set_pvar(SPVAR_9,RF_release);
set_pvar(SPVAR_10,AR_vertical);
set_pvar(SPVAR_11,AR_horizontal);
set_pvar(SPVAR_12,polar_ar_val);
set_pvar(SPVAR_13,polar_aasist_radius);
set_pvar(SPVAR_14,polar_aasist_steps);
set_pvar(SPVAR_15,aabuse_hold);
set_pvar(SPVAR_16,aabuse_rest);
combo_run(EXIT);
}// end of save
combo MESSAGE {
wait(20);
save_toggles ();
cls_oled(0);
printf(horizontal_center_offset(sizeof(EXIT_TXT1), OLED_FONT_MEDIUM ), 2,
OLED_FONT_MEDIUM, 1, EXIT_TXT1[0]);
printf(horizontal_center_offset(sizeof(EXIT_TXT2), OLED_FONT_MEDIUM ), 23,
OLED_FONT_MEDIUM, 1, EXIT_TXT2[0]);
exit_wait = 2000;
}
function blinck ( var){
if(var){
BlinckColor = Green;
}else{
BlinckColor = Red;
}
combo_run(BLINK_NOTIFY);
}
combo BLINK_NOTIFY {
colourled(BlinckColor);
wait(300);
colourled(ColorOFF);
wait(100);
colourled(BlinckColor);
wait(300);
colourled(ColorOFF);
}
const uint8 FONT_STATS[][] = {
{ 7, 10, 18 }, // Small
{ 11, 18, 11 }, // Medium
{ 16, 26, 7 } // Large
};
function display_edit( f_string, f_print, f_val) {
printf(f_string, 0, OLED_FONT_MEDIUM, OLED_WHITE, f_print);
number_to_string(f_val, find_digits(f_val));
}
function number_to_string(f_val,f_digits) {
/***********************************************************
* number_to_string(value to convert, # of digits in value)
*
* Display Up to Max 16-bit Signed Integer (-32,768 to 32,767)
*
* Convert digits to ASCII
* Add ASCII character to print buffer
* Print string centered X & Y on OLED
*
***********************************************************/
s = 1; c_val = 10000;
if(f_val < 0) //--neg numbers
{
putc_oled(s,45); //--add leading "-"
s += 1;
f_val = abs(f_val);
}
for(c = 5; c >= 1; c--)
{
if(f_digits >= c)
{
putc_oled(s,ASCII_NUM[f_val / c_val]);
f_val = f_val % c_val;
s += 1;
if(c == 4)
{
putc_oled(s,44); //--add ","
s += 1;
}
}
c_val /= 10;
}
puts_oled(center_x(s - 1,OLED_FONT_LARGE_WIDTH),37,OLED_FONT_LARGE,s -
1,OLED_WHITE); // adjustable value centered in X
}
int n_str_;
int horiz_X_center_sufix;
function print_number(f_val,f_digits ,print_s_x , print_s_y , f_font) {
n_str_ = 1; c_val = 10000;
if(f_val < 0) //--neg numbers
{
putc_oled(n_str_,45); //--add leading "-"
n_str_ += 1;
f_val = abs(f_val);
for(c = 5; c >= 1; c--)
{
if(f_digits >= c)
{
putc_oled(n_str_,ASCII_NUM[f_val / c_val]);
f_val = f_val % c_val;
n_str_ += 1;
}
c_val /= 10;
}
puts_oled(print_s_x,print_s_y,f_font,n_str_ - 1,OLED_WHITE); // adjustable
value centered in X
}
function edit_val( f_val, f_min, f_max ) { // antirecoil = edit_val( 0 ,
antirecoil, 99 , 99 )
line_oled(1,18,127,18,1,1);
// print the range values
// on the left: min value
print_number(f_min ,find_digits(f_min) ,4 , 22 , OLED_FONT_SMALL);
// on the right: max value
print_number(f_max ,find_digits(f_max) ,97 , 22 , OLED_FONT_SMALL);
if(get_val(PS4_L2)){
if(press_hold(PS4_RIGHT)){
f_val ++;
if(f_val > f_max ) f_val = f_max;
display_EDIT = TRUE;
need_to_be_save = TRUE;
}
if(press_hold(PS4_LEFT)){
f_val --;
if(f_val < f_min ) f_val = f_min;
display_EDIT = TRUE;
need_to_be_save = TRUE;
}
if(press_hold(PS4_UP)){
f_val +=10;
if(f_val > f_max ) f_val = f_max;
display_EDIT = TRUE;
need_to_be_save = TRUE;
}
if(press_hold(PS4_DOWN)){
f_val -=10;
if(f_val < f_min ) f_val = f_min;
display_EDIT = TRUE;
need_to_be_save = TRUE;
}
}
return f_val;
}
function press_hold(f_btn) {
// return TRUE - event_press()
//- every 250ms when button is held
return event_press(f_btn) || get_val(f_btn) && get_ptime(f_btn) > 250
&& get_ptime(f_btn) % (get_rtime() * 8) == 0;
}
function find_digits(f_num) {
// find_digits(value)
// return Number of Digits in Value Passed
f_num = abs(f_num);
if(f_num / 10000 > 0) return 5;
if(f_num / 1000 > 0) return 4;
if(f_num / 100 > 0) return 3;
if(f_num / 10 > 0) return 2;
return 1;
}
///////////////////////////////////////////////
// FUNCTIONS
function center_x(f_chars,f_font) {
// center_x(number of chars,font size);
// return X for Centering String Horizontally
return (OLED_WIDTH / 2) - ((f_chars * f_font) / 2);
}
function display_mod(f_idx, f_string, mod_name, f_toggle, f_option) {
// Display MOD_NAME
printf(f_string, 3, OLED_FONT_MEDIUM, OLED_WHITE, mod_name);
if(f_option == 1)
{
// Display Disable / Enable
if(f_toggle == 1)
printf(center_x(sizeof(ON) - 1,
OLED_FONT_LARGE_WIDTH),37,OLED_FONT_LARGE,OLED_WHITE, ON[0]);// Enable
else
printf(center_x(sizeof(OFF) - 1,
OLED_FONT_LARGE_WIDTH),37,OLED_FONT_LARGE,OLED_WHITE,OFF[0]);// Disable
}
}
// COLOR LED function
//--------------------------------------------------------------
function colourled(Colour) {
Col_ind=(Colour*4)- 3;
set_led(LED_1,duint8(Col_ind ));
set_led(LED_2,duint8(Col_ind+ 1));
set_led(LED_3,duint8(Col_ind+ 2));
set_led(LED_4,duint8(Col_ind+ 3));
}