fix errors please

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

fix errors please

Postby c0ns013tun3r » Mon Jan 07, 2019 1:56 am

if possible please make a tutorial on how to fix some of these errors from cm cause I don't want to keep bothering you guys with conversions

Code: Select all
/*+++++++  +++++++++++++++++++++++++++++
H1Z1 :Beta Version 1.02
 
Coded by
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++(lokidagawd)++++++++++++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 ???     ??????   ?? ??? ???? ??????  ???        ?????  ???       ?     ????????? ++
????    ????  ??? ????? ????? ??? ?????????     ??? ?????????    ??? ? ??????? ???+++
????    ????  ????????? ????? ??   ?????  ???   ???????????  ???  ??? ? ?? ???   ??++
????    ???   ?????? ?? ????? ???   ??????????  ???  ???????????? ??? ? ?? ????   ?++
????????? ??????????? ??????? ??????  ??   ???? ???????? ??   ???????????? ??????? ++
? ???  ?? ?????? ? ?? ????    ???  ?  ??   ???? ??   ?  ??   ????? ??? ?   ???  ?  ++
? ? ?  ?  ? ? ?? ? ?? ?? ? ?  ? ?  ?   ?   ?? ?  ?   ?   ?   ?? ?  ? ? ?   ? ?  ?  ++
  ? ?   ? ? ? ?  ? ?? ?  ? ?  ? ?  ?   ?   ?   ? ?   ?   ?   ?     ?   ?   ? ?  ?  ++
    ?  ?    ? ?  ?  ?    ?      ?          ?  ?      ?       ?  ?    ?       ?     ++
                              ?                                            ?      ++
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++(lokidagawd)++++++++++++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+~+~~+~~+~+~++~+~+~+~+~+PLEASE TAKE A SECOND TO READ~+~+~+~+~+~~+~+~+~+~+~+~~+~
 hey everybody, thanks for using my script, ive put alot of work in this and still have much planned in the future.
 if you have any problems or find bugs please report them to me by email at [email protected] or at device.com
 my user there is lokidagawd,there you can also find this script that has swapped the X button for R3 which makes it
 easier for you to jump without taking your finger off your camera stick (basically like stick and move from cod).
 i disabled the EMOTE button in game (up arrow) because its rather annoying when you try to turn on rapid fire in a gun
 fight and have to press circle to back out of the emote screen (plus emotes suck in this game) however if you can't
 live without them you can remedy by commenting out the "unmap 13; portion i have highlighted below, to comment/void
 out a command simple put two forward slashes in front of the code like this // again thanks for downloading and enjoy.
 not that it matters that much but green thumbs ups are inspiring to make a better menu, red thumbs down.... not so much
 please bring your complaints and issues to me directly so i can better fix this script, i cant do it without you all.
 i am still working on a better LED notification system but for now its basic with a single rumble notification for mods on,
 and a double for mods off, with each mod having a single led representation, i will address this but if i spent more time
 on it now you guys suffer, so enjoy whats here now and please leave feedback in the device thread @
if you use any of the code below thats fine, but please dont be a douche, give credit where it's due, we work hard on these script
FOR FREE and having your shit stolen does not inspire more public scripts, god bless you all and stay gaming.
i have some exciting this im working on for next update... STAY TUNED!!!!!!!!!!!!!!!!
device.COM SCRIPT THREAD : https://device.com/forums/showthread ... ost1126204
/**********************************************************
AUTO STRAFE = L2+DOWN        (WORKS WELL WHEN BATTLING MID-RANGE WITH SMG)
ANTI RECOIL = L2+LEFT        (WILL MAKE ALWAYS ON, NEXT UPDATE TO MAKE ROOM FOR MORE)
STEADY AIM = L2 + TRIANGLE   (THIS IS BEST FOR AR'S, YOU NEED TO TAP FIRE THE AK, DO NOT JUST HOLD THE BUTTON DOWN, AR YOU CAN HOLD DOWN FULLY.. STILL WORKING ON THIS)
JUMP SHOT = L2 + RIGHT       (REPLACED JIGGLE MOD) SO OP!!!!!!!!! BEST WITH SHOTGUNS BUT WORKS WELL WITH SMG ALSO
RAPID FIRE = L2+UP           (THIS IS BEST FOR PISTOL'S SMG'S AND SHOTGUN'S, HELLFIRE HAS NO RECOIL WITH THIS AT ALL, CAN HOLD BUTTON DOWN FREELY)
RESET MODS = L2 + R3         (TURNS OFF ALL MODS, IF YOU HAVE DIFFICULTY DRIVING, USE THIS WHEN YOU GET IN A CAR)
AIM ASSIST = L2+ SQUARE      (TEST MODE/BUGGY, WILL RELEASE AT LATER DATE)
/*********************************************************/

