Mentally Ill, Need help converting a device script to t2

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

Mentally Ill, Need help converting a device script to t2

Postby jkilgren32 » Sun Sep 16, 2018 9:19 pm

Hello everyone, I am completely new to the scripting/modding world. I have been trying to teach myself how to code on and off for a few years but because of some mental handicaps ( or learning disabilities) it has been pretty much impossible for me to learn successfully. Retaining information is also extremely hard as well as comprehension for me. That being said, I've been looking for a do it all type script for cod including the new one with black out that will also allow me to use my xbox elite controller on my ps4, and i think i found one for the device max but I cant find where the error in the script is that it reports when i test it. Im not sure how any of this work and Im not looking to steal someones work and play it off as my own i just need to find something that works and can do a lot of things ( i have been trying to figure out how it works by studying it ) so i can mess around and hopefully learn and one day contribute. It is a pretty big script and i dont want to post it in case its against the rules or something. If anyone is willing to help me through it or even do it for me ( not expected, but i would really appreciate it) I would appreciate it. Thanks in advance, at least for reading all this.
User avatar
jkilgren32
Staff Sergeant
Staff Sergeant
 
Posts: 13
Joined: Sun Sep 16, 2018 7:49 pm

Re: Mentally Ill, Need help converting a device script to t2

Postby jkilgren32 » Mon Sep 17, 2018 1:02 am

Sorry if im freaking you guys out, I know im a little crazy but this is the script that I have been trying to convert to t2.
User avatar
jkilgren32
Staff Sergeant
Staff Sergeant
 
Posts: 13
Joined: Sun Sep 16, 2018 7:49 pm

Re: Mentally Ill, Need help converting a device script to t2

Postby J2Kbr » Mon Sep 17, 2018 3:44 pm

Converted:
Code: Select all
#include <titanone.gph>
 
/*******************************************************************************/
data(1,                                                                           
  2,0,0,0, //1. Blue                                                               
  0,2,0,0, //2. Red                                                               
  0,0,2,0, //3. Green                                                             
  0,0,0,2, //4. Pink                                                               
  2,0,2,0, //5. SkyBlue                                                           
  0,2,2,0, //6. Yellow                                                             
  2,2,2,2  //7. White                                                             
);
/*******************************************************************************
LED COLOURS: (remember to hold reload for 2 sec when you DIE to reset the script)
 
- BLUE                    :     STANDARD COLOUR / STANDARD SET UP
- GREEN BLINKING        :    ANTI RECOIL IS RUNNING (LED BLINKS FAST, MED & SLOW TO INDICATE PROFILE)
- PINK WHEN ADS/AIMING    :     AIM ASSIST IS ON (WORKS WITH ANTI RECOIL; SO YOU CAN USE BOTH MODS AT THE SAME TIME)
- PINK WHEN FIRE        :    AIM CORRECTION IS ON (WORKS WITH AIM ASSIST AND ANTI RECOIL)
- SKY BLUE                :    SECONDARY OR PRIMARY EASY AKIMBO WITH RAPID FIRE
- RED                    :     SECONDARY GUN RAPID FIRE
- WHITE                    :     PRIMARY GUN RAPID FIRE
********************************************************************************/

 
//------ START USER SETTINGS AND PREFERENCES-------/
 
int In_Game_Sens                 = 4;                 //CHANGE THIS VALUE TO ADJUST AIM ASSIST SETTINGS (ENTER VALUE OF YOUR IN-GAME SENSITIVITY SETTINGS)
int flipped                    = FALSE;            //CHANGE TO TRUE IF YOU PLAY WITH TRIGGERS & BUMMPERS FLIPPED
int Default                    = FALSE;            //CHANGE TO TRUE IS YOU PLAY WITH DEFAULT BUTTON LAYOUT (CURRENTLY TACTICAL)
int Aim_Assist                = FALSE;             //AIM ASSIST -> CHANGE TO TRUE IF YOU WANT AA ON BY DEFAULT - TO OPTIMIZE TO YOUR OWN DEFAULT SETTING: CHANGE THE VALUE ABOVE!
int easy_run                  = TRUE;                //CHANGE TO FALSE TO SWITCH OFF AUTO SPRINT BY DEFAULT
int EASYMELEE                = TRUE;             //CHANGE THIS VALUE TO FALSE IF YOU WANT TO REMOVE EASY_MELEE FROM THE SCRIPT (NOTE, THIS WILL ONLY WORK WITH TACTICAL BTN LAYOUTS)
int PS4_Compatible             = FALSE;             //ELITE CONTROLLER ON PS4? --> CHANGE "FALSE;" TO "TRUE;"
int hair_trigger            = TRUE;             //CHANGE TO FALSE TO CANCEL HAIR TRIGGERS IN THE GAME
int ads_sens                 = FALSE;            //AIM CORRECTION: CHANGE TO TRUE TO SWITCH ON DEFAULT
int AutoAim                    = FALSE;            //IF YOU PRESS FIRE, YOU WILL AUTO AIM / CHANGE TO TRUE IF YOU WANT THIS ON BY DEFAULT
int Auto_Heal                = FALSE;            //IF YOU WANT TO RUN AUTO HEAL CHANGE THIS VALUE TO TRUE
int Secondary_Weapon        = TRUE;                //IF YOU WANT TO SWITCH OFF SECONDARY WEAPONS FIRE MODS (E.G. RAPID FIRE, AKIMBO) CHANGE THIS VALUE TO FALSE -> NOW RAPID FIRE MODS ARE SWITCHED TO YOUR PRIMARY WEAPON
int recoil_onoff              = FALSE;             //IF "TRUE" ANTI RECOIL IS ON BY DEFAULT - IF FALSE, OFF BY DEFAULT (ALSO READ TIP BELOW)
                                                //TIP: IN THE SCRIPT LOOK UP THE SECTION NAMED ANTI RECOIL PROFILES TO REPLACE ANTI RECOIL VALUES THAT MATCH YOUR WEAPONS OF CHOICE
 
