private void btnNavigateToGlobalTradeDepot_Click(object sender, EventArgs e) { this.btnNavigateToGlobalTradeDepot.BackColor = Color.YellowGreen; navigateToBuilding.NavigateTo(BuildingMatch.Get(Building.GlobalTrade), 1); this.btnNavigateToGlobalTradeDepot.BackColor = this.tradeWindow.IsGlobalTradeVisible() ? Color.Green : Color.Red; }
private void bntCollectSales_Click(object sender, EventArgs e) { this.bntCollectSales.BackColor = Color.YellowGreen; navigateToBuilding.NavigateTo(BuildingMatch.Get(Building.TradeDepot), 1); if (!this.tradeWindow.IsTradeDepotLogoVisible()) { this.bntCollectSales.BackColor = Color.Red; return; } btnCaptureImagesTradeDepot_Click(sender, e); salesman.CollectSales(); this.bntCollectSales.BackColor = Color.Gray; }
private void btnNavigateTo_Click(object sender, EventArgs e) { this.btnNavigateTo.BackColor = Color.YellowGreen; foreach (BuildingMatch buildingMatch in BuildingMatch.Create()) { if (buildingMatch.Building.ToString() == cboBuilding.SelectedItem.ToString()) { this.btnNavigateTo.BackColor = navigateToBuilding.NavigateTo(buildingMatch, 1)? Color.Green : Color.Red; // pick up any items touch.ClickAt(Bot.Location.CentreMap); // reselect navigateToBuilding.NavigateTo(buildingMatch, 1); } } }
private void btnBuyItemsAndCraft_Click(object sender, EventArgs e) { string itemSold; this.btnTradeDepotStartCapture.Enabled = false; tradeWindow.StopCapture = false; itemHashes.ReadHashes(); while (!tradeWindow.StopCapture) { bool buildingItems = craftsman.Craft(); salesman.Sell(out itemSold); var buyTimeAvailableMilliseconds = (buildingItems ? 120 : 240) * 1000; var sw = new Stopwatch(); sw.Start(); // go to global trade bool result = navigateToBuilding.NavigateTo(BuildingMatch.Get(Building.GlobalTrade), 1); if (result) { while (sw.ElapsedMilliseconds < buyTimeAvailableMilliseconds) { Application.DoEvents(); BuyItemsFromGlobalTrade(); } } else { } } this.btnTradeDepotStartCapture.Enabled = true; }