Quantcast
Download
(3 Kb)
Download
Updated: 06/18/19 03:52 PM
Compatibility:
Elsweyr (5.0.5)
Wrathstone (4.3)
Murkmire (4.2)
Wolfhunter (4.1)
Summerset (4.0)
Dragon Bones (3.3)
Clockwork City (3.2)
Horns of the Reach (3.1)
Morrowind (3.0)
Homestead (2.7)
One Tamriel (2.6)
Shadows of the Hist (2.5)
Dark Brotherhood (2.4)
Thieves Guild (2.3)
Orsinium (2.2.4)
Updated:06/18/19 03:52 PM
Created:05/24/14 11:45 AM
Monthly downloads:13,546
Total downloads:24,236
Favorites:42
MD5:
5.0.5
LibResearch  Popular! (More than 5000 hits)
Version: 4.0r1
by: Baertram, ingeniousclown, katkat42, Randactyl
This library basically provides a bunch of simple functions to get research information.
The library is accessable via the global variable:
Code:
LibResearch
-> For some time it will be accessible via the library LibStub as well but this will be removed soon in the future:

Lua Code:
  1. local libResearch = LibStub("LibResearch")


Here is the new API:
lua Code:
  1. -- returns true if the character knows or is in the process of researching the supplied trait; else returns false
  2. -- there are a few items, given to the character at the very beginning of the game, that are traited but unresearchable;
  3. -- these will present bugs when used with this function, but these items are very rare
  4. -- this function REPLACES the old function IsCraftingTraitKnownOrResearching()
  5. function libResearch:WillCharacterKnowTrait(craftingSkillType, researchLineIndex, traitIndex)
  6.  
  7. -- returns three values: int traitKey, bool isResearchable, string reason
  8. -- traitKey will be 0 if item is ornate, intricate, or traitless; else it will be the result of GetTraitKey()
  9. -- if isResearchable, then reason will be nil
  10. -- otherwise, reason will be: "WrongItemType", "Ornate", "Intricate", "Traitless", "AlreadyKnown"
  11. -- this function REPLACES DetailedIsItemResearchable() and IsItemResearchable()
  12. function libResearch:GetItemTraitResearchabilityInfo(itemLink)
  13.  
  14. -- Returns an integer representation of the parameters
  15. -- craftingSkillType * 10000 + researchLineIndex * 100 + traitIndex
  16. function libResearch:GetTraitKey( craftingSkillType, researchLineIndex, traitIndex )
  17.  
  18. -- returns the global enums CRAFTING_TYPE_BLACKSMITHING, CRAFTING_TYPE_CLOTHIER, CRAFTING_TYPE_WOODWORKING or CRAFTING_TYPE_JEWELRYCRAFTING
  19. -- if applicable; else returns -1
  20. function libResearch:GetItemCraftingSkill( itemLink )
  21.  
  22. -- returns a trait index suitable for feeding to the global functions GetSmithingLineTraitInfo() et. al.,
  23. -- or returns the string "Ornate" if the item is ornate,
  24. -- or returns the string "Intricate" if the item is intricate,
  25. -- or returns -1 if no trait exists
  26. function libResearch:GetResearchTraitIndex( itemLink )
  27.  
  28. -- returns an index that corresponds to the weapon or armor type within the given crafting skill
  29. -- or returns -1 if not applicable
  30. function libResearch:GetResearchLineIndex( itemLink )
  31.  
  32. -- returns three values: craftingSkill, researchLineIndex, traitIndex for the given item link
  33. function libResearch:GetItemResearchInfo( itemLink )
  34.  
  35. -- returns true if the craftingSkillType is one of the researchable crafts, false otherwise
  36. --> As we got 4 crafting skills now the name is wrong, but all are supported!
  37. function libResearch:IsBigThreeCrafting( craftingSkillType )
  38.  
  39. -- Returns true if the integer you pass in represents Blacksmithing, Clothier, or Woodworking; false otherwise
  40. function libResearch:IsBigThreeCrafting( craftingSkillType )
  41.  
  42. -- returns the below table "researchMap"
  43. function libResearch:GetResearchMap()

