GetNumMatchTradingHouseItemNamesResults

From ESOUI Wiki

Jump to: navigation, search

This function takes a match ID returned by MatchTradingHouseItemNames and returns the number of matching items, if the match as completed. Note that this function can return nil.

Arguments

matchID
A handle to an item name search — that is, a number returned by MatchTradingHouseItemNames, which identifies a search operation.

Example

local function _onComplete(eventCode, matchID, numResults, backgroundDurationMS)
   d("Listing results...")
   local count = GetNumMatchTradingHouseItemNamesResults(matchID) -- you could also just use numResults
   for i = 1, count do
      local name, hash = GetMatchTradingHouseItemNamesResult(id, i)
      d(" - " .. name)
   end
end
 
EVENT_MANAGER:RegisterForEvent("MyExampleEvent", EVENT_MATCH_TRADING_HOUSE_ITEM_NAMES_COMPLETE, _onComplete)
 
local searchText = "em" -- find all items whose names contain this, e.g. "emerald"
 
if ZoUTF8StringLength(searchText) < GetMinLettersInTradingHouseItemNameForCurrentLanguage() then
   d("The search string is too short! No search was performed.")
else
   local matchID = MatchTradingHouseItemNames("em") -- find all items whose names contain "em," e.g. "emerald"
   --
   -- Storing the match ID in a variable allows you to cancel 
   -- the search early if you need to. For example, if you're 
   -- creating a textbox to allow the player to search for 
   -- items by name, you may want to cancel the search if the 
   -- player changes what's in the textbox.
   --
end

External links

Personal tools
Namespaces
Variants
Actions
Menu
Wiki
Toolbox