Need someone to help with errors on gpc file

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

Need someone to help with errors on gpc file

Postby RichHomieThor » Wed Oct 21, 2020 11:29 am

Code: Select all
//Posted by Taylordrift21, a member of the device Community - https://device.com/forums
 
//Posted : Thursday 11th of June, 2020 12:08 CST6CDT 
 
 
/* *
* GPC SCRIPT
*
*  GPC is a scripting language with C-like syntax.
*  To learn more access GPC Language Reference on Help menu.
* *********************************************************************************************************************************************************************************************************************************** */

/*
 
 
// Modern Warfare Script For device Plus Ver 1.0
 
 
// Features
 
 
// Sweet Evil's Aim Assist - Aim Boost - Aim Correction - Aim Perfection
 
 
// Anti-Recoil Standard
 
 
 # # # # # # # # # # # # # # # #
 # /\/\/\/\/\/\/\/\/\/\/\/\/\/ #
 # /\/\/\/\  Made By  /\/\/\/\ #
 # /\/\/\ Taylordrift21 \/\/\/ # 
 # /\/\/\/\/\/\/\/\/\/\/\/\/\/ # 
 # # # # # # # # # # # # # # # #
 
 */

 
define Sampling_Time = 8;//10*; //10 //8 //16
define Aim_Boost = 8;//7;* //8 //6                 // Play with these to suit yourself
define Aim_Correction = 6//11//12;* //5//6//11 //3 // Play with these to suit yourself
define Aim_Perfection_Limit = 30;//30; //20 //25* //26 // Play with these to suit yourself
//operating aim perfection interval
define POS_Aim_Limit = 70;//70; //75
define NEG_Aim_Limit = -70;//-70; //75
define POS_Micro_MVT_Limit = 25;
define NEG_Micro_MVT_Limit = -25;
//Button Layout
define PS = 0;
define SHARE = 1;
define OPTIONS = 2;
define R1 = 3;
define R2 = 4;
define R3 = 5;
define L1 = 6;
define L2 = 7;
define L3 = 8;
define RX = 9;
define RY = 10;
define LX = 11;
define LY = 12;
define UP = 13;
define DOWN = 14;
define LEFT = 15;
define RIGHT = 16;
define TRIANGLE = 17;
define CIRCLE = 18;
define CROSS = 19;
define SQUARE = 20
define TOUCHPAD = 27;
// Sweet Evil's Aim Assist
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 spiroide_pulse = 0;
int fine_pulse = 0;
int Joystick_calibration = FALSE;
int RX_Axis_Joystick_calibrate = 0;
int RY_Axis_Joystick_calibrate = 0;
//Custom Sensitivity
int GEN_SENS = 100;
int ADS_SENS = 100;
int FIRE_SENS = 100;
int ADS_FIRE_SENS = 100;
int GRENADE_SENS = 100;
int CS = TRUE;
int USE_SENS;
/*NOTE:
Default = 100
Ranges from 0 to 327*/

 
 
 //Anti Recoil
    int AR = 10; //Vertical Recoil  // This is the value you can adjust for your anti-recoil
    int AR_H = 0: //Horizontal Recoil // This is the vlaue you can adjust for horizontal // Leave alone if you are not sure about it or have a play with it
    int AR_I = 1; //Change 1 to -1 If you play with Inverted
    int ARS;
 
    //Aim Assist
    int AS = TRUE;           // Change to FALSE if you don't want aim assist
    int aa          = 25;    // Decrease if shake or increase if you want stronger aim assist (it will cause more shake)
    int aa_delay    = 20;    // Increase if game lag
 
 
 
 
main {
 
 
//update main every 8ms --> only for PS4
    //vm_tctrl(-2);
        if (Joystick_calibration == FALSE)
            {
                RX_Axis_Joystick_calibrate = get_val(9);
                RY_Axis_Joystick_calibrate = get_val(10);
                Joystick_calibration = TRUE;     
            }
        X_Last_Value = X_Current_Value;
        Y_Last_Value = Y_Current_Value;
        X_Current_Value = get_lval(9)- RX_Axis_Joystick_calibrate;
        Y_Current_Value = get_lval(10)- RY_Axis_Joystick_calibrate;
            //--LT pulled
        if(get_val(7))
            {
            //--current & last value less than limit   
                if(abs(X_Current_Value) <= POS_Micro_MVT_Limit && abs(Y_Current_Value) <= POS_Micro_MVT_Limit)
                {
                    //--both have a value       
                    //if(X_Last_Value && X_Current_Value)
                        //{
                        //--difference between the 2 values less than 15         
                        if(abs(X_Last_Value - X_Current_Value) < 15)
                            {
                                combo_stop(Aim_Assist_Perfection);
                                Sampling_Done = FALSE;
 
                                //--RT pulled more than 95%
                                if(get_val(4) > 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);
                                    }   
                            }
                    //}
                }
                //--current and last greater than limit             
                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 //--LT not pulled
            {
                combo_stop(Fine_Tune_Aim);
                combo_stop(spiroide_Aim_Assit);
                combo_stop(Aim_Assist_Perfection);
                spiroide_pulse = 0;
                fine_pulse = 0;
                Sampling_Done = FALSE;   
            }
 
 
    if(CS)
    if(!get_val(L2) && !get_val(R2)) {
    USE_SENS=GEN_SENS;}
    else if(get_val(L2) && !get_val(R2)) {
    USE_SENS=ADS_SENS;}   
    else if(!get_val(L2) && get_val(R2)) {
    USE_SENS=FIRE_SENS;}
    else if(get_val(L2) && get_val(R2)) {
    USE_SENS=ADS_FIRE_SENS;}
    else if(get_val(R1)) {
    USE_SENS=GRENADE_SENS;}
    sensitivity(RY,NOT_USE,USE_SENS);
    sensitivity(RX,NOT_USE,USE_SENS);
 
    if(AS)
    if(get_val(L2)) combo_run(AS);
 
    if(get_val(L2) && get_val(R2))
    combo_run(AR);
 
 
    if(abs(get_val(RY)) > AR + 2 || abs(get_val(RX)) > AR + 2) {
    combo_stop(AR);}
 
    deadzone(L2,R2,100,100);
    }
 
    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(9)- RX_Axis_Joystick_calibrate;
        Y_Current_Value = get_lval(10)- RY_Axis_Joystick_calibrate;
 
     if (Sampling_Done == TRUE )
        {
            //Applying BOOST
            //Aim_Perfection(Last_Value, Current_Value, Boost, Correction, X_AXIS, Y_AXIS )
            Aim_Perfection(X_Last_Value, X_Current_Value, 1, 0, 1, 0 );
            Aim_Perfection(Y_Last_Value, Y_Current_Value, 1, 0, 0, 1 );
        }
 
        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(9)- RX_Axis_Joystick_calibrate;
        Y_Current_Value = get_lval(10)- RX_Axis_Joystick_calibrate;
 
   if (Sampling_Done == TRUE )
        {
            //Applying CORRECTION
            //Aim_Perfection(Last_Value, Current_Value, Boost, Correction, X_AXIS, Y_AXIS )
            Aim_Perfection(X_Last_Value, X_Current_Value, 0, 1, 1, 0 );
            Aim_Perfection(Y_Last_Value, Y_Current_Value, 0, 1, 0, 1 );
        }
 
        Sampling_Done = TRUE;
        wait(Sampling_Time);
    }
 
combo Fine_Tune_Aim {
 
    set_val(9,(15 - fine_pulse));//right
    set_val(11,(-15 + fine_pulse));//move left
    wait(Sampling_Time);
 
    wait(Sampling_Time);
    wait(Sampling_Time);
 
    set_val(9,(15 - fine_pulse));//right+down
    set_val(10,(10 - fine_pulse));
    set_val(11,(-5 + fine_pulse));//move left
    wait(Sampling_Time);
 
    wait(Sampling_Time);
    wait(Sampling_Time);
 
 
    set_val(10,(10 - fine_pulse));// down
    wait(Sampling_Time);
 
    wait(Sampling_Time);
    wait(Sampling_Time);
    wait(Sampling_Time);
 
    set_val(9,(-15 + fine_pulse));//left+down
    set_val(10,(10 - fine_pulse));
    set_val(11,(5 - fine_pulse))//move     right
    wait(Sampling_Time);
 
    wait(Sampling_Time)
    wait(Sampling_Time)
 
    set_val(9,(-15 + fine_pulse));// left
    set_val(11,(15 - fine_pulse))//move     right
    wait(Sampling_Time);
 
    wait(Sampling_Time);
    wait(Sampling_Time);
 
    set_val(9,(-15 + fine_pulse)); //left + up
    set_val(10,(-10 + fine_pulse));
    set_val(11,(5 - fine_pulse))//move     right
    wait(Sampling_Time);
 
    wait(Sampling_Time);
    wait(Sampling_Time);
 
    set_val(10,(-10 + fine_pulse)); //up
    wait(Sampling_Time);
 
    wait(Sampling_Time);
    wait(Sampling_Time);
    wait(Sampling_Time);
 
    set_val(9,(15 - fine_pulse));//right+up
    set_val(10,(-10 + fine_pulse));
    set_val(11,(-5 + fine_pulse))//move     left
    wait(Sampling_Time);
 
    wait(Sampling_Time);
 
    fine_pulse = fine_pulse + 2;
 
 
    if ( fine_pulse >10)
       {
            fine_pulse = 0;   
        }
   }
 
combo spiroide_Aim_Assit {
 
    set_val(9,(4 + spiroide_pulse));//right
    set_val(11,(-15+ spiroide_pulse));//move left
    wait(Sampling_Time);
 
    wait(Sampling_Time);
 
 
    set_val(10,(5 + spiroide_pulse));// down
    wait(Sampling_Time);
 
    wait(Sampling_Time);
    wait(Sampling_Time);
    wait(Sampling_Time);
 
    set_val(9,(-4 - spiroide_pulse));//left
    set_val(11,15 - spiroide_pulse );//move right
    wait(Sampling_Time);
 
    wait(Sampling_Time)
 
    set_val(10,(5 + spiroide_pulse));// down
    wait(Sampling_Time);
 
    wait(Sampling_Time);
    wait(Sampling_Time);
    wait(Sampling_Time);
 
 
    spiroide_pulse = spiroide_pulse + 2;
 
 
    if ( spiroide_pulse >10)
       {
            spiroide_pulse = 0;   
        }
   }
 
 
    combo AR {
    ARS = get_val(RY) + AR;
    if(ARS > 100) ARS = 100;
    set_val(RY,ARS * AR_I);
    ARS = get_val(RX) + AR_H;
    if(ARS > 100) ARS = 100;
    set_val(RX,ARS);}
 
    combo AS {
    set_val(RY,xy_val(RY,aa));
    wait(aa_delay)
    set_val(RX,xy_val(RX,aa));
    set_val(LX,xy_val(LX,aa));
    wait(aa_delay)
    set_val(RY,xy_val(RY,inv(aa)));
    wait(aa_delay)
    set_val(RX,xy_val(RX,inv(aa)));
    set_val(LX,xy_val(LX,inv(aa)));
    wait(aa_delay)
}
    function xy_val(f_axis,f_val) {
    if(abs(get_val(f_axis)) < aa + 1)
    return f_val;
    return get_val(f_axis);
}
  function Aim_Perfection(Last_Value, Current_Value, Boost, Correction, X_AXIS, Y_AXIS )
    {
 
 
       if(abs(Last_Value - Current_Value) < Aim_Perfection_Limit)
            {
                //--moving right
                if(Last_Value < Current_Value)
                    {           
                        if (Boost)
                            {
                                if (X_AXIS)
                                    set_val(9, (Current_Value + Aim_Boost));
 
                                if (Y_AXIS)
                                        set_val(10, (Current_Value + Aim_Boost));
                            }
 
 
                        else if(Correction)
                            {
                                if (X_AXIS)
                                    set_val(9, (Current_Value - Aim_Correction));
 
                                if (Y_AXIS)
                                set_val(10, (Current_Value - Aim_Correction));           
                            }
                    }
                else //--moving left
                    {
 
                        if (Boost)
                            {
                                if (X_AXIS)
                                    set_val(9, (Current_Value - Aim_Boost));
 
                                if (Y_AXIS)
                                        set_val(10, (Current_Value - Aim_Boost));
                            }
 
 
                        else if(Correction)
                            {
                                if (X_AXIS)
                                    set_val(9, (Current_Value + Aim_Correction));
 
                                if (Y_AXIS)
                                set_val(10, (Current_Value + Aim_Correction));           
                            }
                    }
            }
    }
User avatar
RichHomieThor
Staff Sergeant
Staff Sergeant
 
Posts: 10
Joined: Mon Oct 19, 2020 7:21 am

Re: Need someone to help with errors on gpc file

Postby Mad » Wed Oct 21, 2020 7:40 pm

