void ScriptRunner()
        {
            try
            {
                Script();
            }
            catch (ThreadAbortException)
            {
                // Script stopped by user
            }
            catch (ScriptExitException e)
            {
                ScriptExit?.Invoke(e.Message);

                AutomataApi.ShowMessageBox("Script Exited", e.Message);
            }
            catch (Exception e)
            {
                LogError(e);

                ScriptExit?.Invoke(e.Message);

                AutomataApi.ShowMessageBox("Unexpected Error", e.ToString());
            }
        }
示例#2
0
 public void Highlight(TimeSpan Duration)
 {
     AutomataApi.Highlight(this, Duration);
 }
示例#3
0
 public IPattern GetPattern() => AutomataApi.GetCopy(this);
示例#4
0
 public bool Exists(IPattern Image, int?Timeout = null, double?Similarity = null) => AutomataApi.Exists(this, Image, Timeout, Similarity);
示例#5
0
 public void WaitVanish(IPattern Image, int?Timeout = null) => AutomataApi.WaitVanish(this, Image, Timeout);
        static bool LogError(Exception E)
        {
            AutomataApi.WriteDebug(E.ToString());

            return(false);
        }