WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   I think i need help here (old dr.damage) (https://www.wowinterface.com/forums/showthread.php?t=50859)

Uitat 12-25-14 09:22 AM

I think i need help here (old dr.damage)
 
so i am getting the error GetNumTalents = nil

i understand that his has been removed from the API but i can not figure out how to bypass it/fix it

it seems to be happening here in this code

actualll line of code in the real Program is 2207 -2237
the error fires off at line 2209 and states GetNumTalents = nil
in this bit of code it would be line 3

Lua Code:
  1. local talentTable = optionsTable.Talents.args
  2.     for t = 1, GetNumSpecializations() do
  3.         for i = 1, GetNumTalents(t) do --
  4.             local talentName, icon, _, _, _, maxRank = GetTalentInfo(t, i)
  5.             if talentInfo[talentName] and not talentInfo[talentName].NoManual then
  6.                 talentTable[(string_gsub(talentName," +", ""))] = {
  7.                     type = 'range',
  8.                     name = "|T" .. icon .. ":20:20:-5:0|t" .. talentName,
  9.                     --disabled = function() return self.CustomTalents end,
  10.                     min = 0,
  11.                     max = maxRank,
  12.                     step = 1,
  13.                     order = 3 + i + (t-1) * 50,
  14.                     get =   function() return talents[talentName] or 0 end,
  15.                     set =   function(info, v)
  16.                                 if v == 0 and not talentInfo[talentName].Manual then
  17.                                     talents[talentName] = nil
  18.                                 else
  19.                                     talents[talentName] = v
  20.                                 end
  21.                                 self:UpdateTalents(true)
  22.                             end,
  23.                 }
  24.             end
  25.         end
  26.         talentTable[("Tab" .. t)] = {
  27.             type = 'header',
  28.             name = --[["|T" .. select(2,GetSpecializationInfo(t)) .. ":30:30:-7:0|t" ..--]] select(2,GetSpecializationInfo(t)),
  29.             order = 2 + (t-1) * 49,
  30.         }
  31.     end

sirann 12-25-14 03:17 PM

http://wowprogramming.com/docs/api/GetNumTalents

It's no longer a thing. So it doesn't know what to do with getnumtalents. I'd figure out the api you need, but I'm on my phone and I hate searching for stuff when it's so easy comparatively on a computer.

E: could try looking at this: http://wowprogramming.com/docs/api/GetTalentInfo

Xrystal 12-25-14 04:11 PM

Don't forget to check wowpedia.org too. It looks like that site is more updated with the 6.0 functions for this area.

Talent Functions
  • CheckTalentMasterDist() - Returns nil if the player is too far away from the talent master to use the talent methods.
  • ConfirmTalentWipe() - Confirms freeing all talent points.
  • GetMaxTalentTier() - Returns the number of available talent tiers.
  • GetNumTalents([inspect]) - Returns the maximum talent slot index.
  • GetNumUnspentTalents() - Returns the number of unspent talents.
  • GetTalentClearInfo() - Returns information about the current cost of unlearning a talent
  • GetTalentInfo(talentID[,isInspect[,specGroup[,inspectID[, classID]]]])- Returns information about a talent.
  • GetTalentLink(talentID[,isInspect[,specGroup[,inspectID[, classID]]]]) - Returns the talent link.
  • GetTalentRowSelectionInfo(tier) - Returns information about the player's talent selection in the specified talent tier.
  • IsTalentSpell(slot, bookType) - Returns whether or not the specified spell is learned from a talent.
  • REMOVED LearnTalent(tabIndex,talentIndex) - Learns a talent from the talent tree. Renamed to LearnTalents (5.0.4)
  • NOCOMBAT LearnTalents(talentID1, talentID2, etc..) - Learns the talents listed.
  • PickupTalent(talentID) - Grabs the selected talent spell for placement on an action bar.
  • NOCOMBAT RemoveTalent(talentID) - Removes the specified talent.

Specialization Functions
  • GetActiveSpecGroup([isInspect]) - Returns the index of the current active specialization/talent/glyph group.
  • GetArenaOpponentSpec() -
  • GetInspectSpecialization("unit") - Returns a number representing the current active specialization of a given unit.
  • GetNumArenaOpponentSpecs() -
  • GetNumSpecGroups([isInspect]) - Returns the number of specialization group (dual specs) the player has.
  • GetNumSpecializations([isInspect[, isPet]]) - Returns the number of available specializations.
  • GetNumSpecializationsForClassID(classID) - Returns the number of specializations available to a particular class.
  • GetSpecialization([isInspect[, isPet[, specGroup]]]) - Returns the index of the player's current specialization.
  • GetSpecializationInfo(specIndex[, isInspect[, isPet]]) - Returns information about the player's specializations.
  • GetSpecializationInfoByID(specID) - Returns information about the specified specialization.
  • GetSpecializationInfoForClassID(classID, specIndex) - Returns information about the specified specialization.
  • GetSpecializationMasterySpells(specIndex[, isInspect[, isPet]]) - Returns the mastery spellID of the current player's specialization.
  • GetSpecializationRole(specIndex[, isInspect[, isPet]]) - Returns the role a specialization is intended to perform.
  • GetSpecializationRoleByID(specID) - Returns the role a specialization is intended to perform.
  • GetSpecializationSpells(specIndex[, isInspect[, isPet]]) - Returns the spellID of key abilities used by the specified specialization.
  • GetSpecsForSpell("spellName" or spellIndex, "bookType") - Returns the specs for which the specified spell can be used.
  • IsSpellClassOrSpec("spellName" or spellIndex, "bookType") - Returns whether a given spell is specific to a specialization and/or class.
  • NOCOMBAT SetActiveSpecGroup(groupIndex) - Changes the active specialization group.
  • NOCOMBAT SetSpecialization(specIndex [, isPet]) - Selects a specialization.
  • NOCOMBAT UnlearnSpecialization(specIndex [, isPet]) -

Phanx 12-26-14 11:28 PM

Why exactly are you trying to update Dr. Damage? There's absolutely no need for such an addon anymore, since your spell tooltips now display the actual amount of damage each spell will do with your current stats. Dr. Damage exists because that used to not be the case -- the tooltip only showed the base amount, and the addon had to do a lot of work to estimate the actual amount based on your gear, talents, etc. Doing all that work yourself at this point would just be pointless redundancy.

If all you want to do is show the damage numbers on your action bars, there's a much easier way to do that -- just pull the number out of the tooltip and show it. No talent checking or other theorycrafting required.

Uitat 12-27-14 07:18 AM

Quote:

Originally Posted by Phanx (Post 303318)
Why exactly are you trying to update Dr. Damage? There's absolutely no need for such an addon anymore, since your spell tooltips now display the actual amount of damage each spell will do with your current stats. Dr. Damage exists because that used to not be the case -- the tooltip only showed the base amount, and the addon had to do a lot of work to estimate the actual amount based on your gear, talents, etc. Doing all that work yourself at this point would just be pointless redundancy.

If all you want to do is show the damage numbers on your action bars, there's a much easier way to do that -- just pull the number out of the tooltip and show it. No talent checking or other theorycrafting required.

thank you i never though of that Phanx, once again your the bomb. seems i never like to see the easy way


All times are GMT -6. The time now is 04:53 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI