Would appreciate help with script conversion

GPC2 script programming for Titan Two. Code examples, questions, requests.

Would appreciate help with script conversion

Postby PuckItYolo » Sat Aug 18, 2018 9:00 am

I was wondering if I'd be able to get assistance converting this script to become compatible with Titan Two. I have already included the GPC Header for the Titan at the top of the script along with shifting the descriptions (mostly for myself) along with the initialization and a few Define variables to the left side of the script to make it easier for anyone who might help. I am pulling "declaration syntax" errors from a few combo keywords.

I have tried renaming/and or adding a simple letter to these combos as well as changing the combos in the combo_run/stop sections to match, but to no avail. So I'm stumped, along with me being unsure what to do with the "Notify" declaration error as well. I also appreciate any input on what you did to rectify these errors and I will thoroughly study the changes. Input on what you did to correct these errors aren't necessary since I should be able to figure out what you did, but is still appreciated. I've also left the credit to the original author in there since I'm not claiming it as my own.

Code: Select all
#include <titanone.gph>
 
/*                                         ______ ____  _____ _______ _   _ _____ _______ ______
                                      // *|  ____/ __ \|  __ \__   __| \ | |_   _|__   __|  ____|* //
 SCRIPT FEATURES                      // *| |__ | |  | | |__) | | |  |  \| | | |    | |  | |__   * //
 - Aim Abuse                          // *|  __|| |  | |  _  /  | |  | . ` | | |    | |  |  __|  * //
 - Aim Assist                         // *| |   | |__| | | \ \  | |  | |\  |_| |_   | |  | |____ * //
 - 100% Accuracy                      // *|_|    \____/|_|  \_\ |_|  |_| \_|_____|  |_|  |______|* //
 - Anti Recoil
 - Turbo Harvesting (New Method)
 
Credits: WalterHMartinez                                                                         
Tested With Builder Pro Only! (XB1/PS4)                                                               
-------------------------------------------------                                                           
NOTE INSTRUCTIONS ARE BELOW!                                                                       
DROP A LIKE ON THIS SCRIPT AND SHOW SOME LOVE*/
                                                             
 
//IN GAME SENS X/Y
int In_Game_Sens = 7                                                                                                                                 ;
 
//SINGLE SHOT                                                           
int SINGLESHOT = TRUE;                                                           
 
//AIM ABUSE
int AimAbuse = TRUE;                                                           
int AimSpeed = 85;                                                                                         
int delay = 14;                                                                                                                     
 
//AIM ASSIST 
int AimAssist = TRUE;
int valueX = 20;
int delayA = 7;             
 
//ANTI RECOIL
int ANTI_RECOIL; //--ANTI RECOIL
int anti_recoil;
define AR_Release = 23;
define ONLY_WITH_SCOPE = TRUE;
 
//TURBO FARMING
int PICKAXE = FALSE;
 
//DROP SHOT
int DROPSHOT = FALSE; //--DROPSHOT
 
 
/*=========================================================================================
INSTRUCTIONS OF USE:
 
NOTICE: XBOX HOME BUTTON/PS4 NOW BRINGS UP MAP!
 
===========================================================================================
AIM ABUSE: Aim Abuse Is Always On, If Using Scoped Weapons Hold ADS Button Less Than 95% You'll Be Able
To Use Scope.
===========================================================================================
DROP SHOT: Simply Press View/Share Button To Enable Drop Shot Mode.
 ===========================================================================================
ANTI RECOIL: This Is Always On, Just Shoot Away!
===========================================================================================
SINGLE SHOT: This Is Always On, Hold ADS Button And Right Bumper To Shoot Players At A Greater Distance.
===========================================================================================
TURBO HARVESTING: Hold ADS And Hold Left Bump To Use. Make Sure You Have Some Sort Of Explosive
In Your First Slot For It To Work And Make Sure Your Slot One With The Explosive Is Selected.
===========================================================================================
AIM ASSIST: This Is Always On, Hold ADS And Abuse The Aim Assist.
=================================================*/

 
//--------------------------------------------> INITALIZATION
   int a; int b; int rumble_type = RUMBLE_A;
 
   define FIRE_BTN   = XB1_RT;
   define ADS_BTN    = XB1_LT;
   define CROUCH_BTN = XB1_RS;
   define SPRINT_BTN = XB1_LS;
   define JUMP_BTN   = XB1_A;
   define RIGHT_BUMP = XB1_RB;
   define LEFT_BUMP  = XB1_LB;
   define SWAP_BTN   = XB1_Y;
   define BUILD_BTN  = XB1_B;
   define RELOAD_BTN = XB1_X;
   define LX         = XB1_LX;
   define RX         = XB1_RX;
   define RY         = XB1_RY;
   define LY         = XB1_LY;
   define UP         = XB1_UP;
   define DOWN       = XB1_DOWN;
   define LEFT       = XB1_LEFT;
   define RIGHT      = XB1_RIGHT;
   define HOME       = XB1_XBOX;
   define VIEW       = XB1_VIEW;
/*------------------------------
 
           BUILDER PRO*/
                                                           
   define WALL_BTN   = XB1_RT;
   define STAIRS_BTN = XB1_LT;
   define FLOOR_BTN  = XB1_RB;
   define ROOF_BTN   = XB1_LB;
 
     //<--Unmapped Buttons-->
   remap XB1_XBOX XB1_VIEW
   unmap XB1_XBOX
 
 
//------------------| MAIN |-----------------------------
 
 
main {
 
         //AimAssist Settings
         delayA = (7 * valueX ) / In_Game_Sens; set_val(TRACE_2, delayA);
 
        //////AIM ASSIST//////---------------<3
    if (AimAssist){
    if (get_val(ADS_BTN)){
       combo_run(Aim_Assist);
       }
    if ((get_val(RX)) > valueX || (get_val(RX)) < valueX*(-1)){
       combo_stop(Aim_Assist);
       }
          }   
 
        //////ANTI RECOIL//////---------------<3
    if (get_val(ADS_BTN) && get_val(FIRE_BTN)) {
        ANTI_RECOIL = 8;
        combo_run(AntiRecoil);
        }
 
        //////AIM ABUSE//////---------------<3
    if (AimAbuse){
    if (get_val(ADS_BTN) > 95) {
       combo_run(AIM_ABUSE);}
    if (event_release(ADS_BTN)){ combo_stop(AIM_ABUSE);}
       }   
 
        //////DROP SHOT//////---------------<3
    if (!get_val(ADS_BTN) && event_press(VIEW)) {
        DROPSHOT = !DROPSHOT;
    if (DROPSHOT == TRUE){combo_run(Notify);a=0;b=2;}
    if (DROPSHOT == FALSE){combo_run(Notify);a=2;b=0;}
        rumble_A_if_true(DROPSHOT);
        }
    if (DROPSHOT) {
    if (get_val(ADS_BTN) && get_val(FIRE_BTN)) {
        combo_run(DROP_SHOT);
        }
           }
 
           /////TURBO FARMING//////---------------<3
     if (get_val(ADS_BTN) && get_val(LEFT_BUMP)) {
        combo_run(Harvesting);
        combo_run(Notify);a=0;b=2;
        set_val(LEFT_BUMP, 0);
        } else {
        combo_stop(Harvesting);
        }
 
 
        //////DEAD ZONE(0)//////---------------<3
    if (abs(get_val(PS4_LY)) < 0 && abs(get_val(PS4_LX)) < 0 ){       
        set_val(PS4_LY,0);                                               
        set_val(PS4_LX,0);                                               
        }                                                                                           
    if (abs(get_val(PS4_RY)) < 0 && abs(get_val(PS4_RX)) < 0 ){         
        set_val(PS4_RY,0);                                                 
        set_val(PS4_RX,0);                                               
        }       
 
        //////SINGLE SHOT//////---------------<3
    if (get_val(ADS_BTN) && get_val(RIGHT_BUMP)) {
        combo_run(SINGLESHOT);
        combo_run(Notify);a=0;b=2;
        set_val(RIGHT_BUMP, 0);
        } else {
        combo_stop(SINGLESHOT);
        }
           }
 
//  MAIN BLOCK END   
//---------------------------------------------| COMBO's
 
 
combo Notify {
    set_led(LED_1,0);
    set_led(LED_2,a);
    set_led(LED_3,b);
    set_led(LED_4,0);
    wait(550);
    set_led(LED_1,0);
    set_led(LED_2,0);
    set_led(LED_3,0);
    set_led(LED_4,0);
    wait(250);
    set_led(LED_1,0);
    set_led(LED_2,a);
    set_led(LED_3,b);
    set_led(LED_4,0);
    wait(250);
    set_led(LED_1,0);
    set_led(LED_2,0);
    set_led(LED_3,0);
    set_led(LED_4,0);
    wait(250);
    set_led(LED_1,0);
    set_led(LED_2,a);
    set_led(LED_3,b);
    set_led(LED_4,0);
    wait(250);
    reset_leds();
}
 