Modern_Warfare_Taylordrift21.gpc
(11.62 KiB) Downloaded 127 times
ConsoleTuner Support Team || ConsoleTuner Discord || InputSense Discord
Mad
Major General
Major General
 
Posts: 4536
Joined: Wed May 22, 2019 5:39 am

Re: Need someone to help with errors on gpc file

Postby MXLANDRO » Thu Jun 22, 2023 12:26 pm

Mad wrote:
Modern_Warfare_Taylordrift21.gpc



Hello, I am years later finding this. There's still an error at line 64 with 'define'. I have another script with the same issue. I tried my best to ''correct it'' but I can't.


Any help would be appreciated.


Thanks.
User avatar
MXLANDRO
Private
Private
 
Posts: 1
Joined: Wed Jun 21, 2023 8:22 pm

Re: Need someone to help with errors on gpc file

Postby Mad » Sat Jun 24, 2023 10:29 am

MXLANDRO wrote:Hello, I am years later finding this. There's still an error at line 64 with 'define'.

You're in the Titan one section.

If you want to use it for the T2:
Code: Select all
#include <titanone.gph>
 
// Modern Warfare Script For device Plus Ver 1.0
 
 
// Features
// Sweet Evil's Aim Assist - Aim Boost - Aim Correction - Aim Perfection
 
// Anti-Recoil Standard
 
//Made By Taylordrift21 
 
define Sampling_Time = 8;//10*; //10 //8 //16
define Aim_Boost = 8;//7;* //8 //6                 // Play with these to suit yourself
define Aim_Correction = 6;//11//12;* //5//6//11 //3 // Play with these to suit yourself
define Aim_Perfection_Limit = 30;//30; //20 //25* //26 // Play with these to suit yourself
//operating aim perfection interval
define POS_Aim_Limit = 70;//70; //75
int NEG_Aim_Limit = -70;//-70; //75
define POS_Micro_MVT_Limit = 25;
int NEG_Micro_MVT_Limit = -25;
//Button Layout
define PS = 0;
define SHARE = 1;
define OPTIONS = 2;
define R1 = 3;
define R2 = 4;
define R3 = 5;
define L1 = 6;
define L2 = 7;
define L3 = 8;
define RX = 9;
define RY = 10;
define LX = 11;
define LY = 12;
define UP = 13;
define DOWN = 14;
define LEFT = 15;
define RIGHT = 16;
define TRIANGLE = 17;
define CIRCLE = 18;
define CROSS = 19;
define SQUARE = 20;
define TOUCHPAD = 27;
// Sweet Evil's Aim Assist
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 spiroide_pulse = 0;
int fine_pulse = 0;
int Joystick_calibration = FALSE;
int RX_Axis_Joystick_calibrate = 0;
int RY_Axis_Joystick_calibrate = 0;
//Custom Sensitivity
int GEN_SENS = 100;
int ADS_SENS = 100;
int FIRE_SENS = 100;
int ADS_FIRE_SENS = 100;
int GRENADE_SENS = 100;
int CS = TRUE;
int USE_SENS;
/*NOTE:
Default = 100
Ranges from 0 to 327*/

 
 
 //Anti Recoil
    int AR = 10; //Vertical Recoil  // This is the value you can adjust for your anti-recoil
    int AR_H = 0; //Horizontal Recoil // This is the vlaue you can adjust for horizontal // Leave alone if you are not sure about it or have a play with it
    int AR_I = 1; //Change 1 to -1 If you play with Inverted
    int ARS;
 
    //Aim Assist
    int AS = TRUE;           // Change to FALSE if you don't want aim assist
    int aa          = 25;    // Decrease if shake or increase if you want stronger aim assist (it will cause more shake)
    int aa_delay    = 20;    // Increase if game lag
 
 
 
 
