private void autoLocateTables(bool resetMouse) { TextToSpeech.SayAsnc(settings, "Locating tables"); // update UI autoLocateTablesUI(); // table if (resetMouse) { app.ResetMouse(); } // open tables (-> table container added by delegate) app.OpenNewTables(); }
private void startLogic(bool resetMouse) { if (InvokeRequired) { BeginInvoke(new StartLogicDelegate(startLogic), new object[] { resetMouse }); } else { // auto stop autoStopOccured = false; // replace time randomReplaceTime(); // stop time randomAutoStopTime(); // runtime timer timerRuntime.Start(); // logic app.Start(resetMouse); // log Security.StartSession(config["user"], settings.Name, settings.AutoLocateTablesNum, app.RulesCount); // ui buttonStart.Enabled = false; buttonStartBottom.Enabled = false; buttonStop.Enabled = true; buttonStopButtom.Enabled = true; // log TextToSpeech.SayAsnc(settings, "Bot started"); } }
private void sitIn() { TextToSpeech.SayAsnc(settings, "Sit in"); app.SitIn(); }
private void loadDevice() { try { if (!isLoaded) { // logic int vmWidth = int.Parse(config["vmWidth"]); int vmHeight = int.Parse(config["vmHeight"]); app = new BotAppLogic(new VirtualBoxControl(this.textBoxVM.Text, vmWidth, vmHeight), settings); // callbacks app.TableFoundEvent += delegate(TableContainer table) { addTableToUI(table); }; app.RemoveTableEvent += delegate(TableContainer table) { removeTableFromUI(table); }; app.ContainersChangedEvent += delegate(int tables) { setTableLabelText(tables); }; app.ResetTablesEvent += delegate() { resetTablesUI(); }; app.StartSessionEvent += delegate() { randomReplaceTime(); }; app.TotalMoneyChangedEvent += delegate(double totalMoney) { setMoneyLabelText(totalMoney); }; app.ReplaceMinsLeftEvent += delegate(int mins) { setReplaceMinsLabelText(mins); }; // ui buttonDevice.Text = "Unload Device"; isLoaded = true; buttonScan.Enabled = true; buttonAuto.Enabled = true; buttonAutoStart.Enabled = true; // log TextToSpeech.SayAsnc(settings, "Virtual machine started"); } else { app.DeviceControl.Suspend(); buttonDevice.Text = "Load Device"; isLoaded = false; buttonScan.Enabled = false; buttonAuto.Enabled = false; buttonAutoStart.Enabled = false; } } catch (Exception ex) { ErrorHandler.ReportException(ex, "device"); MessageBox.Show(ex.Message, "Error load device", MessageBoxButtons.OK, MessageBoxIcon.Error); } }