public static void Replay() { MacroManager manager = MacroManager.GetInstance(); MacroEntry current = manager.GetCurrentMacro(); Task.Run(() => current.Action(current)); }
public static void PlayMacro(string name) { MacroManager manager = MacroManager.GetInstance(); MacroEntry macro = manager.Items.FirstOrDefault(m => m.Name == name); if (macro == null) { UOC.SystemMessage(Strings.Unknown_macro___); return; } Task.Run(() => macro.Action(macro)); }
public static void Replay() { MacroManager manager = MacroManager.GetInstance(); MacroEntry current = manager?.GetCurrentMacro(); if (current?.Action == null) { return; } manager.Replay = true; Task.Run(() => current.Action(current)); }
public static void PlayMacro(string name) { MacroManager manager = MacroManager.GetInstance(); MacroEntry current = manager.GetCurrentMacro(); if (current != null && current.IsBackground) { UOC.SystemMessage(Strings.Cannot_PlayMacro_from_background_macro___); return; } MacroEntry macro = manager.Items.FirstOrDefault(m => m.Name == name); if (macro == null) { UOC.SystemMessage(Strings.Unknown_macro___); return; } Task.Run(() => macro.Action(macro)); }