### ItemRack.CreateTimer, ItemRack.StartTimer, ItemRack.StopTimer - Custom Timers Source: https://context7.com/rottenbeer/itemrack/llms.txt Provides functionality to create, start, stop, and check the status of custom timers within event scripts. These timers are useful for executing delayed actions or managing timed sequences. Dependencies: ItemRack addon. ```lua -- Create a repeating timer (runs every 0.5 seconds) ItemRack.CreateTimer("MyTimer", function() if SomeCondition() then EquipSet("My Set") ItemRack.StopTimer("MyTimer") end end, 0.5, 1) -- name, function, delay, repeat (1=yes) -- Start the timer ItemRack.StartTimer("MyTimer") -- Start with custom delay (overrides default) ItemRack.StartTimer("MyTimer", 1.0) -- Stop a timer ItemRack.StopTimer("MyTimer") -- Check if timer is active if ItemRack.IsTimerActive("MyTimer") then print("Timer is running") end ``` -------------------------------- ### ItemRack.GetInfoByID - Get Item Information Source: https://context7.com/rottenbeer/itemrack/llms.txt Retrieves detailed information about an item using its ItemRack-style ID. This includes the item's name, texture path, equip slot, and quality. Useful for displaying item details or making decisions based on item properties. Dependencies: ItemRack addon. ```lua -- Get item info from ItemRack ID local name, texture, equipSlot, quality = ItemRack.GetInfoByID("28830:0:0:0:0:0:0:0:70:0") print("Item: " .. name) print("Texture: " .. texture) print("Slot: " .. (equipSlot or "N/A")) print("Quality: " .. quality) -- Check if item is a two-handed weapon local _, _, slot = ItemRack.GetInfoByID(itemID) if slot == "INVTYPE_2HWEAPON" then print("This is a two-handed weapon") end ``` -------------------------------- ### Macro Functions Source: https://github.com/rottenbeer/itemrack/blob/master/ItemRack/readme.txt Lua functions available for use in game macros or custom scripts to manage equipment sets programmatically. ```APIDOC ## Macro Functions ### Description Functions to manipulate gear sets via Lua scripts or macros. ### Functions - `EquipSet(setname)` - Equips the specified set. - `UnequipSet(setname)` - Unequips the specified set. - `ToggleSet(setname)` - Toggles the set (equip if off, unequip if on). - `IsSetEquipped(setname)` - Returns true if the set is currently equipped. ### Note If naming conflicts occur, use the namespace prefix: `ItemRack.EquipSet(setname)`. ``` -------------------------------- ### ItemRack Event System Source: https://context7.com/rottenbeer/itemrack/llms.txt Utilities for managing automatic gear swapping based on game events like buffs, stances, or custom scripts. ```APIDOC ## ItemRack Event System ### Description Allows automatic equipment changes based on game events. Supports Buff-based, Stance-based, Zone-based, and custom Script events. ### Method Lua Event Handling ### Parameters - **Event Type** (string) - Required - The type of trigger (e.g., 'Script', 'Buff', 'Stance'). - **Trigger** (string) - Required - The specific game event name (e.g., 'UNIT_SPELLCAST_SUCCEEDED'). ### Request Example -- Script Event: Equip after casting a specific spell if arg1 == "player" and arg2 == "Evocation" then EquipSet("Spirit Gear") end ``` -------------------------------- ### ItemRack Event System - Automatic Gear Swapping Source: https://context7.com/rottenbeer/itemrack/llms.txt Leverages ItemRack's event system to trigger equipment changes based on various game events such as buffs, stances, zones, or custom scripts. This allows for dynamic gear swapping in response to in-game conditions. Dependencies: ItemRack addon. ```lua -- Script Event: Equip gear when swimming -- Event Type: Script -- Trigger: MIRROR_TIMER_START local set = "Swimming Gear" if IsSwimming() and not IsSetEquipped(set) then EquipSet(set) if not SwimmingEvent then function SwimmingEvent() if not IsSwimming() then ItemRack.StopTimer("SwimmingEvent") UnequipSet(set) end end ItemRack.CreateTimer("SwimmingEvent", SwimmingEvent, 0.5, 1) end ItemRack.StartTimer("SwimmingEvent") end -- Script Event: Equip after casting a specific spell -- Trigger: UNIT_SPELLCAST_SUCCEEDED local spell = "Evocation" local set = "Spirit Gear" if arg1 == "player" and arg2 == spell then EquipSet(set) end -- Default event types available: -- Buff events: Mounted, Drinking, Evocation (Mage) -- Stance events: Warrior stances, Druid forms, Rogue Stealth, Priest Shadowform -- Zone events: PVP (battlegrounds/arenas), City (major cities) ``` -------------------------------- ### Configure ItemRack Settings and Access Set Data Source: https://context7.com/rottenbeer/itemrack/llms.txt This snippet demonstrates how to modify global and character-specific settings for ItemRack, such as tooltip behavior and UI scaling. It also shows how to iterate through the ItemRackUser.Sets table to retrieve equipment set details including icons and slot mappings. ```lua -- Access global settings (per-account) ItemRackSettings.ShowTooltips = "ON" ItemRackSettings.TinyTooltips = "OFF" ItemRackSettings.CooldownCount = "ON" ItemRackSettings.LargeNumbers = "OFF" ItemRackSettings.Notify = "ON" ItemRackSettings.NotifyThirty = "OFF" ItemRackSettings.ShowMinimap = "ON" ItemRackSettings.TrinketMenuMode = "OFF" ItemRackSettings.EquipToggle = "OFF" ItemRackSettings.CharacterSheetMenus = "ON" -- Access user settings (per-character) ItemRackUser.Locked = "OFF" ItemRackUser.Alpha = 1 ItemRackUser.MainScale = 1 ItemRackUser.MenuScale = 0.85 ItemRackUser.EnableEvents = "ON" ItemRackUser.EnableQueues = "ON" -- Access saved sets for setName, setData in pairs(ItemRackUser.Sets) do print("Set: " .. setName) print(" Icon: " .. (setData.icon or "default")) for slot, itemID in pairs(setData.equip) do print(" Slot " .. slot .. ": " .. itemID) end end ``` -------------------------------- ### GET/SET ItemRackSettings Source: https://context7.com/rottenbeer/itemrack/llms.txt Access and modify global account-wide settings for the ItemRack addon. ```APIDOC ## GET/SET ItemRackSettings ### Description Accesses the global configuration table for ItemRack, controlling UI elements like tooltips, minimap buttons, and notification settings. ### Method LUA Global Access ### Endpoint ItemRackSettings ### Parameters #### Request Body - **ShowTooltips** (string) - Optional - "ON" or "OFF" - **TinyTooltips** (string) - Optional - "ON" or "OFF" - **CooldownCount** (string) - Optional - "ON" or "OFF" - **LargeNumbers** (string) - Optional - "ON" or "OFF" - **Notify** (string) - Optional - "ON" or "OFF" - **ShowMinimap** (string) - Optional - "ON" or "OFF" ### Request Example ItemRackSettings.ShowTooltips = "ON"; ### Response #### Success Response (200) - **Value** (string) - Returns the current state of the setting. ``` -------------------------------- ### ItemRack Slash Commands Source: https://context7.com/rottenbeer/itemrack/llms.txt Quick access to common ItemRack functions via the command line interface without using the GUI. ```bash # Open the options window /itemrack opt # Equip a set by name /itemrack equip Tank Set # Toggle a single set /itemrack toggle Fishing Gear # Toggle between two sets /itemrack toggle Tank Set, DPS Set # Lock/unlock the buttons /itemrack lock # Reset button positions /itemrack reset ``` -------------------------------- ### Slash Commands Source: https://github.com/rottenbeer/itemrack/blob/master/ItemRack/readme.txt Commands available for use in the game chat window to manage ItemRack settings and equipment sets. ```APIDOC ## Slash Commands ### Description Commands to interact with ItemRack via the chat interface. ### Commands - `/itemrack` - List common commands - `/itemrack opt` - Open options GUI - `/itemrack equip [setname]` - Equip a specific gear set - `/itemrack reset` - Reset buttons - `/itemrack reset everything` - Wipe all settings and data - `/itemrack lock/unlock` - Toggle button locking - `/itemrack toggle [set1], [set2]` - Toggle between one or two sets ``` -------------------------------- ### ItemRack.SetQueue Source: https://context7.com/rottenbeer/itemrack/llms.txt Configures an auto-queue for a specific equipment slot, allowing automatic item swapping when the current item goes on cooldown. ```APIDOC ## ItemRack.SetQueue ### Description Sets up an auto-queue for a specific equipment slot. When enabled, ItemRack will automatically swap to the next available item in the queue when the current item goes on cooldown. ### Method Lua Function ### Parameters #### Arguments - **slot** (number) - Required - The equipment slot ID (e.g., 13 for top trinket). - **queue** (table) - Optional - A table of ItemRack-style item IDs. Pass nil to disable the queue for the slot. ### Request Example ItemRack.SetQueue(13, {"28830:0:0:0:0:0:0:0:70:0", "28288:0:0:0:0:0:0:0:70:0"}) ``` -------------------------------- ### ItemRack Macro Functions for Gear Swapping Source: https://github.com/rottenbeer/itemrack/blob/master/ItemRack/readme.txt Provides Lua functions to equip, unequip, and toggle gear sets. It also includes a function to check if a set is currently equipped. These functions can be used in macros or scripts. The mod also offers longer, namespaced versions (e.g., ItemRack.EquipSet) to avoid conflicts. ```lua EquipSet("setname") -- equips "setname" UnequipSet("setname") -- unequips "setname" ToggleSet("setname") -- toggles (equips then unequips) "setname" IsSetEquipped("setname") -- returns true if "setname" is equipped -- Long versions to avoid conflicts: -- ItemRack.EquipSet("setname") -- ItemRack.UnequipSet("setname") -- ItemRack.ToggleSet("setname") -- ItemRack.IsSetEquipped("setname") ``` -------------------------------- ### ItemRack.FindItem Source: https://context7.com/rottenbeer/itemrack/llms.txt Searches the player's inventory and equipment for an item by its ItemRack-style ID. ```APIDOC ## ItemRack.FindItem ### Description Searches player's inventory and equipment for an item by its ItemRack-style ID. Returns the location where the item was found. ### Method Lua Function ### Parameters - **itemID** (string) - Required - The ItemRack-style ID. - **lock** (boolean) - Optional - Prevents the same item from being found twice during a set swap. ### Response - **invSlot** (number) - The equipment slot ID if equipped. - **bag** (number) - The bag index. - **slot** (number) - The slot index within the bag. ``` -------------------------------- ### EquipSet - Equip a Saved Gear Set Source: https://context7.com/rottenbeer/itemrack/llms.txt Equips a previously saved equipment set by name. This function handles combat queuing automatically, ensuring items are equipped once the player leaves combat. ```lua -- Basic set equipping EquipSet("PVP Gear") -- In a macro /script EquipSet("Tank Set") -- Using the full namespace ItemRack.EquipSet("Healing Set") -- Conditional equipping in an event script if UnitAffectingCombat("player") then EquipSet("Combat Gear") end ``` -------------------------------- ### ToggleSet - Toggle Between Equipped and Unequipped States Source: https://context7.com/rottenbeer/itemrack/llms.txt Toggles a set on or off. If the set is currently equipped, it restores the previous gear; otherwise, it equips the set. ```lua -- Toggle a set on/off ToggleSet("Fishing Gear") -- In a macro for easy gear switching /script ToggleSet("Tank Set") -- Toggle between two different sets /itemrack toggle pvp gear, pve gear -- Full namespace version ItemRack.ToggleSet("City Outfit") ``` -------------------------------- ### ItemRack Timer Management Source: https://context7.com/rottenbeer/itemrack/llms.txt Methods for creating and managing custom timers to handle delayed actions within event scripts. ```APIDOC ## ItemRack.CreateTimer / ItemRack.StartTimer ### Description Create and manage custom timers for delayed actions in event scripts. ### Method Lua Function ### Parameters - **name** (string) - Required - Unique identifier for the timer. - **callback** (function) - Required - The function to execute. - **delay** (number) - Required - Time in seconds. - **repeat** (number) - Required - 1 to repeat, 0 for one-time. ### Request Example ItemRack.CreateTimer("MyTimer", function() EquipSet("My Set") end, 0.5, 1) ItemRack.StartTimer("MyTimer") ``` -------------------------------- ### GET/SET ItemRackUser Source: https://context7.com/rottenbeer/itemrack/llms.txt Access and modify character-specific settings and equipment set data. ```APIDOC ## GET/SET ItemRackUser ### Description Accesses character-specific configuration, including UI scaling, event system toggles, and the collection of saved equipment sets. ### Method LUA Global Access ### Endpoint ItemRackUser ### Parameters #### Request Body - **Locked** (string) - Optional - "ON" or "OFF" - **Alpha** (number) - Optional - 0 to 1 - **MainScale** (number) - Optional - UI scale factor - **EnableEvents** (string) - Optional - "ON" or "OFF" - **Sets** (table) - Read-only - Collection of equipment sets ### Request Example ItemRackUser.Alpha = 1; ### Response #### Success Response (200) - **Sets** (table) - Returns a table containing all user-defined equipment sets and their associated item IDs. ``` -------------------------------- ### UnequipSet - Restore Previous Equipment Source: https://context7.com/rottenbeer/itemrack/llms.txt Unequips a set and restores the items that were previously worn. This requires the set to have been equipped via ItemRack with the 'Unequip' option enabled. ```lua -- Unequip a set and restore previous gear UnequipSet("Mounted") -- In a macro for toggle behavior /script UnequipSet("Swimming Gear") -- Full namespace version ItemRack.UnequipSet("PVP Gear") -- Conditional unequip based on buff status if not IsMounted() then UnequipSet("Mounted") end ``` -------------------------------- ### ItemRack Slash Commands for Mod Control Source: https://github.com/rottenbeer/itemrack/blob/master/ItemRack/readme.txt Lists various slash commands to interact with the ItemRack mod. These commands allow users to list common commands, open the options GUI, equip sets, reset UI elements, lock/unlock buttons, and toggle between sets. ```text /itemrack : list the most common slash commands /itemrack opt : summon the options GUI /itemrack equip setname : equips a set /itemrack reset : resets buttons /itemrack reset everything : wipes all settings, sets and events /itemrack lock/unlock : locks and unlocks the buttons /itemrack toggle set name[, second set name] : equips/unequips "set name" (or swaps between two sets if a second set given) ``` -------------------------------- ### ItemLink/ItemString to ItemRackStyleID Conversion Source: https://github.com/rottenbeer/itemrack/blob/master/Changelog.txt Functions for converting ItemLink or ItemString to ItemRackStyleID, ItemRackStyleID to BaseID, and ItemLink/ItemString to BaseID. These functions consolidate item string handling for robustness and easier updates. ```Lua -- Consolidated patterns for ItemLink/ItemString-to-ItemRackStyleID, ItemRackStyleID-to-BaseID, ItemLink/ItemString-to-BaseID -- New functions using these patterns and other helper functions to consolidate all ItemString-handling. -- Replaced old-style handling of itemIDs (string.gsub/find/match) with new functions. -- Updated GUI code to draw item tooltips using the player's current level. ``` -------------------------------- ### RegisterExternalEventListener - Third-Party Integration Source: https://context7.com/rottenbeer/itemrack/llms.txt Allows external addons to listen to ItemRack events like set saves, deletions, or equipment changes. ```lua -- Register a listener for set changes ItemRack.RegisterExternalEventListener(self, "SET_SAVED", function(event, setName) print("Set saved: " .. setName) end) -- Multiple listeners can be registered ItemRack.RegisterExternalEventListener(nil, "SET_EQUIPPED", function(event, setName) MyAddon:RefreshGearDisplay() end) ``` -------------------------------- ### IsSetEquipped - Check if a Set is Currently Worn Source: https://context7.com/rottenbeer/itemrack/llms.txt Returns true if all items in the specified set are currently equipped. Supports optional exact matching for enchants and gems. ```lua -- Check if a set is equipped if IsSetEquipped("Tank Set") then print("Tank set is active") end -- Conditional set swap if not IsSetEquipped("PVP Gear") then EquipSet("PVP Gear") end -- Use with exact matching if ItemRack.IsSetEquipped("Healing Set", true) then print("Exact healing set equipped") end ``` -------------------------------- ### ItemRack.SetQueue - Configure Auto-Queue for Trinkets Source: https://context7.com/rottenbeer/itemrack/llms.txt Configures an automatic queue for a specified equipment slot. When enabled, ItemRack swaps to the next item in the queue when the current item's cooldown expires. Pass 'nil' to disable the queue for a slot. Dependencies: ItemRack addon. ```lua local trinketQueue = { "28830:0:0:0:0:0:0:0:70:0", -- Dragonspine Trophy "28288:0:0:0:0:0:0:0:70:0", -- Abacus of Violent Odds "28034:0:0:0:0:0:0:0:70:0", -- Hourglass of the Unraveller } ItemRack.SetQueue(13, trinketQueue) -- Disable queue for a slot ItemRack.SetQueue(14, nil) -- Get current queues (respects per-set queue setting) local queues = ItemRack.GetQueues() local slot13Queue = queues[13] ``` -------------------------------- ### ItemRack.GetInfoByID Source: https://context7.com/rottenbeer/itemrack/llms.txt Retrieves metadata for an item using its ItemRack-style ID. ```APIDOC ## ItemRack.GetInfoByID ### Description Retrieves item name, texture, equip slot, and quality from an ItemRack-style ID. ### Method Lua Function ### Parameters - **itemID** (string) - Required - The ItemRack-style ID. ### Response - **name** (string) - Item name. - **texture** (string) - Icon texture path. - **equipSlot** (string) - The equipment slot type (e.g., 'INVTYPE_2HWEAPON'). - **quality** (number) - Item quality index. ``` -------------------------------- ### ItemRack.FindItem - Locate Items in Inventory Source: https://context7.com/rottenbeer/itemrack/llms.txt Searches the player's inventory and currently equipped items for a specific item identified by its ItemRack-style ID. It returns the location (equipped slot, bag, or bag slot) where the item is found. An optional lock parameter can prevent duplicate findings. Dependencies: ItemRack addon. ```lua -- Find an item by its ItemRack ID local invSlot, bag, slot = ItemRack.FindItem("28830:0:0:0:0:0:0:0:70:0") if invSlot then print("Item is equipped in slot " .. invSlot) elseif bag and slot then print("Item is in bag " .. bag .. " slot " .. slot) else print("Item not found in inventory") end -- Find with lock (prevents same item from being found twice during set swap) local inv, bag, slot = ItemRack.FindItem(itemID, true) ``` -------------------------------- ### Hunter Macro for Feign Death Swap Source: https://github.com/rottenbeer/itemrack/blob/master/Changelog.txt A macro used by Hunters to trigger a trinket swap when using Feign Death. This macro is a dependency for a bug fix in version 3.31. ```Lua /petpassive /cast Feign Death ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.