Exemplo n.º 1
0
 /// <summary>
 /// Executes the script.
 /// </summary>
 public void ExecuteScript()
 {
     if (Script != null) {
         SetRunningState();
         ScriptRunner = new ScriptRunner(Script, TibiaClient);
         ScriptRunner.Start(false);
     }
 }
Exemplo n.º 2
0
        private void RunScript(bool debug)
        {
            if (TibiaClient != null) {
                SetControlState(true);
                InDebugMode = debug;

                this.BeginInvoke(new Callback(delegate() {

                    if (CompiledScript != null) {
                        RestoreRows();
                        HidePanels();

                        Runner = new ScriptRunner(CompiledScript, TibiaClient);
                        Runner.OnScriptStop += Runner_OnScriptStop;
                        Runner.OnException += Runner_OnException;
                        Runner.OnScriptException += Runner_OnScriptException;
                        Runner.OnRowBeginExecute += new EventHandler<Keyrox.Scripting.Events.ScriptLineEventArgs>(Runner_OnRowBeginExecute);
                        Runner.OnRowEndExecute += new EventHandler<Keyrox.Scripting.Events.ScriptLineEventArgs>(Runner_OnRowEndExecute);
                        Runner.Start(debug);
                    }
                    else { SetControlState(false); }
                }));
            }
        }