Thread: Help please
View Single Post
11-18-12, 01:36 PM   #2
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Code:
/run local v = GetCVarBool("autoLootDefault") SetCVar("autoLootDefault", v and 0 or 1) print(format("AutoLoot is now %s.", v and "off" or "on"))
The problem in your macro is that you're calling GetCVar immediately after SetCVar, at which point it's probably still returning the old value. My revised version will cache the current value, and use that for both the setting and the printing parts.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote