Fix please script

GPC1 script programming for Titan One. Code examples, questions, requests.

Fix please script

Postby alvariyo360 » Sat May 25, 2019 5:10 pm

Fix please script fortnite
Code: Select all
// GPC Online Library
// aim_abuse_only_"fortnite".gpc
 
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/*  ______    ____    _____    _______   _   _   _____   _______   ______      _____    _____   _____    _____   _____    _______        /
 |  ____|  / __ \  |  __ \  |__   __| | \ | | |_   _| |__   __| |  ____|    / ____|  / ____| |  __ \  |_   _| |  __ \  |__   __|         /
 | |__    | |  | | | |__) |    | |    |  \| |   | |      | |    | |__      | (___   | |      | |__) |   | |   | |__) |    | |            /
 |  __|   | |  | | |  _  /     | |    | . ` |   | |      | |    |  __|      \___ \  | |      |  _  /    | |   |  ___/     | |            /
 | |      | |__| | | | \ \     | |    | |\  |  _| |_     | |    | |____     ____) | | |____  | | \ \   _| |_  | |         | |            /
 |_|       \____/  |_|  \_\    |_|    |_| \_| |_____|    |_|    |______|   |_____/   \_____| |_|  \_\ |_____| |_|         |_|            /
                                                                                                                                         /
*/
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////   
// BY FORTNITE79//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// 2 AIM ASSIST 2 AIM ABUSE  FORTNITE SCRIPT///////////AIM ASSIST & AIM ABUSE ALWAYS ON///////////////////////////////////////////////////                 
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// CREDITS TO BATTS USED HIS AIM ASSIST & ANTIRECOIL//////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// CREDITS TO WALTER& EXCALIBER USED THERE AUTO AIM V2////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// CREDITS TO SWEET EVIL USED HIS 4.65 TEST SCRIPT////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// BUTTON LAYOUT: BUILDER PRO
 define FIRE_BTN = 4; //XB1_RB //PS4_R2
 define ADS_BTN = 7; //XB1_LB //PS4_L2
 define CROUCH_BTN = 5; //XB1_RS //PS4_R3
 define SPRINT_BTN = 8; //XB1_LS //PS4_L3
 define JUMP_BTN = 19; //XB1_A  //PS4_CROSS
 define NEXT_PIECE = 3; //XB1_RT //PS4_R1
 define LEFT_BUMP = 6; //XB1_LT //PS4_L1
 define SWAP_BTN = 17; //XB1_Y  //PS4_TRIANGLE
 define BUILD_BTN = 18; //XB1_B  //PS4_CIRCLE
 define WALL_BTN = 4; //XB1_RB //PS4_R2
 define STAIRS_BTN = 7; //XB1_LB //PS4_L2
 define FLOOR_BTN = 3; //XB1_RT //PS4_R1
 define ROOF_BTN = 6; //XB1_LT //PS4_L1
 define RELOAD_BTN = 20; //XB1_X //PS4_SQAURE
 define R_X = 9; //XB1_RX //PS4_RX
 define R_Y = 10; //XB1_RY //PS4_RY
 define L_X = 11; //XB1_LX //PS4_LX
 define L_Y = 12; //XB1_LY //PS4_LY
 define UP = 13; //XB1_UP //PS4_UP
 define DOWN = 14; //XB1_DOWN //PS4_DOWN
 define LEFT = 15; //XB1_LEFT //PS4_LEFT
 define RIGHT = 16; //XB1_RIGHT //PS4_RIGHT
 //1
//SWEETEVIL//
define Sampling_Time = 10;
define Aim_Boost = 7;
define Aim_Correction = 12;
define Aim_Perfection_Limit = 30;
define POS_Aim_Limit = 70;
define NEG_Aim_Limit = -70;
define POS_Micro_MVT_Limit = 25;//25
define NEG_Micro_MVT_Limit = -25;//25
// Dont't change!
//
int X_Last_Value     = 0;
int Y_Last_Value     = 0;
int X_Current_Value  = 0;
int Y_Current_Value  = 0;
int Sampling_Done = FALSE;
int micro_mvt = FALSE;
//
int spiroide_pulse = 0;
int fine_pulse = 0;
//
// Joystick calibration value
int Joystick_calibration = FALSE;
int RX_Axis_Joystick_calibrate = 0;
int RY_Axis_Joystick_calibrate = 0;
 
int ar_y = 10//--amount of vertical (up/down) recoil
int ar_x = -5//--amount of horizontal (left/right) recoil
int v;   
 
int AimAssist_onoff  = TRUE;               
int shake            = 18;
//2
int aa_p  = 18 // Aim Assist
int aa_n = -23; // Aim Assist
int aa_delay  = 11;
int release = 16;
//1
 
 
 