combo AntiRecoil {
    anti_recoil = get_val(RY) + ANTI_RECOIL;
    if (anti_recoil > 100) anti_recoil = 100;
    set_val(RY, anti_recoil);
}
 
combo Aim_Assist {
    wait(4)//45
    set_val(RX, valueX);
    wait(delayA);
    set_val(RX, valueX*(-1));
    wait(delayA);
}
 
combo AIM_ABUSE{
    set_val(ADS_BTN,100);
    wait(AimSpeed);
    set_val(ADS_BTN,0);
    wait(delay);   
}
 
combo SINGLESHOT {
    set_val(FIRE_BTN,100);
    wait(100);
    wait(250);
    set_val(FIRE_BTN,100);
}
 
combo DROP_SHOT{
    set_val(CROUCH_BTN,100);
    wait(40);
    wait(200);
    set_val(CROUCH_BTN,100);
}
 
combo Harvesting {
    set_val(FIRE_BTN, 100);
    wait(163);
    set_val(RIGHT_BUMP, 100);
    wait(35);
    set_val(SWAP_BTN, 100);
    wait(225);
}
 
combo VIBRATE {
    set_rumble(rumble_type, 100);
    wait(300);
    reset_rumble();
}
 
function rumble_A_if_true(var) {
    if (var) rumble_type = RUMBLE_A;
    else rumble_type = RUMBLE_B;
    combo_run(VIBRATE);
}
User avatar
PuckItYolo
Sergeant First Class
Sergeant First Class
 
Posts: 21
Joined: Sat Aug 11, 2018 10:45 pm

Re: Would appreciate help with script conversion

Postby Scachi » Sat Aug 18, 2018 9:09 am

the remap command seems to be different between the devices. The T1 needs a "->" between the buttons.
2 or 3 ; where missing
renamed the SINGLESHOT combo to cSINGLESHOT to get rid of the invalid redefinition error

This compiles:
Code: Select all
#include <titanone.gph>
 
/*                                         ______ ____  _____ _______ _   _ _____ _______ ______
                                      // *|  ____/ __ \|  __ \__   __| \ | |_   _|__   __|  ____|* //
 SCRIPT FEATURES                      // *| |__ | |  | | |__) | | |  |  \| | | |    | |  | |__   * //
 - Aim Abuse                          // *|  __|| |  | |  _  /  | |  | . ` | | |    | |  |  __|  * //
 - Aim Assist                         // *| |   | |__| | | \ \  | |  | |\  |_| |_   | |  | |____ * //
 - 100% Accuracy                      // *|_|    \____/|_|  \_\ |_|  |_| \_|_____|  |_|  |______|* //
 - Anti Recoil
 - Turbo Harvesting (New Method)
 
Credits: WalterHMartinez                                                                         
Tested With Builder Pro Only! (XB1/PS4)                                                               
-------------------------------------------------                                                           
NOTE INSTRUCTIONS ARE BELOW!                                                                       
DROP A LIKE ON THIS SCRIPT AND SHOW SOME LOVE*/
                                                             
 
//IN GAME SENS X/Y
int In_Game_Sens = 7                                                                                                                                 ;
 
//SINGLE SHOT                                                           
int SINGLESHOT = TRUE;                                                           
 
//AIM ABUSE
int AimAbuse = TRUE;                                                           
int AimSpeed = 85;                                                                                         
int delay = 14;                                                                                                                     
 
//AIM ASSIST 
int AimAssist = TRUE;
int valueX = 20;
int delayA = 7;             
 
//ANTI RECOIL
int ANTI_RECOIL; //--ANTI RECOIL
int anti_recoil;
define AR_Release = 23;
define ONLY_WITH_SCOPE = TRUE;
 
//TURBO FARMING
int PICKAXE = FALSE;
 
