• Visit Rebornbuddy
  • Crafting Window and Plugin

    Discussion in 'Rebornbuddy Support' started by nishalp, Aug 26, 2015.

    1. nishalp

      nishalp Member

      Joined:
      Sep 13, 2014
      Messages:
      174
      Likes Received:
      4
      Trophy Points:
      18
      From a Plugin, is there any exposed interface to set the amount of Normal Quality and / or High Quality for each of the ingredients? I am able to select the recipe. Just cant seem to find a way to select the ingredient amounts.
       
    2. Cloud30000

      Cloud30000 New Member

      Joined:
      May 9, 2015
      Messages:
      298
      Likes Received:
      7
      Trophy Points:
      0
      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
       
    3. nishalp

      nishalp Member

      Joined:
      Sep 13, 2014
      Messages:
      174
      Likes Received:
      4
      Trophy Points:
      18
      Perfect. Thanks for that.

       
    4. nishalp

      nishalp Member

      Joined:
      Sep 13, 2014
      Messages:
      174
      Likes Received:
      4
      Trophy Points:
      18
      So I tried the following from the Reborn Console. It gets all the data and ingredients and things. Looking at the listbeth code its just setting the prefer NQ or HQ mats as -1 or -2 for each ingredient into a int array for the number of ingredients in the recipe. This recipe has 4 ingredients however when I run this, I get no error but it does not set the material amount in the UI or start to synch. Output is below from this script. Any ideas?

      Code:
      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();
      Output from running:
      Sohm Al Tart
      0,0,12893,44,3,3
      109,0,4848,0,0,1
      102,0,4852,0,0,1
      0,0,12881,2,2,2
      0,0,0,0,0,0
      0,0,0,0,0,0
       

    Share This Page