Two buttons for one action

Gtuner Pro general support. Operation, questions, updates, feature request.

Two buttons for one action

Postby FleeX-85 » Thu Apr 20, 2017 10:06 pm

Hallo!
I need a simple script for a button combination. I want to press L1 + right analog stick down at the same time. The action for this should be pressing the triangle button. Thanks
User avatar
FleeX-85
Private
Private
 
Posts: 1
Joined: Thu Apr 20, 2017 9:47 pm

Re: Two buttons for one action

Postby The_Rabid_Taco » Fri Apr 21, 2017 12:55 pm

Give this a try and see if it does what you want. If not let us know so we can adjust it for you. :innocent_smile_1:

Code: Select all
main {
 
    if(get_val(PS4_L1) && get_val(PS4_R3)) {
        set_val(PS4_TRIANGLE, 100);
        set_val(PS4_L1, 0);
        set_val(PS4_R3, 0);'
    }
 
}
User avatar
The_Rabid_Taco
Major
Major
 
Posts: 1066
Joined: Wed Mar 16, 2016 6:04 pm
Location: Pensacola, FL

Re: Two buttons for one action

Postby glacius » Thu May 04, 2017 2:12 am

Hi Taco I tried this out myself. Didn't work for some reason. All I did was change the trigger buttons to suit what I wanted. My combo was R1 to L1 and the button to combo that was R1 to begin with.

Do you need to create a toggle on/off button to make the script work? Like L2 + Up on d-pad?
User avatar
glacius
Sergeant First Class
Sergeant First Class
 
Posts: 18
Joined: Fri Apr 21, 2017 4:00 pm

Re: Two buttons for one action

Postby The_Rabid_Taco » Thu May 04, 2017 1:47 pm

You shouldn't need a toggle, but what is the exact sequence you are trying to accomplish? Did you want the script to do L1 + Right Analog Down when you press triangle or did you want to press L1 + Right Analog down and have that cause the script to press triangle? I guess if I know the exact combination you are trying to press and then the expected outcome by the script I can try to get it done a little better for you. I also have a much harder time explaining without visual aid, ie a script. Personal downfall I'm afraid. Well, let me have it and I'll see what I can do for you.
User avatar
The_Rabid_Taco
Major
Major
 
Posts: 1066
Joined: Wed Mar 16, 2016 6:04 pm
Location: Pensacola, FL

Re: Two buttons for one action

Postby glacius » Fri May 05, 2017 6:40 am

So I'd like to press R1 followed by L1 in order of execution.
So the maco button for this combo would be circle.
So everytime I press circle button on PS4 it will do the following action: R1 then L1.
Hope that helps Taco.
User avatar
glacius
Sergeant First Class
Sergeant First Class
 
Posts: 18
Joined: Fri Apr 21, 2017 4:00 pm

Re: Two buttons for one action

Postby The_Rabid_Taco » Fri May 05, 2017 6:57 am

Ok, that makes sense and shouldn't be too hard to do. I'll take a look at it tomorrow as it's almost 2 AM here and I have to have my daughter in the hospital in just a few hours for surgery. That being said, I will have plenty of time in the waiting room. I'll take a look and see if I can't get this together for you then. Any ideas on how long each one needs held? R1 then L1, will they overlap at all? Just a few things that will help out along the way.
User avatar
The_Rabid_Taco
Major
Major
 
Posts: 1066
Joined: Wed Mar 16, 2016 6:04 pm
Location: Pensacola, FL

Re: Two buttons for one action

Postby glacius » Fri May 05, 2017 1:30 pm

Thanks Taco no rush buddy take your time. The R1 button will be pressed down fully and released and then the L1 button will be pressed immediately after so i'd say within a sec at least between both buttons. Hope that helps you and thanks for doing this for me.
User avatar
glacius
Sergeant First Class
Sergeant First Class
 
Posts: 18
Joined: Fri Apr 21, 2017 4:00 pm

Re: Two buttons for one action

Postby glacius » Fri May 05, 2017 1:33 pm

Sorry R1 to L2 that is
User avatar
glacius
Sergeant First Class
Sergeant First Class
 
Posts: 18
Joined: Fri Apr 21, 2017 4:00 pm

Re: Two buttons for one action

Postby J2Kbr » Fri May 05, 2017 4:13 pm

glacius wrote:So everytime I press circle button on PS4 it will do the following action: R1 then L1.

glacius wrote:Sorry R1 to L2 that is

Please check if this script does what you need:
Code: Select all
main {
    if(event_press(PS4_CIRCLE)) {
        combo_run(R1thenL1);
    }
    block(PS4_CIRCLE, 250);
}
 
combo R1thenL1 {
    set_val(PS4_R1, 100);
    wait(50);
    wait(100);
    set_val(PS4_L2, 100);
    wait(50);
}
 
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: Two buttons for one action

Postby glacius » Sat May 06, 2017 8:19 am

J2Kbr wrote:
glacius wrote:So everytime I press circle button on PS4 it will do the following action: R1 then L1.

glacius wrote:Sorry R1 to L2 that is

Please check if this script does what you need:
Code: Select all
main {
    if(event_press(PS4_CIRCLE)) {
        combo_run(R1thenL1);
    }
    block(PS4_CIRCLE, 250);
}
 
combo R1thenL1 {
    set_val(PS4_R1, 100);
    wait(50);
    wait(100);
    set_val(PS4_L2, 100);
    wait(50);
}
 


Hi J2Kbr thanks for the help with the script! I may of confused you with the button combination but it's R1 then L2.
Rather than R1 to L1. I did change that in the script but the outcome is as follows.

When I press Circle button it performs the action of R1 but it doesn't immediately follow it up with the L2 button.
However if I do press Circle twice it will perform the R1 then L2 sequence.
Perhaps this is a timing issue between the 2 buttons? I'm not sure...
User avatar
glacius
Sergeant First Class
Sergeant First Class
 
Posts: 18
Joined: Fri Apr 21, 2017 4:00 pm

Next

Return to Gtuner Pro Support

Who is online

Users browsing this forum: No registered users and 42 guests