View Single Post
01/05/24, 11:15 AM   #2
wookiefriseur
 
wookiefriseur's Avatar
Join Date: Mar 2014
Posts: 53
You could store the racialPatternId in a variable, because you never switch characters once the AddOn is loaded.

Something like this:

Lua Code:
  1. local racialId
  2.  local function getRacialId()
  3.   if racialId then return racialId end
  4.  
  5.  local characterId = GetCurrentCharacterId()
  6.   for i = 1, GetNumCharacters() do
  7.     local _, _, _, _, raceId, _, id, _ = GetCharacterInfo(i)
  8.     if (characterId == id) then
  9.       return raceId
  10.     end
  11.  end
  12. end

Regarding LLC, don't know but looks like you have to register your AddOn with LibLazyCrafting and then you get a function table that you can use. Something like:

Lua Code:
  1. local autocraft = true
  2.  
  3. -- you could use some function, that handles the crafting results and stuff, but nil should be fine for now
  4. local callbackfunction = nil
  5.  
  6. local LLC = LibLazyCrafting:AddRequestingAddon(LazyCraftingCertification.name, autocraft, callbackfunction )
  7.  
  8. -- and then use it like
  9. LLC.CraftSmithingItemByLevel(7, false, 1, getRacialId(), 1, false, CRAFTING_TYPE_BLACKSMITHING, 0, 1, true)

Careful, didn't test it.
  Reply With Quote