main {
     //update main every 8ms --> only for PS4
   vm_tctrl(-2);
 
     // Aim Assist 1
        if(get_val(7)  && !get_val(4)) combo_run(AA_XY);
        else combo_stop(AA_XY);
 
 
     // Aim Assist 2
        if (AimAssist_onoff) {                           
        if (get_val(7))                       
            combo_run(Auto_Aimm);                     
        else       
            combo_stop(Auto_Aimm);
 
 
 
        if (get_val(7) > 90) {                       
            if (abs(get_val(9)) > 21 || abs(get_val(10)) > 21){
                combo_stop(Auto_Aimm);                 
            }                                         
        }                                             
    }
 
   // AIM ABUSE 1
   if (Joystick_calibration == FALSE)
            {
                RX_Axis_Joystick_calibrate = get_val(PS4_RX);
                RY_Axis_Joystick_calibrate = get_val(PS4_RY);
                Joystick_calibration = TRUE;     
            }
 
        X_Last_Value = X_Current_Value;
        Y_Last_Value = Y_Current_Value;
        X_Current_Value = get_lval(PS4_RX)- RX_Axis_Joystick_calibrate;
        Y_Current_Value = get_lval(PS4_RY)- RY_Axis_Joystick_calibrate;
 
        if(get_val(PS4_L2))
            {
                if(abs(X_Current_Value) <= POS_Micro_MVT_Limit && abs(Y_Current_Value) <= POS_Micro_MVT_Limit)
                //if(get_lval(PS4_RX) > NEG_Micro_MVT_Limit || get_lval(PS4_RX) < POS_Micro_MVT_Limit || get_lval(PS4_RY) > NEG_Micro_MVT_Limit || get_lval(PS4_RY) < POS_Micro_MVT_Limit
                //|| get_lval(PS4_RX) > NEG_Micro_MVT_Limit || get_lval(PS4_RX) < POS_Micro_MVT_Limit || get_lval(PS4_RY) > NEG_Micro_MVT_Limit || get_lval(PS4_RY) < POS_Micro_MVT_Limit)
                    {
                       if ((X_Last_Value >=0 && X_Current_Value >=0) || (X_Last_Value <=0 && X_Current_Value <=0))
                            {
                            if (abs(abs(X_Last_Value)-abs(X_Current_Value))<15)
                                {
                                    micro_mvt = TRUE;
                                }
                            else
                                {
                                    micro_mvt = FALSE;
                                }       
                        }
                    else if ((X_Last_Value <=0 && X_Current_Value >=0) || (X_Last_Value >=0 && X_Current_Value <=0))
                        {
 
                            if (abs(X_Last_Value)+abs(X_Current_Value)<15)
                                {
                                    micro_mvt = TRUE;
                                }
                            else
                                {
                                    micro_mvt = FALSE;
                                }       
                        }
                    else{
                            micro_mvt = FALSE;
                        }
 
                       if(micro_mvt == TRUE)
                               {
                                   combo_stop(Aim_Assist_Perfection);
                                Sampling_Done = FALSE;
                               }
                           if (!combo_running(Aim_Assist_Perfection))
                               {
                                   if (get_val(PS4_R2)>95)
                                {
                                    combo_stop(Fine_Tune_Aim);
                                    fine_pulse = 0;
                                    combo_run(spiroide_Aim_Assit);
                                }
                                else
                                {
                                    combo_stop(spiroide_Aim_Assit);
                                    spiroide_pulse = 0;
                                    combo_run(Fine_Tune_Aim);
                                }
                               }                     
 
                    }
                else if(abs(X_Current_Value) <= POS_Aim_Limit && abs(Y_Current_Value) <= POS_Aim_Limit)
                    {
                        combo_stop(Fine_Tune_Aim);
                        combo_stop(spiroide_Aim_Assit);
                        spiroide_pulse = 0;
                        fine_pulse = 0;
                        combo_run(Aim_Assist_Perfection);
 
                    }
                else
                    {
                        combo_stop(Fine_Tune_Aim);
                        combo_stop(spiroide_Aim_Assit);
                        combo_stop(Aim_Assist_Perfection);
                        spiroide_pulse = 0;
                        fine_pulse = 0;
                        Sampling_Done = FALSE;   
                    }
            }
        else
            {
                combo_stop(Fine_Tune_Aim);
                combo_stop(spiroide_Aim_Assit);
                combo_stop(Aim_Assist_Perfection);
                spiroide_pulse = 0;
                fine_pulse = 0;
                Sampling_Done = FALSE;   
 
            }
 
 
    //AIM ASSIST
 
   //AIM ABUSE 2
    if(get_val(PS4_L2)>90) {
        combo_run(AimAbuse);
    }
 
//--anti recoil
    if(get_val(4)) {
        //--ry
        set_val(10,ar(10,ar_y));
        //--rx
        set_val(9,ar(9,ar_x));
    }
 
}
 
/////////////////////////
 
combo AimAbuse {
    set_val(PS4_L2, 100);
    wait(310);
    set_val(PS4_L2, 0);
    wait(15);
    set_val(PS4_L2, 0);
}
 
combo AA_XY {
    set_val(10,xy_val(10,aa_p));
    wait(aa_delay)
    set_val(9,xy_val(9,aa_p));
    wait(aa_delay)
    set_val(10,xy_val(10,aa_n));
    wait(aa_delay)
    set_val(9,xy_val(9,aa_n));
    wait(aa_delay)
}
function xy_val(f_axis,f_val) {
    if(abs(get_val(f_axis)) < release)
        return f_val;
    return get_val(f_axis);
}
 
combo Auto_Aimm {         
    set_val(10, shake * -1); //1 
    wait(11)               
    set_val(9,  shake); //1 
    wait(11)             
    set_val(10, shake); //1 
    wait(11)               
    set_val(9,  shake * -1); //1 
    wait(11)               
}
function ar(f_axis,f_val) {
    v = get_val(f_axis);
    if(abs(v) <= f_val + 5)
        return v + f_val ;
    return v;
}
 
combo Aim_Assist_Perfection
    {       
        // Save the first joystick position
        X_Last_Value = X_Current_Value
        Y_Last_Value = Y_Current_Value
 
        // Sampling frequency
        wait(Sampling_Time);
 
        // Save the second joystick position
        X_Current_Value = get_lval(PS4_RX)- RX_Axis_Joystick_calibrate;
        Y_Current_Value = get_lval(PS4_RY)- RY_Axis_Joystick_calibrate;
 
     if (Sampling_Done == TRUE )
         {
         if (X_Last_Value > 0 && X_Current_Value > 0)
            { 
                if (X_Last_Value > X_Current_Value)
                    {
                        if ( X_Last_Value - X_Current_Value < Aim_Perfection_Limit)
                            {
                                 set_val(PS4_RX, (X_Current_Value + Aim_Boost));
                            }
                    }
                else
                    {
                        if ( X_Current_Value - X_Last_Value < Aim_Perfection_Limit)
                            {
                                 set_val(PS4_RX, (X_Current_Value - Aim_Boost));
                            }
                    }
            }
         else if (X_Last_Value > 0 && X_Current_Value < 0)
            {
                    if ( X_Last_Value + X_Current_Value < Aim_Perfection_Limit)
                            {
                                 set_val(PS4_RX, (X_Current_Value + Aim_Boost));
                            }     
            }
        else if (X_Last_Value < 0 && X_Current_Value > 0)
            {
                if (  X_Current_Value - X_Last_Value < Aim_Perfection_Limit)
                    {
                         set_val(PS4_RX, (X_Current_Value - Aim_Boost));
                    }               
            }
        else
            {
                if (X_Last_Value > X_Current_Value)
                    {
                        if ( X_Last_Value - X_Current_Value < Aim_Perfection_Limit)
                            {
                                 set_val(PS4_RX, (X_Current_Value - Aim_Boost));
                            }
                    }
                else
                    {
                        if ( X_Current_Value - X_Last_Value < Aim_Perfection_Limit)
                            {
                                 set_val(PS4_RX, (X_Current_Value + Aim_Boost));
                            }
                    }
            }
 
 
         if (Y_Last_Value > 0 && Y_Current_Value > 0)
            { 
                if (Y_Last_Value > Y_Current_Value)
                    {
                        if ( Y_Last_Value - Y_Current_Value < Aim_Perfection_Limit)
                            {
                                 set_val(PS4_RY, (Y_Current_Value + Aim_Boost));
                            }
                    }
                else
                    {
                        if ( Y_Current_Value - Y_Last_Value < Aim_Perfection_Limit)
                            {
                                 set_val(PS4_RY, (Y_Current_Value - Aim_Boost));
                            }
                    }
            }
         else if (Y_Last_Value > 0 && Y_Current_Value < 0)
            {
                    if ( Y_Last_Value + Y_Current_Value < Aim_Perfection_Limit)
                            {
                                 set_val(PS4_RY, (Y_Current_Value + Aim_Boost));
                            }     
            }
        else if (Y_Last_Value < 0 && Y_Current_Value > 0)
            {
                if (  Y_Current_Value - Y_Last_Value < Aim_Perfection_Limit)
                    {
                         set_val(PS4_RY, (Y_Current_Value - Aim_Boost));
                    }               
            }
        else
            {
                if (Y_Last_Value > Y_Current_Value)
                    {
                        if ( Y_Last_Value - Y_Current_Value < Aim_Perfection_Limit)
                            {
                                 set_val(PS4_RY, (Y_Current_Value - Aim_Boost));
                            }
                    }
                else
                    {
                        if ( Y_Current_Value - Y_Last_Value < Aim_Perfection_Limit)
                            {
                                 set_val(PS4_RY, (Y_Current_Value + Aim_Boost));
                            }
                    }
            }
 
        }
 
        X_Last_Value = X_Current_Value;
        Y_Last_Value = Y_Current_Value;
 
        // Sampling frequency
        wait(Sampling_Time);
 
        // Save the second joystick position
        X_Current_Value = get_lval(PS4_RX)- RX_Axis_Joystick_calibrate;
        Y_Current_Value = get_lval(PS4_RY)- RX_Axis_Joystick_calibrate;
    if (Sampling_Done == TRUE )
        {
         if (X_Last_Value > 0 && X_Current_Value > 0)
            { 
                if (X_Last_Value > X_Current_Value)
                    {
                        if ( X_Last_Value - X_Current_Value < Aim_Perfection_Limit)
                            {
                                 set_val(PS4_RX, (X_Current_Value - Aim_Correction));
                            }
                    }
                else
                    {
                        if ( X_Current_Value - X_Last_Value < Aim_Perfection_Limit)
                            {
                                 set_val(PS4_RX, (X_Current_Value + Aim_Correction));
                            }
                    }
            }
         else if (X_Last_Value > 0 && X_Current_Value < 0)
            {
                    if ( X_Last_Value + X_Current_Value < Aim_Perfection_Limit)
                            {
                                 set_val(PS4_RX, (X_Current_Value - Aim_Correction));
                            }     
            }
        else if (X_Last_Value < 0 && X_Current_Value > 0)
            {
                if (  X_Current_Value - X_Last_Value < Aim_Perfection_Limit)
                    {
                         set_val(PS4_RX, (X_Current_Value + Aim_Correction));
                    }               
            }
        else
            {
                if (X_Last_Value > X_Current_Value)
                    {
                        if ( X_Last_Value - X_Current_Value < Aim_Perfection_Limit)
                            {
                                 set_val(PS4_RX, (X_Current_Value + Aim_Correction));
                            }
                    }
                else
                    {
                        if ( X_Current_Value - X_Last_Value < Aim_Perfection_Limit)
                            {
                                 set_val(PS4_RX, (X_Current_Value - Aim_Correction));
                            }
                    }
            }
 
 
         if (Y_Last_Value > 0 && Y_Current_Value > 0)
            { 
                if (Y_Last_Value > Y_Current_Value)
                    {
                        if ( Y_Last_Value - Y_Current_Value < Aim_Perfection_Limit)
                            {
                                 set_val(PS4_RY, (Y_Current_Value - Aim_Correction));
                            }
                    }
                else
                    {
                        if ( Y_Current_Value - Y_Last_Value < Aim_Perfection_Limit)
                            {
                                 set_val(PS4_RY, (Y_Current_Value + Aim_Correction));
                            }
                    }
            }
         else if (Y_Last_Value > 0 && Y_Current_Value < 0)
            {
                    if ( Y_Last_Value + Y_Current_Value < Aim_Perfection_Limit)
                            {
                                 set_val(PS4_RY, (Y_Current_Value - Aim_Correction));
                            }     
            }
        else if (Y_Last_Value < 0 && Y_Current_Value > 0)
            {
                if (  Y_Current_Value - Y_Last_Value < Aim_Perfection_Limit)
                    {
                         set_val(PS4_RY, (Y_Current_Value + Aim_Correction));
                    }               
            }
        else
            {
                if (Y_Last_Value > Y_Current_Value)
                    {
                        if ( Y_Last_Value - Y_Current_Value < Aim_Perfection_Limit)
                            {
                                 set_val(PS4_RY, (Y_Current_Value + Aim_Correction));
                            }
                    }
                else
                    {
                        if ( Y_Current_Value - Y_Last_Value < Aim_Perfection_Limit)
                            {
                                 set_val(PS4_RY, (Y_Current_Value - Aim_Correction));
                            }
                    }
            }
        }
 
        Sampling_Done = TRUE;
        wait(Sampling_Time);
    }
 
 
 
combo Fine_Tune_Aim {
 
    set_val(PS4_RX,(4 + fine_pulse));
    wait(Sampling_Time);
 
    wait(Sampling_Time);
    wait(Sampling_Time);
 
    set_val(PS4_RX,(-4 - fine_pulse));
    wait(Sampling_Time);
 
    wait(Sampling_Time);
    wait(Sampling_Time);
 
    fine_pulse = fine_pulse + 2;
 
 
    if ( fine_pulse > 10)
       {
            fine_pulse = 0;   
        }
   }
 
    combo spiroide_Aim_Assit {
 
 
    set_val(PS4_RY,(5 + spiroide_pulse));
    wait(Sampling_Time);
 
    wait(Sampling_Time);
 
    set_val(PS4_RX,(4 + spiroide_pulse));
    wait(Sampling_Time);
 
    wait(Sampling_Time);
 
    set_val(PS4_RY,(5 + spiroide_pulse));
    wait(Sampling_Time);
 
    wait(Sampling_Time);
    wait(Sampling_Time);
    wait(Sampling_Time);
 
    set_val(PS4_RY,(5 + spiroide_pulse));
    wait(Sampling_Time);
 
    wait(Sampling_Time);
 
    set_val(PS4_RX,(-4 - spiroide_pulse));
    wait(Sampling_Time);
 
    wait(Sampling_Time);
 
    set_val(PS4_RY,(5 + spiroide_pulse));
    wait(Sampling_Time);
 
    wait(Sampling_Time);
    wait(Sampling_Time);
    wait(Sampling_Time);
 
    spiroide_pulse = spiroide_pulse + 2;
 
 
    if ( spiroide_pulse > 10)
       {
            spiroide_pulse = 0;   
        }
   }
 
User avatar
alvariyo360
Master Sergeant
Master Sergeant
 
Posts: 27
Joined: Fri Jun 19, 2015 2:31 pm

Re: Fix please script

Postby Buffy » Sat May 25, 2019 5:18 pm

Code: Select all
 
//#pragma METAINFO("fort.gpc", 1, 0, "Buffy's GPC Converter v0.25")
//#include <titanone.gph>
 
 
// GPC Online Library
// aim_abuse_only_"fortnite".gpc
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/*  ______    ____    _____    _______   _   _   _____   _______   ______      _____    _____   _____    _____   _____    _______        /
 |  ____|  / __ \  |  __ \  |__   __| | \ | | |_   _| |__   __| |  ____|    / ____|  / ____| |  __ \  |_   _| |  __ \  |__   __|         /
 | |__    | |  | | | |__) |    | |    |  \| |   | |      | |    | |__      | (___   | |      | |__) |   | |   | |__) |    | |            /
 |  __|   | |  | | |  _  /     | |    | . ` |   | |      | |    |  __|      \___ \  | |      |  _  /    | |   |  ___/     | |            /
 | |      | |__| | | | \ \     | |    | |\  |  _| |_     | |    | |____     ____) | | |____  | | \ \   _| |_  | |         | |            /
 |_|       \____/  |_|  \_\    |_|    |_| \_| |_____|    |_|    |______|   |_____/   \_____| |_|  \_\ |_____| |_|         |_|            /
                                                                                                                                         /
**/
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////   
// BY FORTNITE79//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// 2 AIM ASSIST 2 AIM ABUSE  FORTNITE SCRIPT///////////AIM ASSIST & AIM ABUSE ALWAYS ON///////////////////////////////////////////////////                 
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// CREDITS TO BATTS USED HIS AIM ASSIST & ANTIRECOIL//////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// CREDITS TO WALTER& EXCALIBER USED THERE AUTO AIM V2////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// CREDITS TO SWEET EVIL USED HIS 4.65 TEST SCRIPT////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// BUTTON LAYOUT: BUILDER PRO
//XB1_RB //PS4_R2
//XB1_LB //PS4_L2
//XB1_RS //PS4_R3
//XB1_LS //PS4_L3
//XB1_A  //PS4_CROSS
//XB1_RT //PS4_R1
//XB1_LT //PS4_L1
//XB1_Y  //PS4_TRIANGLE
//XB1_B  //PS4_CIRCLE
//XB1_RB //PS4_R2
//XB1_LB //PS4_L2
//XB1_RT //PS4_R1
//XB1_LT //PS4_L1
//XB1_X //PS4_SQAURE
//XB1_RX //PS4_RX
//XB1_RY //PS4_RY
//XB1_LX //PS4_LX
//XB1_LY //PS4_LY
//XB1_UP //PS4_UP
//XB1_DOWN //PS4_DOWN
//XB1_LEFT //PS4_LEFT
//XB1_RIGHT //PS4_RIGHT
//1
//SWEETEVIL//
//25
//25
// Dont't change!
//
//
//
// Joystick calibration value
//--amount of vertical (up/down) recoil
//--amount of horizontal (left/right) recoil
//2
// Aim Assist
// Aim Assist
//1
//update main every 8ms --> only for PS4
// Aim Assist 1
// Aim Assist 2
// AIM ABUSE 1
//if(get_lval(PS4_RX) > -NEG_Micro_MVT_Limit || get_lval(PS4_RX) < POS_Micro_MVT_Limit || get_lval(PS4_RY) > -NEG_Micro_MVT_Limit || get_lval(PS4_RY) < POS_Micro_MVT_Limit
//|| get_lval(PS4_RX) > -NEG_Micro_MVT_Limit || get_lval(PS4_RX) < POS_Micro_MVT_Limit || get_lval(PS4_RY) > -NEG_Micro_MVT_Limit || get_lval(PS4_RY) < POS_Micro_MVT_Limit)
//AIM ASSIST
//AIM ABUSE 2
//--anti recoil
//--ry
//--rx
/////////////////////////
//1 
//1 
//1 
//1 
// Save the first joystick position
// Sampling frequency
// Save the second joystick position
// Sampling frequency
// Save the second joystick position
 
 
 
 
define FIRE_BTN = 4;
define ADS_BTN = 7;
define CROUCH_BTN = 5;
define SPRINT_BTN = 8;
define JUMP_BTN = 19;
define NEXT_PIECE = 3;
define LEFT_BUMP = 6;
define SWAP_BTN = 17;
define BUILD_BTN = 18;
define WALL_BTN = 4;
define STAIRS_BTN = 7;
define FLOOR_BTN = 3;
define ROOF_BTN = 6;
define RELOAD_BTN = 20;
define R_X = 9;
define R_Y = 10;
define L_X = 11;
define L_Y = 12;
define UP = 13;
define DOWN = 14;
define LEFT = 15;
define RIGHT = 16;
define Sampling_Time = 10;
define Aim_Boost = 7;
define Aim_Correction = 12;
define Aim_Perfection_Limit = 30;
define POS_Aim_Limit = 70;
define POS_Micro_MVT_Limit = 25;
define NEG_Micro_MVT_Limit = 25;
 
