public override void Run() { Logger.LogDebug("************ RUNNING DISENCHANT STATE ************"); Step currentStep = profession.CurrentStep; List <WoWItem> bagItems = Bag.GetBagItem(); List <WoWItem> itemsToDisenchant = profession.ItemsToDisenchant; MovementManager.StopMoveNewThread(); // Deactivate broadcast Broadcaster.autoBroadcast = false; foreach (WoWItem item in itemsToDisenchant) { List <int> bagAndSlot = Bag.GetItemContainerBagIdAndSlot(item.Name); Logger.Log($"Disenchanting item {item.Name} (iLvl {item.GetItemInfo.ItemLevel})"); Disenchant.Launch(); if (Main.wowVersion > 1) { Lua.LuaDoString("UseContainerItem(" + bagAndSlot[0] + "," + bagAndSlot[1] + ")"); } else { Lua.LuaDoString("PickupContainerItem(" + bagAndSlot[0] + "," + bagAndSlot[1] + ")"); } Usefuls.WaitIsCasting(); } profession.ReevaluateStep(); Broadcaster.autoBroadcast = true; }
public override void Run() { Logger.LogDebug("************ RUNNING CRAFT ONE STATE ************"); Step currentStep = profession.CurrentStep; MovementManager.StopMoveNewThread(); // Deactivate broadcast Broadcaster.autoBroadcast = false; // Craft Logger.Log($"Crafting {currentStep.ItemoCraft.Name}"); ToolBox.Craft(profession.Name.ToString(), currentStep.ItemoCraft, 1); Logger.Log("Craft complete"); ToolBox.CloseProfessionFrame(); Lua.RunMacroText("/stopcasting"); profession.ReevaluateStep(); profession.SetContext(); Broadcaster.autoBroadcast = true; }
public override void Run() { Logger.LogDebug("************ RUNNING ENCHANT STATE ************"); Step currentStep = profession.CurrentStep; MovementManager.StopMoveNewThread(); // Deactivate broadcast Broadcaster.autoBroadcast = false; //Debugger.Launch(); //Debugger.Break(); // amountAlreadyCrafted NOT USED ANYMORE ????? //int amountAlreadyCrafted = ToolBox.GetAlreadyCrafted(profession.ProfessionName.ToString(), currentStep.itemoCraft.name); //Logger.Log($"We've already crafted {amountAlreadyCrafted} {currentStep.itemoCraft.name}"); // Craft (has to be craft to level) int amountEnchant = currentStep.GetRemainingProfessionLevels(); Logger.Log($"Enchanting x {amountEnchant}"); for (int i = 0; i < amountEnchant; i++) { if (currentStep.HasMatsToCraftOne() && ToolBox.GetProfessionLevel(profession.Name) < currentStep.LevelToReach) { ToolBox.Craft(profession.Name.ToString(), currentStep.ItemoCraft, 1); Thread.Sleep(100); } } Logger.Log("Enchant complete"); ToolBox.CloseProfessionFrame(); Lua.RunMacroText("/stopcasting"); profession.ReevaluateStep(); Broadcaster.autoBroadcast = true; }