public static async Task StartObs() { System.Diagnostics.Debug.WriteLine("inside StartObs"); var obsStream = Process.GetProcessesByName("obs64"); if (obsStream.Length == 0) { Process.Start(Constants.ObsStudioAbsolutePath); } obs = Process.GetProcessesByName("obs64").FirstOrDefault(); IntPtr h = obs.MainWindowHandle; SetForegroundWindow(h); await Task.Delay(8000); System.Diagnostics.Debug.WriteLine("sending OBS inputs..."); Debug.WriteLine("Starting stream..at: " + DateTime.Now); var ahk = new AutoHotkey.Interop.AutoHotkeyEngine(); ahk.LoadFile(Constants.AhkRelativeFilePath); ahk.ExecFunction("StartStream"); }
public static async Task StartObs() { System.Diagnostics.Debug.WriteLine("inside StartObs"); var obsStream = Process.GetProcessesByName("obs64"); if (obsStream.Length == 0) { Process.Start("C:\\ProgramData\\Microsoft\\Windows\\Start Menu\\Programs\\OBS Studio\\OBS Studio (64bit)"); } obs = Process.GetProcessesByName("obs64").FirstOrDefault(); IntPtr h = obs.MainWindowHandle; SetForegroundWindow(h); await Task.Delay(8000); System.Diagnostics.Debug.WriteLine("sending OBS inputs..."); Debug.WriteLine("Starting stream..at: " + DateTime.Now); var ahk = new AutoHotkey.Interop.AutoHotkeyEngine(); ahk.LoadFile("../../test.ahk"); ahk.ExecFunction("StartStream"); }
public override void Execute(ActionContext context) { try { var ahk = new AutoHotkey.Interop.AutoHotkeyEngine(); ahk.LoadFile(ScriptName); ahk.ExecFunction(FunctionName); while (ahk.IsReady() == true) { System.Threading.Thread.Sleep(100); } ahk.Reset(); // MessageBox.Show("Engine finished."); AhkResult = ("Finished successfully."); } catch (Exception e) { if (e is ActionException) { throw; } throw new ActionException("ActionError", e.Message, e.InnerException); } // TODO: set values to Output Arguments here }
public static void StopObs() { Debug.WriteLine("Stopping stream..at: " + DateTime.Now); obs = Process.GetProcessesByName("obs64").FirstOrDefault(); IntPtr h = obs.MainWindowHandle; SetForegroundWindow(h); var ahk = new AutoHotkey.Interop.AutoHotkeyEngine(); ahk.LoadFile(Constants.AhkRelativeFilePath); ahk.ExecFunction("StopStream"); }
public static void StartReplay(int playerSlot, long matchID) { IntPtr h = Dota.MainWindowHandle; SetForegroundWindow(h); //Thread.Sleep(10000); Console.WriteLine("sending input.."); System.Diagnostics.Debug.WriteLine("sending inputs..."); var ahk = new AutoHotkey.Interop.AutoHotkeyEngine(); ahk.LoadFile(Constants.AhkRelativeFilePath); ahk.ExecFunction("TestSend"); ahk.ExecFunction("WatchThisReplay", matchID.ToString(), playerSlot.ToString()); }
public static async Task StartReplay(int playerSlot) { IntPtr h = dota.MainWindowHandle; SetForegroundWindow(h); //Thread.Sleep(10000); await Task.Delay(10000); Console.WriteLine("sending input.."); System.Diagnostics.Debug.WriteLine("sending inputs..."); var ahk = new AutoHotkey.Interop.AutoHotkeyEngine(); ahk.LoadFile("../../test.ahk"); ahk.ExecFunction("TestSend"); ahk.ExecFunction("WatchThisReplay", matchID.ToString(), playerSlot.ToString()); }