You should not require widgets for this.
What are you trying to do?
-Are you trying to run the same thing every 100ms. For that you use the timer.
Or
-Are you trying to run something, wait X ms, run something else, wait Y ms, run something else, wait Z ms, run something else, etc. For that, you use the pause function.
You can either run a task, pause, run a second task, pause, run a third task, pause, etc.
Or you can use the "ogscript.pause" method inside your tasks. BUT that method does not work in a normal task, because we do NOT want the user to be able to pause the UI so that DashBoard freezes. Instead, you have to run it in an asyncexec block. Like this:
function runTask() {
ogscript.debug("Do the first thing");
ogscript.pause(1000);
ogscript.debug("Do the second thing");
ogscript.pause(3000);
ogscript.debug("Do the third thing");
ogscript.pause(500);
ogscript.debug("Do the fourth thing");
}
// Run the runTask function in the background in 1 milliseconds
ogscript.asyncExec(runTask, 1);
Here is the whole panel with that code in a button:
<abs contexttype="opengear" id="_top" keepalive="false">
<button buttontype="push" height="61" left="137" name="Run 4 things with timing" top="167" width="209">
<task tasktype="ogscript">function runTask() {
ogscript.debug("Do the first thing");
ogscript.pause(1000);
ogscript.debug("Do the second thing");
ogscript.pause(3000);
ogscript.debug("Do the third thing");
ogscript.pause(500);
ogscript.debug("Do the fourth thing");
}
// Run the task in 1 milliseconds
ogscript.asyncExec(runTask, 1);</task>
</button>
</abs>
#DashBoard