Pubg Script only for Experience Scripter

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

Pubg Script only for Experience Scripter

Postby 3rne5t0 » Fri Dec 29, 2017 10:20 am

Hey there is my PUBG Script for XboX One. I Need some Experience Eyes 2 Help Improve this one. So ist Defently not a Public Release. It includes some simple Scripts Like get in Car and Change 2 Driver Seat. Holding L2 Also Leans and Holding Breath. 2 Fire Modes for Single and Burst. And LED Changes Between Modes. Also he Autostrafes in Inventory and you can use Leftstick 2 Navigate. Hold Trow granate Button 2 Aim Release the Button 2 Trow and Switch Back 2 Weapon.

Code: Select all
#pragma METAINFO("PUBG", 1, 0, "")
 
#define FIRE_BUTTON     BUTTON_5
#define SPRINT_BUTTON   BUTTON_9
bool autofire;
uint8 b_Run = 0;
bool FIGHT_SWITCH;
bool INVENTAR;
 
main {
    if((autofire && !FIGHT_SWITCH)) {
        ColorLED('G');
    } else if((FIGHT_SWITCH && !autofire)) {
        ColorLED('R');
    } else if((!FIGHT_SWITCH && !autofire)) {
        ColorLED('W');
    }
    //INVENTORY
    if(event_active(BUTTON_3)) {
    if(INVENTAR == 0 ) {
                 autofire = 0;
        FIGHT_SWITCH = 0;
        INVENTAR = 1;
    }else if(INVENTAR == 1) {
        FIGHT_SWITCH = 1;
        INVENTAR = 0;
    }
}
    if(INVENTAR >= 1) {
        set_val(STICK_1_X, 0.0);
        set_val(STICK_1_Y, 0.0);
        set_val(BUTTON_15, 0.0);
        combo_run(Strafing);
    if(get_val(STICK_2_Y) <= -95.0) {
        set_val(STICK_2_Y, 0.0);
        combo_run(Up);
    }
    if(get_val(STICK_2_Y) >= 95.0) {
        set_val(STICK_2_Y, 0.0);
        combo_run(Down);
    }
    if(get_val(STICK_2_X) >= 95.0) {
        set_val(STICK_2_X, 0.0);
        combo_run(Right);
    }
    if(get_val(STICK_2_X) <= -95.0) {
        set_val(STICK_2_X, 0.0);
        combo_run(Left);
    }
}
    //Fight switch
    set_val(BUTTON_10, 0.0);
    if(event_active(BUTTON_10)) {
        FIGHT_SWITCH = 0;
        autofire = 0;
    }
    if(event_active(BUTTON_10)) {
        set_val(BUTTON_16, 0.0);
        combo_run(Loot);
        combo_run(Driver);
    }
    //AutoFire
    if(event_active(BUTTON_9)) {
    if(FIGHT_SWITCH == 1 ) {
        FIGHT_SWITCH = 0;
        autofire = 1;
    }else if(autofire == 1) {
        FIGHT_SWITCH = 1;
        autofire = 0;
    }
}
    if(event_active(BUTTON_6)) {
    if(FIGHT_SWITCH == 1) {
        FIGHT_SWITCH = 0;
        autofire = 1;
    }else if(autofire == 1) {
        FIGHT_SWITCH = 1;
        autofire = 0;
    }
}
    //Switcher
    if(INVENTAR == 0 && autofire == 0) {
    if(get_val(BUTTON_15)) {
        FIGHT_SWITCH = 1;
    }
    if(get_val(BUTTON_14)) {
        FIGHT_SWITCH = 1;
    }
    if(get_val(BUTTON_16)) {
        FIGHT_SWITCH = 1;
    }
    if(get_val(BUTTON_17)) {
        FIGHT_SWITCH = 1;
    }
    if(get_val(BUTTON_12)) {
        FIGHT_SWITCH = 1;
    }
}
    //autofire
    if(autofire >= 1) {
    if(get_val(BUTTON_9)) {
        set_val(BUTTON_9, 0.0);
        combo_run(Left);
    }
    if(get_val(BUTTON_6)) {
        set_val(BUTTON_6, 0.0);
        combo_run(Up);
    }
    // EASY SPRINT
    if(get_val(STICK_2_Y) <= -75.0) {
        combo_run(EasySprint);
    } else {
        combo_stop(EasySprint);
    }
    //Rapidfire
    if(event_active(BUTTON_5) && get_val(STICK_2_X) < -75.0) {
        combo_run(LeanleftRapid);
    }
    if(event_active(BUTTON_5) && get_val(STICK_2_X) > 75.0) {
        combo_run(LeanrightRapid);
    }
    if(get_val(BUTTON_5)) {
        set_val(STICK_2_Y, 0.0);
        combo_run(QuickshotAuto);
        combo_run(Movement);
        combo_run(Strafing);
        combo_run(ADS1);
    }
    if(event_active(BUTTON_5) && get_val(STICK_2_X) < 75.0 && get_val(STICK_2_X) > -75.0) {
        combo_run(Rightalways);
    }
    //Reload
    if(get_val(BUTTON_12)) {
        set_val(BUTTON_12, 0.0);
        combo_run(Reload);
    }   
    //Loot
    if(get_val(BUTTON_17)) {
        set_val(BUTTON_17, 0.0);
        combo_run(Loot);
    }
    //ADS Shoot
    if(get_val(BUTTON_8)) {
        set_val(STICK_2_Y, 0.0);
    }
    if(get_val(BUTTON_8) && get_val(STICK_2_X) < -75.0 && time_active(STICK_2_X) >= 600) {
        combo_run(Leanleft);
        }
    if(get_val(BUTTON_8) && get_val(STICK_2_X) > 75.0 && time_active(STICK_2_X) >= 600) {
        combo_run(Leanright);
        }
    if(get_val(BUTTON_5) && get_val(BUTTON_8)) {
        combo_run(ShootADSAuto);
        combo_run(Movement);
        combo_stop(ADS1);
        combo_stop(Quickshot);
        combo_stop(Strafing);
        combo_stop(Rightalways);
    }
    if(event_release(BUTTON_5) && time_active(BUTTON_5) >= 1500) {
        combo_run(Reload);
        }
    if(event_active(BUTTON_8)) {
        combo_run(HoldBreath);
        combo_run(ADS2);
        }
    if(get_val(BUTTON_8) && time_active(BUTTON_8) >= 800) {
        combo_run(HoldBreath);
        }
    if(event_release(BUTTON_8)) {
        combo_run(ADS2);
        combo_stop(HoldBreath);
        }
    if(get_val(BUTTON_8)) {
        combo_stop(ADS1);
        }
    if(ADS2) {
        combo_stop(Leanleft);
        combo_stop(Leanright);
        }
    //Granate Trow
    if(event_active(BUTTON_13)) {
        combo_run(WaittimerGranate);
        }
    if(get_val(BUTTON_13)) {
        set_val(BUTTON_13, 0.0);
        combo_run(Granate);
        }
    if(event_release(BUTTON_13)) {
        combo_run(Granateswitch);
        }
    if(WaittimerGranate) {
        combo_stop(Granate);
        }
    //AUTORUN
    if(get_val(STICK_2_Y) <= -75.0 && get_val(BUTTON_7)) {
        b_Run = 1;
        }
     //let go of the stick first before checking for activity to stop the running
     if(b_Run == 1 && get_val(STICK_2_Y) >= -10.0) b_Run = 2;
     if (b_Run >= 1) {
         combo_run(Easyrun);
         if ( b_Run >= 2 && get_val(FIRE_BUTTON)) b_Run = 0;
     }
     if(event_active(BUTTON_8) || get_val(STICK_2_Y) > 15f) {
        b_Run = 0;
          }
    }
    //Fight Switch One
    if(FIGHT_SWITCH >= 1) {
    if(get_val(BUTTON_9)) {
        set_val(BUTTON_9, 0.0);
        combo_run(Left);
    }
    if(get_val(BUTTON_6)) {
        set_val(BUTTON_6, 0.0);
        combo_run(Up);
    }
    // EASY SPRINT
    if(get_val(STICK_2_Y) <= -75.0) {
        combo_run(EasySprint);
    } else {
        combo_stop(EasySprint);
    }
    //Rapidfire
    if(event_active(BUTTON_5) && get_val(STICK_2_X) < -75.0) {
        combo_run(LeanleftRapid);
    }
    if(event_active(BUTTON_5) && get_val(STICK_2_X) > 75.0) {
        combo_run(LeanrightRapid);
    }
    if(get_val(BUTTON_5)) {
        set_val(STICK_2_Y, 0.0);
        combo_run(Quickshot);
        combo_run(Movement);
        combo_run(Strafing);
        combo_run(ADS1);
    }
    if(event_active(BUTTON_5) && get_val(STICK_2_X) < 75.0 && get_val(STICK_2_X) > -75.0) {
        combo_run(Rightalways);
    }
    //Reload
    if(get_val(BUTTON_12)) {
        set_val(BUTTON_12, 0.0);
        combo_run(Reload);
    }   
    //Loot
    if(get_val(BUTTON_17)) {
        set_val(BUTTON_17, 0.0);
        combo_run(Loot);
    }
    //ADS Shoot
    if(get_val(BUTTON_8)) {
        set_val(STICK_2_Y, 0.0);
    }
    if(get_val(BUTTON_8) && get_val(STICK_2_X) < -75.0 && time_active(STICK_2_X) >= 600) {
        combo_run(Leanleft);
        }
    if(get_val(BUTTON_8) && get_val(STICK_2_X) > 75.0 && time_active(STICK_2_X) >= 600) {
        combo_run(Leanright);
        }
    if(get_val(BUTTON_5) && get_val(BUTTON_8)) {
        combo_run(ShootADS);
        combo_run(Movement);
        combo_stop(ADS1);
        combo_stop(Quickshot);
        combo_stop(Strafing);
        combo_stop(Rightalways);
    }
    if(event_release(BUTTON_5) && time_active(BUTTON_5) >= 1500) {
        combo_run(Reload);
        }
    if(event_active(BUTTON_8)) {
        combo_run(HoldBreath);
        combo_run(ADS2);
        }
    if(get_val(BUTTON_8) && time_active(BUTTON_8) >= 800) {
        combo_run(HoldBreath);
        }
    if(event_release(BUTTON_8)) {
        combo_run(ADS2);
        combo_stop(HoldBreath);
        }
    if(get_val(BUTTON_8)) {
        combo_stop(ADS1);
        }
    if(ADS2) {
        combo_stop(Leanleft);
        combo_stop(Leanright);
        }
    //Granate Trow
    if(event_active(BUTTON_13)) {
        combo_run(WaittimerGranate);
        }
    if(get_val(BUTTON_13)) {
        set_val(BUTTON_13, 0.0);
        combo_run(Granate);
        }
    if(event_release(BUTTON_13)) {
        combo_run(Granateswitch);
        }
    if(WaittimerGranate) {
        combo_stop(Granate);
        }
    //AUTORUN
    if(get_val(STICK_2_Y) <= -75.0 && get_val(BUTTON_7)) {
        b_Run = 1;
        }
     //let go of the stick first before checking for activity to stop the running
     if(b_Run == 1 && get_val(STICK_2_Y) >= -10.0) b_Run = 2;
     if (b_Run >= 1) {
         combo_run(Easyrun);
         if ( b_Run >= 2 && get_val(FIRE_BUTTON)) b_Run = 0;
     }
     if(event_active(BUTTON_8) || get_val(STICK_2_Y) > 15f) {
        b_Run = 0;
          }
    }
}
combo ADS1 {
    set_val(BUTTON_8, 100.0);
}
combo ADS2 {
    set_val(BUTTON_8, 100.0);
    wait(80);
    set_val(BUTTON_8, 0.0);
    wait(200);
}
combo Quickshot {
    set_val(BUTTON_5, 100.0);
    wait(80);
    set_val(STICK_1_Y, 50.0);
    set_val(BUTTON_5, 0.0);
    wait(40);
    set_val(STICK_1_Y, 0.0);
}
combo QuickshotAuto {
    set_val(BUTTON_5, 100.0);
    wait(40);
    set_val(STICK_1_Y, 50.0);
    set_val(BUTTON_5, 100.0);
    wait(80);
    set_val(STICK_1_Y, 0.0);
    set_val(BUTTON_5, 0.0);
    wait(380);
}
combo Reload {
    set_val(BUTTON_17, 100.0);
    wait(600);
    set_val(BUTTON_17, 0.0);
}
combo Loot {
    set_val(BUTTON_17, 100.0);
    wait(140);
    set_val(BUTTON_17, 0.0);
    wait(650);
}
combo ShootADS {
    set_val(BUTTON_5, 100.0);
    wait(160);
    set_val(STICK_1_Y, 50.0);
    set_val(BUTTON_5, 0.0);
    wait(40);
    set_val(STICK_1_Y, 0.0);
}
combo ShootADSAuto {
    set_val(BUTTON_5, 100.0);
    wait(40);
    set_val(STICK_1_Y, 50.0);
    set_val(BUTTON_5, 100.0);
    wait(120);
    set_val(STICK_1_Y, 0.0);
    set_val(BUTTON_5, 0.0);
    wait(500);
}
combo Granate {
    set_val(BUTTON_5, 100.0);
}
combo Movement {
    set_val(STICK_2_Y, 0.0);
}
combo Granateswitch {
    set_val(BUTTON_5, 0.0);
    wait(40);
    set_val(BUTTON_14, 100.0);
    wait(40);
    set_val(BUTTON_14, 0.0);
}
combo WaittimerGranate {
    set_val(BUTTON_13, 100.0);
    wait(200);
    set_val(BUTTON_13, 0.0);
    wait(800);
}
combo HoldBreath {
    set_val(STICK_2_Y, 0.0);
    set_val(STICK_2_X, 0.0);
    wait(200);
    set_val(STICK_2_Y, 0.0);
    set_val(STICK_2_X, 0.0);
    set_val(BUTTON_7, 100.0);
    wait(200);
    set_val(BUTTON_7, 100.0);
    wait(4000);
    set_val(BUTTON_7, 0.0);
}
combo Strafing {
    set_val(STICK_2_X, 100.0);
    wait(360);
    set_val(STICK_2_X, 0.0);
    wait(140);
    set_val(STICK_2_X, -100.0);
    wait(360);
    set_val(STICK_2_X, 0.0);
    wait(140);
}
combo Driver {
    wait(600);
    set_val(BUTTON_16, 100.0);
    wait(600);
    set_val(BUTTON_16, 0.0);
}
combo Leanleft {
    set_val(BUTTON_9, 100.0);
}
combo Leanright {
    set_val(BUTTON_6, 100.0);
}
combo LeanleftRapid {
    wait(40);
    set_val(BUTTON_9, 100.0);
    wait(100);
    set_val(BUTTON_9, 0.0);
}
combo LeanrightRapid {
    wait(40);
    set_val(BUTTON_6, 100.0);
    wait(100);
    set_val(BUTTON_6, 0.0);
}
combo Rightalways {
    wait(40);
    set_val(BUTTON_6, 100.0);
    wait(100);
    set_val(BUTTON_6, 0.0);
}
combo Easyrun {
    set_val(STICK_2_Y, -100.0);
}
combo Up {
    set_val(BUTTON_10, 100.0);
}
combo Down {
    set_val(BUTTON_11, 100.0);
}
combo Left {
    set_val(BUTTON_12, 100.0);
}
combo Right {
    set_val(BUTTON_13, 100.0);
}
combo EasySprint {
    set_val(SPRINT_BUTTON, 100.0);
}
void ColorLED(char Color) {
    fix32 Color1, Color2, Color3, Color4;
 
    if(Color == 'B'){Color1 = 100.0;    Color2 = 0.00;    Color3 = 0.00;    Color4 = 0.00;}
    if(Color == 'R'){Color1 = 0.00;    Color2 = 100.0;    Color3 = 0.00;    Color4 = 0.00;}
    if(Color == 'G'){Color1 = 0.00;    Color2 = 0.00;    Color3 = 100.0;    Color4 = 0.00;}
    if(Color == 'P'){Color1 = 0.00;    Color2 = 0.00;    Color3 = 0.00;    Color4 = 100.0;}
    if(Color == 'C'){Color1 = 100.0;    Color2 = 0.00;    Color3 = 100.0;    Color4 = 0.00;}
    if(Color == 'A'){Color1 = 0.00;    Color2 = 100.0;    Color3 = 100.0;    Color4 = 0.00;}
    if(Color == 'W'){Color1 = 100.0;    Color2 = 100.0;    Color3 = 100.0;    Color4 = 100.0;}
 
    led_set(LED_1, Color1, 0);
    led_set(LED_2, Color2, 0);
    led_set(LED_3, Color3, 0);
    led_set(LED_4, Color4, 0);
 
    return;
}
User avatar
3rne5t0
Sergeant Major of the Army
Sergeant Major of the Army
 