main {
 
 
//update main every 8ms --> only for PS4
    //vm_tctrl(-2);
        if (Joystick_calibration == FALSE)
            {
                RX_Axis_Joystick_calibrate = get_val(9);
                RY_Axis_Joystick_calibrate = get_val(10);
                Joystick_calibration = TRUE;     
            }
        X_Last_Value = X_Current_Value;
        Y_Last_Value = Y_Current_Value;
        X_Current_Value = get_lval(9)- RX_Axis_Joystick_calibrate;
        Y_Current_Value = get_lval(10)- RY_Axis_Joystick_calibrate;
            //--LT pulled
        if(get_val(7))
            {
            //--current & last value less than limit   
                if(abs(X_Current_Value) <= POS_Micro_MVT_Limit && abs(Y_Current_Value) <= POS_Micro_MVT_Limit)
                {
                    //--both have a value       
                    //if(X_Last_Value && X_Current_Value)
                        //{
                        //--difference between the 2 values less than 15         
                        if(abs(X_Last_Value - X_Current_Value) < 15)
                            {
                                combo_stop(Aim_Assist_Perfection);
                                Sampling_Done = FALSE;
 
                                //--RT pulled more than 95%
                                if(get_val(4) > 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);
                                    }   
                            }
                    //}
                }
                //--current and last greater than limit             
                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 //--LT not pulled
            {
                combo_stop(Fine_Tune_Aim);
                combo_stop(spiroide_Aim_Assit);
                combo_stop(Aim_Assist_Perfection);
                spiroide_pulse = 0;
                fine_pulse = 0;
                Sampling_Done = FALSE;   
            }
 
 
    if(CS)
    if(!get_val(L2) && !get_val(R2)) {
    USE_SENS=GEN_SENS;}
    else if(get_val(L2) && !get_val(R2)) {
    USE_SENS=ADS_SENS;}   
    else if(!get_val(L2) && get_val(R2)) {
    USE_SENS=FIRE_SENS;}
    else if(get_val(L2) && get_val(R2)) {
    USE_SENS=ADS_FIRE_SENS;}
    else if(get_val(R1)) {
    USE_SENS=GRENADE_SENS;}
    sensitivity(RY,NOT_USE,USE_SENS);
    sensitivity(RX,NOT_USE,USE_SENS);
 
    if(AS)
    if(get_val(L2)) combo_run(cAS);
 
    if(get_val(L2) && get_val(R2))
    combo_run(cAR);
 
 
    if(abs(get_val(RY)) > AR + 2 || abs(get_val(RX)) > AR + 2) {
    combo_stop(cAR);}
 
    deadzone(L2,R2,100,100);
    }
 
    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(9)- RX_Axis_Joystick_calibrate;
        Y_Current_Value = get_lval(10)- RY_Axis_Joystick_calibrate;
 
     if (Sampling_Done == TRUE )
        {
            //Applying BOOST
            //Aim_Perfection(Last_Value, Current_Value, Boost, Correction, X_AXIS, Y_AXIS )
            Aim_Perfection(X_Last_Value, X_Current_Value, 1, 0, 1, 0 );
            Aim_Perfection(Y_Last_Value, Y_Current_Value, 1, 0, 0, 1 );
        }
 
        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(9)- RX_Axis_Joystick_calibrate;
        Y_Current_Value = get_lval(10)- RX_Axis_Joystick_calibrate;
 
   if (Sampling_Done == TRUE )
        {
            //Applying CORRECTION
            //Aim_Perfection(Last_Value, Current_Value, Boost, Correction, X_AXIS, Y_AXIS )
            Aim_Perfection(X_Last_Value, X_Current_Value, 0, 1, 1, 0 );
            Aim_Perfection(Y_Last_Value, Y_Current_Value, 0, 1, 0, 1 );
        }
 
        Sampling_Done = TRUE;
        wait(Sampling_Time);
    }
 
combo Fine_Tune_Aim {
 
    set_val(9,(15 - fine_pulse));//right
    set_val(11,(-15 + fine_pulse));//move left
    wait(Sampling_Time);
 
    wait(Sampling_Time);
    wait(Sampling_Time);
 
    set_val(9,(15 - fine_pulse));//right+down
    set_val(10,(10 - fine_pulse));
    set_val(11,(-5 + fine_pulse));//move left
    wait(Sampling_Time);
 
    wait(Sampling_Time);
    wait(Sampling_Time);
 
 
    set_val(10,(10 - fine_pulse));// down
    wait(Sampling_Time);
 
    wait(Sampling_Time);
    wait(Sampling_Time);
    wait(Sampling_Time);
 
    set_val(9,(-15 + fine_pulse));//left+down
    set_val(10,(10 - fine_pulse));
    set_val(11,(5 - fine_pulse));//move     right
    wait(Sampling_Time);
 
    wait(Sampling_Time);
    wait(Sampling_Time);
 
    set_val(9,(-15 + fine_pulse));// left
    set_val(11,(15 - fine_pulse));//move     right
    wait(Sampling_Time);
 
    wait(Sampling_Time);
    wait(Sampling_Time);
 
    set_val(9,(-15 + fine_pulse)); //left + up
    set_val(10,(-10 + fine_pulse));
    set_val(11,(5 - fine_pulse));//move     right
    wait(Sampling_Time);
 
    wait(Sampling_Time);
    wait(Sampling_Time);
 
    set_val(10,(-10 + fine_pulse)); //up
    wait(Sampling_Time);
 
    wait(Sampling_Time);
    wait(Sampling_Time);
    wait(Sampling_Time);
 
    set_val(9,(15 - fine_pulse));//right+up
    set_val(10,(-10 + fine_pulse));
    set_val(11,(-5 + fine_pulse));//move     left
    wait(Sampling_Time);
 
    wait(Sampling_Time);
 
    fine_pulse = fine_pulse + 2;
 
 
    if ( fine_pulse >10)
       {
            fine_pulse = 0;   
        }
   }
 
