→Example
m (→Example) |
|||
| Line 13: | Line 13: | ||
<!-- If it helps, include an example here, though it's not required if the usage is self-explanatory --> | <!-- 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.'' | ''This toggles Auto Loot on and off when used in a macro spot.'' | ||
:/script SetCVar("scriptErrors",1); if GetAutoLootDefault() | :/script SetCVar("scriptErrors",1); if (GetAutoLootDefault()) then SetAutoLootDefault(false); message("Auto Loot is off."); else SetAutoLootDefault(true); message("Auto Loot is on."); end; | ||
or (easier to change if the need arises) | or (easier to change if the need arises) | ||
:/script SetCVar("scriptErrors",1); local onOff = {["1"] = "on",["nil"] = "off"}; SetAutoLootDefault(not GetAutoLootDefault()); message("Auto Loot is "..onOff[tostring(GetAutoLootDefault())].."."); | :/script SetCVar("scriptErrors",1); local onOff = {["1"] = "on",["nil"] = "off"}; SetAutoLootDefault(not GetAutoLootDefault()); message("Auto Loot is "..onOff[tostring(GetAutoLootDefault())].."."); | ||