//+++++++++++++++++++++++++++++++++MISC DEFINES+++++++++
define ONLY_WITH_SCOPE = TRUE;
define ANTI_RECOIL = 0;     
define ANTI_RECOIL_LEFT = 0
define ANTI_RECOIL_RIGHT = 0;
define Shoot = PS4_R2;
define Aim = PS4_L2;
define Crouch = PS4_CIRCLE;
define Jump = PS4_CROSS;
define Mod_Reset = PS4_R3;
 
//+++++++++++++++++++++COLORS+++ CREDIT device DOCUMENTATION
define Off = 0;
define On = 100;
define Dim_Blue = 1;
define Dim_Red = 2;
define Dim_Green = 3;
define Dim_Pink = 4;
define Dim_SkyBlue = 5;
define Dim_Yellow = 6;
define Dim_White = 7;
define Blue = 8;
define Red = 9;
define Green = 10;
define Pink = 11;
define SkyBlue = 12;
define Yellow = 13;
define White = 14;
define Bright_Blue = 15;
define Bright_Red = 16;
define Bright_Green = 17;
define Bright_Pink = 18;
define Bright_SkyBlue = 19;
define Bright_Yellow = 20;
define Bright_White = 21;
 
data (
 
0,0,0,0, // Off
1,0,0,0, // Dim Blue
0,1,0,0, // Dim Red
0,0,1,0, // Dim Green
0,0,0,1, // Dim Pink
1,0,1,0, // Dim SkyBlue
0,1,1,0, // Dim Yellow
1,1,1,1, // Dim White
2,0,0,0, // Blue
0,2,0,0, // Red
0,0,2,0, // Green
0,0,0,2, // Pink
2,0,2,0, // SkyBlue
0,2,2,0, // Yellow
2,2,2,2, // White
3,0,0,0, // Bright Blue
0,3,0,0, // Bright Red
0,0,3,0, // Bright Green
0,0,0,3, // Bright Pink
3,0,3,0, // Bright SkyBlue
0,3,3,0, // Bright Yellow
3,3,3,3  // Bright white
 
);
//+++++++++++++++++++++++++intergers
int Tap[6];
int strafeLeft, strafeRight;
int Rand = 32767;
int anti_recoil;
int anti_recoil_left;
int anti_recoil_right;
int Steady_On_Off = FALSE;
int Strafe_On_Off = FALSE;
int Recoil_On_Off = FALSE;
int Rapid_On_Off = FALSE;
int Jump_On_Off = FALSE;
//int Ds_On_Off = FALSE;
//int Aim_On_Off = FALSE;
//int Jiggle_On_Off = FALSE;
//===========================================================
unmap 13; // comment out if you want to use emote's (it's annoying when its on and setting rapid fire, thats why i have off)
init{
set_ds4_led(White);
Tap[0] = 6;
Tap[1] = 20;
}
main {
//==========================RAPID FIRE=======================
if(get_val(Aim) && event_press(PS4_UP)){
    Rapid_On_Off=!Rapid_On_Off;
        if(Rapid_On_Off == TRUE){set_ds4_led(Red);combo_run(notify_on);}
            if(Rapid_On_Off == FALSE){set_ds4_led(White);combo_run(notify_off);
            if(((Rapid_On_Off == TRUE)&&(Recoil_On_Off == TRUE))&& (Steady_On_Off == TRUE)){set_ds4_led(Bright_SkyBlue);}}}
                if (Rapid_On_Off){
                       Rapid_FIRE();       
    } 
//=============ANTI-RECOIL===================================       
if((get_val(Aim)) && (event_press(PS4_LEFT))){Recoil_On_Off=!Recoil_On_Off;
    if(Recoil_On_Off == TRUE){set_ds4_led(Pink);combo_run(notify_on);}
        if(Recoil_On_Off == FALSE){set_ds4_led(White);combo_run(notify_off);}}
             if (Recoil_On_Off){
                  combo_run(AntiRecoil);
      }
//================Jump Shot==================================
if (get_val(Aim) && event_press(PS4_RIGHT)){Jump_On_Off=!Jump_On_Off;
    if(Jump_On_Off == TRUE){set_ds4_led(Blue);combo_run(notify_on);}
        if(Jump_On_Off == FALSE){set_ds4_led(White);combo_run(notify_off);}}
              if (Jump_On_Off){
              if(get_val(Shoot)){
                         combo_run(jump_shot);
                         }
                         }
/*=============(TEST MOD)DROP SHOT==========================
if (get_val(Aim) && event_press(PS4_RIGHT)){Ds_On_Off=!Ds_On_Off;
    if(Ds_On_Off == TRUE){set_ds4_led(Blue);combo_run(notify_on);}
        if(Ds_On_Off == FALSE){set_ds4_led(White);combo_run(notify_off);}}
              if (Ds_On_Off){
                  if(get_val(Aim)){
                         drop_shot();
        }
          }
/*============TEST MOD(AIM-ASSIST===========================
if (get_val(Aim) && event_press(PS4_SQUARE)){Aim_On_Off=!Aim_On_Off;}
  if (Aim_On_Off){
        set_rumble(RUMBLE_A, 60);
          combo_run(Tap_6);
    }
*/
//================AUTO_STRAFE=============================
if(get_val(Aim) && event_press(PS4_DOWN)){Strafe_On_Off=!Strafe_On_Off;
      if(Strafe_On_Off == TRUE){set_ds4_led(Yellow);combo_run(notify_on);}
            if(Strafe_On_Off == FALSE){set_ds4_led(White);combo_run(notify_off);}}
               if(Strafe_On_Off) {
                   if((get_val(Aim)) && (get_val(Shoot))){           
                          combo_run(AutoStrafe);}
                         else {if (get_val(Shoot)){combo_run(AntiRecoil);}}
    }
//=================STEADY AIM================================
if ((get_val(Aim)) && (event_press(PS4_TRIANGLE))){Steady_On_Off=!Steady_On_Off;
     if(Steady_On_Off == TRUE){set_ds4_led(Green);combo_run(notify_on);}
          if(Steady_On_Off == FALSE){set_ds4_led(White);combo_run(notify_off);}}
             if ((Steady_On_Off)&& get_val(Shoot)) {
                combo_run(Tap_1);
                    combo_run(AntiRecoil);}   
 
//=======================AUTO_RUN============================ // feel free to change value lower if you want to start your sprint sooner, i leave at 99 to prevent problems when sending messages
if((get_val(PS4_LY)) < -99) {
     set_val(PS4_L3, 100);
    }
//=================BUNNY-HOP=================================
if (get_val(Jump)){
    combo_run(bunny_hop);
    }
//=============RESET MODS====================================
if (get_val(Aim) && event_press (PS4_R3)){reset_mods(); combo_run(notify_off); combo_run(rb_active);}   
//====END MAIN===============================================
Tap [2] = Tap[4]+Tap[1];
Tap [3] = 4;
Tap [4] = 40;
Tap [6] = T_1(Tap [3], Tap [2], Tap [0]);
}
//===========COMBO'S=========================================
combo Tap_1 {
    set_val(Shoot, On);
    wait(Tap [4] * Tap [0] - Tap [2]);
    set_val(Shoot, Off);
    wait(Tap [4] * Tap [0] - Tap [2]);
    set_val(Shoot, Off);
    }
