Thread Tools Display Modes
04/09/14, 07:58 AM   #1
ZaneMcDougal
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 2
Problem getting correct data from GetSkillLineXPInfo()

From the API on ESOUI wiki:

GetSkillLineXPInfo(SkillType skillType, luaindex skillIndex)

Returns: integer lastRankXp, integer nextRankXP, integer currentXP

my code: (8,6) corresponds to woodworking

xp1, xp2, xp3 = GetSkillLineXPInfo(8,6);

result:
xp1 = nil
xp2 = nil
xp3 = lastRankXP

Pretty sure i'm screwing something up but have no idea.

p.s. Spent 3 hours debugging only to realize I put a space in my "elseif's" (else if vice elseif) = FAIL.
  Reply With Quote
04/09/14, 08:23 AM   #2
Sharp
 
Sharp's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 32
You could try to use the Global for TradeskillType Woodworking:

CRAFTING_TYPE_WOODWORKING

Lua Code:
  1. xp1, xp2, xp3 = GetSkillLineXPInfo(CRAFTING_TYPE_WOODWORKING,6);


Judging from the wiki here Woodworking is not a Skilltype, just SKILL_TYPE_TRADESKILL.
  Reply With Quote
04/09/14, 08:36 AM   #3
Xrystal
caritas omnia vincit
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 369
I've used the Skill Line info in my addons. But stop before using the XP side. Here's what I have used it for.

Use the tradeskill constant to get access to the skilltype.

local skillType,skillIndex = GetCraftingSkillLineIndices(tradeSkill)

You then use skillType and skillIndex to get the rest of the information.
local skillName,skillRank = GetSkillLineInfo(skillType,skillIndex)
local lastRankXp, nextRankXP, currentXP = GetSkillLineXPInfo(skillType, skillIndex)
local numAbilities = GetNumSkillAbilities(skillType, skillIndex)

And then onto the ability specific functions etc.

Last edited by Xrystal : 04/09/14 at 08:41 AM.
  Reply With Quote
04/09/14, 04:04 PM   #4
Iyanga
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 183
Originally Posted by ZaneMcDougal View Post
p.s. Spent 3 hours debugging only to realize I put a space in my "elseif's" (else if vice elseif) = FAIL.
You should get a LUA editor with a parser. It will tell you without painful debugging whether at least your syntax is right or not.
  Reply With Quote
04/09/14, 09:04 PM   #5
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 648
I heartily endorse Notepad++ if you're on Windows.
http://notepad-plus-plus.org/
  Reply With Quote

ESOUI » Developer Discussions » Lua/XML Help » Problem getting correct data from GetSkillLineXPInfo()

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off