Перейти к содержанию

Дайджесты за январь-февраль

Обновления гайдов и аддонов

Январь Февраль

Мониторинг серверов и редактор аддонов

Представляем вам две легенды. То, о чем можно было только мечтать, стало реальностью.

Мониторинг серверов Редактор аддонов

Подсказки из игры на вашем сайте

Теперь вы можете отображать сведения о внутриигровых элементах простым наведением курсора мыши.

Подробнее

Апдейтер аддонов

Представляем вам программу для автообновления аддонов и делимся подробностями.

Подробнее Скачать

Getting items one can craft


North

Рекомендуемые сообщения

I want to get the data for the items I can craft. It would be great if anybody can help me. This is what I tried (besides many other calls). I think avatar.GetArmorCraftInfo is the function to use but I don't know how to get that skillId.

local skills = avatar.GetSkills ()
for i = 0, GetTableSize (skills) - 1 do
 local skillInfo = avatar.GetSkillInfo (skills [i])
 if skillInfo then
  LogInfo (skillInfo.name)
  local armorCraft = avatar.GetArmorCraftInfo (skillInfo.id)
  if armorCraft and armorCraft.active then
   local recipesList = armorCraft.recipes
   researchObj('', recipesList);
  end
 end
end

Any help will be greatly appreciated

Ссылка на комментарий
Поделиться на другие сайты

I don't know what you want to say. It is a function I use to see what information I get.

function researchObj(tab,obj)
   tab = tab .. "    "
   --- limit the recursion
   if string.len (tab) > 50 then
    LogInfo ("Recursion is limited!")
    return
   end
   local metaTable = getmetatable (obj)
   if metaTable then
    ---- Show the function of the object
    for k,v in pairs( metaTable ) do
	    LogInfo ( tab, k,":=",v)
    end
   end
   if type(obj) == "table" then
    ---- Show the fields (variables) of the table
    if GetTableSize( obj ) == 0
	    then LogInfo ( tab, "{}")
	    return
	    end
    for k,v in pairs(obj) do
	    LogInfo ( tab, k,":=",v,  "{", type (v), "}")
	    if type (v) == "table" and k ~= "__index"  and k ~= "_G" then
		    --- "__index" - It is exactly the same table is a nested loop that leads to
		    researchObj(tab,v)
	    end
    end
   else
    LogInfo ( tab, "_:=",obj, "{", type (obj), "}")
   end
end

Ссылка на комментарий
Поделиться на другие сайты

seeScriptLIB.lua in AddonsTools addon

okey

for i, skillId in avatar.GetSkills () do
 local skillInfo = avatar.GetSkillInfo (skillId)
 if skillInfo then
  exObj2("skillInfo", skillInfo)
  local armorCraft = avatar.GetArmorCraftInfo (skillInfo.id)
  exObj2("recipes", armorCraft.recipes);
 end
end

Ссылка на комментарий
Поделиться на другие сайты

Thank you icreator. exObj2 is really useful.

My problem is that I get the following error:

Game::LuaAvatarGetArmorCraftInfo: skill Mechanics/Skills/BlacksmithV2/Blacksmith.(DiceCraftSkillResource).xdb is not armor craft, details: int __cdecl Game::LuaAvatarGetArmorCraftInfo(struct lua_State *)

I am not able to get a list of the recipes I can craft. I've managed to get such a list for alchemy. I would like to do the same for Blacksmithing for example.

local alchemy = avatar.GetAlchemyInfo ()
exObj2('alchemy', alchemy);
for i, recipe in alchemy.recipes do
 local recipeInfo = avatar.GetRecipeInfo (recipe)
 exObj2('recipe', recipeInfo);
end

Ссылка на комментарий
Поделиться на другие сайты

craft.DiceCraftGetRecipes()

local recipes = craft.DiceCraftGetRecipes()

if recipes and recipes[0] then

LogInfo( avatar.GetRecipeInfo(recipes[0]) )

end

Ссылка на комментарий
Поделиться на другие сайты

Гость
Ответить в этой теме...

×   Вставлено с форматированием.   Восстановить форматирование

  Разрешено использовать не более 75 эмодзи.

×   Ваша ссылка была автоматически встроена.   Отображать как обычную ссылку

×   Ваш предыдущий контент был восстановлен.   Очистить редактор

×   Вы не можете вставлять изображения напрямую. Загружайте или вставляйте изображения по ссылке.

×
×
  • Создать...

Важная информация

Пользуясь сайтом, вы принимаете Условия использования