It mostly depends on what sort of profile you're dealing with.
For the
Questing botbase, you could easily write in a disenchant logic with the DoWhen hook.
Here's an example of having it disenchant all
greens that you pick up:
PHP:
<CustomBehavior File="RunCode" Type="Definition" ><=!=[=C=D=A=T=A=[
public static bool HaveGreen()
{
bool HaveItem = Me.BagItems.Any(item => item.Quality == WoWItemQuality.Uncommon && item.RequiredEnchantingLevelToDisenchant <= StyxWoW.Me.GetSkill(333).CurrentValue);
return HaveItem;
}
public static async Task DisenchantGreens()
{
var disenchantList = Me.BagItems.Where(item => item.Quality == WoWItemQuality.Uncommon && item.RequiredEnchantingLevelToDisenchant <= StyxWoW.Me.GetSkill(333).CurrentValue);
foreach (WoWItem disenchantMe in disenchantList)
{
await CommonCoroutines.StopMoving();
SpellManager.Cast(13262);
Bots.Professionbuddy.PBLog.Log(System.Windows.Media.Colors.DeepSkyBlue, "[Profile Disenchanter] ", System.Windows.Media.Colors.LightGreen, $"Disenchanting > {disenchantMe.Name}");
await Coroutine.Sleep(650);
disenchantMe.Use();
await Coroutine.Wait(2000, () => LootFrame.Instance.IsVisible);
LootFrame.Instance.LootAll();
await Coroutine.Wait(2000, () => !LootFrame.Instance.IsVisible);
}
}
]=]=>
</CustomBehavior>
<CustomBehavior File="Hooks\DoWhen" LogExecution="false" ActivityName="DisenchantGreens" UseWhen="HaveGreen()">
<CustomBehavior File="RunCode" Code="await DisenchantGreens();" />
</CustomBehavior>
Or, if you want it in plugin form - that's possible as well.
Here's an example of a plugin that will disenchant
all greens, blues and purples that you have in your inventory: