KB + XIM + Titan2 - Fortnite Combos

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

Re: KB + XIM + Titan2 - Fortnite Combos

Postby MAL8010 » Tue Mar 13, 2018 1:54 pm

[redacted] wrote:And the verdict is out; all systems are GO! Cheers m8. We're all set to go! :smile0517: :smile0203: :joia:


:smile0517:
User avatar
MAL8010
Sergeant Major of the Army
Sergeant Major of the Army
 
Posts: 263
Joined: Sun Feb 05, 2017 3:12 pm

Re: KB + XIM + Titan2 - Fortnite Combos

Postby MAL8010 » Tue Mar 13, 2018 5:25 pm

Silktouch wrote:I love this script now even more with the fixed bug, but is there maybe a way to reset everytime after I open my inventary and cancel out of it... It happens so many times that I forget it and the T2 thinks Im in building mode and sure its not building instead it switches to my medipack or so :D I use my Inventory a lot....

With some IF structures it might be possible.

Cheers


Are you using a KB connected directly to the T2? In order for the menu cancellation code to work the T2 has to 'see' the menu buttons being pressed, which it can't do obviously if your KB is connected directly to the XIM and T2 is into XIM.
User avatar
MAL8010
Sergeant Major of the Army
Sergeant Major of the Army
 
Posts: 263
Joined: Sun Feb 05, 2017 3:12 pm

Re: KB + XIM + Titan2 - Fortnite Combos

Postby MAL8010 » Tue Mar 13, 2018 5:26 pm

[redacted] wrote:
MAL8010 wrote:Cool, I thought that was the issue.

Of course if you want to use the G13 button for reset instead of a mouse button, presumably you can just run the G13 through the T2 etc.

It 'should' be easy to get the whole script working now you've got stairs working by itself.


So it's safe to try the latest version of the script at this point? I'm assuming I keep the Input Translator as well, correct?

EDIT: As far as using the G13 header file I posted, you'd have to edit the button layout as you see fit in the array. You also can't use an Input Translator, but you can see there's a section in there for mouse input if you need it (but if you're using an Apex, just passthru I suppose). It was a pain in the butt to get it working the way I wanted it, but it felt good to get it going as I virtually had no help with that. If you'd like, I'd be more than willing to help you set it up once you get it going. I had to comment out parts of your original script for the keyboard mappings as well, but that was easy. I love these C-based languages (been a C coder for quite some time) as it's pretty easy to follow what's happening in the script(s).

EDIT 2: stop making edits to your posts as I don't see them right away! lol just make a new post :P


Got my G13 header file remapped fine, but er how do you use pass through with the G13 so the XIM recognises the keys pressed?

I need the g13 connected to the T2 as the T2 needs to see things like RB/LB/menu buttons pressed in order to execute parts of the script properly etc
User avatar
MAL8010
Sergeant Major of the Army
Sergeant Major of the Army
 
Posts: 263
Joined: Sun Feb 05, 2017 3:12 pm

Re: KB + XIM + Titan2 - Fortnite Combos

Postby Silktouch » Tue Mar 13, 2018 5:57 pm

MAL8010 wrote:
Silktouch wrote:Hey MAL, maybe you can help me, I try to integrate Emote shortcuts, but this code wont work for me, maybe its because I use a XIM and must change something. When I press 1 the XIM Manager only show that I press one and doesnt activate the combo.

Code: Select all
    if(key_status(KEY_1)) {
        combo_run(dance1);
    }
    if(key_status(KEY_2)) {
        combo_run(dance2);
    }
    if(key_status(KEY_3)) {
        combo_run(dance3);
    }
    if(key_status(KEY_4)) {
        combo_run(dance4);
    }   
    if(key_status(KEY_5)) {
        combo_run(dance5);
    }
    if(key_status(KEY_6)) {
        combo_run(dance6);
    }
combo dance1 {
    set_val(BUTTON_11, 100.0);
    wait(40); wait(160);
 
    set_val(STICK_1_Y, -100.0);
    wait(80);
 
    set_val(BUTTON_16, 100.0);
    wait(40);
}
combo dance2 {
    set_val(BUTTON_11, 100.0);
    wait(40); wait(160);
 
    set_val(STICK_1_X, 100.0);
    set_val(STICK_1_Y, -60.0);
 
    wait(80);
 
    set_val(BUTTON_16, 100.0);
    wait(40);
}
combo dance3 {
    set_val(BUTTON_11, 100.0);
    wait(40); wait(160);
 
    set_val(STICK_1_X, 100.0);
    set_val(STICK_1_Y, 47.0);
    wait(80);
 
    set_val(BUTTON_16, 100.0);
    wait(40);
}
combo dance4 {
    set_val(BUTTON_11, 100.0);
    wait(40); wait(160);
 
    set_val(STICK_1_Y, 100.0);
    wait(80);
 
    set_val(BUTTON_16, 100.0);
    wait(40);
}
combo dance5 {
    set_val(BUTTON_11, 100.0);
    wait(40); wait(160);
 
    set_val(STICK_1_Y, 53.0);
    set_val(STICK_1_X, -93.0);
    wait(80);
 
    set_val(BUTTON_16, 100.0);
    wait(40);
}
combo dance6 {
    set_val(BUTTON_11, 100.0);
    wait(40); wait(160);
 
    set_val(STICK_1_Y, -90.0);
    set_val(STICK_1_X, -53.0);
    wait(80);
 
    set_val(BUTTON_16, 100.0);
    wait(40);
}


