Example #1
0
        private void timerTyping_Tick(object sender, EventArgs e)
        {
            System.Text.StringBuilder title = new System.Text.StringBuilder(256);
            IntPtr handleWindow             = GetForegroundWindow();

            GetWindowText(handleWindow, title, title.Capacity);
            Status("รอเลือกหน้าจอเกม...");

            if (title.ToString().StartsWith("YGOnline"))
            {
                Status("บอทกำลังทำงาน...");
                //Bot
                SerialCode.GameWindow gameWindow = SerialCode.GameWindowList()[comboBoxGameWindow.SelectedIndex];
                _bot.Run(handleWindow, gameWindow, comboBoxNpcZoom.SelectedIndex == 0);
            }
            //Update Status
            UpdateStatus();

            //Stop bot
            if (_bot.BotStop)
            {
                Status("สิ้นสุดการทำงาน");
                Stop();
            }
        }
Example #2
0
        private void FormMain_Load(object sender, EventArgs e)
        {
            //Set title
            this.Text = @"Yulgang Serial Code " + Assembly.GetExecutingAssembly().GetName().Version.ToString();

            //Set Bot
            _bot = new Bot();

            //Game Window
            foreach (SerialCode.GameWindow gameWindow in SerialCode.GameWindowList())
            {
                comboBoxGameWindow.Items.Add(gameWindow.Width.ToString() + "x" + gameWindow.Height.ToString());
            }

            comboBoxGameWindow.SelectedIndex = 0;
            comboBoxNpcZoom.SelectedIndex    = 0;
        }