WoW:API GetAutoLootDefault: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
mNo edit summary
(removedapi, restore old docs.)
Line 1: Line 1:
{{wowapi}} __NOTOC__
{{removedapi|3.0|Behavior now controlled by the {{api|autoLootDefault|t=c}} CVar. Use {{api|GetCVar}}.}}
{{wowapi}}
Returns the state of Auto Loot.
state = GetAutoLootDefault();


== Returns ==
;state : Boolean - 1 if auto loot is enabled, nil if disabled.


''As of 3.0, this function no longer exists. Use [[API GetCVar|GetCVar("autoLootDefault")]] instead.''
== Example ==
<!-- If it helps, include an example here, though it's not required if the usage is self-explanatory -->
''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())]..".");
 
<big>'''Result'''</big>
:Pops up a window informing the user of the state of Auto Loot. Very useful for toggling Auto Loot on the fly.

Revision as of 14:55, 29 May 2009

WoW API < GetAutoLootDefault

Returns the state of Auto Loot.

state = GetAutoLootDefault();

Returns

state
Boolean - 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.