Posts: 210
Joined: Mon Jan 30, 2017 10:31 am

Re: Pubg Script only for Experience Scripter

Postby Scachi » Fri Dec 29, 2017 10:54 am

Are you sure the ColorLED calls only happen on color change ? Haven't read enough through the script to be sure but calling this function without needing to change the color may result in overloading the usb and disconnect/lag problems
User avatar
Scachi
Brigadier General
Brigadier General
 
Posts: 3044
Joined: Wed May 11, 2016 6:25 am
Location: Germany

Re: Pubg Script only for Experience Scripter

Postby 3rne5t0 » Fri Dec 29, 2017 2:06 pm

Thats the code for lights what woud be your solution, i dont notice any overload.


Code: Select all
main {
    if((autofire && !FIGHT_SWITCH)) {
        ColorLED('G');
    } else if((FIGHT_SWITCH && !autofire)) {
        ColorLED('R');
    } else if((!FIGHT_SWITCH && !autofire)) {
        ColorLED('W');
    }
}
void ColorLED(char Color) {
    fix32 Color1, Color2, Color3, Color4;
 
    if(Color == 'B'){Color1 = 100.0;    Color2 = 0.00;    Color3 = 0.00;    Color4 = 0.00;}
    if(Color == 'R'){Color1 = 0.00;    Color2 = 100.0;    Color3 = 0.00;    Color4 = 0.00;}
    if(Color == 'G'){Color1 = 0.00;    Color2 = 0.00;    Color3 = 100.0;    Color4 = 0.00;}
    if(Color == 'P'){Color1 = 0.00;    Color2 = 0.00;    Color3 = 0.00;    Color4 = 100.0;}
    if(Color == 'C'){Color1 = 100.0;    Color2 = 0.00;    Color3 = 100.0;    Color4 = 0.00;}
    if(Color == 'A'){Color1 = 0.00;    Color2 = 100.0;    Color3 = 100.0;    Color4 = 0.00;}
    if(Color == 'W'){Color1 = 100.0;    Color2 = 100.0;    Color3 = 100.0;    Color4 = 100.0;}
 
    led_set(LED_1, Color1, 0);
    led_set(LED_2, Color2, 0);
    led_set(LED_3, Color3, 0);
    led_set(LED_4, Color4, 0);
 
    return;
}
User avatar
3rne5t0
Sergeant Major of the Army
Sergeant Major of the Army
 
