Fortnite Emote-Hotkeys

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

Re: Fortnite Emote-Hotkeys

Postby J2Kbr » Tue Mar 13, 2018 8:04 pm

Silktouch wrote:I use T2 into XIM4 into PS4.

When using the Titan Two plugged on XIM the outputs are restricted to keyboard key presses and mouse movement/buttons. The script above is clearly to be used without XIM, as it makes use at the same time of keyboard/mouse and gamepad.

What you need to to is convert the combos to keyboard and mouse events, something like this:

Code: Select all
combo dance1 {
    key_set(KEY_DOWNARROW, 1);
    wait(40);
    key_set(KEY_DOWNARROW, 0);
    wait(160);
 
    mouse_set(MOUSE_Y, -10);
    wait(80);
 
    mouse_set(MOUSE_Y, -10);
    set_val(KEY_SPACEBAR, 1);
    wait(40);
 
    mouse_set(MOUSE_Y, 0);
    set_val(KEY_SPACEBAR, 0);
}


Please note I have not tested the above combo and it may need some tweak to work.
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: Fortnite Emote-Hotkeys

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

J2Kbr wrote:
Silktouch wrote:I use T2 into XIM4 into PS4.

When using the Titan Two plugged on XIM the outputs are restricted to keyboard key presses and mouse movement/buttons. The script above is clearly to be used without XIM, as it makes use at the same time of keyboard/mouse and gamepad.

What you need to to is convert the combos to keyboard and mouse events, something like this:

Code: Select all
combo dance1 {
    key_set(KEY_DOWNARROW, 1);
    wait(40);
    key_set(KEY_DOWNARROW, 0);
    wait(160);
 
    mouse_set(MOUSE_Y, -10);
    wait(80);
 
    mouse_set(MOUSE_Y, -10);
    set_val(KEY_SPACEBAR, 1);
    wait(40);
 
    mouse_set(MOUSE_Y, 0);
    set_val(KEY_SPACEBAR, 0);
}


Please note I have not tested the above combo and it may need some tweak to work.


Thank you, I think this is the right direction.
When I press Key_1 now, it opens the Emote menu, but after this something strange happens, the Titan2 lights up blue and restart itself. Mouse and KB are disconnected for 2 seconds and then all is ok again. I dont know what this is. The mouse not move at all, because after opening the emote menu the T2 disconnects - or the XIM, but the XIM remains flashing green and dont restart. And in XIM Manager I see only Key Down for Emote menu.
User avatar
Silktouch
Sergeant Major
Sergeant Major
 
Posts: 70
Joined: Sat Mar 03, 2018 2:57 pm

Re: Fortnite Emote-Hotkeys

Postby J2Kbr » Tue Mar 13, 2018 8:34 pm

Please try change the -10 to -1 in both occurrences to check if it works.

mouse_set(MOUSE_Y, -1);
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: Fortnite Emote-Hotkeys

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

J2Kbr wrote:Please try change the -10 to -1 in both occurrences to check if it works.

mouse_set(MOUSE_Y, -1);

Same before, the T2 blinks blue and restarts :shocked:
User avatar
Silktouch
Sergeant Major
Sergeant Major
 
Posts: 70
Joined: Sat Mar 03, 2018 2:57 pm

Re: Fortnite Emote-Hotkeys

Postby J2Kbr » Tue Mar 13, 2018 9:12 pm

Sorry, I made a mistake in the code, used set_val() instead of key_set(), fixed:

Code: Select all
combo dance1 {
    key_set(KEY_DOWNARROW, 1);
    wait(40);
    key_set(KEY_DOWNARROW, 0);
    wait(160);
 
    mouse_set(MOUSE_Y, -10);
    wait(80);
 
    mouse_set(MOUSE_Y, -10);
    key_set(KEY_SPACEBAR, 1);
    wait(40);
 
    mouse_set(MOUSE_Y, 0);
    key_set(KEY_SPACEBAR, 0);
}
ConsoleTuner Support Team
User avatar
J2Kbr
General of the Army
General of the Army
 
Posts: 20323
Joined: Tue Mar 18, 2014 1:39 pm

Re: Fortnite Emote-Hotkeys

Postby Silktouch » Tue Mar 13, 2018 10:07 pm

Thanks a lot. I tweaked it a little and now it is perfect for the first 4 dances. Before my char looked in the sky or on the bottom, now its all centered when dancing and the timings are perfect :smile0517:

Main:
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);
    }


and here are the combos Key_1 is DanceUP, Key_2 is DanceDOWN, Key_3 is RightDown, Key_4 is LeftUP, Key_5 is LeftDown and Key_6 is RightUP:

Code: Select all
combo dance1 {
    key_set(KEY_DOWNARROW, 1);
    wait(100);
    key_set(KEY_DOWNARROW, 0);
    wait(160);
 
    mouse_set(MOUSE_Y, -100);
    wait(120);
 
    key_set(KEY_SPACEBAR, 1);
    wait(200);
 
    key_set(KEY_SPACEBAR, 0);
    mouse_set(MOUSE_Y, 100);
}
 
combo dance2 {
    key_set(KEY_DOWNARROW, 1);
    wait(100);
    key_set(KEY_DOWNARROW, 0);
    wait(120);
 
    mouse_set(MOUSE_Y, 100);
    wait(180);
 
    key_set(KEY_SPACEBAR, 1);
    wait(200);
 
    key_set(KEY_SPACEBAR, 0);
    mouse_set(MOUSE_Y, -100);
}
 
combo dance3 {
    key_set(KEY_DOWNARROW, 1);
    wait(100);
    key_set(KEY_DOWNARROW, 0);
    wait(120);
 
    mouse_set(MOUSE_X, 100);
    mouse_set(MOUSE_Y, 40);
    wait(180);
 
    key_set(KEY_SPACEBAR, 1);
    wait(200);
 
    key_set(KEY_SPACEBAR, 0);
    mouse_set(MOUSE_X, -100);
    mouse_set(MOUSE_Y, -40);
}
 
combo dance4 {
    key_set(KEY_DOWNARROW, 1);
    wait(100);
    key_set(KEY_DOWNARROW, 0);
    wait(120);
 
    mouse_set(MOUSE_X, -100);
    mouse_set(MOUSE_Y, -50);
 
    wait(180);
 
    key_set(KEY_SPACEBAR, 1);
    wait(200);
 
    key_set(KEY_SPACEBAR, 0);
    mouse_set(MOUSE_X, 100);
    mouse_set(MOUSE_Y, 50);
}
 
combo dance5 {
    key_set(KEY_DOWNARROW, 1);
    wait(100);
    key_set(KEY_DOWNARROW, 0);
    wait(120);
 
    mouse_set(MOUSE_X, -100);
    mouse_set(MOUSE_Y, 50);
    wait(180);
 
    key_set(KEY_SPACEBAR, 1);
    wait(200);
 
    key_set(KEY_SPACEBAR, 0);
    mouse_set(MOUSE_X, 100);
    mouse_set(MOUSE_Y, -50);
}
 
combo dance6 {
    key_set(KEY_DOWNARROW, 1);
    wait(100);
    key_set(KEY_DOWNARROW, 0);
    wait(120);
 
    mouse_set(MOUSE_X, 100);
    mouse_set(MOUSE_Y, -40);
    wait(180);
 
    key_set(KEY_SPACEBAR, 1);
    wait(200);
 
    key_set(KEY_SPACEBAR, 0);
    mouse_set(MOUSE_X, -100);
    mouse_set(MOUSE_Y, 40);
}


Cheers
User avatar
Silktouch
Sergeant Major
Sergeant Major
 
Posts: 70
Joined: Sat Mar 03, 2018 2:57 pm

Re: Fortnite Emote-Hotkeys

Postby J2Kbr » Wed Mar 14, 2018 10:23 am

:joia: :joia:
ConsoleTuner Support Team
User avatar
J2Kbr
General of the Army
General of the Army
 
Posts: 20323
Joined: Tue Mar 18, 2014 1:39 pm

Previous

Return to GPC2 Script Programming

Who is online

Users browsing this forum: Google [Bot] and 101 guests