defcon.klaxon
Lifetime Supporting Member
Hi guys,
I'm trying to write a simple little script that will take a button in InTouch that's animated for "Direct" (i.e., momentary) and make it stay true for, say, five seconds.
I've read generally that one can write a script that'll look at $Second and use that to wait 5 (or 10 or whatever) seconds, but I'm not sure the right way to go about that script-wise (I'm pretty new to the script aspect of InTouch). Would I use a FOR loop, inside an IF? I'm sure this is simple, but I'm not sure how to attack this.
So far, I've come up with a conditional script whose condition is the button's Direct tag being true, with the following script:
I found this as an example on the forum, but I'm not sure if this'll be suitable for what I'm doing. As for the number in the FOR loop, I assume that'll depend on how fast my code is executed on the PC, so it'll have to be tuned; or I could make a tag for that upper limit and have it as a temporary user adjustable setpoint. Does this sound right to you guys? Thanks!
I'm trying to write a simple little script that will take a button in InTouch that's animated for "Direct" (i.e., momentary) and make it stay true for, say, five seconds.
I've read generally that one can write a script that'll look at $Second and use that to wait 5 (or 10 or whatever) seconds, but I'm not sure the right way to go about that script-wise (I'm pretty new to the script aspect of InTouch). Would I use a FOR loop, inside an IF? I'm sure this is simple, but I'm not sure how to attack this.
So far, I've come up with a conditional script whose condition is the button's Direct tag being true, with the following script:
Code:
button_tag == 1 (this is the condition that starts the script)
script:
x = $second;
FOR i = 1 TO 100000
button_tag = 1;
IF x <> $second THEN
EXIT FOR;
ENDIF;
NEXT;
Last edited: