Skip to content

Instantly share code, notes, and snippets.

@z16
Last active August 29, 2015 14:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save z16/e2067d1b27484e1adbe3 to your computer and use it in GitHub Desktop.
Save z16/e2067d1b27484e1adbe3 to your computer and use it in GitHub Desktop.
S(
windower.ffxi.get_items().treasure -- This returns the treasure table.
) -- S() creates a set out of the provided treasure table.
:map( -- This function transforms the set.
-- The function provided to :map is applied to every element in the set.
table.get-{'item_id'} -- This function takes a table and returns the field "item_id".
)
--[[
This means the function that retrieves the field "item_id" is applied to every element in
the set. I.e. it converts the set of tables containing treasure-slot information into a number,
the ID of the dropped item.
]]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment