CancelMatchTradingHouseItemNames

From ESOUI Wiki

Jump to: navigation, search

This function can be used to cancel a MatchTradingHouseItemNames search that is in progress.

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"
   --
   zo_callLater(function()
      CancelMatchTradingHouseItemNames(matchID)
      d("Search canceled!")
   end, 5)
   --
   -- If the search doesn't complete within five milliseconds, then the 
   -- search will be canceled.
   --
end

External links

Personal tools
Namespaces
Variants
Actions
Menu
Wiki
Toolbox