Dear Joe,
Thank you for using the PowerScene. we are really sorry for late respond.
We didn`t check customer request because we got mail on holiday.
As you know, each script run sequentially in the calculation formula. so if one script run long time, another script should wait until long script finished. because if script run concurrently, control is very hard.
For that reason, user should avoid to use time.sleep() in calculation formula.
But sometime, we need wait function for check some period time. and then execute next logic,
To wait without stopping another script, there are two ways.
easy way is to use the 'Event Script'. event script run when condition which user inputted is True.
You can use wait function ( app.wait(sec) not time.sleep(3) ) in event script.
app.wait(sec) in event script wait without stopping script in calculation formula.
Here is example, in this case, if when condition(sss.1 ==1 and sss.2 ==1) is true , script will be executed.
This is easiest way to wait script.
Another way is to implement your state based logic.
Event script can be used, when condition and control logic are very simple.
But if you implement your own state based logic, you can do more then event script.
Here is example screen.
1. you implement your state based logic and set 'once'.
2. run execute function periodically by (n) millisecond.
In Once script , you write your logic, (below is sample)
This logic , check value (sss.1 and sss.2),
and when condition is true, wait delay(5 second), and do something.
Notice, actually we don`t call any app.wait or time.sleep.
We just check current state return quickly for another script.
in repeat script , we just call below.
I attach sample project, you can refer state based logic,
If you have further question, please notify us,
Thank you and Thank you very much using PowerScene
-------------------------------------------------------------
Dear Anygate,
I notice that if any script (Calculation Formula) has a call to time.sleep(), it will pause or prevent the execution of all other scripts. How can I allow one script to wait for something without stopping all the other scripts from running?
Thank you,
Joe