Beispiel #1
0
        private void timer2_Tick(object sender, EventArgs e)
        {
            try
            {
                var length = GetWindowTextLength(_gameHandle);
                var sb     = new StringBuilder(length + 1);
                GetWindowText(_gameHandle, sb, sb.Capacity);
                var title = sb.ToString();

                if ((title != "osu!") && (title != "") && (ReplayParsed))
                {
                    if (IsRun)
                    {
                        return;
                    }
                    IsRun            = true;
                    LTitle.ForeColor = Color.Chartreuse;
                }
                else
                {
                    IsRun            = false;
                    LTitle.ForeColor = Color.Red;

                    if (BotFunction.GetAsyncKeyState(Keys.Home) != 0)
                    {
                        BotFunction.Parse();
                    }

                    if (BotFunction.GetAsyncKeyState(Keys.LControlKey) == 0 || BotFunction.GetAsyncKeyState(Keys.O) == 0)
                    {
                        return;
                    }
                    //open new form
                    if (!SettingOpen)
                    {
                        var thread = new Thread(NewForm);
                        thread.Start();
                        SettingOpen = true;
                        while (SettingOpen)
                        {
                            Thread.Sleep(5);
                        }
                        thread.Abort();
                    }
                    var cfg = new Config();
                    cfg.ReadeFile();
                    Text = cfg.NewTitle;
                }
            }
            catch
            {
                // ignored
            }
        }
Beispiel #2
0
 private void btnRead_Click(object sender, EventArgs e)
 {
     BotFunction.Parse();
 }