Quantcast How to identify crafting surveys with API? - ESOUI
Thread Tools Display Modes
02/01/18, 09:58 AM   #1
crafty35a
 
crafty35a's Avatar
Join Date: Dec 2017
Posts: 5
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!
  Reply With Quote
02/01/18, 10:17 AM   #2
sirinsidiator
 
sirinsidiator's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 1,080
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.
__________________
>siri.exe MyAddon
Does your addon work? [y/n] n
There is a typo in there.
  Reply With Quote
02/01/18, 12:24 PM   #3
crafty35a
 
crafty35a's Avatar
Join Date: Dec 2017
Posts: 5
Thank you!
  Reply With Quote
02/02/18, 01:53 AM   #4
manavortex
 
manavortex's Avatar
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 137
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
  Reply With Quote

ESOUI » Developer Discussions » General Authoring Discussion » How to identify crafting surveys with API?

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