PDA

View Full Version : WaitForAutoToFinish() Broken?


johnhuebbe
12-30-2005, 10:44 PM
I was reading through the ToasterScript files for the switcher and came across this keyboard shortcut that is in the "Kbd.ToasterScript" file.

When I use the shortcut and my DSK is on, it operates correctly (by first fading the DSK then going ahead with Auto.) But when my DKS is off, it does not operate correctly. The Auto and DSK happen at the same time. This would lead me to believe that the command "WaitForAutoToFinish()" is broken.

Can someone else confirm this? (BTW, I'm using VT3).


CreateShortCut ("CapsLockOn Ctrl Alt Space", code(
if (DSKGet())
{
DSKFade()
WaitForDSKToFinish();
ts_Auto();
}
else
{
ts_Auto();
WaitForAutoToFinish();
DSKFade()
}
), "OrderedFocus", KbdPriorityHigh)

Also, if it is in fact broken, I was trying to create a new script that would operate in the same way. I'm having some trouble with it though...


myWaitForAutoToFinish() {
while( GetCurrentTBarSpeed() > 0 )
{
ts_Wait(60)
}
}


Then I use it in the shortcut like this...
ts_Auto();
myWaitForAutoToFinish();
DSKFade()


I would think this would do the trick, but it doesn't even do anything. I guess the command "GetCurrentTBarSpeed()" does not get updated after the Auto() command takes place. Any ideas on why?

Any help would be most appreciated.

John Perkins
12-31-2005, 01:06 AM
I haven't tried this yet, but I suspect this will work.


myWaitForAutoToFinish() {Moving=0 //initialize to Zero first
while( Moving > 0 )
{
ts_Wait(60)
Moving=GetCurrentTBarSpeed()
}
}

I had the same problem last night on the timer.

As for the other wait being broken, it may be.

Sorry, I just can't test right now.

johnhuebbe
12-31-2005, 04:18 PM
Nope, that didn't work either.

It's almost like the script isn't grabbing the speed of the TBar as the script is running. Like when I have the script

ts_Auto();
myWaitForAutoToFinish();

it gets the speed of the TBar at the same instant the auto command is issued, so then the speed is 0.