public static void LoadOffsets() { try { Offsets = Offsets.FromFile("offsets.json"); } catch (Exception ex) { Offsets = new Offsets(); Offsets.Save("offsets.json"); Logger.Error("Failed to read offsets!"); Logger.PrintException(ex, true, false); } }
static void Main(string[] args) { //new Test().Run(); //return; Animation = new ConsoleAnimation(); Animation.Text = Name = string.Format("[ZMH5] Helios v.{0}", Assembly.GetExecutingAssembly().GetName().Version); Animation.Delimiter = " // "; Animation.RunningOutOfNews += (o, e) => Animation.AppendNews(Memes.Captions[new Random().Next(0, Memes.Captions.Length)]); Animation.Start(); Animation.Interval = (int)(1000f / 15f); Logger = new Logger(); Logger.PrintDate = Logger.PrintTime = false; Logger.Log("### [Helios] started ###"); Logger.Info("Loaded {0} memes", Memes.Captions.Length); LoadSettings(); CurrentSettings.Save(); LoadOffsets(); Offsets.Save("offsets.json"); //Wait for game Logger.Warning("WAITING FOR CSGO..."); while (!EUCProcess.IsProcessRunning("csgo")) { Thread.Sleep(500); } Hack = new Heke(); var thread = new Thread(() => { var cfg = new ConfigForm(); ConfigWindowHandle = cfg.Handle; Application.Run(cfg); }); thread.TrySetApartmentState(ApartmentState.STA); thread.Start(); Logger.Info("> Running hack!"); Hack.Run(); Console.ReadLine(); }