The above timer examples are using throttle position to trigger and are awesome.
I'm having trouble wrapping my head around how I can use the example to trigger a timer based on a variable value.
Simple answer, you need to use an REXEC to call a function that checks your variable, but would otherwise start and stop the timer the same as my last example.
So in my example, I put WEPTimerStartStop(&o, x); in EventHandle(), but this will only execute if a button or axis event occurs. If you don't touch your controller, nothing will ever call EventHandle(). So it doesn't help you for monitoring a variable. So instead, you need to use REXEC to call WEPTimerStartStop() at some interval.
Then, inside WEPTimerStartStop(), change the if statements to check the variable instead of the axis values.
So replace these lines:
if ((&o == &Throttle) & (x == THR_LEFT)) ...
...
if (percent >= 90) ...
with something like:
if (myvariable == 0) ...
We don't need to check the axis value, so delete that if statement and code below it. Then my "if (percent >=90)" is where you want to check your variable, myvariable.
Or something along those lines. Let me know if that gets you started.