private void btnTradeDepotStartCapture_Click(object sender, EventArgs e) { this.btnTradeDepotStartCapture.Enabled = false; tradeWindow.StopCapture = false; itemHashes.ReadHashes(); while (!tradeWindow.StopCapture) { BuyItemsFromGlobalTrade(); } this.btnTradeDepotStartCapture.Enabled = true; }
private void btnStartCapture_Click(object sender, EventArgs e) { this.tradeWindow.StopCapture = false; itemHashes.ReadHashes(); while (!this.tradeWindow.StopCapture) { touch.ClickAt(Bot.Location.GlobalTradeRefresh); WaitForSeconds(1); while (CaptureImagesGlobalTrade().Count == 0) { this.Text = "Waiting for new images"; touch.ClickAt(Bot.Location.GlobalTradeRefresh); WaitForSeconds(1); } var panels = itemHashes.ProcessCaptureImages(CaptureImagesGlobalTrade()); buyIfMatchFound(panels); touch.Swipe(Bot.Location.GlobalTradeMiddleRight, Bot.Location.GlobalTradeMiddleRight, Bot.Location.GlobalTradeMiddleLeft, swipeSteps, true); WaitForSeconds(1); panels = itemHashes.ProcessCaptureImages(CaptureImagesGlobalTrade()); buyIfMatchFound(panels); touch.Swipe(Bot.Location.GlobalTradeMiddleRight, Bot.Location.GlobalTradeMiddleRight, Bot.Location.GlobalTradeMiddleLeft, swipeSteps, true); WaitForSeconds(1); panels = itemHashes.ProcessCaptureImages(CaptureImagesGlobalTrade()); buyIfMatchFound(panels); WaitForSeconds(1); WaitFor(this.tradeWindow.IsRefreshGlobalTradeButtonVisible, "Reset Button"); } }
public BotForm() { InitializeComponent(); log = new LogToText(this.txtLog, this); touch = new Touch(log); buildingSelector = new BuildingSelector(log, touch); captureScreen = new CaptureScreen(log); tradeWindow = new TradeWindow(captureScreen, log); navigateToBuilding = new NavigateToBuilding(log, touch, buildingSelector, tradeWindow); resourceReader = new CommerceResourceReader(log, touch); buildItemList = CommerceItemBuild.CreateResourceList(); tradePanelCapture = new TradePanelCapture(tradeWindow); itemHashes = new ItemHashes(new List <PictureBox>(), new List <TextBox>()); itemHashes.ReadHashes(); salesman = new Salesman(touch, tradeWindow, tradePanelCapture, itemHashes, navigateToBuilding, log); craftsman = new Craftsman(log, buildingSelector, navigateToBuilding, touch, resourceReader, buildItemList); }
public TradeDepot() { InitializeComponent(); var log = new LogToText(this.txtLog, this); captureScreen = new CaptureScreen(log); touch = new Touch(log); tradeWindow = new TradeWindow(captureScreen, log); tradePanelCapture = new TradePanelCapture(tradeWindow); buildingSelector = new BuildingSelector(log, touch); navigateToBuilding = new NavigateToBuilding(log, touch, buildingSelector, tradeWindow); tradeWindow.PictureBox = this.pictureBox1; var pictureBoxes = new List <PictureBox>(); var textBoxes = new List <TextBox>(); pictureBoxes.Add(this.pb1); pictureBoxes.Add(this.pb2); pictureBoxes.Add(this.pb3); pictureBoxes.Add(this.pb4); pictureBoxes.Add(this.pb5); pictureBoxes.Add(this.pb6); pictureBoxes.Add(this.pb7); pictureBoxes.Add(this.pb8); textBoxes.Add(this.tb1); textBoxes.Add(this.tb2); textBoxes.Add(this.tb3); textBoxes.Add(this.tb4); textBoxes.Add(this.tb5); textBoxes.Add(this.tb6); textBoxes.Add(this.tb7); textBoxes.Add(this.tb8); itemHashes = new ItemHashes(pictureBoxes, textBoxes); itemHashes.ReadHashes(); salesman = new Salesman(touch, tradeWindow, tradePanelCapture, itemHashes, navigateToBuilding, log); }