public void StartDemo() { Console.Title = @"Âđĺě˙ çŕęŕçîâ äë˙ Äŕëüíîáîéůčęŕ"; //var processName = "notepad"; //čě˙ ďđîöĺńńŕ var processName = "GTA5"; //čě˙ ďđîöĺńńŕ var process = System.Diagnostics.Process.GetProcessesByName(processName).FirstOrDefault(); if (process == null) { Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine($"Čăđŕ íĺ íŕéäĺíŕ."); Console.ForegroundColor = ConsoleColor.Yellow; Console.WriteLine("Îćčäŕíčĺ çŕďóńęŕ čăđű..."); System.Threading.Thread.Sleep(5000); Console.Clear(); StartDemo(); } _directXoverlayPluginExample = new DirectxOverlayPluginExample(); _processSharp = new ProcessSharp(process, MemoryType.Remote); var result = "30"; var fpsValid = int.TryParse(Convert.ToString(result, CultureInfo.InvariantCulture), NumberStyles.Any, NumberFormatInfo.InvariantInfo, out int fps); var d3DOverlay = (DirectxOverlayPluginExample)_directXoverlayPluginExample; d3DOverlay.Settings.Current.UpdateRate = 1000 / fps; _directXoverlayPluginExample.Initialize(_processSharp.WindowFactory.MainWindow); _directXoverlayPluginExample.Enable(); // Log some info about the overlay. var info = d3DOverlay.Settings.Current; Console.ForegroundColor = ConsoleColor.Cyan; Console.Write($"Ŕâňîđ: "); Console.ForegroundColor = ConsoleColor.Yellow; Console.WriteLine($"{ info.Author}"); Console.ForegroundColor = ConsoleColor.Cyan; Console.Write($"Îâĺđëĺé: "); Console.ForegroundColor = ConsoleColor.Yellow; Console.WriteLine($"{ info.Identifier}"); Console.ForegroundColor = ConsoleColor.Cyan; Console.Write($"Âĺđńč˙: "); Console.ForegroundColor = ConsoleColor.Yellow; Console.WriteLine($"{ info.Version}"); Console.WriteLine(""); Console.ForegroundColor = ConsoleColor.Yellow; Console.WriteLine("×ňîáű âűęëţ÷čňü îâĺđëĺé - çŕęđîéňĺ ęîíńîëü."); while (true) { _directXoverlayPluginExample.Update(); } }
public void StartDemo() { Log.Debug(@"Please type the process name of the window you want to attach to, e.g 'notepad."); Log.Debug("Note: If there is more than one process found, the first will be used."); var processName = Console.ReadLine(); var process = System.Diagnostics.Process.GetProcessesByName(processName).FirstOrDefault(); if (process == null) { Log.Warn($"No process by the name of {processName} was found."); Log.Warn("Please open one or use a different name and restart the demo."); Console.ReadLine(); return; } _directXoverlayPluginExample = new DirectxOverlayPluginExample(); _processSharp = new ProcessSharp(process, MemoryType.Remote); _directXoverlayPluginExample.Initialize(_processSharp.WindowFactory.MainWindow); _directXoverlayPluginExample.Enable(); var d3DOverlay = (DirectxOverlayPluginExample)_directXoverlayPluginExample; // Log some info about the overlay. Log.Debug("Starting update loop (open the process you specified and drag around)"); Log.Debug("Update rate: " + d3DOverlay.Settings.Current.UpdateRate.Milliseconds()); var info = d3DOverlay.Settings.Current; Log.Debug($"Author: {info.Author}"); Log.Debug($"Description: {info.Description}"); Log.Debug($"Name: {info.Name}"); Log.Debug($"Identifier: {info.Identifier}"); Log.Debug($"Version: {info.Version}"); Log.Info("Note: Settings are saved to a settings folder in your main app folder."); Log.Info("Give your window focus to enable the overlay (and unfocus to disable..)"); Log.Info("Close the console to end the demo."); while (true) { _directXoverlayPluginExample.Update(); } }
public void StartDirectX() { _logger.logInfo("Process name {0} using for application.", AppConstant.ProcessName); _process = System.Diagnostics.Process.GetProcessesByName(AppConstant.ProcessName).FirstOrDefault(); if (_process == null) { _logger.logError("No process found with name {0}", AppConstant.ProcessName); Console.ReadLine(); return; } _directXoverlayPlugin = new AppDirectXOverlay(_process); _processSharp = new ProcessSharp(_process, MemoryType.Remote); _logger.logInfo("Application using frame rate : {0}", AppConstant.Fps); var d3DOverlay = (AppDirectXOverlay)_directXoverlayPlugin; d3DOverlay.Settings.Current.UpdateRate = 1000 / AppConstant.Fps; _directXoverlayPlugin.Initialize(_processSharp.WindowFactory.MainWindow); _directXoverlayPlugin.Enable(); // Log some info about the overlay. _logger.logInfo("Starting update loop (open the process you specified and drag around)"); _logger.logInfo("Update rate: {0}", d3DOverlay.Settings.Current.UpdateRate); var info = d3DOverlay.Settings.Current; _logger.logInfo($"Author: {info.Author}"); _logger.logInfo($"Description: {info.Description}"); _logger.logInfo($"Name: {info.Name}"); _logger.logInfo($"Identifier: {info.Identifier}"); _logger.logInfo($"Version: {info.Version}"); _logger.logInfo("Note: Settings are saved to a settings folder in your main app folder."); _logger.logInfo("Give your window focus to enable the overlay (and unfocus to disable..)"); while (true) { _directXoverlayPlugin.Update(); } }
public void Start() { var processName = "gta5"; var process = System.Diagnostics.Process.GetProcessesByName(processName).FirstOrDefault(); if (process == null) { MessageBox.Show(processName + ".exe not running"); Environment.Exit(0); } _processSharp = new ProcessSharp(process, MemoryType.Remote); var d3DOverlay = (DirectXOverlayPlugin)directXOverlay; d3DOverlay.Settings.Current.UpdateRate = 1000 / fps; directXOverlay.Initialize(_processSharp.WindowFactory.MainWindow); directXOverlay.Enable(); bw.DoWork += Bw_DoWork; bw.RunWorkerAsync(); }
public void Initialize() { Console.WriteLine($"Starting overlay..."); SC2Proc = System.Diagnostics.Process.GetProcessesByName(SC2ProcName).FirstOrDefault(); SC1Proc = System.Diagnostics.Process.GetProcessesByName(SC1ProcName).FirstOrDefault(); WC3Proc = System.Diagnostics.Process.GetProcessesByName(WC3ProcName).FirstOrDefault(); while (SC2Proc == null && SC1Proc == null && WC3Proc == null) { Console.WriteLine($"No processes by the names of {SC1ProcName}, {SC2ProcName} or {WC3ProcName} were found."); System.Threading.Thread.Sleep(1000); SC2Proc = System.Diagnostics.Process.GetProcessesByName(SC2ProcName).FirstOrDefault(); SC1Proc = System.Diagnostics.Process.GetProcessesByName(SC1ProcName).FirstOrDefault(); WC3Proc = System.Diagnostics.Process.GetProcessesByName(WC3ProcName).FirstOrDefault(); } Console.WriteLine($"Starting overlay in 5..."); System.Threading.Thread.Sleep(1000); Console.WriteLine($"Starting overlay in 4..."); System.Threading.Thread.Sleep(1000); Console.WriteLine($"Starting overlay in 3..."); System.Threading.Thread.Sleep(1000); Console.WriteLine($"Starting overlay in 2..."); System.Threading.Thread.Sleep(1000); Console.WriteLine($"Starting overlay in 1..."); System.Threading.Thread.Sleep(1000); _directXoverlayPluginExample = new DirectxOverlayPluginExample(); if (SC2Proc != null) { _processSharp = new ProcessSharp(SC2Proc, MemoryType.Remote); } else if (SC1Proc != null) { _processSharp = new ProcessSharp(SC1Proc, MemoryType.Remote); } else if (WC3Proc != null) { _processSharp = new ProcessSharp(WC3Proc, MemoryType.Remote); } var fpsValid = int.TryParse(Convert.ToString("60", CultureInfo.InvariantCulture), NumberStyles.Any, NumberFormatInfo.InvariantInfo, out int fps); var d3DOverlay = (DirectxOverlayPluginExample)_directXoverlayPluginExample; d3DOverlay.Settings.Current.UpdateRate = 1000 / fps; _directXoverlayPluginExample.Initialize(_processSharp.WindowFactory.MainWindow); _directXoverlayPluginExample.Enable(); var info = d3DOverlay.Settings.Current; Console.WriteLine($"Overlay Started."); while (true) { _directXoverlayPluginExample.Update(); // check if game died. SC2Proc = System.Diagnostics.Process.GetProcessesByName(SC2ProcName).FirstOrDefault(); SC1Proc = System.Diagnostics.Process.GetProcessesByName(SC1ProcName).FirstOrDefault(); WC3Proc = System.Diagnostics.Process.GetProcessesByName(WC3ProcName).FirstOrDefault(); if (SC2Proc == null && SC1Proc == null && WC3Proc == null) { Console.WriteLine("Game has exited..."); Initialize(); break; } } }
public void StartDemo() { Log.Debug(@"Please type the process name of the window you want to attach to, e.g 'notepad."); Log.Debug("Note: If there is more than one process found, the first will be used."); var processName = Console.ReadLine(); var process = System.Diagnostics.Process.GetProcessesByName(processName).FirstOrDefault(); if (process == null) { Log.Warn($"No process by the name of {processName} was found."); Log.Warn("Please open one or use a different name and restart the demo."); Console.ReadLine(); return; } _directXoverlayPluginExample = new DirectxOverlayPluginExample(); _processSharp = new ProcessSharp(process, MemoryType.Remote); Log.Debug("Enter the frame rate the overlay should render at. e.g '60'"); var result = Console.ReadLine(); var fpsValid = int.TryParse(Convert.ToString(result, CultureInfo.InvariantCulture), NumberStyles.Any, NumberFormatInfo.InvariantInfo, out int fps); if (!fpsValid) { Log.Debug($"{result} is not valid. Please reload and try again by entering an integer such as '30' or '60' "); return; } var d3DOverlay = (DirectxOverlayPluginExample)_directXoverlayPluginExample; d3DOverlay.Settings.Current.UpdateRate = 1000 / fps; _directXoverlayPluginExample.Initialize(_processSharp.WindowFactory.MainWindow); _directXoverlayPluginExample.Enable(); // Log some info about the overlay. Log.Debug("Starting update loop (open the process you specified and drag around)"); Log.Debug("Update rate: " + d3DOverlay.Settings.Current.UpdateRate.Milliseconds()); var info = d3DOverlay.Settings.Current; Log.Debug($"Author: {info.Author}"); Log.Debug($"Description: {info.Description}"); Log.Debug($"Name: {info.Name}"); Log.Debug($"Identifier: {info.Identifier}"); Log.Debug($"Version: {info.Version}"); Log.Info("Note: Settings are saved to a settings folder in your main app folder."); Log.Info("Give your window focus to enable the overlay (and unfocus to disable..)"); Log.Info("Close the console to end the demo."); while (true) { _directXoverlayPluginExample.Update(); } }