public static Composite SellCrItemsToVendor() { return(new Decorator(delegate { if (GetNumberOfCrRecipeSetsInInventory() == 1 && chaosRecipeSetsSoldThisCycle < 10) { return true; } return false; }, new Sequence( CommonBehavior.CloseOpenPanels(), SellBehavior.FindVendor(), SellBehavior.MoveToAndOpenVendor(), SellBehavior.OpenVendorSellScreen(), new Action(delegate { Input.KeyDown(Keys.LControlKey); Thread.Sleep(10); foreach (var item in GameController.Game.IngameState.IngameUi.InventoryPanel[InventoryIndex.PlayerInventory].VisibleInventoryItems) { if (IsCrItem(item)) { Mouse.SetCursorPosAndLeftOrRightClick(item.GetClientRectCache, Latency, randomClick: true); Thread.Sleep(Latency); } } Input.KeyUp(Keys.LControlKey); Thread.Sleep(Latency + 100); if (IsNpcOfferValid()) { // click accept button Console.WriteLine("Offer correct"); chaosRecipeSetsSoldThisCycle += 1; hasInitializedSets = false; var acceptButton = WillBot.gameController.IngameState.IngameUi.VendorAcceptButton; Mouse.SetCursorPosAndLeftOrRightClick(acceptButton.GetClientRectCache, Latency, randomClick: true); return RunStatus.Success; } else { Console.WriteLine("Offer incorrect"); // need to fail gracefully somehow.. return RunStatus.Failure; } }), // Testing purposes.. Create a loop. // Close panels. // Run stashie // CommonBehavior.CloseOpenPanels(), CommonBehavior.CloseOpenPanels(), CommonBehavior.CloseOpenPanels() //new Action(delegate { WillBot.Me.HasStashedItemsThisTownCycle = false; return RunStatus.Success; }), //TownBehavior.Stashie() ) )); }
public static Composite EnterBloodAquaducts() { // Find waypoint -> navigate to waypoint-> return(new Sequence( CommonBehavior.CloseOpenPanels(), new Action(delegate { WillBot.Mover.RemoveNavigationDataForCurrentZone(); TestEnterBloodAqua(); Thread.Sleep(4000); return RunStatus.Success; }) )); }