//DROP SHOT
int DROPSHOT = FALSE; //--DROPSHOT
 
 
/*=========================================================================================
INSTRUCTIONS OF USE:
 
NOTICE: XBOX HOME BUTTON/PS4 NOW BRINGS UP MAP!
 
===========================================================================================
AIM ABUSE: Aim Abuse Is Always On, If Using Scoped Weapons Hold ADS Button Less Than 95% You'll Be Able
To Use Scope.
===========================================================================================
DROP SHOT: Simply Press View/Share Button To Enable Drop Shot Mode.
 ===========================================================================================
ANTI RECOIL: This Is Always On, Just Shoot Away!
===========================================================================================
SINGLE SHOT: This Is Always On, Hold ADS Button And Right Bumper To Shoot Players At A Greater Distance.
===========================================================================================
TURBO HARVESTING: Hold ADS And Hold Left Bump To Use. Make Sure You Have Some Sort Of Explosive
In Your First Slot For It To Work And Make Sure Your Slot One With The Explosive Is Selected.
===========================================================================================
AIM ASSIST: This Is Always On, Hold ADS And Abuse The Aim Assist.
=================================================*/

 
//--------------------------------------------> INITALIZATION
   int a; int b; int rumble_type = RUMBLE_A;
 
   define FIRE_BTN   = XB1_RT;
   define ADS_BTN    = XB1_LT;
   define CROUCH_BTN = XB1_RS;
   define SPRINT_BTN = XB1_LS;
   define JUMP_BTN   = XB1_A;
   define RIGHT_BUMP = XB1_RB;
   define LEFT_BUMP  = XB1_LB;
   define SWAP_BTN   = XB1_Y;
   define BUILD_BTN  = XB1_B;
   define RELOAD_BTN = XB1_X;
   define LX         = XB1_LX;
   define RX         = XB1_RX;
   define RY         = XB1_RY;
   define LY         = XB1_LY;
   define UP         = XB1_UP;
   define DOWN       = XB1_DOWN;
   define LEFT       = XB1_LEFT;
   define RIGHT      = XB1_RIGHT;
   define HOME       = XB1_XBOX;
   define VIEW       = XB1_VIEW;
/*------------------------------
 
           BUILDER PRO*/
                                                           
   define WALL_BTN   = XB1_RT;
   define STAIRS_BTN = XB1_LT;
   define FLOOR_BTN  = XB1_RB;
   define ROOF_BTN   = XB1_LB;
 
     //<--Unmapped Buttons-->
   remap XB1_XBOX->XB1_VIEW;
   unmap XB1_XBOX;
 
 
//------------------| MAIN |-----------------------------
 
 
main {
 
         //AimAssist Settings
         delayA = (7 * valueX ) / In_Game_Sens; set_val(TRACE_2, delayA);
 
        //////AIM ASSIST//////---------------<3
    if (AimAssist){
    if (get_val(ADS_BTN)){
       combo_run(Aim_Assist);
       }
    if ((get_val(RX)) > valueX || (get_val(RX)) < valueX*(-1)){
       combo_stop(Aim_Assist);
       }
          }   
 
        //////ANTI RECOIL//////---------------<3
    if (get_val(ADS_BTN) && get_val(FIRE_BTN)) {
        ANTI_RECOIL = 8;
        combo_run(AntiRecoil);
        }
 
        //////AIM ABUSE//////---------------<3
    if (AimAbuse){
    if (get_val(ADS_BTN) > 95) {
       combo_run(AIM_ABUSE);}
    if (event_release(ADS_BTN)){ combo_stop(AIM_ABUSE);}
       }   
 
        //////DROP SHOT//////---------------<3
    if (!get_val(ADS_BTN) && event_press(VIEW)) {
        DROPSHOT = !DROPSHOT;
    if (DROPSHOT == TRUE){combo_run(Notify);a=0;b=2;}
    if (DROPSHOT == FALSE){combo_run(Notify);a=2;b=0;}
        rumble_A_if_true(DROPSHOT);
        }
    if (DROPSHOT) {
    if (get_val(ADS_BTN) && get_val(FIRE_BTN)) {
        combo_run(DROP_SHOT);
        }
           }
 
           /////TURBO FARMING//////---------------<3
     if (get_val(ADS_BTN) && get_val(LEFT_BUMP)) {
        combo_run(Harvesting);
        combo_run(Notify);a=0;b=2;
        set_val(LEFT_BUMP, 0);
        } else {
        combo_stop(Harvesting);
        }
 
 
        //////DEAD ZONE(0)//////---------------<3
    if (abs(get_val(PS4_LY)) < 0 && abs(get_val(PS4_LX)) < 0 ){       
        set_val(PS4_LY,0);                                               
        set_val(PS4_LX,0);                                               
        }                                                                                           
    if (abs(get_val(PS4_RY)) < 0 && abs(get_val(PS4_RX)) < 0 ){         
        set_val(PS4_RY,0);                                                 
        set_val(PS4_RX,0);                                               
        }       
 
        //////SINGLE SHOT//////---------------<3
    if (get_val(ADS_BTN) && get_val(RIGHT_BUMP)) {
        combo_run(cSINGLESHOT);
        combo_run(Notify);a=0;b=2;
        set_val(RIGHT_BUMP, 0);
        } else {
        combo_stop(cSINGLESHOT);
        }
}
 