combo AutoStrafe {
    strafeRight = Rand(500, 1000);
    set_val(PS4_LX, 40);
    wait(strafeRight);
    strafeLeft = Rand(500, 1000);
    set_val(PS4_LX, inv(40));
    wait(strafeLeft);
    set_val(PS4_LX, 40);
    }
/*combo Tap_6 {
    set_val(Aim, 100);
    wait(70);
    set_val(Aim, 100);
    wait(70);
    set_val(Aim, 100);
   }
 
combo drop_shot {
    set_val(PS4_CIRCLE, 100);
    wait (500);
    set_val(PS4_CIRCLE, 0);
    if ((get_val(PS4_LY) < -90)) {
    set_val(PS4_CIRCLE, 0);
}
}
*/

combo jump_shot { 
     set_val(Jump,60);
     wait (30);
     set_val(PS4_R2,100);
     wait (35);
     set_val(Jump, 0);
     wait (30);
     set_val(PS4_R2,100);
      }
/*
combo JiggleMod {
    set_val(Crouch, Off);
    //set_val(Aim, 20); later add for next update(jitter shot)
    wait(80);
    set_val(Crouch, 90);
    //set_val(Aim, 100);
    wait(80);
    set_val(Crouch, Off);
    //set_val(Aim, 20);
    wait(50);
    set_val(Crouch, 90);
    //set_val(Aim, 20);
    wait(50);
    set_val(Crouch, Off);
   }
   */

combo bunny_hop {
    set_val (Jump, Off);
    wait(110);
    set_val (Jump, On);
    wait(130);
    set_val (Jump, On);
    wait (110);
    }
combo rapid_aim{
    set_val(Shoot, On);
    wait(Tap [6]);
    set_val(Shoot, Off);
    wait(Tap [6]);
    set_val(Shoot, Off);
    }
combo rapid_hip {
    set_val(Shoot, On);
    wait(40);
    set_val(Shoot, Off);
    wait(40);
    set_val(Shoot, Off);
    }
combo rb_active{
    set_ds4_led(2);
    wait(110);
    set_ds4_led(3);
    wait(110);
    set_ds4_led(4);
    wait(110);
    set_ds4_led(5);
    wait(110);
    set_ds4_led(6);
    wait(110);
    set_ds4_led(7);
    wait(110);
    set_ds4_led(8);
    wait(110);
    set_ds4_led(9);
    wait(110);
    set_ds4_led(14);
    }
combo AntiRecoil {
    if(get_val(Shoot)) {
    anti_recoil = get_val(10) + ANTI_RECOIL;
    if(anti_recoil > 100) anti_recoil = 100;
    set_val(10, anti_recoil);
    anti_recoil_left = get_val(9) -ANTI_RECOIL_LEFT;
    if(anti_recoil_left > 100) anti_recoil_left = 100;
    set_val(9, anti_recoil_left);
    anti_recoil_right = get_val(9) +ANTI_RECOIL_RIGHT;
    if(anti_recoil_right > 100) anti_recoil_right = 100;
    set_val(9, anti_recoil_right);
        }
    }
 
combo notify_on {
    set_rumble(RUMBLE_B, 100);
    wait(300);
    reset_rumble();
    wait (1000);
    }
combo notify_off {
    set_rumble(RUMBLE_B, 100);
    wait(300);
    reset_rumble();
    wait (300);
    set_rumble(RUMBLE_B, 100);
    wait(300);
    reset_rumble();
    wait(300);
}
function Rand(min,max){
    Rand = Rand *8403 % 32767;
    if (min>= Off && max >= Off)
    return abs(min + (Rand && (max - min)));
    return min + (Rand % (max - min));
    }
 
function Rapid_FIRE(){
    if((get_val(TRACE_1)) == Off) {
    set_val(TRACE_1, 1);}
    else {set_val(TRACE_1, 1);
    }   
if((get_val(Shoot)) && (get_val(TRACE_1)) == 1) {   
    if(get_val(Aim)) {
    combo_run(rapid_aim);}
    else {combo_run(rapid_hip);
              }
          }
   }
function T_1(Tap_3, Tap_5, Tap_1) {
   return Tap_5 + Tap_3 + Tap_1;
 
}
function set_ds4_led(colour) {
    set_led(LED_1, dbyte(colour * 4));
    set_led(LED_2, dbyte((colour * 4) + 1));
    set_led(LED_3, dbyte((colour * 4) + 2));
    set_led(LED_4, dbyte((colour * 4) + 3));
 
}
function reset_mods(){
    //Jiggle_On_Off = FALSE;
    Rapid_On_Off = FALSE;
    Recoil_On_Off = FALSE;
    Strafe_On_Off = FALSE;
    Steady_On_Off = FALSE;
    }
    /*
    function drop_shot() {
    set_val(PS4_R2, 100);
    set_val(PS4_CIRCLE, 100);
    if (get_val(PS4_L2, 100)){
    set_val(PS4_CIRCLE,0);
    }
    }*/
User avatar
c0ns013tun3r
Corporal
Corporal
 
Posts: 4
Joined: Tue Jan 01, 2019 6:26 am

Re: fix errors please

Postby J2Kbr » Tue Jan 08, 2019 6:25 am