Send me the exact script you're looking to integrate this into and i'll look at it.


This is my script:
Code: Select all
#pragma METAINFO("<Mark>", 1, 0, "FORTNITE BUILDING ONLY - T2 INTO XIM APEX") 
 
#include <keyboard.gph>
#include <display.gph>
#include "light_k.gph"
#include <mouse.gph>
#define Reset BUTTON_13 //manual reset of tracking (right arrow)
#define Wall (KEY_Y)
#define Floor (KEY_U)
#define Stair (KEY_I)
#define InitailEnd_Wait 20
#define SameButton_Wait 40
#define GenericBetweenButton_Wait 50
#define BeforeFireButton_Wait1 50
#define BeforeFireButton_Wait2 100
#define QUICKSCOPE_TIME         250
 
//mode and tracker
int mode;
int bldvalue;
int NavState;
 
//building hotkeys and tracker
int bldslottrack=1;
bool event_active_b;
bool event_active_n;
bool event_active_f;
 
init {
 
//------------------------------------------------------------------------------
// KEYBOARD BINDINGS
      const uint8 map[] = {
 
        MOUSE_X,            STICK_1_X,
        MOUSE_Y,            STICK_1_Y,
 
      };
 
       const uint8 map2[] = {
 
          KEY_RIGHTARROW,   BUTTON_13,   
          KEY_F,            BUTTON_15,
 
       };
 
    keymapping(map2);
    mousemapping(map);
 
}   
 
main {
 
    mouse_passthru();
    key_passthru();
 
     if(key_status(KEY_1)) {
        combo_run(dance1);
    }
    if(key_status(KEY_2)) {
        combo_run(dance2);
    }
    if(key_status(KEY_3)) {
        combo_run(dance3);
    }
    if(key_status(KEY_4)) {
        combo_run(dance4);
    }   
    if(key_status(KEY_5)) {
        combo_run(dance5);
    }
    if(key_status(KEY_6)) {
        combo_run(dance6);
    }
 
//------------------------------------------------------------------------------
//QUICKSCOPE
 
if(event_release(BUTTON_8) && time_active(BUTTON_8) < 140) {
        combo_run(QuickScope);
    }   
 
//------------------------------------------------------------------------------
//MODE TRACKING
 
    if (mode == 0) {
        set_light('G');
        }
 
    if (mode == 1) {
        set_light('R');
        }
 
    if (mode > 1) {
        mode = 0;}
 
    if ((event_release(BUTTON_15)) && (mode == 0)){
            mode = 1; //building mode
            }
 
    else if (event_release(BUTTON_15) && (mode == 1)) {
            mode = 0; //combat mode
            bldslottrack = 1; //building always resets to slot 1, weapons to last occupied slot
            }
 
//------------------------------------------------------------------------------
//BUILDING AND WEAPON SLOT TRACKING
 
    //Building to axe - has to return to slot 1
    if ((event_release(BUTTON_14)) && (mode == 1)) {
        mode = 0;
        bldslottrack = 1;
        }
 
    if ((event_release(BUTTON_4)) && (mode == 1)) {
        bldslottrack = bldslottrack + 1;
            if (bldslottrack > 4) {
                bldslottrack = 1;
            }
        }
 
    if ((event_release(BUTTON_7)) && (mode == 1)) {
        bldslottrack = bldslottrack - 1;
            if (bldslottrack < 1) {
                bldslottrack = 4;
            }
        }
 
//------------------------------------------------------------------------------
//TRACKER RESETS
 
    //manual tracker reset to weapon mode slot1
    if (event_active(Reset)) {
        mode = 0;
        bldslottrack = 1;
    }
 
    //Since B is cancel as well as enter building mode, need to reset tracker if using to cancel out of xbox menu, inventory, game menu, emotes
    if (event_release (BUTTON_1) || event_release (BUTTON_3) || event_release (BUTTON_10) || event_release (BUTTON_11)) {
        NavState = 1;}
 
    // Pressing B to cancel resets
    if (event_release (BUTTON_15) && NavState) {
        mode = mode + 1;
        NavState = 0;}
 
//------------------------------------------------------------------------------
// KEYCODE
 
    // Output the key code of pressed keys
    output_keycode();   
 
//------------------------------------------------------------------------------
// LOAD-OUTS
 
       if(key_status(Wall)) {
            bldvalue = 1 -  bldslottrack;
            if(!event_active_b) {
                event_active_b = TRUE;
                if (mode == 0){ //weapons or pickaxe to wall
                    combo_run (BuildWall);
                }     else if ((mode == 1) && (bldvalue == 0)) { //already have wall selected
                        combo_run (RT);}
                    else { //moving from building slots 2,3,4 to wall
                        if (bldvalue == -1) {
                            combo_run (QLB1);
                            bldslottrack = 1;}
                        if (bldvalue == -2) {
                            combo_run (QLB2);
                            bldslottrack = 1;}
                        if (bldvalue == -3) {
                            combo_run (QRB1);
                            bldslottrack = 1;}
                    }
                }
        } else event_active_b = FALSE;
 
        if(key_status(Floor))  {
                bldvalue = 2 -  bldslottrack;
                if(!event_active_f) {
                    event_active_f = TRUE;
                    if (mode == 0){
                        combo_run (BuildFloor);
                    }    else if    ((mode == 1) && (bldvalue == 0)) {
                            combo_run (RT);}
                        else {   
                            if (bldvalue == 1) {
                                combo_run (QRB1);
                                bldslottrack = 2;}
                            if (bldvalue == -1) {
                                combo_run (QLB1);
                                bldslottrack = 2;}
                            if (bldvalue == -2) {
                                combo_run (QLB2);
                                bldslottrack = 2;}
                    }
                }
        } else event_active_f = FALSE;   
 
        if(key_status(Stair))    { 
                bldvalue = 3 -  bldslottrack;
                if(!event_active_n) {
                    event_active_n = TRUE;
                    if (mode == 0){
                        combo_run (BuildStair);
                    } else if ((mode == 1) && (bldvalue == 0)) {
                        combo_run (RT);}
                      else {
                          if (bldvalue == 2) {
                              combo_run (QLB2);
                              bldslottrack = 3;}
                          if (bldvalue == 1) {
                              combo_run (QRB1);
                              bldslottrack = 3;}
                          if (bldvalue == -1) {
                              combo_run (QLB1);
                              bldslottrack = 3;}
                    }
                }
        } else event_active_n = FALSE;   
 
//------------------------------------------------------------------------------
//LED                   
        if (mode == 1){           
        switch(bldslottrack) {
                case 0: display_overlay(_0_, 2000); break;
                case 1: display_overlay(_1_, 2000); break;
                case 2: display_overlay(_2_, 2000); break;
                case 3: display_overlay(_3_, 2000); break;
                case 4: display_overlay(_4_, 2000); break;
            }
        }
 
        if (mode == 0) {
            display_overlay(_0_, 2000); }   
 
} // main
 
combo BuildWall {
    wait(InitailEnd_Wait);
    key_set(KEY_F, 1);
    wait(SameButton_Wait);
    key_set(KEY_F, 0);
    wait(BeforeFireButton_Wait1);
    wait(BeforeFireButton_Wait2);
    mouse_set(MBUTTON_1, 1);
    wait(SameButton_Wait);
    mouse_set(MBUTTON_1, 0);
    wait(InitailEnd_Wait);
    bldslottrack = 1;
    mode = 1;
}
 
combo BuildFloor {
    wait(InitailEnd_Wait);
    key_set(KEY_F, 1);
    wait(SameButton_Wait);
    key_set(KEY_F, 0);
    wait(GenericBetweenButton_Wait);
    key_set(KEY_E, 1);
    wait(SameButton_Wait);
    key_set(KEY_E, 0);
    wait(BeforeFireButton_Wait1);
    wait(BeforeFireButton_Wait2);
    mouse_set(MBUTTON_1, 1);
    wait(SameButton_Wait);
    mouse_set(MBUTTON_1, 0);
    wait(InitailEnd_Wait);
    bldslottrack = 2;
    mode = 1;
}
 
combo BuildStair {
    wait(InitailEnd_Wait);
    key_set(KEY_F, 1);
    wait(SameButton_Wait);
    key_set(KEY_F, 0);
    wait(GenericBetweenButton_Wait);
    key_set(KEY_E, 1);
    wait(SameButton_Wait);
    key_set(KEY_E, 0);
    wait(GenericBetweenButton_Wait);
    key_set(KEY_E, 1);
    wait(SameButton_Wait);
    key_set(KEY_E, 0);
    wait(BeforeFireButton_Wait1);
    wait(BeforeFireButton_Wait2);
    mouse_set(MBUTTON_1, 1);
    wait(SameButton_Wait);
    mouse_set(MBUTTON_1, 0);
    wait(InitailEnd_Wait);
    bldslottrack = 3;
    mode = 1;
}
 
combo QLB1 {
    wait(InitailEnd_Wait);
    key_set(KEY_Q, 1);
    wait(SameButton_Wait);
    key_set(KEY_Q, 0);
    wait(BeforeFireButton_Wait1);
    wait(BeforeFireButton_Wait2);
    mouse_set(MBUTTON_1, 1);
    wait(SameButton_Wait);
    mouse_set(MBUTTON_1, 0);
    wait(InitailEnd_Wait);
}
 
combo QLB2 {
    wait(InitailEnd_Wait);
    key_set(KEY_Q, 1);
    wait(SameButton_Wait);
     key_set(KEY_Q, 0);
    wait(GenericBetweenButton_Wait);
    key_set(KEY_Q, 1);
    wait(SameButton_Wait);
     key_set(KEY_Q, 0);
    wait(BeforeFireButton_Wait1);
    wait(BeforeFireButton_Wait2);
    mouse_set(MBUTTON_1, 1);
    wait(SameButton_Wait);
    mouse_set(MBUTTON_1, 0);
    wait(InitailEnd_Wait);
}
 
combo QRB1 {
    wait(InitailEnd_Wait);
    key_set(KEY_E, 1);
    wait(SameButton_Wait);
    key_set(KEY_E, 0);
    wait(BeforeFireButton_Wait1);
    wait(BeforeFireButton_Wait2);
    mouse_set(MBUTTON_1, 1);
    wait(SameButton_Wait);
    mouse_set(MBUTTON_1, 0);
    wait(InitailEnd_Wait);
}   
 
combo RT {
    wait(InitailEnd_Wait);
    mouse_set(MBUTTON_1, 1);
    wait(SameButton_Wait);
    mouse_set(MBUTTON_1, 0);
    wait(InitailEnd_Wait);
}
 
combo QuickScope {
    set_val(BUTTON_5, 0);
    set_val(BUTTON_8, 100);
    wait(100);
 
    set_val(BUTTON_5, 0);
    set_val(BUTTON_8, 100);
    wait(QUICKSCOPE_TIME);
 
    set_val(BUTTON_5, 100);
    set_val(BUTTON_8, 100);
    wait(50);
}
 
combo dance1 {
    set_val(BUTTON_11, 100.0);
    wait(40); wait(160);
 
    set_val(STICK_1_Y, -100.0);
    wait(80);
 
    set_val(BUTTON_16, 100.0);
    wait(40);
}
combo dance2 {
    set_val(BUTTON_11, 100.0);
    wait(40); wait(160);
 
    set_val(STICK_1_X, 100.0);
    set_val(STICK_1_Y, -60.0);
 
    wait(80);
 
    set_val(BUTTON_16, 100.0);
    wait(40);
}
combo dance3 {
    set_val(BUTTON_11, 100.0);
    wait(40); wait(160);
 
    set_val(STICK_1_X, 100.0);
    set_val(STICK_1_Y, 47.0);
    wait(80);
 
    set_val(BUTTON_16, 100.0);
    wait(40);
}
combo dance4 {
    set_val(BUTTON_11, 100.0);
    wait(40); wait(160);
 
    set_val(STICK_1_Y, 100.0);
    wait(80);
 
    set_val(BUTTON_16, 100.0);
    wait(40);
}
combo dance5 {
    set_val(BUTTON_11, 100.0);
    wait(40); wait(160);
 
    set_val(STICK_1_Y, 53.0);
    set_val(STICK_1_X, -93.0);
    wait(80);
 
    set_val(BUTTON_16, 100.0);
    wait(40);
}
combo dance6 {
    set_val(BUTTON_11, 100.0);
    wait(40); wait(160);
 
    set_val(STICK_1_Y, -90.0);
    set_val(STICK_1_X, -53.0);
    wait(80);
 
    set_val(BUTTON_16, 100.0);
    wait(40);
}
 
//------------------------------------------------------------------------------
// KEYBOARD SUPPORT
// view pressed key
void output_keycode() {
    static uint8 previous_keycode;
    uint8 keycode;
 
    keycode = key_check();
    if(keycode != previous_keycode) {
        if(keycode) {
            printf("Key Code: %02X", keycode);
        }
        previous_keycode = keycode;
    }
    return;
}
 
 


All works well, only the Emotes dont work. The emote code is at the main start and the combos at the end.
And as answert to your other question, my mouse and keyboard are both connected to T2 and then T2 to XIM4 and XIM4 to PS4 Pro. :smile0517:
User avatar
Silktouch
Sergeant Major
Sergeant Major
 
Posts: 70
Joined: Sat Mar 03, 2018 2:57 pm

Re: KB + XIM + Titan2 - Fortnite Combos

Postby Shthappensbro » Tue Mar 13, 2018 6:35 pm

So what script. I use for fast build ???
User avatar
Shthappensbro
Major
Major
 
Posts: 754
Joined: Wed Aug 16, 2017 4:55 pm

Re: KB + XIM + Titan2 - Fortnite Combos

Postby [redacted] » Tue Mar 13, 2018 6:59 pm

MAL8010 wrote:
[redacted] wrote:
MAL8010 wrote:Cool, I thought that was the issue.

Of course if you want to use the G13 button for reset instead of a mouse button, presumably you can just run the G13 through the T2 etc.

It 'should' be easy to get the whole script working now you've got stairs working by itself.


So it's safe to try the latest version of the script at this point? I'm assuming I keep the Input Translator as well, correct?

EDIT: As far as using the G13 header file I posted, you'd have to edit the button layout as you see fit in the array. You also can't use an Input Translator, but you can see there's a section in there for mouse input if you need it (but if you're using an Apex, just passthru I suppose). It was a pain in the butt to get it working the way I wanted it, but it felt good to get it going as I virtually had no help with that. If you'd like, I'd be more than willing to help you set it up once you get it going. I had to comment out parts of your original script for the keyboard mappings as well, but that was easy. I love these C-based languages (been a C coder for quite some time) as it's pretty easy to follow what's happening in the script(s).

