Пример #1
0
        private void Emulate_Click(object sender, EventArgs e)
        {
            int startPosotion = int.Parse(maskedTextBoxStartPosition.Text);
            int delay         = int.Parse(maskedDelay.Text);

            Cheat.EmulateKeyboardInput(richTextBox1.Text, startPosotion, delay);
        }
Пример #2
0
        private void buttonScreenShot_Click(object sender, EventArgs e)
        {
            Visible = false;

            Language lang;

            if (radioButtonRus.Checked)
            {
                lang = Language.rus;
            }
            else
            {
                lang = Language.eng;
            }


            using (var screenShot = Cheat.GetBitmap())
            {
                if (screenShot == null)
                {
                    richTextBox1.Clear();
                    listBox1.Items.Clear();
                    textBox1.Clear();
                    label1.Text = "Не выбран скрин";
                    Console.WriteLine("Не выбран скрин");
                }
                else
                {
                    string text;
                    text = Cheat.RecognizePicture(screenShot, lang);

                    // Чистка от переносов и двойных пробелов
                    text = text.Replace("“", "\"").Replace("‘", "'").Replace("\n", " ").Replace("\n\r", " ").Replace(Environment.NewLine, " ").Replace("  ", " ");

                    richTextBox1.Text = text;
                    _result           = Cheat.CheckSpelling(text, lang);

                    if (_result.Errors != null && _result.Errors.Count > 0)
                    {
                        _error = _result.Errors[0];
                        ShowError();
                    }
                    else
                    {
                        Console.WriteLine(_result.Errors == null);
                    }
                    textBox1.Focus();
                }
            }
            Visible = true;
        }