Quote:
Originally Posted by Schetti
I know, the script itself is useless, but it MUST have a timeout, doesnt it? So, it sends the "works?" like a spam, but NO "timeout?"
someone can explain why?
|
onTestTime gets first executed without a timeout set, so there is no chance that "if (timeout)" is true at that point. So the settimer inside the if-block is not being executed either. Consequently the recursive call to onTestTime also happens without a timeout being active, and we basically start from the beginning over and over again until you run out of stack space and the recursion terminates. At that point, the script might either error out or go to the next statement, not sure. If the latter is the case, you will finally set your timer and onTimeout() will be called 0.05 seconds later, setting the timer again and continuing the timeout loop. Since onTimeout is not calling onTestTime, your "if (timeout)" check is not going to be executed anymore and the sendtorc still does not happen.
Your expectation that something different happens implies that you think there is some magic going on that is not actually there.