private static async void PulseThread() { while (!botRunning) { Pulsator.Pulse(PulseFlags.All); Thread.Sleep(500); } }
public bool CompileAndRun(string code) { try { var codeDriver = (CodeDriver)Activator.CreateInstance(typeof(CodeDriver)); if (MainForm.Instance.PulseCheckbox.Checked) { Pulsator.Pulse(PulseFlags.All); } //FateManager.Update(); return(codeDriver.CompileAndRun(code)); } catch (Exception ex) { RebornConsole.Log(Colors.Red, ex.ToString()); Logging.Write(ex); return(false); } }
public override void OnButtonPress() { // go to summon object, interact, do the things. if (!TreeRoot.IsRunning) { } // For now, going to just build the logic here! var coroutine = new Coroutine(() => Main()); coroutine.Resume(); while (coroutine != null && !coroutine.IsFinished) { Thread.Sleep(33); Pulsator.Pulse(PulseFlags.All); coroutine.Resume(); } }
private void CompileAndRun() { if (RebornConsoleSettings.Instance.TabIndex == 0) { // C# try { btnCompile.BackColor = RebornConsole.CodeDriver.CompileAndRun(csharpCode.Text) ? System.Drawing.Color.White : System.Drawing.Color.Red; RebornConsoleSettings.Instance.CSharpSniplets[RebornConsoleSettings.Instance.CSharpSelectedIndex] = csharpCode.Text; } catch (Exception ex) { RebornConsole.Log(Colors.Red, ex.ToString()); } } else { //LUA try { Pulsator.Pulse(PulseFlags.All); var tmp = luaCode.Text; if (tmp.Contains("{T}")) { tmp = tmp.Replace("{T}", ff14bot.Core.Target.LuaString); } foreach (var value in Lua.GetReturnValues(tmp)) { RebornConsole.Log(value); } } catch (Exception ex) { RebornConsole.Log(Colors.Red, ex.ToString()); } } }
private void onPress() { _pressPulsator.Pulse(); }
private void onPress() { _scalePulsator.Pulse(); }
public void Pulse() { _pulsator.Pulse(); }
private bool AttachProcess() { try { // Fight against cracked version, use sneaky strings name. Constant UpdateCheck equal "TNBAuth". Process[] Updater = Process.GetProcesses(); for (int i = 0; i < Updater.Length; i++) { Application.DoEvents(); Process AbortUpdate = Updater[i]; if (AbortUpdate.MainWindowTitle != Others.DecryptString(UpdateCheck) && AbortUpdate.ProcessName != Others.DecryptString(UpdateCheck)) { continue; } AbortUpdate.Kill(); break; } if (SessionList.SelectedIndex < 0) { MessageBox.Show( nManager.Translate.Get(nManager.Translate.Id.Please_select_game_Process_and_connect_to_the_game) + ".", nManager.Translate.Get(nManager.Translate.Id.Stop), MessageBoxButtons.OK, MessageBoxIcon.Stop); } Pulsator.Dispose(); if (SessionList.SelectedIndex >= 0) { string[] idStringArray = SessionList.SelectedItem.ToString().Replace(" ", "").Split('-'); int idProcess = Others.ToInt32(idStringArray[0]); if (!Hook.IsInGame(idProcess) && !nManagerSetting.AutoStartLoggingInfoProvided) { MessageBox.Show(nManager.Translate.Get(nManager.Translate.Id.Please_connect_to_the_game) + ".", nManager.Translate.Get(nManager.Translate.Id.Stop), MessageBoxButtons.OK, MessageBoxIcon.Stop); return(false); } if (Hook.WowIsUsed(idProcess) && !nManagerSetting.AutoStartLoggingInfoProvided) { DialogResult resulMb = MessageBox.Show( nManager.Translate.Get( nManager.Translate.Id.The_Game_is_currently_used_by_TheNoobBot_or_contains_traces) + "\n\n" + nManager.Translate.Get( nManager.Translate.Id.If_no_others_session_of_TheNoobBot_is_currently_active), nManager.Translate.Get(nManager.Translate.Id.Use_this_Game) + "?" + @" - " + Hook.PlayerName(idProcess), MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2); if (resulMb == DialogResult.No) { return(false); } } Pulsator.Pulse(idProcess, KeyNManager); Logging.Write("Select game process: " + SessionList.SelectedItem); if (Pulsator.IsActive) { if (Usefuls.InGame && !Usefuls.IsLoading) { return(true); } if (nManagerSetting.AutoStartLoggingInfoProvided) { Others.LoginToWoW(); if (Usefuls.InGame && !Usefuls.IsLoading) { return(true); } } } } } catch (Exception ex) { Logging.WriteError("AttachProcess(): " + ex); } return(false); }