Posts: 210
Joined: Mon Jan 30, 2017 10:31 am

Re: Pubg Script only for Experience Scripter

Postby Scachi » Fri Dec 29, 2017 5:23 pm

I don't know if the problem has gone with some firmware update, but others had experienced problems with calling it to often (that was on every main loop iteration), so it can't hurt to avoid something like that ;-)
User avatar
Scachi
Brigadier General
Brigadier General
 
Posts: 3044
Joined: Wed May 11, 2016 6:25 am
Location: Germany

Re: Pubg Script only for Experience Scripter

Postby 3rne5t0 » Fri Dec 29, 2017 10:34 pm

how can i call switching letters like s and p for example, or do you think there is a better solution
User avatar
3rne5t0
Sergeant Major of the Army
Sergeant Major of the Army
 
Posts: 210
Joined: Mon Jan 30, 2017 10:31 am

Re: Pubg Script only for Experience Scripter

Postby Sillyasskid » Mon Jan 01, 2018 1:56 pm

3rne5t0 wrote:Thats the code for lights what woud be your solution, i dont notice any overload.
:smile0201: The led_set() holds the last state set and should NOT be called on every interaction of main.
This is mentioned in the wiki GPC Language Reference led_set()

I've edited your script, This should solve the problem. :)
Code: Select all
main
{
  if(autofire && !FIGHT_SWITCH)       ColorLED('G');
  else if(FIGHT_SWITCH && !autofire)  ColorLED('R');
  else if(!FIGHT_SWITCH && !autofire) ColorLED('W');
}
void ColorLED(char Color)
{
  static char a;
  if (Color != a)
  {
    fix32 Color1, Color2, Color3, Color4;
    if(Color == 'B') Color1 = 100f, Color2 = 0.00, Color3 = 0.00, Color4 = 0.00;
    if(Color == 'R') Color1 = 0.00, Color2 = 100f, Color3 = 0.00, Color4 = 0.00;
    if(Color == 'G') Color1 = 0.00, Color2 = 0.00, Color3 = 100f, Color4 = 0.00;
    if(Color == 'P') Color1 = 0.00, Color2 = 0.00, Color3 = 0.00, Color4 = 100f;
    if(Color == 'C') Color1 = 100f, Color2 = 0.00, Color3 = 100f, Color4 = 0.00;
    if(Color == 'A') Color1 = 0.00, Color2 = 100f, Color3 = 100f, Color4 = 0.00;
    if(Color == 'W') Color1 = 100f, Color2 = 100f, Color3 = 100f, Color4 = 100f;
    led_set(LED_1, Color1, 0), led_set(LED_2, Color2, 0);
    led_set(LED_3, Color3, 0), led_set(LED_4, Color4, 0);
    printf("%c", Color); //This line can be removed.
    a = Color;
  }
  return;
}
User avatar
Sillyasskid
Captain
Captain
 
Posts: 574
Joined: Sat May 14, 2016 3:07 am

Re: Pubg Script only for Experience Scripter

Postby 3rne5t0 » Mon Jan 01, 2018 4:54 pm

Thx you sir! :smile0203: :smile0203: :smile0203: :joia:
User avatar
3rne5t0
Sergeant Major of the Army
Sergeant Major of the Army
 
Posts: 210
Joined: Mon Jan 30, 2017 10:31 am


Return to GPC2 Script Programming

Who is online

Users browsing this forum: No registered users and 90 guests