In almost 100% of the cases are just two issues to be fixed:

1. Missing the "end of statement" (semicolon ';')
2. Combos with the same name of variables.

Code: Select all
/*+++++++  +++++++++++++++++++++++++++++
H1Z1 :Beta Version 1.02
 
Coded by
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++(lokidagawd)++++++++++++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 ???     ??????   ?? ??? ???? ??????  ???        ?????  ???       ?     ????????? ++
????    ????  ??? ????? ????? ??? ?????????     ??? ?????????    ??? ? ??????? ???+++
????    ????  ????????? ????? ??   ?????  ???   ???????????  ???  ??? ? ?? ???   ??++
????    ???   ?????? ?? ????? ???   ??????????  ???  ???????????? ??? ? ?? ????   ?++
????????? ??????????? ??????? ??????  ??   ???? ???????? ??   ???????????? ??????? ++
? ???  ?? ?????? ? ?? ????    ???  ?  ??   ???? ??   ?  ??   ????? ??? ?   ???  ?  ++
? ? ?  ?  ? ? ?? ? ?? ?? ? ?  ? ?  ?   ?   ?? ?  ?   ?   ?   ?? ?  ? ? ?   ? ?  ?  ++
  ? ?   ? ? ? ?  ? ?? ?  ? ?  ? ?  ?   ?   ?   ? ?   ?   ?   ?     ?   ?   ? ?  ?  ++
    ?  ?    ? ?  ?  ?    ?      ?          ?  ?      ?       ?  ?    ?       ?     ++
                              ?                                            ?      ++
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++(lokidagawd)++++++++++++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+~+~~+~~+~+~++~+~+~+~+~+PLEASE TAKE A SECOND TO READ~+~+~+~+~+~~+~+~+~+~+~+~~+~
 hey everybody, thanks for using my script, ive put alot of work in this and still have much planned in the future.
 if you have any problems or find bugs please report them to me by email at [email protected] or at device.com
 my user there is lokidagawd,there you can also find this script that has swapped the X button for R3 which makes it
 easier for you to jump without taking your finger off your camera stick (basically like stick and move from cod).
 i disabled the EMOTE button in game (up arrow) because its rather annoying when you try to turn on rapid fire in a gun
 fight and have to press circle to back out of the emote screen (plus emotes suck in this game) however if you can't
 live without them you can remedy by commenting out the "unmap 13; portion i have highlighted below, to comment/void
 out a command simple put two forward slashes in front of the code like this // again thanks for downloading and enjoy.
 not that it matters that much but green thumbs ups are inspiring to make a better menu, red thumbs down.... not so much
 please bring your complaints and issues to me directly so i can better fix this script, i cant do it without you all.
 i am still working on a better LED notification system but for now its basic with a single rumble notification for mods on,
 and a double for mods off, with each mod having a single led representation, i will address this but if i spent more time
 on it now you guys suffer, so enjoy whats here now and please leave feedback in the device thread @
if you use any of the code below thats fine, but please dont be a douche, give credit where it's due, we work hard on these script
FOR FREE and having your shit stolen does not inspire more public scripts, god bless you all and stay gaming.
i have some exciting this im working on for next update... STAY TUNED!!!!!!!!!!!!!!!!
device.COM SCRIPT THREAD : https://device.com/forums/showthread ... ost1126204
/**********************************************************
AUTO STRAFE = L2+DOWN        (WORKS WELL WHEN BATTLING MID-RANGE WITH SMG)
ANTI RECOIL = L2+LEFT        (WILL MAKE ALWAYS ON, NEXT UPDATE TO MAKE ROOM FOR MORE)
STEADY AIM = L2 + TRIANGLE   (THIS IS BEST FOR AR'S, YOU NEED TO TAP FIRE THE AK, DO NOT JUST HOLD THE BUTTON DOWN, AR YOU CAN HOLD DOWN FULLY.. STILL WORKING ON THIS)
JUMP SHOT = L2 + RIGHT       (REPLACED JIGGLE MOD) SO OP!!!!!!!!! BEST WITH SHOTGUNS BUT WORKS WELL WITH SMG ALSO
RAPID FIRE = L2+UP           (THIS IS BEST FOR PISTOL'S SMG'S AND SHOTGUN'S, HELLFIRE HAS NO RECOIL WITH THIS AT ALL, CAN HOLD BUTTON DOWN FREELY)
RESET MODS = L2 + R3         (TURNS OFF ALL MODS, IF YOU HAVE DIFFICULTY DRIVING, USE THIS WHEN YOU GET IN A CAR)
AIM ASSIST = L2+ SQUARE      (TEST MODE/BUGGY, WILL RELEASE AT LATER DATE)
/*********************************************************/

