Page 1 of 1

Script troubles doing a sequence n holding multiple buttons?

PostPosted: Sat Apr 13, 2019 6:17 pm
by kenshyn
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

Re: Script troubles doing a sequence n holding multiple butt

PostPosted: Sat Apr 13, 2019 6:22 pm
by bonefisher
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!

Re: Script troubles doing a sequence n holding multiple butt

PostPosted: Sat Apr 13, 2019 6:28 pm
by bonefisher
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!

Re: Script troubles doing a sequence n holding multiple butt

PostPosted: Sat Apr 13, 2019 6:37 pm
by bonefisher
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);
}
 

Re: Script troubles doing a sequence n holding multiple butt

PostPosted: Sun Apr 14, 2019 2:03 am
by kenshyn
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.

Re: Script troubles doing a sequence n holding multiple butt

PostPosted: Sun Apr 14, 2019 3:05 am
by bonefisher
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.

Re: Script troubles doing a sequence n holding multiple butt

PostPosted: Sun Jun 23, 2019 2:24 am
by kenshyn
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);

}

Re: Script troubles doing a sequence n holding multiple butt

PostPosted: Sat Jun 29, 2019 12:40 pm
by J2Kbr
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);
}