combo spiroide_Aim_Assit {
 
    set_val(9,(4 + spiroide_pulse));//right
    set_val(11,(-15+ spiroide_pulse));//move left
    wait(Sampling_Time);
 
    wait(Sampling_Time);
 
 
    set_val(10,(5 + spiroide_pulse));// down
    wait(Sampling_Time);
 
    wait(Sampling_Time);
    wait(Sampling_Time);
    wait(Sampling_Time);
 
    set_val(9,(-4 - spiroide_pulse));//left
    set_val(11,15 - spiroide_pulse );//move right
    wait(Sampling_Time);
 
    wait(Sampling_Time);
 
    set_val(10,(5 + spiroide_pulse));// down
    wait(Sampling_Time);
 
    wait(Sampling_Time);
    wait(Sampling_Time);
    wait(Sampling_Time);
 
 
    spiroide_pulse = spiroide_pulse + 2;
 
 
    if ( spiroide_pulse >10)
       {
            spiroide_pulse = 0;   
        }
   }
 
 
    combo cAR {
    ARS = get_val(RY) + AR;
    if(ARS > 100) ARS = 100;
    set_val(RY,ARS * AR_I);
    ARS = get_val(RX) + AR_H;
    if(ARS > 100) ARS = 100;
    set_val(RX,ARS);}
 
    combo cAS {
    set_val(RY,xy_val(RY,aa));
    wait(aa_delay);
    set_val(RX,xy_val(RX,aa));
    set_val(LX,xy_val(LX,aa));
    wait(aa_delay);
    set_val(RY,xy_val(RY,inv(aa)));
    wait(aa_delay);
    set_val(RX,xy_val(RX,inv(aa)));
    set_val(LX,xy_val(LX,inv(aa)));
    wait(aa_delay);
}
    function xy_val(f_axis,f_val) {
    if(abs(get_val(f_axis)) < aa + 1)
    return f_val;
    return get_val(f_axis);
}
  function Aim_Perfection(Last_Value, Current_Value, Boost, Correction, X_AXIS, Y_AXIS )
    {
 
 
       if(abs(Last_Value - Current_Value) < Aim_Perfection_Limit)
            {
                //--moving right
                if(Last_Value < Current_Value)
                    {           
                        if (Boost)
                            {
                                if (X_AXIS)
                                    set_val(9, (Current_Value + Aim_Boost));
 
                                if (Y_AXIS)
                                        set_val(10, (Current_Value + Aim_Boost));
                            }
 
 
                        else if(Correction)
                            {
                                if (X_AXIS)
                                    set_val(9, (Current_Value - Aim_Correction));
 
                                if (Y_AXIS)
                                set_val(10, (Current_Value - Aim_Correction));           
                            }
                    }
                else //--moving left
                    {
 
                        if (Boost)
                            {
                                if (X_AXIS)
                                    set_val(9, (Current_Value - Aim_Boost));
 
                                if (Y_AXIS)
                                        set_val(10, (Current_Value - Aim_Boost));
                            }
 
 
                        else if(Correction)
                            {
                                if (X_AXIS)
                                    set_val(9, (Current_Value + Aim_Correction));
 
                                if (Y_AXIS)
                                set_val(10, (Current_Value + Aim_Correction));           
                            }
                    }
            }
    }
ConsoleTuner Support Team || ConsoleTuner Discord || InputSense Discord
Mad
Major General
Major General
 
Posts: 4536
Joined: Wed May 22, 2019 5:39 am


Return to GPC1 Script Programming

Who is online

Users browsing this forum: No registered users and 116 guests