//+++++++++++++++++++++++++++++++++MISC DEFINES+++++++++
define ONLY_WITH_SCOPE = TRUE;
define ANTI_RECOIL = 0;     
define ANTI_RECOIL_LEFT = 0
define ANTI_RECOIL_RIGHT = 0;
define Shoot = PS4_R2;
define Aim = PS4_L2;
define Crouch = PS4_CIRCLE;
define Jump = PS4_CROSS;
define Mod_Reset = PS4_R3;
 
//+++++++++++++++++++++COLORS+++ CREDIT device DOCUMENTATION
define Off = 0;
define On = 100;
define Dim_Blue = 1;
define Dim_Red = 2;
define Dim_Green = 3;
define Dim_Pink = 4;
define Dim_SkyBlue = 5;
define Dim_Yellow = 6;
define Dim_White = 7;
define Blue = 8;
define Red = 9;
define Green = 10;
define Pink = 11;
define SkyBlue = 12;
define Yellow = 13;
define White = 14;
define Bright_Blue = 15;
define Bright_Red = 16;
define Bright_Green = 17;
define Bright_Pink = 18;
define Bright_SkyBlue = 19;
define Bright_Yellow = 20;
define Bright_White = 21;
 
data (
 
0,0,0,0, // Off
1,0,0,0, // Dim Blue
0,1,0,0, // Dim Red
0,0,1,0, // Dim Green
0,0,0,1, // Dim Pink
1,0,1,0, // Dim SkyBlue
0,1,1,0, // Dim Yellow
1,1,1,1, // Dim White
2,0,0,0, // Blue
0,2,0,0, // Red
0,0,2,0, // Green
0,0,0,2, // Pink
2,0,2,0, // SkyBlue
0,2,2,0, // Yellow
2,2,2,2, // White
3,0,0,0, // Bright Blue
0,3,0,0, // Bright Red
0,0,3,0, // Bright Green
0,0,0,3, // Bright Pink
3,0,3,0, // Bright SkyBlue
0,3,3,0, // Bright Yellow
3,3,3,3  // Bright white
 
);
//+++++++++++++++++++++++++intergers
int Tap[6];
int strafeLeft, strafeRight;
int Rand = 32767;
int anti_recoil;
int anti_recoil_left;
int anti_recoil_right;
int Steady_On_Off = FALSE;
int Strafe_On_Off = FALSE;
int Recoil_On_Off = FALSE;
int Rapid_On_Off = FALSE;
int Jump_On_Off = FALSE;
//int Ds_On_Off = FALSE;
//int Aim_On_Off = FALSE;
//int Jiggle_On_Off = FALSE;
//===========================================================
unmap 13; // comment out if you want to use emote's (it's annoying when its on and setting rapid fire, thats why i have off)
init{
set_ds4_led(White);
Tap[0] = 6;
Tap[1] = 20;
}
main {
//==========================RAPID FIRE=======================
if(get_val(Aim) && event_press(PS4_UP)){
    Rapid_On_Off=!Rapid_On_Off;
        if(Rapid_On_Off == TRUE){set_ds4_led(Red);combo_run(notify_on);}
            if(Rapid_On_Off == FALSE){set_ds4_led(White);combo_run(notify_off);
            if(((Rapid_On_Off == TRUE)&&(Recoil_On_Off == TRUE))&& (Steady_On_Off == TRUE)){set_ds4_led(Bright_SkyBlue);}}}
                if (Rapid_On_Off){
                       Rapid_FIRE();       
    } 
//=============ANTI-RECOIL===================================       
if((get_val(Aim)) && (event_press(PS4_LEFT))){Recoil_On_Off=!Recoil_On_Off;
    if(Recoil_On_Off == TRUE){set_ds4_led(Pink);combo_run(notify_on);}
        if(Recoil_On_Off == FALSE){set_ds4_led(White);combo_run(notify_off);}}
             if (Recoil_On_Off){
                  combo_run(AntiRecoil);
      }
//================Jump Shot==================================
if (get_val(Aim) && event_press(PS4_RIGHT)){Jump_On_Off=!Jump_On_Off;
    if(Jump_On_Off == TRUE){set_ds4_led(Blue);combo_run(notify_on);}
        if(Jump_On_Off == FALSE){set_ds4_led(White);combo_run(notify_off);}}
              if (Jump_On_Off){
              if(get_val(Shoot)){
                         combo_run(jump_shot);
                         }
                         }
/*=============(TEST MOD)DROP SHOT==========================
if (get_val(Aim) && event_press(PS4_RIGHT)){Ds_On_Off=!Ds_On_Off;
    if(Ds_On_Off == TRUE){set_ds4_led(Blue);combo_run(notify_on);}
        if(Ds_On_Off == FALSE){set_ds4_led(White);combo_run(notify_off);}}
              if (Ds_On_Off){
                  if(get_val(Aim)){
                         drop_shot();
        }
          }
/*============TEST MOD(AIM-ASSIST===========================
if (get_val(Aim) && event_press(PS4_SQUARE)){Aim_On_Off=!Aim_On_Off;}
  if (Aim_On_Off){
        set_rumble(RUMBLE_A, 60);
          combo_run(Tap_6);
    }
*/
//================AUTO_STRAFE=============================
if(get_val(Aim) && event_press(PS4_DOWN)){Strafe_On_Off=!Strafe_On_Off;
      if(Strafe_On_Off == TRUE){set_ds4_led(Yellow);combo_run(notify_on);}
            if(Strafe_On_Off == FALSE){set_ds4_led(White);combo_run(notify_off);}}
               if(Strafe_On_Off) {
                   if((get_val(Aim)) && (get_val(Shoot))){           
                          combo_run(AutoStrafe);}
                         else {if (get_val(Shoot)){combo_run(AntiRecoil);}}
    }
//=================STEADY AIM================================
if ((get_val(Aim)) && (event_press(PS4_TRIANGLE))){Steady_On_Off=!Steady_On_Off;
     if(Steady_On_Off == TRUE){set_ds4_led(Green);combo_run(notify_on);}
          if(Steady_On_Off == FALSE){set_ds4_led(White);combo_run(notify_off);}}
             if ((Steady_On_Off)&& get_val(Shoot)) {
                combo_run(Tap_1);
                    combo_run(AntiRecoil);}   
 
//=======================AUTO_RUN============================ // feel free to change value lower if you want to start your sprint sooner, i leave at 99 to prevent problems when sending messages
if((get_val(PS4_LY)) < -99) {
     set_val(PS4_L3, 100);
    }
//=================BUNNY-HOP=================================
if (get_val(Jump)){
    combo_run(bunny_hop);
    }
//=============RESET MODS====================================
if (get_val(Aim) && event_press (PS4_R3)){reset_mods(); combo_run(notify_off); combo_run(rb_active);}   
//====END MAIN===============================================
Tap [2] = Tap[4]+Tap[1];
Tap [3] = 4;
Tap [4] = 40;
Tap [6] = T_1(Tap [3], Tap [2], Tap [0]);
}
//===========COMBO'S=========================================
combo Tap_1 {
    set_val(Shoot, On);
    wait(Tap [4] * Tap [0] - Tap [2]);
    set_val(Shoot, Off);
    wait(Tap [4] * Tap [0] - Tap [2]);
    set_val(Shoot, Off);
    }
