Trying to make simple macro that changes my cursor size between Small & Large with 1 click

/run local cvar,v1,v2 = "cursorsizepreferred","0","2" SetCVar(cvar,GetCVar(cvar)==v1 and v2 or v1) print(cvar,"is now",GetCVar(cvar))

You can use this as a generic cvar toggle too, by replacing the name of the cvar (“cursorsizepreferred”) and the two values (“0” and “2”).

For instance to toggle Sound_MasterVolume between “1” and “0.4”:

/run local cvar,v1,v2 = "Sound_MasterVolume","0.4","1" SetCVar(cvar,GetCVar(cvar)==v1 and v2 or v1) print(cvar,"is now",GetCVar(cvar))

These also print what the cvar was changed to. You can remove the print (and everything after it) if you’d prefer to not have the added spam.

2 Likes