//------ END USER SETTINGS AND PREFERENCES-------/
/*------ READ THE INSTRUCTIONS FURTHER BELOW --------/
 
TOGGLES & SWITCHES:
 
HOLD ADS* + TAP
 
- UP                    :    STANDARD SET UP
- DOWN                    :    AKIMBO SET UP
- RIGHT                    :    RAPID FIRE SET UP
- LEFT                    :    ALL RAPID FIRE OFF
- VIEW/SHARE            :    RESET EPROM MEMORY TO DEFAULT VALUES
- MENU/OPTIONS            :    SAVE ADJUSTABLE SETTINGS TO EPROM (!!!will only save until the next time you unplug the CM device!!!)
 
*ADS is the aim button (ussually Left Trigger, unless you have another button lay out)
 
HOLD DOWN +                 OFF/ON = ON BY DEFAULT / ON/OFF = OFF BY DEFAULT
 
- TAP ADS                :    AIM ASSIST            ON/OFF
- TAP FIRE                :    AIM CORRECTION        ON/OFF
- TAP PRONE                :    EASY DROP            OFF/ON
- TAP MELEE                :    EASY MELEE            OFF/ON
- TAP SPRINT            :    EASY SPRINT            OFF/ON
- TAP TACTICAL            :     AUTO AIM            ON/OFF
- TAP SWITCH WEAPON        :    SECONDARY FIRE MODS OFF/ON
 
HOLD RELOAD + TAP        :    ANTI RECOIL PROFILES WITH LED INDICATORS
 
- LEFT (on by default)    :    PROFILE 4    [no led]    AR = 0    / AR-H = 0        ANTI RECOIL OFF
- UP:                     :    PROFILE 1    [100 ms]    AR = 30 / AR-H = 0         ANTI_RECOIL = 30; ANTI_RECOIL_H = 0
- RIGHT:                 :    PROFILE 2    [300 ms]    AR = 34 / AR-H = -20     ANTI_RECOIL = 34; ANTI_RECOIL_H = -20
- DOWN:                 :    PROFILE 3    [500 ms]    AR = *     / AR-H = *       ON THE FLY
 
 
ON THE FLY ANTI RECOIL VALUES: HOLD XB1_B (PS4_CIRCLE) + TAP
 
- UP                    :    ANTI_RECOIL + 1;                             
- DOWN                    :    ANTI_RECOIL - 1;                                                   
- RIGHT                    :    ANTI_RECOIL_H + 1;                   
- LEFT                    :    ANTI_RECOIL_H - 1;
 
 
HOLD JUMP + TAP            :    ADS SENSITIVITY ON THE FLY
 
- UP     increase        :    ADS SENS +2
- DOWN     decrease        :    ADS SENS -2
- RIGHT    increase        :    MIDPOINT +2
- LEFT    decrease        :    MIDPOINT -2
 
ADS SENS & MIDPOINT        :    https://device.com/manual/controller ... ctions.htm
                            https://device.com/forums/showthread ... ING-SCRIPT
 
**************************INSTRUCTIONS:
 
StandardSetUp
- primary weapon: normal fire (BLUE)
- secondary weapon: rapid fire (for pistol) (RED)
- hold reload button for 2 sec to reset (when you die)
- The script will start with this Set Up
- Standard on
 
RapidFireSetUp
- primary weapon: rapid fire (suitable for semi auto rifles) (WHITE)
- secondary weapon: rapid fire (for hand gun)(RED)
- hold reload button for 2 sec to reset (when you die)
 
AkimboSetUP
- primary weapon: normal fire
- secondary weapon: easy akimbo with rapid fire (SKY BLUE)
- for pistols, to fire press either LT or RT
- hold reload button for 2 sec to reset (when you die)
 
Rapid Fire OFF
- will switch all rapid fire modes OFF
 
***********NEW!!!**************
 
IF YOU TOGGLE Secondary_Weapon TO "OFF" OR CHANGE THE VALUE ABOVE UNDER USER SETTINGS TO "FALSE" .....
......-> THEN ALL RAPID FIRE MODS WILL MOVE TO YOUR PRIMARY WEAPON
 
SO YOU WILL HAVE:
 
HOLD ADS* + TAP
 
- UP                    :    NORMAL FIRE
- DOWN                    :    AKIMBO RAPID FIRE ON YOUR PRIMARY WEAPON
- RIGHT                    :    RAPID FIRE ON YOUR PRIMARY WEAPON
- LEFT                    :    ALL RAPID FIRE OFF
 
AIM ASSIST
- NEW: FILL OUT YOUR SENSITIVITY SETTINGS IN THE CONFIG BOX BELOW!
- If you ADS it will stick better on your target
- standard OFF
 
To test Aim Assist settings:
To test settings, start a Custom Game with two controllers. Toggle ADS on the controller with Aim Assist
and move the character without Aim Assist in front of your character to test stickiness.
 
AIM CORRECTION:
When activated:
- TO GET MORE AIM STABILITY YOU CAN ADJUST YOUR SENSITIVITY & MIDPOINT
- TO ACTIVATE HOLD D-BTN DOWN AND TAP FIRE-BTN (STEP 1)
- HOLD THE JUMP BUTTON + PRESS DOWN TO LOWER / PRESS UP TO INCREASE SENSITIVITY
                       + PRESS LEFT TO LOWER / PRESS UP TO INCREASE MIDPOINT
 
- SAVE YOUR SETTINGS: HOLD AIM-BTN + TAP XB1 START / PS4 OPTIONS
- NOTE: SETTINGS WILL ONLY BE SAVED UNTIL YOU DISCONNECT device MAX
- to RESET settings to standard values HOLD ADS + TAP VIEW/SHARE
- this mod is standard OFF
- start value ADS SENS = 100% (standard value) - FOR MORE ACCURACY LOWER THIS VALUE (WITH A FEW CLICKS AT A TIME)
- start value MIDPOINT = 50% (standard value) - FOR MORE ACCURACY INCREASE THIS VALUE (WITH A FEW CLICKS AT A TIME)
- A higher midpoint value makes it easier to be more accurate when you aim
 
TIP: FIND YOUR PERFECT MOVEMENT SPEED AND AIM SETTINGS BY INCREASING YOUR IN-GAME DEFAULT SENSITIVITY, AND, DURING A GAME, ADJUSTING YOUR MIDPOINT IN THE SCRIPT
 
EASY MELEE (to combine with TACTICAL button lay out in the game!)
- should be used in combination with AUTOSPRINT:
- if you use AUTOSPRINT you no longer need to press LS to start sprinting,
- instead use LS for your melee attack!
- it takes a few games to get used to it, but once you are: you will love it!
- Standard ON
 
HAIR TRIGGERS (both ADS + FIRE)
- standard ON
 
EASY SPRINT
- press LS forward to sprint.
- standard ON                           
 
EASY SLIDE
- if you press PRONE you will SLIDE smoothly (just tap or click prone button once)
- if you want to prone instead of slide:
   - tap once on D-PAD LEFT if you want to prone normally;
   - you now have a short time frame to prone normally, because easy slide is switched off for 30 seconds
   - rumble after 30 seconds indicates that easy slide is active again     
- standard ON
 
 
********************************************************************************
SCRIPT STARTS HERE / MAKE NO CHANGES AFTER HERE UNLESS INSTRUCTED!!!
********************************************************************************
 
*/

 
int ShotMode_KS = FALSE;
int hold_time   = 35;
int rest_time   = 35;
//int KS_time= 0;
int easy_run_KS = FALSE;
//int hold1_time1;
//int rest1_time1;
//int RATE_OF_FIRE = 14; //Range: 1 to 25 RPS (Round/s)
int PrimaryWeapon   = TRUE;
int RF_KS   = FALSE;
int R2F_K2S    = TRUE;
// Aim Assist values: do not adjust them here, but change "In_Game_Sens" above!!!
//------------------------------------START AIM ASSIST VALUES-------------------------------------------------------------------------------
int valueA                 = 28;                  // Y-Axis & X-Axis AimAssist value
int delayA;     
//  int Correction_Activator   = 38;
//  int valueXP                = 36;
//  int valueXN                = -36;
//----------------------------------END AIM ASSIST VALUES-----------------------------------------------------------------------------------
//int value_XP;
//int value_XN;
 