combo AutoStrafe {
    strafeRight = RandF(500, 1000);
    set_val(PS4_LX, 40);
    wait(strafeRight);
    strafeLeft = RandF(500, 1000);
    set_val(PS4_LX, inv(40));
    wait(strafeLeft);
    set_val(PS4_LX, 40);
    }
/*combo Tap_6 {
    set_val(Aim, 100);
    wait(70);
    set_val(Aim, 100);
    wait(70);
    set_val(Aim, 100);
   }
 
combo drop_shot {
    set_val(PS4_CIRCLE, 100);
    wait (500);
    set_val(PS4_CIRCLE, 0);
    if ((get_val(PS4_LY) < -90)) {
    set_val(PS4_CIRCLE, 0);
}
}
*/

combo jump_shot { 
     set_val(Jump,60);
     wait (30);
     set_val(PS4_R2,100);
     wait (35);
     set_val(Jump, 0);
     wait (30);
     set_val(PS4_R2,100);
      }
/*
combo JiggleMod {
    set_val(Crouch, Off);
    //set_val(Aim, 20); later add for next update(jitter shot)
    wait(80);
    set_val(Crouch, 90);
    //set_val(Aim, 100);
    wait(80);
    set_val(Crouch, Off);
    //set_val(Aim, 20);
    wait(50);
    set_val(Crouch, 90);
    //set_val(Aim, 20);
    wait(50);
    set_val(Crouch, Off);
   }
   */

