Delay Between Button Presses

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

Delay Between Button Presses

Postby titanone_fan » Mon Sep 19, 2016 9:04 pm

Hi,

How do I get a two second delay between button presses as per the code below? After RT pressed, I need to wait 2 seconds for an animation to complete before I press button X. Wait commands are for actual button press/release. How do I accomplish a delay before next button press/release? Do I define a delay and then refer to it in the combo sequence? Thanks very much.

Code: Select all

combo ButtonSequence {
   
    set_val(XB1_RT, 100);
    wait(20);
    wait(20);
    //need to wait 2 sec here before the next button press executes
   set_val(XB1_X, 100);
    wait(50);
    wait(50);
titanone_fan
First Sergeant
First Sergeant
 
Posts: 57
Joined: Mon Aug 22, 2016 3:04 pm

Re: Delay Between Button Presses

Postby UK_Wildcats » Mon Sep 19, 2016 9:16 pm

the wait command is in milliseconds, therefore, "wait(2000)" would be wait for 2000 milliseconds which equals 2 seconds.


Code: Select all

combo ButtonSequence {
   
    set_val(XB1_RT, 100);
    wait(20);
    wait(20);
    wait(2000);//need to wait 2 sec here before the next button press executes
   set_val(XB1_X, 100);
    wait(50);
    wait(50);
User avatar
UK_Wildcats
Brigadier General
Brigadier General
 
Posts: 2243
Joined: Thu Jan 08, 2015 6:53 pm

Re: Delay Between Button Presses

Postby titanone_fan » Tue Sep 20, 2016 4:21 am

Thank you!
titanone_fan
First Sergeant
First Sergeant
 
Posts: 57
Joined: Mon Aug 22, 2016 3:04 pm


Return to GPC2 Script Programming

Who is online

Users browsing this forum: midg3t2 and 72 guests