//int DblClick_UP;
 
//int QuickScope = FALSE;
int akimbo_onoff = FALSE;
int RAPIDoff;
int ADS_SENS;     
int MIDPOINT;
int ads_sens2 = FALSE;
int Invert =  1;
int ANTI_RECOIL   = 0;               
int ANTI_RECOIL_H = 0;             
int anti_recoil = 0;                                     
int anti_recoil_H = 0;
int AR_Release    = 35;             
int profile;
int LedTime;
//int Combo_UP;
int FIRE_BTN           = XB1_RT;
int ADS_BTN            = XB1_LT;
int SPRINT_BTN         = XB1_LS;
int MELEE_BTN          = XB1_B;
int JUMP_BTN           = XB1_A; 
int RELOAD_BTN         = XB1_X; 
int PRONE_BTN          = XB1_RS; 
int SW_WEAPON_BTN      = XB1_Y; 
int TACTICAL           = XB1_LB; 
int LETHAL             = XB1_RB;
int UP                 = XB1_UP;
int RIGHT              = XB1_RIGHT;
int DOWN               = XB1_DOWN;
int LEFT               = XB1_LEFT;
int LY                 = XB1_LY;
int LX                 = XB1_LX;
int RY                 = XB1_RY;
int RX                 = XB1_RX;
int save  =  2;
int reset =    1;
int Col_ind;
int Blue       =  1;                                                           
int Red        =  2;                                                           
int Green      =  3;                                                           
int Pink       =  4;                                                           
int SkyBlue    =  5;                                                           
int Yellow     =  6;                                                           
int White      =  7;                                                         
//--------------------------------------------------------------------------------
 
init{                                                                                 
if(get_controller() == PIO_WII){ combo_run(STANDARD_ON);}
   else { combo_run(STANDARD_OFF);}
 
if(get_console() == PIO_PS4){
  FIRE_BTN           = PS4_R2;
  ADS_BTN            = PS4_L2;
  SPRINT_BTN         = PS4_L3;
  MELEE_BTN          = PS4_CIRCLE;
  JUMP_BTN           = PS4_CROSS; 
  RELOAD_BTN         = PS4_SQUARE; 
  PRONE_BTN          = PS4_R3; 
  SW_WEAPON_BTN      = PS4_TRIANGLE; 
  TACTICAL           = PS4_L1; 
  LETHAL             = PS4_R1;
  UP                 = PS4_UP;
  RIGHT              = PS4_RIGHT;
  DOWN               = PS4_DOWN;
  LEFT               = PS4_LEFT;
  LY                 = PS4_LY;
  LX                 = PS4_LX;
  RY                 = PS4_RY;
  RX                 = PS4_RX;
  save  =  2;
  reset =  1;
 
   }else{
  FIRE_BTN           = XB1_RT;
  ADS_BTN            = XB1_LT;
  SPRINT_BTN         = XB1_LS;
  MELEE_BTN          = XB1_B;
  JUMP_BTN           = XB1_A; 
  RELOAD_BTN         = XB1_X; 
  PRONE_BTN          = XB1_RS; 
  SW_WEAPON_BTN        = XB1_Y; 
  TACTICAL           = XB1_LB; 
  LETHAL             = XB1_RB;
  UP                 = XB1_UP;
  RIGHT              = XB1_RIGHT;
  DOWN               = XB1_DOWN;
  LEFT               = XB1_LEFT;
  LY                 = XB1_LY;
  LX                 = XB1_LX;
  RY                 = XB1_RY;
  RX                 = XB1_RX;
  save  =      2;
  reset =    1;
   } 
 
     MIDPOINT = get_pvar (SPVAR_2, 0, 100, 50);
     ADS_SENS = get_pvar (SPVAR_5, 0, 327, 100);
     ANTI_RECOIL   = get_pvar(SPVAR_4, -100,+100, 0);   
    ANTI_RECOIL_H = get_pvar(SPVAR_3, -100,+100, 0)
    delayA = (3 * valueA ) / In_Game_Sens; set_val(TRACE_2, delayA);
 
}
//------------------------------------------------------------------------------
//============================= MAIN BLOCK       ===============================
main { // begin of main block
set_val(TRACE_1,R2F_K2S);
set_val(TRACE_2,akimbo_onoff);
set_val(TRACE_3,RF_KS);
set_val(TRACE_4,RAPIDoff);
set_val(TRACE_5,ads_sens);
set_val(TRACE_6,Aim_Assist);
set_val(TRACE_6,profile);
 
 
 
//--------------------------------------------------------------
 
///////////////////////////////////////////////////////////////
///   MENU SYSTEM / HOLD ADS + ///////////////////////////////
/////////////////////////////////////////////////////////////
 
if(get_val(ADS_BTN)){//  hold ADS button + D pad buttons
 
////////////////////////////////
// SAVE TO EPROM
 
    if(event_press(save)){        // XB1 START / PS4 OPTIONS
            save_pvars();
            combo_run(STANDARD_ON);
            set_val(2, 0);     
        }
////////////////////////////////
// RESET EPROM TO DEFAULT ADS & MID POINT
 
 
    if(event_press(reset)){     // XB1 VIEW / PS4 SHARE
        MIDPOINT = 50;
        ADS_SENS = 100;
        set_pvar (SPVAR_2, MIDPOINT);
        set_pvar (SPVAR_5, ADS_SENS);
        set_val(1, 0);
    }
 
////////////////////////////////
// STANDARD SET UP
 
    if(event_press(UP)){// D pad UP
            RF_KS  = FALSE;
            R2F_K2S  = TRUE;
            akimbo_onoff = FALSE;
            RAPIDoff = FALSE;           
        }
////////////////////////////////
// AKIMBO SET UP
 
    if(event_press(DOWN)) {// D pad DOWN 
            RF_KS  = FALSE;
            R2F_K2S  = FALSE;
            akimbo_onoff = TRUE;
              RAPIDoff = FALSE;
        }                                     
////////////////////////////////
// RAPID FIRE SET UP
 
    if(event_press(RIGHT)) {// D pad RIGHT
            RF_KS  = TRUE;
            R2F_K2S  = TRUE;
            akimbo_onoff = FALSE;
            RAPIDoff = FALSE;
        }
////////////////////////////////
// RAPID FIRE OFF
 
    if(event_press(LEFT)) {// D pad LEFT
            RF_KS  = FALSE;
            R2F_K2S  = FALSE;
            akimbo_onoff = FALSE;
            RAPIDoff = TRUE;
        }
////////////////////////////////
// STOP CONTROLLER INPUT
 
//    if(event_press(0)){
//            Combo_UP = !Combo_UP;
//                  if(Combo_UP == TRUE){combo_run(STANDARD_ON)}
//                 if(Combo_UP == FALSE){combo_run(STANDARD_OFF)}   
//                set_val(0,0);
}
 
///////////////////////////////////////////////////////////////
///   MENU SYSTEM / HOLD DOWN + ///////////////////////////////
/////////////////////////////////////////////////////////////
 
if(get_val(DOWN)){                                    //  hold D pad button DOWN +
 
 
////////////////////////////////
// EASY DROP
 
    if (event_press(PRONE_BTN))  {                     // PRONE
            ShotMode_KS = !ShotMode_KS; 
        }
 
///////////////////////////////
// ADS SENS
    if(event_press(FIRE_BTN)){                        // FIRE BUTTON
            ads_sens = !ads_sens;// ads_sens2 = !ads_sens2
        }
///////////////////////////////
// ADS ASSIST       
 
    if(event_press(ADS_BTN)){                        //ADS BUTTON
        Aim_Assist = !Aim_Assist;       
        }
 
////////////////////////////////
// EASY MELEE
 
    if (event_press(MELEE_BTN))  {                     // MELEE
            EASYMELEE = !EASYMELEE;
        }
////////////////////////////////
// EASY SPRINT
 
    if (event_press(SPRINT_BTN))  {                 // SPRINT
            easy_run = !easy_run; 
        }
 
////////////////////////////////
// SECONDARY WEAPON
 
    if (event_press(SW_WEAPON_BTN))  {                 // SW_WEAPON_BTN
            Secondary_Weapon = !Secondary_Weapon; 
        }
////////////////////////////////
// AUTO_AIM
 
    if (event_press(TACTICAL))  {                     // TACTICAL
            AutoAim =! AutoAim;
        }
 
        }
///////////////////////////////////////////////////////////////
///   MIDPOINT / ADS SENS ON THE FLY /// HOLD JUMP_BTN + /////
/////////////////////////////////////////////////////////////
 
 if(get_val(JUMP_BTN)){ //      hold JUMP button +   
 
        if(event_press(RIGHT)){                                   
            MIDPOINT = MIDPOINT + 2;        // RIGHT                 
        }                                                       
        if(event_press(LEFT)) {                                   
            MIDPOINT = MIDPOINT - 2;        // LEFT                         
        }                                                         
       set_val(RIGHT,0); set_val(LEFT,0);                         
 
        if(event_press(UP)){                                   
            ADS_SENS = ADS_SENS + 2;        // UP         
        }                                                       
        if(event_press(DOWN)){                                   
            ADS_SENS = ADS_SENS - 2;        // DOWN                 
        }   
        set_val(UP,0); set_val(DOWN,0);                       
 
 }
///////////////////////////////////////////////////////////////////
// ANTI RECOIL PROFILES ///////// ///ANIT RECOIL PROFILES ////////
///////////////////////////////////////////////////////////////// 
 
if (get_val(RELOAD_BTN)){         
 
/*REPLACE CURRENT ANTI_RECOIL & ANTI_RECOIL_H VALUES WITH ANTI RECOIL VALUES THAT MATCH YOUR WEAPONS OF CHOICE
------------*/

    if(event_press(UP))       {recoil_onoff = TRUE; ANTI_RECOIL = 30; ANTI_RECOIL_H = 0; profile = 1; LedTime= 100; AR_Release = ANTI_RECOIL + 1;}  //  ANTI_RECOIL = 30; ANTI_RECOIL_H = 0
    if(event_press(RIGHT))     {recoil_onoff = TRUE; ANTI_RECOIL = 34; ANTI_RECOIL_H = -20; profile = 2; LedTime= 300; AR_Release = ANTI_RECOIL + 1;} // ANTI_RECOIL = 34; ANTI_RECOIL_H = -20
 
// DO NOT CHANGE PROFILE VALUES AFTER HERE !!!
    if(event_press(DOWN))      {recoil_onoff = TRUE; set_pvar(SPVAR_4,  ANTI_RECOIL); set_pvar(SPVAR_3,  ANTI_RECOIL_H); profile = 3; LedTime= 500; AR_Release = ANTI_RECOIL + 1;} // ON THE FLY (START VALUES ARE THE SAME AS LAST USED PROFILE)
    if(event_press(LEFT))     {recoil_onoff = FALSE; ANTI_RECOIL = 0; ANTI_RECOIL_H = 0; profile = 4; AR_Release = ANTI_RECOIL + 1} // AR VALUES = 0
 
///////////////////////////////////////////////////////////////////
//RELOAD TIMES /////////HOLD X + /////////////////RELOAD TIMES////
///////////////////////////////////////////////////////////////// 
//}                         
//if (get_val(reset)){
//
//    if(event_press(LEFT))  {KS_time= 0; easy_run_KS = FALSE;}//           
//    if(event_press(RIGHT)) {KS_time= 2000;}// RIGHT: 2000 
//     if(event_press(DOWN))  {KS_time= 1500;}// DOWN    : 1500 
//    if(event_press(UP))    {KS_time= 5000;}// UP    : 5000
 
///////////////////////////////////////////////////////////////////
////////////////// KILL SWITCH EASY RUN + other KILL SWITCHES ////
///////////////////////////////////////////////////////////////// 
 
}else {
 
    if (event_press (LEFT) && !get_val (ADS_BTN)) combo_run(SwitchOFF);}
//    if (event_press (ADS_BTN)) {combo_stop(STOP_SPRINT) easy_run_KS =FALSE;}
//    if (event_press (FIRE_BTN)) {combo_stop(STOP_SPRINT) easy_run_KS =FALSE;}
//    if (get_val (FIRE_BTN)) {combo_stop(STOP_SPRINT) easy_run_KS =FALSE;}
//    if (get_val (ADS_BTN)) {combo_stop(STOP_SPRINT) easy_run_KS =FALSE;}
 
///////////////////////////////////////////////////////////////////
////////////////// ON THE FLY ANTI RECOIL HOLD B + ///////////////
///////////////////////////////////////////////////////////////// 
 
 
   if(get_val(XB1_B)){                                             
        if(event_press(XB1_UP)){                                   
            ANTI_RECOIL = ANTI_RECOIL + 1;                       
        }                                                       
        if(event_press(XB1_DOWN)) {                                   
            ANTI_RECOIL = ANTI_RECOIL - 1;                         
        }                                                         
        set_val(XB1_UP,0); set_val(XB1_DOWN,0);                         
 
        if(event_press(XB1_RIGHT)){                                   
            ANTI_RECOIL_H = ANTI_RECOIL_H + 1;                   
        }                                                       
        if(event_press(XB1_LEFT)) {                               
            ANTI_RECOIL_H = ANTI_RECOIL_H - 1;                   
        }   
        set_val(XB1_RIGHT,0); set_val(XB1_LEFT,0);                       
          }
    //------------------------------------------------
    //------------------------------------------------
    // ANTI RECOIL                                   
    if( get_val(ADS_BTN) && get_val(FIRE_BTN )) {
        combo_run(AntiRecoil);                     
    }                                                 
 
    if( abs(get_val(RY)) > AR_Release || abs(get_val(RX)) > AR_Release) {
        combo_stop (AntiRecoil);                       
    } 
///////////////////////////////////////////////////////////////////
///////////////////////////////////// FLIP BUMPERS <-> TRIGGERS///
///////////////////////////////////////////////////////////////// 
 
    if(flipped) {
        swap( 7, 6 );
        swap( 4, 3 );
        }
///////////////////////////////////////////////////////////////////
///////////////////////////////////// DEFAULT ////////////////////
///////////////////////////////////////////////////////////////// 
 
    if(Default) {
        swap( 5, 18 );
        }
///////////////////////////////////////////////////////////////////
//////////////////////////////////////////////// HAIR TRIGGERS ///
///////////////////////////////////////////////////////////////// 
 
    if(hair_trigger) {
        if(get_val(FIRE_BTN)){set_val(FIRE_BTN,100);}
        if(get_val(ADS_BTN)){set_val(ADS_BTN,100);}
        }   
 
///////////////////////////////////////////////////////////////////
///////////////////////////////////////////// EASY SLIDE /////////
///////////////////////////////////////////////////////////////// 
 
    if(!ShotMode_KS){                                                     
        if(get_val(PRONE_BTN)) combo_run(DROP_SHOT);                   
        }   
 
///////////////////////////////////////////////////////////////////
/////////////////////////////////////////////// AUTO AIM /////////
///////////////////////////////////////////////////////////////// 
    if(AutoAim){
           if(get_val(FIRE_BTN)) {set_val(ADS_BTN,100);}
      }     
 
 
///////////////////////////////////////////////////////////////////
//  AKIMBO    ////////////////////////////////////AKIMBO//////////
///////////////////////////////////////////////////////////////// 
 
    if(akimbo_onoff && !PrimaryWeapon) {
        if(get_val(FIRE_BTN) && !get_val(ADS_BTN)){combo_run (RAPID_AKIMBO);
        }
        if(get_val(ADS_BTN) && !get_val(FIRE_BTN)){combo_run (RAPID_AKIMBO);
        }
    }
        if(akimbo_onoff && !Secondary_Weapon) {
        if(get_val(FIRE_BTN) && !get_val(ADS_BTN)){combo_run (RAPID_AKIMBO);
        }
        if(get_val(ADS_BTN) && !get_val(FIRE_BTN)){combo_run (RAPID_AKIMBO);
        }
    }
 
 
///////////////////////////////////////////////////////////////////
//  EASY MELEE    ////////////////////////////////////EASYMELEE///
/////////////////////////////////////////////////////////////////       
 
    if (EASYMELEE)    {
        if (get_val(SPRINT_BTN)) set_val(MELEE_BTN, 100);
        }           
///////////////////////////////////////////////////////////////////
//  Combo_UP   ////////////////////////////////////Combo_UP //////
/////////////////////////////////////////////////////////////////       
 
//    if (Combo_UP)    {
//        combo_run (ComboUP);
 
//        }
//    if (!Combo_UP)    {
//        combo_stop (ComboUP);
//        }
///////////////////////////////////////////////////////////////////
//EASY RUN  //////////////////////////////////////EASY RUN////////
///////////////////////////////////////////////////////////////// 
 
    if(easy_run && !easy_run_KS){                               
        if(get_val(LY) < -5) combo_run(EASY_RUN);
        }
//        if(event_release(RELOAD_BTN) && get_ptime(RELOAD_BTN)< 200){combo_run(STOP_SPRINT);}
 
//////////////////////////////////////////////////////////////////////////
////////////   AUTO HEAL     /////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
    if (Auto_Heal){
    if(event_release(RELOAD_BTN) && get_ptime(RELOAD_BTN)< 200){combo_run(AUTO_HEAL)
        }
     }
///////////////////////////////////////////////////////////////////
// LED COLOURS  /////////////////////////// LED COLOURS //////////
/////////////////////////////////////////////////////////////////
 
 
    if(PrimaryWeapon) colourled (Blue);
    if (!PrimaryWeapon && R2F_K2S) colourled (Red);
    if(PrimaryWeapon && RF_KS) colourled (White);
    if(akimbo_onoff && !PrimaryWeapon) colourled(SkyBlue);
    if(akimbo_onoff && !Secondary_Weapon) colourled(SkyBlue);
    if(Aim_Assist && get_val (ADS_BTN)) colourled(Pink);
    if(ads_sens && get_val (FIRE_BTN)) colourled(Pink);
    if(recoil_onoff)combo_run(BLINK3);
 
 
/////////////////////////////////////////////////////////////////////
////////////////////////////////////////// SWITCH WEAPON ///////////
///////////////////////////////////////////////////////////////////
if (Secondary_Weapon){
    if(event_press(SW_WEAPON_BTN)){                         
        PrimaryWeapon = !PrimaryWeapon;
        }
         }
/////////////////////////////////////////////////////////////////////
/////////////////////////////////// RAPID FIRE 1 ///////////////////
///////////////////////////////////////////////////////////////////
 
    if (PrimaryWeapon && RF_KS && get_val(FIRE_BTN))combo_run (RAPID_FIRE);   
 
 
 
 
//////////////////////////////////////////////////////////////////////
////////////////////////////////////////// RAPID FIRE 2 /////////////
////////////////////////////////////////////////////////////////////   
 
    if(!PrimaryWeapon && R2F_K2S)                     
        if(get_val(FIRE_BTN)) {                                   
        combo_run (RAPID_FIRE);
        } 
 
//////////////////////////////////////////////////////////////////////
////////////////////////////////////////// RESET ////////////////////
//////////////////////////////////////////////////////////////////// 
 
// reset script when you die                             
    if(get_val(RELOAD_BTN) && get_ptime(RELOAD_BTN)> 200){combo_run (STANDARD_ON); PrimaryWeapon = TRUE; }
 
    //////////////////////////////
////////////////////////////////////////// PS4 Compatible ///////////
//////////////////////////////////////////////////////////////////// 
 
    if(PS4_Compatible){       
            // XBOX ELITE Paddle Left down PL2             
            if(get_val(PS4_TOUCH)) set_val(PS4_TOUCH,0)
 
          if(get_val(PS4_SHARE)) {                       
                if(!get_val(PS4_R3)) {                     
                          set_val(PS4_TOUCH, 100);             
                          set_val(PS4_SHARE, 0);         
                  }                           
                set_val(PS4_R3, 0);     
          }
          } 
 
//////////////////////////////////////////////////////////////////////
////////////////////////////////////////// AIM ASSIST ///////////////
//////////////////////////////////////////////////////////////////// 
 
if(Aim_Assist){
   if(get_val(ADS_BTN)){
      combo_run(AssY);
      combo_run(AssX);                 
      if(ads_sens) sensitivity(9, MIDPOINT, ADS_SENS); sensitivity(10, MIDPOINT, ADS_SENS);
         }     
         if((get_val(RY)) > valueA || (get_val(RY)) < valueA*(-1)){
             combo_stop(AssY);
            }
         if((get_val(RX)) > valueA || (get_val(RX)) < valueA*(-1)){
             combo_stop(AssX);
            } 
 //     if(ads_sens2){     
 //        if(get_val(ADS_BTN) && get_val(LX) < Correction_Activator*(-1)){
   //         combo_run(Correction_right);
   //         combo_stop(AssX);
   //         }
   //      if(get_val(ADS_BTN) && get_val(LX) > Correction_Activator){
   //         combo_run(Correction_left);
   //         combo_stop(AssX);
   //         }         
   //      if(abs (get_val(RX)) > valueXP || get_val(RX) < valueXN ){
   //         combo_stop(Correction_left);
   //         combo_stop(Correction_right);
    //        }
         }   
         }   
 
 
//------------------------------------------------------------------------------
//    end of main block     
//------------------------------------------------------------------------------
 
 
//------------------------------------------------------------------------------
//    COMBO BLOCKS                                                               
//------------------------------------------------------------------------------
 
 
//combo Correction_right {
//   set_val(RX, valueXP);
//    wait(1);
//   set_val(RX, valueXP);
//}
 
//combo Correction_left {
//     set_val(RX, valueXN);
//     wait(1);
//     set_val(RX, valueXN);
//}
 
combo AssY {
     wait(delayA);
     set_val(RY, valueA);
     wait(delayA);
     set_val(RY, valueA*(-1));
     wait(delayA);
}
 
combo AssX {   
     wait(delayA);
     set_val(RX, valueA);
     wait(delayA);
     set_val(RX, valueA*(-1));
     wait(delayA);
} 
 
//combo ComboUP    {
//    set_val (0,0); set_val (1,0); set_val (2,0); set_val (3,0); set_val (4,0);
//    set_val (5,0); set_val (6,0); set_val (7,0): set_val (8,0); set_val (9,0);
//    set_val (10,0); set_val (11,0); set_val (12,0); set_val (13,0); set_val (14,0);
//    set_val (15,0); set_val (16,0); set_val (17,0); set_val (18,0); set_val (19,0);
//}   
 