combo bunny_hop {
    set_val (Jump, Off);
    wait(110);
    set_val (Jump, On);
    wait(130);
    set_val (Jump, On);
    wait (110);
    }
combo rapid_aim{
    set_val(Shoot, On);
    wait(Tap [6]);
    set_val(Shoot, Off);
    wait(Tap [6]);
    set_val(Shoot, Off);
    }
combo rapid_hip {
    set_val(Shoot, On);
    wait(40);
    set_val(Shoot, Off);
    wait(40);
    set_val(Shoot, Off);
    }
combo rb_active{
    set_ds4_led(2);
    wait(110);
    set_ds4_led(3);
    wait(110);
    set_ds4_led(4);
    wait(110);
    set_ds4_led(5);
    wait(110);
    set_ds4_led(6);
    wait(110);
    set_ds4_led(7);
    wait(110);
    set_ds4_led(8);
    wait(110);
    set_ds4_led(9);
    wait(110);
    set_ds4_led(14);
    }
combo AntiRecoil {
    if(get_val(Shoot)) {
    anti_recoil = get_val(10) + ANTI_RECOIL;
    if(anti_recoil > 100) anti_recoil = 100;
    set_val(10, anti_recoil);
    anti_recoil_left = get_val(9) -ANTI_RECOIL_LEFT;
    if(anti_recoil_left > 100) anti_recoil_left = 100;
    set_val(9, anti_recoil_left);
    anti_recoil_right = get_val(9) +ANTI_RECOIL_RIGHT;
    if(anti_recoil_right > 100) anti_recoil_right = 100;
    set_val(9, anti_recoil_right);
        }
    }
 
combo notify_on {
    set_rumble(RUMBLE_B, 100);
    wait(300);
    reset_rumble();
    wait (1000);
    }
combo notify_off {
    set_rumble(RUMBLE_B, 100);
    wait(300);
    reset_rumble();
    wait (300);
    set_rumble(RUMBLE_B, 100);
    wait(300);
    reset_rumble();
    wait(300);
}
function RandF(min,max){
    Rand = Rand *8403 % 32767;
    if (min>= Off && max >= Off)
    return abs(min + (Rand && (max - min)));
    return min + (Rand % (max - min));
    }
 
function Rapid_FIRE(){
    if((get_val(TRACE_1)) == Off) {
    set_val(TRACE_1, 1);}
    else {set_val(TRACE_1, 1);
    }   
if((get_val(Shoot)) && (get_val(TRACE_1)) == 1) {   
    if(get_val(Aim)) {
    combo_run(rapid_aim);}
    else {combo_run(rapid_hip);
              }
          }
   }
function T_1(Tap_3, Tap_5, Tap_1) {
   return Tap_5 + Tap_3 + Tap_1;
 
}
function set_ds4_led(colour) {
    set_led(LED_1, dbyte(colour * 4));
    set_led(LED_2, dbyte((colour * 4) + 1));
    set_led(LED_3, dbyte((colour * 4) + 2));
    set_led(LED_4, dbyte((colour * 4) + 3));
 
}
function reset_mods(){
    //Jiggle_On_Off = FALSE;
    Rapid_On_Off = FALSE;
    Recoil_On_Off = FALSE;
    Strafe_On_Off = FALSE;
    Steady_On_Off = FALSE;
    }
    /*
    function drop_shot() {
    set_val(PS4_R2, 100);
    set_val(PS4_CIRCLE, 100);
    if (get_val(PS4_L2, 100)){
    set_val(PS4_CIRCLE,0);
    }
    }*/
ConsoleTuner Support Team
User avatar
J2Kbr
General of the Army
General of the Army
 
Posts: 20323
Joined: Tue Mar 18, 2014 1:39 pm


Return to GPC1 Script Programming

Who is online

Users browsing this forum: No registered users and 93 guests