Script troubles doing a sequence n holding multiple buttons?

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

Script troubles doing a sequence n holding multiple buttons?

Postby kenshyn » Sat Apr 13, 2019 6:17 pm

So can someone clear up what wait actually does? Does it just wait for x ms or does it change a state of a key press set value?

I was under the impression for a key sequence I would have to do the following:
button press x
wait
button release x
wait
button press y

And for multiple buttons

button press x
button press y
wait
button release x
button release y

But that wasn't making the code happy at all. Any samples of a working button mash release sequence and multiple buttons press code would be helpful.

Thanks
User avatar
kenshyn
Sergeant First Class
Sergeant First Class
 
Posts: 22
Joined: Tue Jun 20, 2017 11:03 pm

Re: Script troubles doing a sequence n holding multiple butt

Postby bonefisher » Sat Apr 13, 2019 6:22 pm

First wait under the press of button is the length in milliseconds that is held for and if a second wait is after that first it is a released state of the press!
bonefisher
Lieutenant General
Lieutenant General
 
Posts: 5368
Joined: Thu Jan 29, 2015 10:49 am

Re: Script troubles doing a sequence n holding multiple butt

Postby bonefisher » Sat Apr 13, 2019 6:28 pm

Now you can press a button then wait then press another button then wait which the first button press only runs the length of wait and right away the next button is pressed to that wait length! So it will be one press after the other!
bonefisher
Lieutenant General
Lieutenant General
 
Posts: 5368
Joined: Thu Jan 29, 2015 10:49 am

Re: Script troubles doing a sequence n holding multiple butt

Postby bonefisher » Sat Apr 13, 2019 6:37 pm

Code: Select all
 
main
{
    if(get_actual(BUTTON_8))combo_run(button_press);
}
combo button_press
{
    set_val(BUTTON_17, 100.0);
    wait(100);wait(100);
    set_val(BUTTON_17, 100.0);
    wait(100);wait(100);
    set_val(BUTTON_14, 100.0);
    wait(100);wait(100);
    set_val(BUTTON_17, 100.0);
    set_val(BUTTON_14, 100.0);
    wait(100);wait(100);
    set_val(BUTTON_17, 100.0);
    set_val(BUTTON_14, 100.0);
    wait(100);wait(100);
}
 
bonefisher
Lieutenant General
Lieutenant General
 
Posts: 5368
Joined: Thu Jan 29, 2015 10:49 am

Re: Script troubles doing a sequence n holding multiple butt

Postby kenshyn » Sun Apr 14, 2019 2:03 am

bonefisher wrote:
Code: Select all
 
main
{
    if(get_actual(BUTTON_8))combo_run(button_press);
}
combo button_press
{
    set_val(BUTTON_17, 100.0);
    wait(100);wait(100);
    set_val(BUTTON_17, 100.0);
    wait(100);wait(100);
    set_val(BUTTON_14, 100.0);
    wait(100);wait(100);
    set_val(BUTTON_17, 100.0);
    set_val(BUTTON_14, 100.0);
    wait(100);wait(100);
    set_val(BUTTON_17, 100.0);
    set_val(BUTTON_14, 100.0);
    wait(100);wait(100);
}
 


Thanks that all I needed appreciate the update I thought the sequence was
set_val(BUTTON_17, 100.0);
wait (100);
set_val(BUTTON_17, 0.0);

I was driving myself crazy lol.
User avatar
kenshyn
Sergeant First Class
Sergeant First Class
 
Posts: 22
Joined: Tue Jun 20, 2017 11:03 pm

Re: Script troubles doing a sequence n holding multiple butt

Postby bonefisher » Sun Apr 14, 2019 3:05 am

You can also do :
combo X_press
{
set_val(BUTTON_17, 100.0);
wait(100);
set_val(BUTTON_17, 0.0);
wait(100);
}
for looping or:
combo X_press
{
set_val(BUTTON_17, 100.0);
wait(100);
}
for event_active playing for 100ms.
bonefisher
Lieutenant General
Lieutenant General
 
Posts: 5368
Joined: Thu Jan 29, 2015 10:49 am

Re: Script troubles doing a sequence n holding multiple butt

Postby kenshyn » Sun Jun 23, 2019 2:24 am

I am always seeing the hold key Button_15 toggle into my sequence any way to lock that key out of the output? I tied setting it 0 ugh.

main
{
if(get_actual(BUTTON_15))combo_run(button_press);
}
combo button_press
{
set_val(BUTTON_15, 0);
set_val(BUTTON_5, 100.0);
set_val(BUTTON_17, 100.0);
wait(100);wait(100);

}
User avatar
kenshyn
Sergeant First Class
Sergeant First Class
 
Posts: 22
Joined: Tue Jun 20, 2017 11:03 pm

Re: Script troubles doing a sequence n holding multiple butt

Postby J2Kbr » Sat Jun 29, 2019 12:40 pm

kenshyn wrote:I am always seeing the hold key Button_15 toggle into my sequence any way to lock that key out of the output? I tied setting it 0 ugh.

Fixed, BUTTON_15 will always be 0:
Code: Select all
main {
    if(get_actual(BUTTON_15)) {
        set_val(BUTTON_15, 0.0);
        combo_run(button_press);
    }
}
 
combo button_press {
    set_val(BUTTON_5, 100.0);
    set_val(BUTTON_17, 100.0);
    wait(100);
    wait(100);
}
ConsoleTuner Support Team
User avatar
J2Kbr
General of the Army
General of the Army
 
Posts: 18147
Joined: Tue Mar 18, 2014 1:39 pm


Return to Gtuner IV Support

Who is online

Users browsing this forum: No registered users and 9 guests