Here is the researchMap construct, in case you need it. Note that this can change between patches based on the whims of the game developers...
lua Code:
  1. local researchMap = {
  2.     [BLACKSMITH] = {
  3.         WEAPON = {
  4.             [WEAPONTYPE_AXE] = 1,
  5.             [WEAPONTYPE_HAMMER] = 2,
  6.             [WEAPONTYPE_SWORD] = 3,
  7.             [WEAPONTYPE_TWO_HANDED_AXE] = 4,
  8.             [WEAPONTYPE_TWO_HANDED_HAMMER] = 5,
  9.             [WEAPONTYPE_TWO_HANDED_SWORD] = 6,
  10.             [WEAPONTYPE_DAGGER] = 7,
  11.         },
  12.         ARMOR = {
  13.             [EQUIP_TYPE_CHEST] = 8,
  14.             [EQUIP_TYPE_FEET] = 9,
  15.             [EQUIP_TYPE_HAND] = 10,
  16.             [EQUIP_TYPE_HEAD] = 11,
  17.             [EQUIP_TYPE_LEGS] = 12,
  18.             [EQUIP_TYPE_SHOULDERS] = 13,
  19.             [EQUIP_TYPE_WAIST] = 14,
  20.         },
  21.     },
  22.     --normal for light, +7 for medium
  23.     [CLOTHIER] = {
  24.         ARMOR =  {
  25.             [EQUIP_TYPE_CHEST] = 1,
  26.             [EQUIP_TYPE_FEET] = 2,
  27.             [EQUIP_TYPE_HAND] = 3,
  28.             [EQUIP_TYPE_HEAD] = 4,
  29.             [EQUIP_TYPE_LEGS] = 5,
  30.             [EQUIP_TYPE_SHOULDERS] = 6,
  31.             [EQUIP_TYPE_WAIST] = 7,
  32.         },
  33.     },
  34.     [WOODWORK] = {
  35.         WEAPON = {
  36.             [WEAPONTYPE_BOW] = 1,
  37.             [WEAPONTYPE_FIRE_STAFF] = 2,
  38.             [WEAPONTYPE_FROST_STAFF] = 3,
  39.             [WEAPONTYPE_LIGHTNING_STAFF] = 4,
  40.             [WEAPONTYPE_HEALING_STAFF] = 5,
  41.         },
  42.         ARMOR = {
  43.             [EQUIP_TYPE_OFF_HAND] = 6,
  44.         },
  45.     },
  46.     [JEWELRY_CRAFTING] = {
  47.         ARMOR = {
  48.             [EQUIP_TYPE_NECK] = 1,
  49.             [EQUIP_TYPE_RING] = 2,
  50.         },
  51.     }
  52. }
v4.0r1
Baertram:
-Updated API
-Added AddOnVersion and IsLibrary tags
-Updated library on ESOUI
-Made the library standalone usable via global variable LibResearch
-Library still can be used via LibStub but the name changed to LibResearch, and this will only be kept active for a short time until LibStub wil be obsolete.

v3.0r1
Baertram:
-Added jewelry crafting
-Updated API


v2.0r2
-Fix an insidious bug

v2.0
-Major overhaul:
-new function names
-use itemLinks instead of bagId and slotIndex
-new return values for some functions
-Updated for API patch 100009.

v1.0r4
-Fixed an error introduced because of a misunderstanding about a new API function.

v1.0r3
-Updated for API patch 100008.

v1.0r2
-Added a new function: "IsBigThreeCrafting()". See documentation.


v1.0r1
-Initial release
Optional Files (0)


Archived Files (7)
File Name
Version
Size
Uploader
Date
2.0r2
4kB
katkat42
09/16/14 01:49 PM
2.0
4kB
katkat42
09/13/14 10:27 PM
1.0r4
3kB
katkat42
08/03/14 03:35 PM
1.0r3
3kB
katkat42
08/02/14 12:41 PM
1.0r3
3kB
katkat42
08/02/14 11:15 AM
1.0r2
3kB
ingeniousclown
05/25/14 08:12 PM
1.0r1
3kB
05/24/14 11:45 AM


Post A Reply Comment Options
Unread 08/04/14, 11:16 AM  
Morwo
 
Morwo's Avatar

Forum posts: 44
File comments: 100
Uploads: 0
hi there,
i get lua errors, with LibResearch mentioned in it. they dont stop, even if i turn tis lib off as an addon, anoying because i get tons of po ups. never ending.

Report comment to moderator  
Reply With Quote
Unread 08/03/14, 03:46 PM  
katkat42
AddOn Author - Click to view AddOns

Forum posts: 163
File comments: 166
Uploads: 7
Originally Posted by Sephiroth018
I think you forgot to raise the minor number for registering libResearch in libStub:

In libResearch.lua
Currently:
Lua Code:
  1. local MAJOR, MINOR = "libResearch", 3

Should be:
Lua Code:
  1. local MAJOR, MINOR = "libResearch", 4

That causes your fix (r4) to not be used when r3 has already been registered in libStub
I did. I have fixed and re-uploaded the file.
__________________
"GUIs are tough. Let's go wumpus hunting."
Report comment to moderator  
Reply With Quote
Unread 08/03/14, 03:35 PM  
Sephiroth018
 
Sephiroth018's Avatar
AddOn Author - Click to view AddOns

Forum posts: 20
File comments: 67
Uploads: 3
I think you forgot to raise the minor number for registering libResearch in libStub:

In libResearch.lua
Currently:
Lua Code:
  1. local MAJOR, MINOR = "libResearch", 3

Should be:
Lua Code:
  1. local MAJOR, MINOR = "libResearch", 4

That causes your fix (r4) to not be used when r3 has already been registered in libStub
Last edited by Sephiroth018 : 08/03/14 at 03:36 PM.
Report comment to moderator  
Reply With Quote
Unread 05/25/14, 02:33 AM  
b|m
AddOn Author - Click to view AddOns

Forum posts: 2
File comments: 15
Uploads: 1
Thanks for making your work available in a library.
Last edited by b|m : 05/25/14 at 02:33 AM.
Report comment to moderator  
Reply With Quote
Post A Reply



Category Jump: