Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help with script info
#1
Hi, is it possible to start and end a script with the same hotkey if it's already running, and how do I know if a specific script is running? thx
#2
Quote:is it possible to start and end a script with the same hotkey if it's already running

Code:
Copy      Help
static class My {
    /// <summary>
    ///
Starts executing a script. If already running, ends that task and does not start new.
    /// </summary>
    ///
<inheritdoc cref="script.run"/>
    ///
<example>
    ///
Trigger F11.
    /// <code><![CDATA[
    /// hk["F11"] = o => { My.ScriptRunOrEnd(@"\Script137.cs"); };
    /// ]]></code>
    ///
</example>
    public static void ScriptRunOrEnd(string name, params string[] args) {
        if (script.end(name) == true) return;
        script.run(name, args);
    }
}
 
Quote:how do I know if a specific script is running

Next program version will have function script.isRunning.


Forum Jump:


Users browsing this thread: 1 Guest(s)