Program 2 Buttons To 1

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

Program 2 Buttons To 1

Postby Ruthless » Sun Jun 07, 2020 10:03 am

Hello. I need help programming these scripts:
Map square and triangle to L2
Map cross and circle to R2

Also being able to press and release L2 and R2 multiple times.

I think the script was in ms for the release of the buttons.
I forgot how to do this.

Thank you.
User avatar
Ruthless
Sergeant
Sergeant
 
Posts: 6
Joined: Mon Sep 18, 2017 5:51 am

Re: Program 2 Buttons To 1

Postby J2Kbr » Mon Jun 08, 2020 1:50 pm

Please check if this is what you need. :smile0517:
Code: Select all
main {
    // Map square and triangle to L2
    if(get_val(PS4_SQUARE) && get_val(PS4_TRIANGLE)) {
        set_val(PS4_SQUARE, 0);
        set_val(PS4_TRIANGLE, 0);
        set_val(PS4_L2, 100);
    }
 
    // Map cross and circle to R2
    if(get_val(PS4_CROSS) && get_val(PS4_CIRCLE)) {
        set_val(PS4_CROSS, 0);
        set_val(PS4_CIRCLE, 0);
        set_val(PS4_R2, 100);
    }
}
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: Program 2 Buttons To 1

Postby Ruthless » Mon Jun 08, 2020 4:59 pm

main {
// Map square and triangle to L2
if(get_val(PS4_SQUARE) && get_val(PS4_TRIANGLE)) {
set_val(PS4_SQUARE, 0);
set_val(PS4_TRIANGLE, 0);
set_val(PS4_L2, 100);
}

// Map cross and circle to R2
if(get_val(PS4_CROSS) && get_val(PS4_CIRCLE)) {
set_val(PS4_CROSS, 0);
set_val(PS4_CIRCLE, 0);
set_val(PS4_R2, 100);
}
}


Unfortunately, this script isn't working. The device manager isn't showing the inputs of mapping the 2 buttons into 1. do you possibly have another script, I can use? Thanks for your reply.
User avatar
Ruthless
Sergeant
Sergeant
 
Posts: 6
Joined: Mon Sep 18, 2017 5:51 am

Re: Program 2 Buttons To 1

Postby Mad » Tue Jun 09, 2020 6:07 am

this is what I got out of OP's request:
Code: Select all
main {
    if(get_val(PS4_L2)) {
        set_val(PS4_SQUARE, 100);
        set_val(PS4_TRIANGLE, 100);
        combo_run(L2);
    }
 
    if(get_val(PS4_R2)) {
        set_val(PS4_CROSS, 100);
        set_val(PS4_CIRCLE, 100);
        combo_run(R2);
    }
}
 
combo L2 {
    set_val(PS4_L2, 100);
    wait(60);
    set_val(PS4_L2, 0);
    wait(60);
}
 
combo R2 {
    set_val(PS4_R2, 100);
    wait(60);
    set_val(PS4_R2, 0);
    wait(60);
}
ConsoleTuner Support Team || ConsoleTuner Discord || InputSense Discord
Mad
Major General
Major General
 
Posts: 4536
Joined: Wed May 22, 2019 5:39 am

Re: Program 2 Buttons To 1

Postby DontAtMe » Tue Jun 09, 2020 8:38 am

You have asked a similar question a few years ago. Another script was provided for you, please take a look.
viewtopic.php?f=6&t=6957&p=51675#p51704
User avatar
DontAtMe
Captain
Captain
 
Posts: 502
Joined: Tue Oct 02, 2018 4:49 am

Re: Program 2 Buttons To 1

Postby Ruthless » Tue Jun 09, 2020 1:05 pm

Thanks

The script work, as far as button mapping goes, but I need a script for L2 and R2 to be pressed and released quickly. I'm trying to explain this the best way I can.

In the device manager, it shows an indicator, letting you see the buttons you press and how long you've held them.

i need a script that allows me to hold L2 and R2, but the device manager only registers me pressing the button once, while still physically holding the button

I hope this explanation clears up any confusion.
User avatar
Ruthless
Sergeant
Sergeant
 
Posts: 6
Joined: Mon Sep 18, 2017 5:51 am


Return to GPC1 Script Programming

Who is online

Users browsing this forum: No registered users and 52 guests

cron