//  MAIN BLOCK END   
//---------------------------------------------| COMBO's
 
 
combo Notify {
    set_led(LED_1,0);
    set_led(LED_2,a);
    set_led(LED_3,b);
    set_led(LED_4,0);
    wait(550);
    set_led(LED_1,0);
    set_led(LED_2,0);
    set_led(LED_3,0);
    set_led(LED_4,0);
    wait(250);
    set_led(LED_1,0);
    set_led(LED_2,a);
    set_led(LED_3,b);
    set_led(LED_4,0);
    wait(250);
    set_led(LED_1,0);
    set_led(LED_2,0);
    set_led(LED_3,0);
    set_led(LED_4,0);
    wait(250);
    set_led(LED_1,0);
    set_led(LED_2,a);
    set_led(LED_3,b);
    set_led(LED_4,0);
    wait(250);
    reset_leds();
}
 
combo AntiRecoil {
    anti_recoil = get_val(RY) + ANTI_RECOIL;
    if (anti_recoil > 100) anti_recoil = 100;
    set_val(RY, anti_recoil);
}
 
combo Aim_Assist {
    wait(4);//45
    set_val(RX, valueX);
    wait(delayA);
    set_val(RX, valueX*(-1));
    wait(delayA);
}
 
combo AIM_ABUSE{
    set_val(ADS_BTN,100);
    wait(AimSpeed);
    set_val(ADS_BTN,0);
    wait(delay);   
}
 
combo cSINGLESHOT {
    set_val(FIRE_BTN,100);
    wait(100);
    wait(250);
    set_val(FIRE_BTN,100);
}
 
combo DROP_SHOT{
    set_val(CROUCH_BTN,100);
    wait(40);
    wait(200);
    set_val(CROUCH_BTN,100);
}
 
combo Harvesting {
    set_val(FIRE_BTN, 100);
    wait(163);
    set_val(RIGHT_BUMP, 100);
    wait(35);
    set_val(SWAP_BTN, 100);
    wait(225);
}
 
combo VIBRATE {
    set_rumble(rumble_type, 100);
    wait(300);
    reset_rumble();
}
 
function rumble_A_if_true(var) {
    if (var) rumble_type = RUMBLE_A;
    else rumble_type = RUMBLE_B;
    combo_run(VIBRATE);
}


it looks like
int SINGLESHOT = TRUE;
isn't used at all in the code, so instead of renaming the combo removing this line "int SING..." should have worked too.
User avatar
Scachi
Brigadier General
Brigadier General
 
Posts: 3044
Joined: Wed May 11, 2016 6:25 am
Location: Germany

Re: Would appreciate help with script conversion

Postby PuckItYolo » Sat Aug 18, 2018 9:16 am

Scachi wrote:the remap command seems to be different between the devices. The T1 needs a "->" between the buttons.
2 or 3 ; where missing
renamed the SINGLESHOT combo to cSINGLESHOT to get rid of the invalid redefinition error


Thank you for the quick reply! I understand your explanation of the redefinition errors. So what would the missing "->" flag error-wise?
User avatar
PuckItYolo
Sergeant First Class
Sergeant First Class
 
Posts: 21
Joined: Sat Aug 11, 2018 10:45 pm

Re: Would appreciate help with script conversion

Postby Scachi » Sat Aug 18, 2018 9:24 am

Not sure if I understand your question correctly..
without correcting the -> in the remap command it is a bit difficult to track the error down as the compiler fails to see where the command ends and just reports something else as the error:
Code: Select all
GPC error: e.gpc(182): Declaration syntax error 'combo'
GPC error: e.gpc(211): Declaration syntax error 'combo'
GPC error: e.gpc(217): Declaration syntax error 'combo'
GPC error: e.gpc(225): Declaration syntax error 'combo'
GPC error: e.gpc(232): Declaration syntax error 'combo'
GPC error: e.gpc(239): Declaration syntax error 'combo'
GPC error: e.gpc(246): Declaration syntax error 'combo'
GPC error: e.gpc(255): Declaration syntax error 'combo'
GPC error: e.gpc(261): Declaration syntax error '('

So this error msg isn't helping much.

If I can't see the error near the reported line I start from the top watching out for missing ; or } or );
If this isn't helping I start to add multiline comments /* */ to parts of the code to check if a different error is reported then.
User avatar
Scachi
Brigadier General
Brigadier General
 
Posts: 3044
Joined: Wed May 11, 2016 6:25 am
Location: Germany


Return to GPC2 Script Programming

Who is online

Users browsing this forum: kubawaz and 73 guests