int X_Last_Value = 0;
int Y_Last_Value = 0;
int X_Current_Value = 0;
int Y_Current_Value = 0;
int Sampling_Done = FALSE;
int micro_mvt = FALSE;
int spiroide_pulse = 0;
int fine_pulse = 0;
int Joystick_calibration = FALSE;
int RX_Axis_Joystick_calibrate = 0;
int RY_Axis_Joystick_calibrate = 0;
int ar_y = 10;
int ar_x =- 5;
int v;
int AimAssist_onoff = TRUE;
int shake = 18;
int aa_p = 18;
int aa_n =- 23;
int aa_delay = 11;
int release = 16;
 
main {
    vm_tctrl( - 2);
    if (get_val(7) && !get_val(4)) combo_run(c_AA_XY);
    else  combo_stop(c_AA_XY);
    if (AimAssist_onoff) {
        if (get_val(7)) combo_run(c_Auto_Aimm);
        else  combo_stop(c_Auto_Aimm);
        if (get_val(7) > 90) {
            if (abs(get_val(9)) > 21 || abs(get_val(10)) > 21) {
                combo_stop(c_Auto_Aimm);
            }
        }
    }
    if (Joystick_calibration == FALSE) {
        RX_Axis_Joystick_calibrate = get_val(PS4_RX);
        RY_Axis_Joystick_calibrate = get_val(PS4_RY);
        Joystick_calibration = TRUE;
    }
    X_Last_Value = X_Current_Value;
    Y_Last_Value = Y_Current_Value;
    X_Current_Value = get_lval(PS4_RX) - RX_Axis_Joystick_calibrate;
    Y_Current_Value = get_lval(PS4_RY) - RY_Axis_Joystick_calibrate;
    if (get_val(PS4_L2)) {
        if (abs(X_Current_Value) <= POS_Micro_MVT_Limit && abs(Y_Current_Value) <= POS_Micro_MVT_Limit) {
            if ((X_Last_Value >= 0 && X_Current_Value >= 0) || (X_Last_Value <= 0 && X_Current_Value <= 0)) {
                if (abs(abs(X_Last_Value) - abs(X_Current_Value)) < 15) {
                    micro_mvt = TRUE;
                }
                else {
                    micro_mvt = FALSE;
                }
            }
            else if ((X_Last_Value <= 0 && X_Current_Value >= 0) || (X_Last_Value >= 0 && X_Current_Value <= 0)) {
                if (abs(X_Last_Value) + abs(X_Current_Value) < 15) {
                    micro_mvt = TRUE;
                }
                else {
                    micro_mvt = FALSE;
                }
            }
            else {
                micro_mvt = FALSE;
            }
            if (micro_mvt == TRUE) {
                combo_stop(c_Aim_Assist_Perfection);
                Sampling_Done = FALSE;
            }
            if (!combo_running(c_Aim_Assist_Perfection)) {
                if (get_val(PS4_R2) > 95) {
                    combo_stop(c_Fine_Tune_Aim);
                    fine_pulse = 0;
                    combo_run(c_spiroide_Aim_Assit);
                }
                else {
                    combo_stop(c_spiroide_Aim_Assit);
                    spiroide_pulse = 0;
                    combo_run(c_Fine_Tune_Aim);
                }
            }
        }
        else if (abs(X_Current_Value) <= POS_Aim_Limit && abs(Y_Current_Value) <= POS_Aim_Limit) {
            combo_stop(c_Fine_Tune_Aim);
            combo_stop(c_spiroide_Aim_Assit);
            spiroide_pulse = 0;
            fine_pulse = 0;
            combo_run(c_Aim_Assist_Perfection);
        }
        else {
            combo_stop(c_Fine_Tune_Aim);
            combo_stop(c_spiroide_Aim_Assit);
            combo_stop(c_Aim_Assist_Perfection);
            spiroide_pulse = 0;
            fine_pulse = 0;
            Sampling_Done = FALSE;
        }
    }
    else {
        combo_stop(c_Fine_Tune_Aim);
        combo_stop(c_spiroide_Aim_Assit);
        combo_stop(c_Aim_Assist_Perfection);
        spiroide_pulse = 0;
        fine_pulse = 0;
        Sampling_Done = FALSE;
    }
    if (get_val(PS4_L2) > 90) {
        combo_run(c_AimAbuse);
    }
    if (get_val(4)) {
        set_val(10, f_ar(10, ar_y));
        set_val(9, f_ar(9, ar_x));
    }
}
 
 
combo c_AimAbuse {
    set_val(PS4_L2, 100);
    wait(310);
    set_val(PS4_L2, 0);
    wait(15);
    set_val(PS4_L2, 0);
}
 
combo c_AA_XY {
    set_val(10, f_xy_val(10, aa_p));
    wait(aa_delay);
    set_val(9, f_xy_val(9, aa_p));
    wait(aa_delay);
    set_val(10, f_xy_val(10, aa_n));
    wait(aa_delay);
    set_val(9, f_xy_val(9, aa_n));
    wait(aa_delay);
}
 
combo c_Auto_Aimm {
    set_val(10, shake *- 1);
    wait(11);
    set_val(9, shake);
    wait(11);
    set_val(10, shake);
    wait(11);
    set_val(9, shake *- 1);
    wait(11);
}
 
combo c_Aim_Assist_Perfection {
    X_Last_Value = X_Current_Value;
    Y_Last_Value = Y_Current_Value;
    wait(Sampling_Time);
    X_Current_Value = get_lval(PS4_RX) - RX_Axis_Joystick_calibrate;
    Y_Current_Value = get_lval(PS4_RY) - RY_Axis_Joystick_calibrate;
    if (Sampling_Done == TRUE) {
        if (X_Last_Value > 0 && X_Current_Value > 0) {
            if (X_Last_Value > X_Current_Value) {
                if (X_Last_Value - X_Current_Value < Aim_Perfection_Limit) {
                    set_val(PS4_RX, (X_Current_Value + Aim_Boost));
                }
            }
            else {
                if (X_Current_Value - X_Last_Value < Aim_Perfection_Limit) {
                    set_val(PS4_RX, (X_Current_Value - Aim_Boost));
                }
            }
        }
        else if (X_Last_Value > 0 && X_Current_Value < 0) {
            if (X_Last_Value + X_Current_Value < Aim_Perfection_Limit) {
                set_val(PS4_RX, (X_Current_Value + Aim_Boost));
            }
        }
        else if (X_Last_Value < 0 && X_Current_Value > 0) {
            if (X_Current_Value - X_Last_Value < Aim_Perfection_Limit) {
                set_val(PS4_RX, (X_Current_Value - Aim_Boost));
            }
        }
        else {
            if (X_Last_Value > X_Current_Value) {
                if (X_Last_Value - X_Current_Value < Aim_Perfection_Limit) {
                    set_val(PS4_RX, (X_Current_Value - Aim_Boost));
                }
            }
            else {
                if (X_Current_Value - X_Last_Value < Aim_Perfection_Limit) {
                    set_val(PS4_RX, (X_Current_Value + Aim_Boost));
                }
            }
        }
        if (Y_Last_Value > 0 && Y_Current_Value > 0) {
            if (Y_Last_Value > Y_Current_Value) {
                if (Y_Last_Value - Y_Current_Value < Aim_Perfection_Limit) {
                    set_val(PS4_RY, (Y_Current_Value + Aim_Boost));
                }
            }
            else {
                if (Y_Current_Value - Y_Last_Value < Aim_Perfection_Limit) {
                    set_val(PS4_RY, (Y_Current_Value - Aim_Boost));
                }
            }
        }
        else if (Y_Last_Value > 0 && Y_Current_Value < 0) {
            if (Y_Last_Value + Y_Current_Value < Aim_Perfection_Limit) {
                set_val(PS4_RY, (Y_Current_Value + Aim_Boost));
            }
        }
        else if (Y_Last_Value < 0 && Y_Current_Value > 0) {
            if (Y_Current_Value - Y_Last_Value < Aim_Perfection_Limit) {
                set_val(PS4_RY, (Y_Current_Value - Aim_Boost));
            }
        }
        else {
            if (Y_Last_Value > Y_Current_Value) {
                if (Y_Last_Value - Y_Current_Value < Aim_Perfection_Limit) {
                    set_val(PS4_RY, (Y_Current_Value - Aim_Boost));
                }
            }
            else {
                if (Y_Current_Value - Y_Last_Value < Aim_Perfection_Limit) {
                    set_val(PS4_RY, (Y_Current_Value + Aim_Boost));
                }
            }
        }
    }
    X_Last_Value = X_Current_Value;
    Y_Last_Value = Y_Current_Value;
    wait(Sampling_Time);
    X_Current_Value = get_lval(PS4_RX) - RX_Axis_Joystick_calibrate;
    Y_Current_Value = get_lval(PS4_RY) - RX_Axis_Joystick_calibrate;
    if (Sampling_Done == TRUE) {
        if (X_Last_Value > 0 && X_Current_Value > 0) {
            if (X_Last_Value > X_Current_Value) {
                if (X_Last_Value - X_Current_Value < Aim_Perfection_Limit) {
                    set_val(PS4_RX, (X_Current_Value - Aim_Correction));
                }
            }
            else {
                if (X_Current_Value - X_Last_Value < Aim_Perfection_Limit) {
                    set_val(PS4_RX, (X_Current_Value + Aim_Correction));
                }
            }
        }
        else if (X_Last_Value > 0 && X_Current_Value < 0) {
            if (X_Last_Value + X_Current_Value < Aim_Perfection_Limit) {
                set_val(PS4_RX, (X_Current_Value - Aim_Correction));
            }
        }
        else if (X_Last_Value < 0 && X_Current_Value > 0) {
            if (X_Current_Value - X_Last_Value < Aim_Perfection_Limit) {
                set_val(PS4_RX, (X_Current_Value + Aim_Correction));
            }
        }
        else {
            if (X_Last_Value > X_Current_Value) {
                if (X_Last_Value - X_Current_Value < Aim_Perfection_Limit) {
                    set_val(PS4_RX, (X_Current_Value + Aim_Correction));
                }
            }
            else {
                if (X_Current_Value - X_Last_Value < Aim_Perfection_Limit) {
                    set_val(PS4_RX, (X_Current_Value - Aim_Correction));
                }
            }
        }
        if (Y_Last_Value > 0 && Y_Current_Value > 0) {
            if (Y_Last_Value > Y_Current_Value) {
                if (Y_Last_Value - Y_Current_Value < Aim_Perfection_Limit) {
                    set_val(PS4_RY, (Y_Current_Value - Aim_Correction));
                }
            }
            else {
                if (Y_Current_Value - Y_Last_Value < Aim_Perfection_Limit) {
                    set_val(PS4_RY, (Y_Current_Value + Aim_Correction));
                }
            }
        }
        else if (Y_Last_Value > 0 && Y_Current_Value < 0) {
            if (Y_Last_Value + Y_Current_Value < Aim_Perfection_Limit) {
                set_val(PS4_RY, (Y_Current_Value - Aim_Correction));
            }
        }
        else if (Y_Last_Value < 0 && Y_Current_Value > 0) {
            if (Y_Current_Value - Y_Last_Value < Aim_Perfection_Limit) {
                set_val(PS4_RY, (Y_Current_Value + Aim_Correction));
            }
        }
        else {
            if (Y_Last_Value > Y_Current_Value) {
                if (Y_Last_Value - Y_Current_Value < Aim_Perfection_Limit) {
                    set_val(PS4_RY, (Y_Current_Value + Aim_Correction));
                }
            }
            else {
                if (Y_Current_Value - Y_Last_Value < Aim_Perfection_Limit) {
                    set_val(PS4_RY, (Y_Current_Value - Aim_Correction));
                }
            }
        }
    }
    Sampling_Done = TRUE;
    wait(Sampling_Time);
}
 
