ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   General Authoring Discussion (https://www.esoui.com/forums/forumdisplay.php?f=174)
-   -   How to identify crafting surveys with API? (https://www.esoui.com/forums/showthread.php?t=7602)

crafty35a 02/01/18 09:58 AM

How to identify crafting surveys with API?
 
Is there a simple way to determine if a given item is a crafting survey? I assume I can check GetItemLinkItemType, but I can't find a list of return values anywhere.

Thanks!

sirinsidiator 02/01/18 10:17 AM

Yes, you compare the specialized itemType (second return from the function).
You can find the possible values in the ESOUIDocumentation.txt or on the ESOUI wiki.
The one you are looking for is SPECIALIZED_ITEMTYPE_TROPHY_SURVEY_REPORT.

crafty35a 02/01/18 12:24 PM

Thank you!

manavortex 02/02/18 01:53 AM

SurveyTheWorld
 
Hey,

directly from the source of this: SurveyTheWorld

Lua Code:
  1. local treasure          = SPECIALIZED_ITEMTYPE_TROPHY_TREASURE_MAP
  2. local survey            = SPECIALIZED_ITEMTYPE_TROPHY_SURVEY_REPORT
  3. surveyNames             = {}
  4. treasureNames           = {}
  5.  
  6. for slotId = 0, numBagSlots do 
  7.     local itemType, sItemType = GetItemType(bagId, slotId)
  8.     if itemType == ITEMTYPE_TROPHY and (sItemType == treasure or sItemType == survey) then
  9.         local itemName = string.lower(zo_strformat(GetItemName(bagId, slotId)):match "^%s*(.-)%s*$")
  10.         table.insert(((sItemType == survey and surveyNames) or treasureNames), itemName)
  11.     end
  12. end


All times are GMT -6. The time now is 06:52 AM.

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