WoW API: GetAutoLootDefault

From AddOn Studio
Revision as of 04:45, 15 August 2023 by Move page script (talk | contribs) (Move page script moved page API GetAutoLootDefault to API GetAutoLootDefault without leaving a redirect)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

WoW API < GetAutoLootDefault

Returns the state of Auto Loot.

local state = GetAutoLootDefault()

Parameters

Returns

  • state (onenil) - 1 if auto loot is enabled, nil if disabled.

Example

This toggles Auto Loot on and off when used in a macro spot.

/script if (GetAutoLootDefault()) then SetAutoLootDefault(false); message("Auto Loot is off."); else SetAutoLootDefault(true); print("Auto Loot is on."); end;

or (easier to change if the need arises)

/script local onOff = {["1"] = "on",["nil"] = "off"}; SetAutoLootDefault(not GetAutoLootDefault()); print("Auto Loot is "..onOff[tostring(GetAutoLootDefault())]..".");
Result

Pops up a window informing the user of the state of Auto Loot. Very useful for toggling Auto Loot on the fly.

Notes