Esempio n. 1
0
        private void btn_Start_Click(object sender, RoutedEventArgs e)
        {
            if (_craftThread != null)
            {
                if (_craftThread.IsAlive)
                {
                    _craftThread.Abort();
                    while (_craftThread.IsAlive)
                    {
                    }
                }
            }

            this.Title = "Crafting Bot";

            _craftWorker = new CraftWorker(_keyConditions)
            {
                MaxCrafts = int.Parse(txt_SynthLimit.Text), Paused = false
            };

            if (lst_SynthMode.SelectedIndex == 1)
            {
                _craftWorker.ScriptMode = true;
                _craftWorker.CraftAi    = _craftingAI;
                _craftWorker.CraftAi.Initialize();
            }

            _craftThread = new Thread(new ThreadStart(_craftWorker.DoWork));

            _craftThread.Start();

            while (!_craftThread.IsAlive)
            {
            }

            Debug.Print("Thread Started");
        }
Esempio n. 2
0
        private void btn_Start_Click(object sender, RoutedEventArgs e)
        {
            if (_craftThread != null)
                if (_craftThread.IsAlive)
                {
                    _craftThread.Abort();
                    while (_craftThread.IsAlive)
                    {
                    }
                }

            this.Title = "Crafting Bot";

            _craftWorker = new CraftWorker(_keyConditions) {MaxCrafts = int.Parse(txt_SynthLimit.Text), Paused = false};

            if (lst_SynthMode.SelectedIndex == 1)
            {
                _craftWorker.ScriptMode = true;
                _craftWorker.CraftAi = _craftingAI;
                _craftWorker.CraftAi.Initialize();
            }

            _craftThread = new Thread(new ThreadStart(_craftWorker.DoWork));

            _craftThread.Start();

            while (!_craftThread.IsAlive)
            {
            }

            Debug.Print("Thread Started");
        }