private static async Task <bool> MailboxInteraction(C_WoWObject mailbox, Dictionary <string, List <C_WoWItem> > items) { if (MailHelper.IsOpen) { //Click Send Mail Tab if (!LuaCommands.IsSendMailFrameVisible()) { LuaCommands.ClickSendMailTab(); await CommonCoroutines.SleepForRandomUiInteractionTime(); return(true); } foreach (var keypair in items) { GarrisonBase.Log("Found {0} items to mail", keypair.Value.Count); bool success = await SendMail(keypair.Key, keypair.Value); if (!success) { GarrisonBase.Debug("Sending Mail Failed!"); return(false); } await Coroutine.Yield(); return(true); } } if (StyxWoW.Me.IsMoving) { await CommonCoroutines.StopMoving(); } await CommonCoroutines.SleepForLagDuration(); mailbox.Interact(); await CommonCoroutines.SleepForRandomUiInteractionTime(); return(true); }