Logout / Exit macro

Hi all, trying to make a macro to revive battle pets and logout or exit the game.

/cast Revive Battle Pets
/exit [nomod]
/logout

The issue here is that it doesn’t respond to the conditional, IE it will always exit game if /exit is on top

Some commands, including /logout and /exit (aka /quit), do not use any [conditional]s because they lack the SecureCmdOptionParse call that says what to use when a [condition] is true; they just do it.

SecureCmdList["USE_TOY"] = function(msg)
	local toyName = SecureCmdOptionParse(msg);
	if ( toyName and toyName ~= "" ) then
		UseToyByName(toyName)
	end
end

SecureCmdList["LOGOUT"] = function(msg)
	Logout();
end

The least-effort way to do what you want is probably setting up 3 macros, with the main macro to conditionally /click the others that contain the protected commands /exit or /logout.

1 Like

That’s a shame. Thank you for the feedback :slight_smile:

You could use Macro-Talk’s /opt command to do what you want.

#showtooltip
/cast Revive Battle Pets
/opt [mod] /logout; /exit

https://www.curseforge.com/wow/addons/macro-talk