Help with this script

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

Help with this script

Postby AiM-_LoCckv1 » Fri Jul 16, 2021 11:00 am

Someone can help me with this script. Is complete but there is an error. I USE L2-R2 so if someone can convert for this too

Code: Select all
// auto strafe
int Strafe = TRUE; // (LT+RT)(L2+R2) increase your bullet impacts.
int ast = 100; // store auto strafe time (200ms-360ms).
define LT=PS4_L2
define RT= PS4_R2
define LY= PS4_LY
define LX= PS4_LX
 
 
//Rapid Fire (L2 + LEFT)
int Rapid_Fire = FALSE;
 
 
//Dropshot (L2 + RIGHT)
int DropShot = FALSE;
int DropShotSpeed = 30;
 
 
//Change FALSE TO TRUE If you want Auto Run
int AutoRun = FALSE;
 
 
//PUMP SMG - L2 + DOWN
int PUMP_SMG = FALSE;
 
 
//100% Perfect Accuracy [ALWAYS ON] (L2 + R1)
int PerfectAccuracy = TRUE;
 
 
//Anti Recoil (Leave Alone)
define INTVERTED_RECOIL   =  1;    //ITzSNACK'S INVERTED RECOIL METHOD (IF INVERTED SET TO -1 INSTEAD OF 1)
define DEFAULT_VERTICAL   =  6;    //RECOIL  DEFAULT VERTICAL VALUE
define DEFAULT_HORIZONTAL =  2;    //RECOIL  DEFAULT VERTICAL VALUE
int VERTICAL_RECOIL       =  6;    //RECOIL VERTICAL   (DEFAULT VALUE/STREGNTH)
int HORIZONTAL_RECOIL     =  2;    //RECOIL HORIZONTAL (DEFAULT VALUE/STREGNTH)
define SNACKS_ANTIRECOIL  =  TRUE; //RECOIL MASTER CONTROL (IF YOU DON'T WANT ANTI-RECOIL RUNNING AT ALL INPUT FALSE HERE)
define VIBRATION_RECOIL   =  TRUE; //RECOIL ACTIVE ON VIBRATE OR JUST ON THE TRIGGERS (L2 & R2) (TRUE = VIBRATION  OR  FALSE = TRIGGERS) (MASTER ABOVE MUST BE SET TO TRUE)
 
 
//Aim Abuse (Leave Alone)
int AimAbuse = TRUE;
int AimAbuse_HOLD = 460;
int AimAbuse_RELEASE = 20;
 
 
//Aim Assist (Leave Alone)
define STEP_INTERVAL = 1;
define STEPS = 20;
int bUseAimAssist = TRUE;
int aaboost    = 2;       
int right_stick_deadzone = 9
int fub = 3;       
int fob = 2;           
int leftDboost = 5;   
int rightDboost = 5;   
int ADS_ASSIST = TRUE;
int FIRE_ASSIST = TRUE;
int DRIFT_ASSIST = TRUE;
 
 
//Variables (Leave Alone)
define VIB_A = RUMBLE_A;
int tap;
int R2_block;
int RECOIL;
int interval_t, angle;
int x_stick, y_stick, cos_angle, sin_angle;
const char Polar_Array[]={100,100,100,100,100,100,100,100,99,99,99,99,98,98,97,97,97,96,95,95,94,94,93,92,92,91,90,89,89,88,87,86,85,84,83,82,81,80,79,78,77,75,74,73,72,71,70,69,67,66,65,63,62,61,59,58,56,55,53,52,50,49,47,46,44,43,41,40,38,36,35,33,31,30,28,26,25,23,21,20,18,16,14,13,11,9,7,6,4,2,0,-1,-3,-5,-7,-8,-10,-12,-13,-15,-17,-19,-20,-22,-24,-25,-27,-29,-30,-32,-34,-35,-37,-39,-40,-42,-43,-45,-46,-48,-50,-51,-53,-54,-55,-57,-58,-60,-61,-62,-64,-65,-66,-68,-69,-70,-71,-73,-74,-75,-76,-77,-78,-79,-80,-81,-82,-83,-84,-85,-86,-87,-88,-89,-89,-90,-91,-92,-92,-93,-93,-94,-95,-95,-96,-96,-97,-97,-97,-98,-98,-99,-99,-99,-99,-100,-100,-100,-100,-100,-100,-100,-100,-100,-100,-100,-100,-100,-100,-99,-99,-99,-98,-98,-98,-97,-97,-96,-96,-95,-94,-94,-93,-93,-92,-91,-90,-90,-89,-88,-87,-86,-85,-84,-83,-82,-81,-80,-79,-78,-77,-76,-75,-74,-72,-71,-70,-69,-67,-66,-65,-63,-62,-61,-59,-58,-56,-55,-53,-52,-50,-49,-47,-46,-44,-43,-41,-40,-38,-36,-35,-33,-31,-30,-28,-26,-25,-23,-21,-20,-18,-16,-14,-13,-11,-9,-7,-6,-4,-2,0,2,4,6,7,9,11,13,14,16,18,20,21,23,25,26,28,30,31,33,35,36,38,40,41,43,44,46,47,49,51,52,54,55,56,58,59,61,62,63,65,66,67,69,70,70,72,73,74,75,77,78,79,80,81,82,83,84,85,86,87,88,89,89,90,91,92,92,93,94,94,95,95,96,97,97,97,98,98,99,99,99,99,100,100,100,100,100,100,100};
/*-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 | | | | | | | | |M|A|I|N| | |S|E|C|T|I|O|N| | | | | | | | | | | | | | | | | | | | | | |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+*/

