private static void CheckAndClean(int ItemID, AIHeroClient target = null) { if (Player.CanUseItem(ItemID)) { string MenuName = ItemId.GetName(typeof(ItemId), ItemID); if (config["Cleaners"][MenuName] == null) { Game.Print("Not Found menu " + MenuName); return; } foreach (var buffType in DebuffList2) { if (config["Cleaners"][MenuName].GetValue <MenuBool>(buffType.Key)) { if (Player.HasBuffOfType(buffType.Value)) { Player.UseItem(ItemID); return; } else if (target != null && target.HasBuffOfType(buffType.Value)) { Player.UseItem(ItemID, target); return; } } } } }