EDIT 2: stop making edits to your posts as I don't see them right away! lol just make a new post :P


Got my G13 header file remapped fine, but er how do you use pass through with the G13 so the XIM recognises the keys pressed?

I need the g13 connected to the T2 as the T2 needs to see things like RB/LB/menu buttons pressed in order to execute parts of the script properly etc


In all honesty, I haven't messed with the G13 passthru to the XIM yet. Is it not the same as before? I'll have a closer look when I get home
User avatar
[redacted]
Master Sergeant
Master Sergeant
 
Posts: 32
Joined: Sat Feb 24, 2018 1:23 am

Re: KB + XIM + Titan2 - Fortnite Combos

Postby newbophobia » Tue Mar 13, 2018 7:46 pm

awesome script mal, only problem im having is i cant get my keyboard to work when i connect it to port 2 on my titan 2. it works perfectly when the keyboard is connected to the apex but i need it connect to the titan as my mouse doesnt have as many buttons as yours which makes executing this script very inconvenient
newbophobia
Sergeant
Sergeant
 
Posts: 6
Joined: Mon Feb 26, 2018 12:58 am

Re: KB + XIM + Titan2 - Fortnite Combos

Postby Silktouch » Tue Mar 13, 2018 8:47 pm

MAL8010 wrote:
MAL8010 wrote:
Silktouch wrote:I love this script now even more with the fixed bug, but is there maybe a way to reset everytime after I open my inventary and cancel out of it... It happens so many times that I forget it and the T2 thinks Im in building mode and sure its not building instead it switches to my medipack or so :D I use my Inventory a lot....

With some IF structures it might be possible.

Cheers


The build button being the cancel out of menus is annoying in this regard. I'll take a look at all the menu options and the ways you can cancel out of them later.


The lower part of this code is what should be handling the cancel out of menu's BTW. I'll have to re-check in game later

Code: Select all
//------------------------------------------------------------------------------
//TRACKER RESETS
 
    //manual tracker reset to weapon mode slot1
    if (event_active(Reset)) {
        mode = 0;
        bldslottrack = 1;
    }
 
    //Since B is cancel as well as enter building mode, need to reset tracker if using to cancel out of xbox menu, inventory, game menu, emotes
    if (event_release (BUTTON_1) || event_release (BUTTON_3) || event_release (BUTTON_10) || event_release (BUTTON_11)) {
        NavState = 1;}
 
    // Pressing B to cancel resets
    if (event_release (BUTTON_15) && NavState) {
        mode = mode + 1;
        NavState = 0;}


Maybe something like: // if key_inventory is pressed listen 15 seconds and then when button_building is pressed - Reset. Sounds all little bit hard, but I think there is a way. The code you posted up there is in my script allready, but the biggest problem is not resetting after inventory which I use per game like 55 times :innocent_smile_1:

I will learn more from your code and maybe I can help other people out whos using your script. But I never coded before :shocked:
User avatar
Silktouch
Sergeant Major
Sergeant Major
 
Posts: 70
Joined: Sat Mar 03, 2018 2:57 pm

Re: KB + XIM + Titan2 - Fortnite Combos

Postby Shthappensbro » Tue Mar 13, 2018 9:08 pm

MAL8010 wrote:
[redacted] wrote:And the verdict is out; all systems are GO! Cheers m8. We're all set to go! :smile0517: :smile0203: :joia:


:smile0517:

so what script i use thats up to date and working for fast build ??? on xim4 i got ??
User avatar
Shthappensbro
Major
Major
 
Posts: 754
Joined: Wed Aug 16, 2017 4:55 pm

Re: KB + XIM + Titan2 - Fortnite Combos

Postby MAL8010 » Tue Mar 13, 2018 9:59 pm

Silktouch wrote:
MAL8010 wrote:
Silktouch wrote:Hey MAL, maybe you can help me, I try to integrate Emote shortcuts, but this code wont work for me, maybe its because I use a XIM and must change something. When I press 1 the XIM Manager only show that I press one and doesnt activate the combo.

Code: Select all
    if(key_status(KEY_1)) {
        combo_run(dance1);
    }
    if(key_status(KEY_2)) {
        combo_run(dance2);
    }
    if(key_status(KEY_3)) {
        combo_run(dance3);
    }
    if(key_status(KEY_4)) {
        combo_run(dance4);
    }   
    if(key_status(KEY_5)) {
        combo_run(dance5);
    }
    if(key_status(KEY_6)) {
        combo_run(dance6);
    }
