You could store the racialPatternId in a variable, because you never switch characters once the AddOn is loaded.
Something like this:
Lua Code:
local racialId
local function getRacialId()
if racialId then return racialId end
local characterId = GetCurrentCharacterId()
for i = 1, GetNumCharacters() do
local _, _, _, _, raceId, _, id, _ = GetCharacterInfo(i)
if (characterId == id) then
return raceId
end
end
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:
local autocraft = true
-- you could use some function, that handles the crafting results and stuff, but nil should be fine for now
local callbackfunction = nil
local LLC = LibLazyCrafting:AddRequestingAddon(LazyCraftingCertification.name, autocraft, callbackfunction )
-- and then use it like
LLC.CraftSmithingItemByLevel(7, false, 1, getRacialId(), 1, false, CRAFTING_TYPE_BLACKSMITHING, 0, 1, true)
Careful, didn't test it.