public override async Task <bool> BehaviorRoutine() { if (await base.BehaviorRoutine()) { return(true); } if (IsDone) { return(false); } //Requires Anvil if (Skill == SkillLine.Blacksmithing || Skill == SkillLine.Engineering) { if (_movement != null && await _movement.MoveTo(false)) { return(true); } } Frame f = new Frame("TradeSkillFrame"); //PreCheck (close any tradeskill frames!) if (!_prechecks) { if (f.IsVisible) { LuaCommands.CloseTradeSkillFrame(); await CommonCoroutines.SleepForRandomUiInteractionTime(); await Coroutine.Sleep(StyxWoW.Random.Next(750, 2222)); } _prechecks = true; await CommonCoroutines.SleepForRandomUiInteractionTime(); } //Open Crafting Spellbook if (!LuaEvents.TradeSkillFrameOpen) { WoWSpell.FromId(SkillBookId).Cast(); await CommonCoroutines.SleepForRandomUiInteractionTime(); await Coroutine.Sleep(StyxWoW.Random.Next(1777, 3333)); return(true); } //Craft Item if (!Spell.Cooldown && Spell.CanCast) { await CommonCoroutines.WaitForLuaEvent( "BAG_UPDATE", 10000, () => false, Spell.Cast); return(true); } //Close UI if (f.IsVisible) { LuaCommands.CloseTradeSkillFrame(); await CommonCoroutines.SleepForRandomUiInteractionTime(); } return(false); }