public override async Task <bool> BehaviorRoutine() { if (await base.BehaviorRoutine()) { return(true); } if (IsDone) { return(false); } LuaCommands.ClickStaticPopupButton(_buttonIndex); await CommonCoroutines.SleepForRandomUiInteractionTime(); return(true); }
private async Task <bool> Interaction() { /* * Check Cursor Spell ID * Click Interaction * Await for event CURRENT_SPELL_CAST_CHANGED * -If event did not fire then check for confirmation popup * * Item Interaction * * */ if (Player.CurrentPendingCursorSpellId == 160201) { //Item Interaction! GarrisonBase.Log("Disenchant Cursor!"); if (Player.Inventory.DisenchantItems.Count > 0) { var item = Player.Inventory.DisenchantItems[0]; GarrisonBase.Debug("Disenchanting Item {0} ({1}) Quality {2}", item.Name, item.Entry, item.Quality); bool bagChanged = await CommonCoroutines.WaitForLuaEvent( "BAG_UPDATE", 6200, null, item.Use); PlayerInventory.ItemDisenchantingBlacklistedGuids.Add(item.Guid); //Force update if bag didn't change.. (so we ignore this item now) if (!bagChanged) { Player.Inventory.UpdateBagItems(); } return(true); } return(false); } bool cursorChanged = await CommonCoroutines.WaitForLuaEvent( "CURRENT_SPELL_CAST_CHANGED", StyxWoW.Random.Next(555, 2002), null, DisenchantingObject.Interact); await CommonCoroutines.SleepForRandomUiInteractionTime(); await Coroutine.Yield(); await Coroutine.Sleep(StyxWoW.Random.Next(1222, 2222)); if (!cursorChanged) { if (LuaCommands.IsStaticPopupVisible()) { LuaCommands.ClickStaticPopupButton(1); await CommonCoroutines.SleepForRandomUiInteractionTime(); return(true); } GarrisonBase.Err("Could not find static popup confirmation frame!"); } return(true); }
private static async Task <bool> DisenchantForgeInteraction(C_WoWGameObject disenchantobject, List <C_WoWItem> items) { if (disenchantobject.GetCursor != WoWCursorType.InteractCursor) { GarrisonBase.Debug("Disenchant Interaction failed -- Cursor was not InteractCursor!"); return(false); } if (Player.CurrentPendingCursorSpellId == 160201) { //Item Interaction! GarrisonBase.Log("Disenchant Cursor!"); if (items.Count > 0) { var item = items[0]; GarrisonBase.Debug("Disenchanting Item {0} ({1}) Quality {2}", item.Name, item.Entry, item.Quality); bool bagChanged = await CommonCoroutines.WaitForLuaEvent( "BAG_UPDATE", 6200, null, item.Use); PlayerInventory.ItemDisenchantingBlacklistedGuids.Add(item.Guid); //Force update if bag didn't change.. (so we ignore this item now) if (!bagChanged) { Player.Inventory.UpdateBagItems(); } return(true); } return(false); } bool cursorChanged = await CommonCoroutines.WaitForLuaEvent( "CURRENT_SPELL_CAST_CHANGED", StyxWoW.Random.Next(555, 2002), null, disenchantobject.Interact); await CommonCoroutines.SleepForRandomUiInteractionTime(); await Coroutine.Yield(); await Coroutine.Sleep(StyxWoW.Random.Next(1222, 2222)); if (!cursorChanged) { if (LuaCommands.IsStaticPopupVisible()) { LuaCommands.ClickStaticPopupButton(1); await CommonCoroutines.SleepForRandomUiInteractionTime(); return(true); } } return(true); }