combo dance1 {
    set_val(BUTTON_11, 100.0);
    wait(40); wait(160);
 
    set_val(STICK_1_Y, -100.0);
    wait(80);
 
    set_val(BUTTON_16, 100.0);
    wait(40);
}
combo dance2 {
    set_val(BUTTON_11, 100.0);
    wait(40); wait(160);
 
    set_val(STICK_1_X, 100.0);
    set_val(STICK_1_Y, -60.0);
 
    wait(80);
 
    set_val(BUTTON_16, 100.0);
    wait(40);
}
combo dance3 {
    set_val(BUTTON_11, 100.0);
    wait(40); wait(160);
 
    set_val(STICK_1_X, 100.0);
    set_val(STICK_1_Y, 47.0);
    wait(80);
 
    set_val(BUTTON_16, 100.0);
    wait(40);
}
combo dance4 {
    set_val(BUTTON_11, 100.0);
    wait(40); wait(160);
 
    set_val(STICK_1_Y, 100.0);
    wait(80);
 
    set_val(BUTTON_16, 100.0);
    wait(40);
}
combo dance5 {
    set_val(BUTTON_11, 100.0);
    wait(40); wait(160);
 
    set_val(STICK_1_Y, 53.0);
    set_val(STICK_1_X, -93.0);
    wait(80);
 
    set_val(BUTTON_16, 100.0);
    wait(40);
}
combo dance6 {
    set_val(BUTTON_11, 100.0);
    wait(40); wait(160);
 
    set_val(STICK_1_Y, -90.0);
    set_val(STICK_1_X, -53.0);
    wait(80);
 
    set_val(BUTTON_16, 100.0);
    wait(40);
}


Send me the exact script you're looking to integrate this into and i'll look at it.


This is my script:
Code: Select all
#pragma METAINFO("<Mark>", 1, 0, "FORTNITE BUILDING ONLY - T2 INTO XIM APEX") 
 
#include <keyboard.gph>
#include <display.gph>
#include "light_k.gph"
#include <mouse.gph>
#define Reset BUTTON_13 //manual reset of tracking (right arrow)
#define Wall (KEY_Y)
#define Floor (KEY_U)
#define Stair (KEY_I)
#define InitailEnd_Wait 20
#define SameButton_Wait 40
#define GenericBetweenButton_Wait 50
#define BeforeFireButton_Wait1 50
#define BeforeFireButton_Wait2 100
#define QUICKSCOPE_TIME         250
 
//mode and tracker
int mode;
int bldvalue;
int NavState;
 
//building hotkeys and tracker
int bldslottrack=1;
bool event_active_b;
bool event_active_n;
bool event_active_f;
 
init {
 
//------------------------------------------------------------------------------
// KEYBOARD BINDINGS
      const uint8 map[] = {
 
        MOUSE_X,            STICK_1_X,
        MOUSE_Y,            STICK_1_Y,
 
      };
 
       const uint8 map2[] = {
 
          KEY_RIGHTARROW,   BUTTON_13,   
          KEY_F,            BUTTON_15,
 
       };
 
    keymapping(map2);
    mousemapping(map);
 
}   
 
main {
 
    mouse_passthru();
    key_passthru();
 
     if(key_status(KEY_1)) {
        combo_run(dance1);
    }
    if(key_status(KEY_2)) {
        combo_run(dance2);
    }
    if(key_status(KEY_3)) {
        combo_run(dance3);
    }
    if(key_status(KEY_4)) {
        combo_run(dance4);
    }   
    if(key_status(KEY_5)) {
        combo_run(dance5);
    }
    if(key_status(KEY_6)) {
        combo_run(dance6);
    }
 
//------------------------------------------------------------------------------
//QUICKSCOPE
 
if(event_release(BUTTON_8) && time_active(BUTTON_8) < 140) {
        combo_run(QuickScope);
    }   
 
//------------------------------------------------------------------------------
//MODE TRACKING
 
    if (mode == 0) {
        set_light('G');
        }
 
    if (mode == 1) {
        set_light('R');
        }
 
    if (mode > 1) {
        mode = 0;}
 
    if ((event_release(BUTTON_15)) && (mode == 0)){
            mode = 1; //building mode
            }
 
    else if (event_release(BUTTON_15) && (mode == 1)) {
            mode = 0; //combat mode
            bldslottrack = 1; //building always resets to slot 1, weapons to last occupied slot
            }
 
//------------------------------------------------------------------------------
//BUILDING AND WEAPON SLOT TRACKING
 
    //Building to axe - has to return to slot 1
    if ((event_release(BUTTON_14)) && (mode == 1)) {
        mode = 0;
        bldslottrack = 1;
        }
 
    if ((event_release(BUTTON_4)) && (mode == 1)) {
        bldslottrack = bldslottrack + 1;
            if (bldslottrack > 4) {
                bldslottrack = 1;
            }
        }
 
    if ((event_release(BUTTON_7)) && (mode == 1)) {
        bldslottrack = bldslottrack - 1;
            if (bldslottrack < 1) {
                bldslottrack = 4;
            }
        }
 
//------------------------------------------------------------------------------
//TRACKER RESETS
 
    //manual tracker reset to weapon mode slot1
    if (event_active(Reset)) {
        mode = 0;
        bldslottrack = 1;
    }
 
    //Since B is cancel as well as enter building mode, need to reset tracker if using to cancel out of xbox menu, inventory, game menu, emotes
    if (event_release (BUTTON_1) || event_release (BUTTON_3) || event_release (BUTTON_10) || event_release (BUTTON_11)) {
        NavState = 1;}
 
    // Pressing B to cancel resets
    if (event_release (BUTTON_15) && NavState) {
        mode = mode + 1;
        NavState = 0;}
 
//------------------------------------------------------------------------------
// KEYCODE
 
    // Output the key code of pressed keys
    output_keycode();   
 
//------------------------------------------------------------------------------
// LOAD-OUTS
 
       if(key_status(Wall)) {
            bldvalue = 1 -  bldslottrack;
            if(!event_active_b) {
                event_active_b = TRUE;
                if (mode == 0){ //weapons or pickaxe to wall
                    combo_run (BuildWall);
                }     else if ((mode == 1) && (bldvalue == 0)) { //already have wall selected
                        combo_run (RT);}
                    else { //moving from building slots 2,3,4 to wall
                        if (bldvalue == -1) {
                            combo_run (QLB1);
                            bldslottrack = 1;}
                        if (bldvalue == -2) {
                            combo_run (QLB2);
                            bldslottrack = 1;}
                        if (bldvalue == -3) {
                            combo_run (QRB1);
                            bldslottrack = 1;}
                    }
                }
        } else event_active_b = FALSE;
 
        if(key_status(Floor))  {
                bldvalue = 2 -  bldslottrack;
                if(!event_active_f) {
                    event_active_f = TRUE;
                    if (mode == 0){
                        combo_run (BuildFloor);
                    }    else if    ((mode == 1) && (bldvalue == 0)) {
                            combo_run (RT);}
                        else {   
                            if (bldvalue == 1) {
                                combo_run (QRB1);
                                bldslottrack = 2;}
                            if (bldvalue == -1) {
                                combo_run (QLB1);
                                bldslottrack = 2;}
                            if (bldvalue == -2) {
                                combo_run (QLB2);
                                bldslottrack = 2;}
                    }
                }
        } else event_active_f = FALSE;   
 
        if(key_status(Stair))    { 
                bldvalue = 3 -  bldslottrack;
                if(!event_active_n) {
                    event_active_n = TRUE;
                    if (mode == 0){
                        combo_run (BuildStair);
                    } else if ((mode == 1) && (bldvalue == 0)) {
                        combo_run (RT);}
                      else {
                          if (bldvalue == 2) {
                              combo_run (QLB2);
                              bldslottrack = 3;}
                          if (bldvalue == 1) {
                              combo_run (QRB1);
                              bldslottrack = 3;}
                          if (bldvalue == -1) {
                              combo_run (QLB1);
                              bldslottrack = 3;}
                    }
                }
        } else event_active_n = FALSE;   
 
//------------------------------------------------------------------------------
//LED                   
        if (mode == 1){           
        switch(bldslottrack) {
                case 0: display_overlay(_0_, 2000); break;
                case 1: display_overlay(_1_, 2000); break;
                case 2: display_overlay(_2_, 2000); break;
                case 3: display_overlay(_3_, 2000); break;
                case 4: display_overlay(_4_, 2000); break;
            }
        }
 
        if (mode == 0) {
            display_overlay(_0_, 2000); }   
 
} // main
 
combo BuildWall {
    wait(InitailEnd_Wait);
    key_set(KEY_F, 1);
    wait(SameButton_Wait);
    key_set(KEY_F, 0);
    wait(BeforeFireButton_Wait1);
    wait(BeforeFireButton_Wait2);
    mouse_set(MBUTTON_1, 1);
    wait(SameButton_Wait);
    mouse_set(MBUTTON_1, 0);
    wait(InitailEnd_Wait);
    bldslottrack = 1;
    mode = 1;
}
 
combo BuildFloor {
    wait(InitailEnd_Wait);
    key_set(KEY_F, 1);
    wait(SameButton_Wait);
    key_set(KEY_F, 0);
    wait(GenericBetweenButton_Wait);
    key_set(KEY_E, 1);
    wait(SameButton_Wait);
    key_set(KEY_E, 0);
    wait(BeforeFireButton_Wait1);
    wait(BeforeFireButton_Wait2);
    mouse_set(MBUTTON_1, 1);
    wait(SameButton_Wait);
    mouse_set(MBUTTON_1, 0);
    wait(InitailEnd_Wait);
    bldslottrack = 2;
    mode = 1;
}
 
combo BuildStair {
    wait(InitailEnd_Wait);
    key_set(KEY_F, 1);
    wait(SameButton_Wait);
    key_set(KEY_F, 0);
    wait(GenericBetweenButton_Wait);
    key_set(KEY_E, 1);
    wait(SameButton_Wait);
    key_set(KEY_E, 0);
    wait(GenericBetweenButton_Wait);
    key_set(KEY_E, 1);
    wait(SameButton_Wait);
    key_set(KEY_E, 0);
    wait(BeforeFireButton_Wait1);
    wait(BeforeFireButton_Wait2);
    mouse_set(MBUTTON_1, 1);
    wait(SameButton_Wait);
    mouse_set(MBUTTON_1, 0);
    wait(InitailEnd_Wait);
    bldslottrack = 3;
    mode = 1;
}
 
combo QLB1 {
    wait(InitailEnd_Wait);
    key_set(KEY_Q, 1);
    wait(SameButton_Wait);
    key_set(KEY_Q, 0);
    wait(BeforeFireButton_Wait1);
    wait(BeforeFireButton_Wait2);
    mouse_set(MBUTTON_1, 1);
    wait(SameButton_Wait);
    mouse_set(MBUTTON_1, 0);
    wait(InitailEnd_Wait);
}
 
combo QLB2 {
    wait(InitailEnd_Wait);
    key_set(KEY_Q, 1);
    wait(SameButton_Wait);
     key_set(KEY_Q, 0);
    wait(GenericBetweenButton_Wait);
    key_set(KEY_Q, 1);
    wait(SameButton_Wait);
     key_set(KEY_Q, 0);
    wait(BeforeFireButton_Wait1);
    wait(BeforeFireButton_Wait2);
    mouse_set(MBUTTON_1, 1);
    wait(SameButton_Wait);
    mouse_set(MBUTTON_1, 0);
    wait(InitailEnd_Wait);
}
 
combo QRB1 {
    wait(InitailEnd_Wait);
    key_set(KEY_E, 1);
    wait(SameButton_Wait);
    key_set(KEY_E, 0);
    wait(BeforeFireButton_Wait1);
    wait(BeforeFireButton_Wait2);
    mouse_set(MBUTTON_1, 1);
    wait(SameButton_Wait);
    mouse_set(MBUTTON_1, 0);
    wait(InitailEnd_Wait);
}   
 
combo RT {
    wait(InitailEnd_Wait);
    mouse_set(MBUTTON_1, 1);
    wait(SameButton_Wait);
    mouse_set(MBUTTON_1, 0);
    wait(InitailEnd_Wait);
}
 
combo QuickScope {
    set_val(BUTTON_5, 0);
    set_val(BUTTON_8, 100);
    wait(100);
 
    set_val(BUTTON_5, 0);
    set_val(BUTTON_8, 100);
    wait(QUICKSCOPE_TIME);
 
    set_val(BUTTON_5, 100);
    set_val(BUTTON_8, 100);
    wait(50);
}
 
combo dance1 {
    set_val(BUTTON_11, 100.0);
    wait(40); wait(160);
 
    set_val(STICK_1_Y, -100.0);
    wait(80);
 
    set_val(BUTTON_16, 100.0);
    wait(40);
}
combo dance2 {
    set_val(BUTTON_11, 100.0);
    wait(40); wait(160);
 
    set_val(STICK_1_X, 100.0);
    set_val(STICK_1_Y, -60.0);
 
    wait(80);
 
    set_val(BUTTON_16, 100.0);
    wait(40);
}
combo dance3 {
    set_val(BUTTON_11, 100.0);
    wait(40); wait(160);
 
    set_val(STICK_1_X, 100.0);
    set_val(STICK_1_Y, 47.0);
    wait(80);
 
    set_val(BUTTON_16, 100.0);
    wait(40);
}
combo dance4 {
    set_val(BUTTON_11, 100.0);
    wait(40); wait(160);
 
    set_val(STICK_1_Y, 100.0);
    wait(80);
 
    set_val(BUTTON_16, 100.0);
    wait(40);
}
combo dance5 {
    set_val(BUTTON_11, 100.0);
    wait(40); wait(160);
 
    set_val(STICK_1_Y, 53.0);
    set_val(STICK_1_X, -93.0);
    wait(80);
 
    set_val(BUTTON_16, 100.0);
    wait(40);
}
combo dance6 {
    set_val(BUTTON_11, 100.0);
    wait(40); wait(160);
 
    set_val(STICK_1_Y, -90.0);
    set_val(STICK_1_X, -53.0);
    wait(80);
 
    set_val(BUTTON_16, 100.0);
    wait(40);
}
 
//------------------------------------------------------------------------------
// KEYBOARD SUPPORT
// view pressed key
void output_keycode() {
    static uint8 previous_keycode;
    uint8 keycode;
 
    keycode = key_check();
    if(keycode != previous_keycode) {
        if(keycode) {
            printf("Key Code: %02X", keycode);
        }
        previous_keycode = keycode;
    }
    return;
}
 
 


All works well, only the Emotes dont work. The emote code is at the main start and the combos at the end.
And as answert to your other question, my mouse and keyboard are both connected to T2 and then T2 to XIM4 and XIM4 to PS4 Pro. :smile0517:


Think J2 has posted corrected code on the other thread so it should work if you incorporate it in.
User avatar
MAL8010
Sergeant Major of the Army
Sergeant Major of the Army
 
Posts: 263
Joined: Sun Feb 05, 2017 3:12 pm

PreviousNext

Return to GPC2 Script Programming

Who is online

Users browsing this forum: No registered users and 90 guests