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.