//combo STOP_SPRINT {     
//  easy_run_KS = TRUE; 
//     wait(KS_time);
//  easy_run_KS = FALSE;
//    combo_run (STANDARD_OFF);
//}       
 
combo RAPID_FIRE { 
    set_val(FIRE_BTN,100);
    wait(hold_time);       
    set_val(FIRE_BTN,  0);
    wait(rest_time);     
} 
 
combo BLINK3{
    colourled(Green);
        wait (LedTime);
    if(PrimaryWeapon) colourled (Blue);
    if (!PrimaryWeapon && R2F_K2S) colourled (Red);
    if(PrimaryWeapon && RF_KS) colourled (White);
    if(akimbo_onoff && !PrimaryWeapon) colourled(SkyBlue);
    if(akimbo_onoff && !Secondary_Weapon) colourled(SkyBlue);
    if(Aim_Assist && get_val (ADS_BTN)) colourled(Pink);
    if(ads_sens && get_val (FIRE_BTN)) colourled(Pink);
    if(recoil_onoff)combo_run(BLINK3);
          wait (900);
}
 
combo SwitchOFF { 
//   set_rumble(RUMBLE_A,100);
//    wait(200);
//    reset_rumble();
    ShotMode_KS = TRUE;   
    wait(30000);
    combo_run (STANDARD_OFF);
    ShotMode_KS = FALSE;
 }
 