main {
 
//-- auto strafe
    if(Strafe)
        {
        if(get_val(LT) && get_val(RT) || get_val(RT))
        {combo_run(Auto_Strafe);}
 
        if(abs(get_val(LX)) > 40 || abs(get_val(LY)) > 40)
        {combo_stop(Auto_Strafe);}
        }
 
///////////////////////////////
 
 
         if(AutoRun)
 if(get_val(PS4_LY)<-90 && !get_val(PS4_L2)) set_val(PS4_L3,100);
    block_rumble();
    if(bUseAimAssist) {
          interval_t += get_rtime();
          if(!(interval_t % STEP_INTERVAL)) {
            angle = (angle+STEPS) % 360;
          }
                if(ADS_ASSIST){
                    if(isqrt(abs(get_val(PS4_RX)) * abs(get_val(PS4_RX)) + abs(get_val(PS4_RY)) * abs(get_val(PS4_RY))) <= right_stick_deadzone + 5) {
                        if(get_val(PS4_L2) > 95 && !get_val(PS4_R2)){
                            Shake();   
                        }
                    }
                }
                if(DRIFT_ASSIST){
                    if(isqrt(abs(get_val(PS4_RX)) * abs(get_val(PS4_RX))) >= right_stick_deadzone + 5) {
                        if(get_val(PS4_L2) > 95 && !get_val(PS4_R2)){
                            combo_run(leftDrift);   
                        }
                    }
                    if(isqrt(abs(get_val(PS4_RX)) * abs(get_val(PS4_RX))) >= right_stick_deadzone + 5) {
                        if(get_val(PS4_L2) > 95 && !get_val(PS4_R2)){
                            combo_run(rightDrift);   
                        }
                    }
                }
                if(FIRE_ASSIST){
                    if(get_val(PS4_R2)){
                        if(isqrt(abs(get_val(PS4_RX)) * abs(get_val(PS4_RX)) + abs(get_val(PS4_RY)) * abs(get_val(PS4_RY))) <= right_stick_deadzone + 5) {
                            combo_run(fire_under);
                        }
                        if(isqrt(abs(get_val(PS4_RX)) * abs(get_val(PS4_RX)) + abs(get_val(PS4_RY)) * abs(get_val(PS4_RY))) >= right_stick_deadzone + 5) {
                            combo_run(fire_over);
                        }
                    }
                }
            }
              if (SNACKS_ANTIRECOIL) {
if (VIBRATION_RECOIL) {
if (get_val(PS4_L2) && get_val(PS4_R2) && get_rumble(VIB_A)) {
    combo_run(RECOIL); }   
} else
if (!VIBRATION_RECOIL && get_val(PS4_L2) && get_val(PS4_R2)) {
    combo_run(RECOIL);
}
if (abs(get_val(PS4_RY)) > VERTICAL_RECOIL + 2 || abs(get_val(PS4_RX)) > VERTICAL_RECOIL + 2) {
    combo_stop(RECOIL); }
    }
if (get_val(PS4_L2)) {
if (event_press(PS4_DOWN)) {
combo_run (vibrate);
PUMP_SMG = !PUMP_SMG;
tap = FALSE;}
set_val(PS4_L3, 0);}
if (PUMP_SMG) {
if (R2_block) {
set_val(PS4_L2, 0);
set_val(PS4_R2, 0);}
if (get_val(PS4_L2) && event_press(PS4_R2)) {
if (!tap) {
tap = TRUE;
combo_run(Double_Tact_R1);
set_val(PS4_R2, 0);}
}
if (event_press(PS4_L2)) {
tap = FALSE;}
}
if (get_val(PS4_L2) && get_val(PS4_R1)) {
PerfectAccuracy = !PerfectAccuracy;
combo_run(cPerfectAccuracy);
set_val(PS4_R1, 0);
} else {
combo_stop(cPerfectAccuracy);}
if(AimAbuse){
if(get_val(PS4_L2) > 95 ){
combo_run(AimAbuse);}
if(event_release(PS4_L2)){ combo_stop(AimAbuse);}
}
if(get_val(PS4_L2) && event_press(PS4_LEFT)) {
combo_run (vibrate);
Rapid_Fire=!Rapid_Fire;}
if (Rapid_Fire) {
if(get_val(PS4_R2)) {
combo_run (Rapiid_Fire);}
}
if(get_val(PS4_L2) && event_press(PS4_RIGHT)) {
combo_run (vibrate);
DropShot=!DropShot;}
if (DropShot) {
if(get_val(PS4_R2)) {
combo_run (DroppShott);}
}
if(abs(get_val(PS4_LY)) < 10 && abs(get_val(PS4_LX)) < 10 ){       
set_val(PS4_LY,0);                                               
set_val(PS4_LX,0); }                                               
if(abs(get_val(PS4_RY)) < 9 && abs(get_val(PS4_RX)) < 9 ){         
set_val(PS4_RY,0);                                                 
set_val(PS4_RX,0); }                                               
    }
