var synth = new Synthesize();
uint rcipeId = CraftContext.Current.Recipe.Id;
synth.RecipeId = rcipeId;
int matNumbers = Database.Recipes.First(r => r.Id == rcipeId).Ingredients
.Count(i => !CharacterStatus.ShardIds.Contains(i.Id));
var mats = new int[matNumbers];
for (int i = 0; i < mats.Length; i++)
{
mats[i] = LisbethSettings.Instance.UseHqMatsFirst ? -1 : -2;
}
synth.HQMats = mats;
bool result = false;
try { result = await synth.StartCrafting(); }
catch { Logger.LogError("The Synthesize exception was thrown."); }
if (!result) { return false; }
Logger.Log("Remaining Amount: {0}", CraftContext.Current.Amount
- CharacterStatus.GetItemAmount(CraftContext.Current.ItemId));
return true;
Here is a small snippet from how the old Lisbeth handled Nq/Hq mats:
Code:var synth = new Synthesize(); uint rcipeId = CraftContext.Current.Recipe.Id; synth.RecipeId = rcipeId; int matNumbers = Database.Recipes.First(r => r.Id == rcipeId).Ingredients .Count(i => !CharacterStatus.ShardIds.Contains(i.Id)); var mats = new int[matNumbers]; for (int i = 0; i < mats.Length; i++) { mats[i] = LisbethSettings.Instance.UseHqMatsFirst ? -1 : -2; } synth.HQMats = mats; bool result = false; try { result = await synth.StartCrafting(); } catch { Logger.LogError("The Synthesize exception was thrown."); } if (!result) { return false; } Logger.Log("Remaining Amount: {0}", CraftContext.Current.Amount - CharacterStatus.GetItemAmount(CraftContext.Current.ItemId)); return true;
Synthesize() is a ProfileBehavior class/object from ff14bot.NeoProfiles.Tags
By creating an instance of Synthesize, you can then customize all the properties normally found in an Orderbot profile and open the crafting window with it's StartCrafting() function
ClearLog();
var r = CraftingManager.CurrentRecipe;
Log(r.CurrentLocaleName);
var mats = new int[4];
foreach (var i in r.Ingredients)
{
Log("{0},{1},{2},{3},{4},{5}", i.HqInInventory, i.HqSelected, i.ItemId, i.NormalInInventory, i.NqSelected, i.TotalNeeded);
}
var synth = new ff14bot.NeoProfiles.Tags.Synthesize();
synth.RecipeId = CraftingManager.CurrentRecipeId;
mats[0]=-1;
mats[1]=-1;
mats[2]=-1;
mats[3]=-1;
synth.HQMats = mats;
synth.StartCrafting();