combo DROP_SHOT{   
    set_val(PRONE_BTN,100);
    wait(500)
}
 
combo AUTO_HEAL {   
    wait(1500);
    set_val(TACTICAL,100);
    combo_run (STANDARD_ON);
    wait(100);     
}
 
combo RAPID_AKIMBO {     
   set_val(FIRE_BTN,100);
   set_val( ADS_BTN,100);
   wait(hold_time);     
   set_val( ADS_BTN,0);   
   set_val(FIRE_BTN,0);   
   wait(rest_time);     
}
combo EASY_RUN {                 
    set_val(SPRINT_BTN,100);       
    wait(30);                     
    wait(100);                   
} 
 
combo STANDARD_ON {
   set_rumble(RUMBLE_A,100);
   wait(250);
   reset_rumble();
   wait(2000);
}
 
combo STANDARD_OFF {
   set_rumble(RUMBLE_B,100);
// set_val (0,0);
   wait(250);
   reset_rumble();
   wait(2000);
}
 
 
 
combo AntiRecoil {                     
    if(recoil_onoff) {                   
        anti_recoil = get_val(RY) + (ANTI_RECOIL * Invert);
        if(anti_recoil > 100) anti_recoil = 100;
        set_val(10, anti_recoil);               
        anti_recoil_H = get_val(RX) + ANTI_RECOIL_H;
        if(anti_recoil_H > 100) anti_recoil_H = 100;
        set_val(9, anti_recoil_H);                 
    }                                         
}   
// COLOR LED function                                 
 
 
function colourled(Colour) {         
    Col_ind=(Colour*4)- 3;           
    set_led(LED_1,dbyte(Col_ind  ))
    set_led(LED_2,dbyte(Col_ind+ 1));
    set_led(LED_3,dbyte(Col_ind+ 2));
    set_led(LED_4,dbyte(Col_ind+ 3));
}// End
 
function save_pvars(){
set_pvar(SPVAR_2, MIDPOINT);
set_pvar(SPVAR_5, ADS_SENS);
set_pvar(SPVAR_4, ANTI_RECOIL);                         
set_pvar(SPVAR_3, ANTI_RECOIL_H);   
 
}
 
ConsoleTuner Support Team
User avatar
J2Kbr
General of the Army
General of the Army
 
Posts: 20323
Joined: Tue Mar 18, 2014 1:39 pm

Re: Mentally Ill, Need help converting a device script to t2

Postby jkilgren32 » Mon Sep 17, 2018 6:17 pm

THANK YOU SO MUCH! Was there a lot of problems in it, Im curious as to what it was, I tried line by line fixing with the error report but new things kept popping up, and after a few minutes it was all looking scrambled to me. Thank you for your help
User avatar
jkilgren32
Staff Sergeant
Staff Sergeant
 
Posts: 13
Joined: Sun Sep 16, 2018 7:49 pm

Re: Mentally Ill, Need help converting a device script to t2

Postby J2Kbr » Mon Sep 17, 2018 6:40 pm

you are welcome. :)
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 GPC2 Script Programming

Who is online

Users browsing this forum: No registered users and 96 guests