/*-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 | | | | | | | | |C|O|M|B|O| |S|E|C|T|I|O|N| | | | | | | | | | | | | | | | | | | | | | |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+*/

 combo Auto_Strafe { // auto strafe variable (200ms to 320ms).
    //-- macros
    set_val(LX,-40);
    wait(ast);
    set_val(LX, 40);
    wait(ast);
    //-- check
    if(ast < 160){ast = ast + 10;}
    else {ast = 100;}
    }
 
 combo RECOIL {
    RECOIL = get_val(PS4_RY) + VERTICAL_RECOIL;
if(RECOIL > 100) RECOIL = 100;
    set_val(PS4_RY,RECOIL * INTVERTED_RECOIL);
    RECOIL = get_val(PS4_RX) + HORIZONTAL_RECOIL;
if(RECOIL > 100) RECOIL = 100;
    set_val(PS4_RX,RECOIL);
}
combo leftDrift {
       offset(PS4_RX,right_stick_deadzone + leftDboost);
       wait(30);
       offset(PS4_RX,(right_stick_deadzone + leftDboost) * -1);
       wait(30);
}
 
 combo rightDrift {
       offset(PS4_RX,right_stick_deadzone + rightDboost);
       wait(30);
       offset(PS4_RX,(right_stick_deadzone + rightDboost) * -1);
       wait(30);
}
 
 combo fire_under {
       offset(PS4_RX,right_stick_deadzone + fub);
       wait(30);
       offset(PS4_RX,(right_stick_deadzone + fub) * -1);
       wait(30);
 }
 
 combo fire_over {
       offset(PS4_RX,right_stick_deadzone + fob);
       wait(40);
       offset(PS4_RX,(right_stick_deadzone + fob) * -1);
       wait(40);
}
combo vibrate {     
set_rumble(RUMBLE_A, 85);     
wait(225);                         
reset_rumble();                   
}                                     
combo Double_Tact_R1 {
R2_block = TRUE;
set_val(PS4_R2, 100);
wait(10);
wait(10);
set_val(PS4_L2, 100);
set_val(PS4_L3, 100);
set_val(PS4_R1, 100);
wait(15);
R2_block = FALSE;
}
combo cPerfectAccuracy {
set_val(PS4_R2,100);
wait(100);
wait(250);
set_val(PS4_R2,100);
}
combo Rapiid_Fire {
set_val(PS4_R2, 100);
wait(35);
set_val(PS4_R2, 0);
wait(25);
}
combo DroppShott {
set_val(PS4_R3,100);
wait(40);
wait(DropShotSpeed);
set_val(PS4_R3,100);
}
combo AimAbuse {
set_val(PS4_L2, 100);
wait(AimAbuse_HOLD);
set_val(PS4_L2, 0);
wait(AimAbuse_RELEASE);
}
/*-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 | | | | | | | | |F |U | N | C | T | I | O | N | S | | | | | | | | | | | | | | | | | | |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+*/

function Set_polar(stick, angle, radius){
      x_stick = 7 + stick;
      y_stick = 8 + stick;
      if(angle < 0) angle = 360 + (angle % 360);
      angle = (angle + 90) % 360;
      radius = clamp(radius, 0, 100);
      sin_angle = Polar_Array[angle];
      cos_angle = Polar_Array[(angle + 90) % 360];
      offset(x_stick, inv(radius * cos_angle / 100));
      offset(y_stick, inv(radius * sin_angle / 100));
      return;
}
function offset(int axis, int offset_val) {
      set_val(axis, clamp(offset_val * (100 - abs(get_val(axis))) / 100 + get_val(axis), -100, 100));
    return
}
 
 
function Shake() {
    Set_polar(2, angle, right_stick_deadzone + aaboost);   
}
function clamp(v, lo, hi)
{
    if(v < lo) return lo;
    if(v > hi) return hi;
    return v;
}
/*-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 | | | | | | | | | | | | | | | E | N | D | | | | | | | | | | | | | | | | | | | | | | | |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+*/
User avatar
AiM-_LoCckv1
Staff Sergeant
Staff Sergeant
 
Posts: 15
Joined: Tue Mar 16, 2021 9:58 am

Re: Help with this script

Postby AiM-_LoCckv1 » Sat Jul 17, 2021 2:56 pm

Someone can help me?
User avatar
AiM-_LoCckv1
Staff Sergeant
Staff Sergeant
 
Posts: 15
Joined: Tue Mar 16, 2021 9:58 am


Return to GPC1 Script Programming

Who is online

Users browsing this forum: Alfagamer and 4 guests