Beispiel #1
0
        public static void Main(string[] args)
        {
            CustomEvents.Game.OnGameLoad += Game_OnGameLoad;

            PrepareDrawing();

            Misc.GetRegionInfo();

            Misc.MenuAttach(Misc.Config);


            if (File.Exists(Config.AppDataDirectory + "\\elosharp.txt"))
            {
                nameofplayer = File.ReadAllText(Config.AppDataDirectory + "\\elosharp.txt").ToLower();
            }

            if (Misc.Validregion() && (nameofplayer != ""))
            {
                Console.WriteLine("[EloSharp] Configuration set for:  " + nameofplayer);
                Utility.DelayAction.Add(3000, () =>
                {
                    Performlookup();
                });
                Game.OnWndProc += Game_OnWndProc;

                var website = Misc.Config.Item("choosewebsite");
                website.ValueChanged += delegate { Misc.SetWebsite = Misc.Config.Item("choosewebsite").GetValue <StringList>().SelectedIndex; };
            }
        }
Beispiel #2
0
        public static void Main(string[] args)
        {
            Console.WriteLine("Elosharp V2 injected");

            CustomEvents.Game.OnGameLoad += Setup;

            PrepareDrawing();

            Misc.MenuAttach(Misc.Config);

            var website = Misc.Config.Item("choosewebsite");

            website.ValueChanged += delegate { Misc.SetWebsite = Misc.Config.Item("choosewebsite").GetValue <StringList>().SelectedIndex; };

            Misc.RegionTag = Game.Region;

            if (File.Exists(Config.AppDataDirectory + "\\elosharp.txt"))
            {
                nameofplayer = File.ReadAllText(Config.AppDataDirectory + "\\elosharp.txt").ToLower();
                nameofplayer = HttpUtility.UrlEncode(nameofplayer);
            }
            else
            {
                Console.WriteLine("Elosharp.txt not found. Waiting for game to load to setup.");
            }

            if (Misc.Validregion() && (nameofplayer != ""))
            {
                Console.WriteLine("[EloSharp] Configuration set for:  " + nameofplayer);

                if (Game.Mode == GameMode.Running)
                {
                    try
                    {
                        Console.WriteLine("performing instant lookup");
                        Performlookup();
                        delaying = false;
                        Game_OnGameLoad(new EventArgs());
                    }
                    catch (Exception e)
                    {
                        Console.WriteLine(e);
                    }
                }
                else
                {
                    Console.WriteLine("performing delayed lookup");
                    delaying = true;
                    CustomEvents.Game.OnGameLoad += Game_OnGameLoad;
                    Timer          = new Timer(5000);
                    Timer.Elapsed += new ElapsedEventHandler(TriggerLookup);
                    Timer.Enabled  = true;
                }
            }
        }