combo c_Fine_Tune_Aim {
    set_val(PS4_RX, (4 + fine_pulse));
    wait(Sampling_Time);
    wait(Sampling_Time);
    wait(Sampling_Time);
    set_val(PS4_RX, ( - 4 - fine_pulse));
    wait(Sampling_Time);
    wait(Sampling_Time);
    wait(Sampling_Time);
    fine_pulse = fine_pulse + 2;
    if (fine_pulse > 10) {
        fine_pulse = 0;
    }
}
 
combo c_spiroide_Aim_Assit {
    set_val(PS4_RY, (5 + spiroide_pulse));
    wait(Sampling_Time);
    wait(Sampling_Time);
    set_val(PS4_RX, (4 + spiroide_pulse));
    wait(Sampling_Time);
    wait(Sampling_Time);
    set_val(PS4_RY, (5 + spiroide_pulse));
    wait(Sampling_Time);
    wait(Sampling_Time);
    wait(Sampling_Time);
    wait(Sampling_Time);
    set_val(PS4_RY, (5 + spiroide_pulse));
    wait(Sampling_Time);
    wait(Sampling_Time);
    set_val(PS4_RX, ( - 4 - spiroide_pulse));
    wait(Sampling_Time);
    wait(Sampling_Time);
    set_val(PS4_RY, (5 + spiroide_pulse));
    wait(Sampling_Time);
    wait(Sampling_Time);
    wait(Sampling_Time);
    wait(Sampling_Time);
    spiroide_pulse = spiroide_pulse + 2;
    if (spiroide_pulse > 10) {
        spiroide_pulse = 0;
    }
}
 
 
function f_xy_val(f_axis, f_val) {
    if (abs(get_val(f_axis)) < release)
        return f_val;
    return get_val(f_axis);
}
 
function f_ar(f_axis, f_val) {
    v = get_val(f_axis);
    if (abs(v) <= f_val + 5)
        return v + f_val;
    return v;
}
 
ConsoleTuner Support Team || Discord || Custom Scripts
User avatar
Buffy
Lieutenant
Lieutenant
 
Posts: 422
Joined: Wed Jul 20, 2016 5:23 am


Return to GPC1 Script Programming

Who is online

Users browsing this forum: No registered users and 69 guests