FEATURE: /mqpause chat [on|off]

A forum for feature requests/discussions and user submitted patches that improve MQ2

Moderator: MacroQuest Developers

MacroFiend
a grimling bloodguard
a grimling bloodguard
Posts: 662
Joined: Mon Jul 28, 2003 2:47 am

FEATURE: /mqpause chat [on|off]

Post by MacroFiend » Fri Oct 10, 2003 12:46 am

Per the request of a few macro writers, I added the ability to definatively define /mqpause chat. If you leave out the argument, it will toggle like the original version did.

Code: Select all

// ***************************************************************************
// Function:    MacroPause
// Description: Our '/mqpause' command
//              Pause/resume a macro
// Usage:       /mqpause <off>
//				/mqpause chat [on|off]
// ***************************************************************************
VOID MacroPause(PSPAWNINFO pChar, PCHAR szLine)
{
	BOOL Pause = TRUE;
	CHAR szBuffer[MAX_STRING] = {0};

	DWORD Command;
	CHAR szArg[MAX_STRING] = {0};
	CHAR szArg1[MAX_STRING] = {0};

	PCHAR szPause[] = {
		"off",
		"on",
		NULL
	};

	bRunNextCommand = TRUE;

	GetArg(szArg,szLine,1);
	if (!stricmp(szArg,"chat")) {
		GetArg(szArg1,szLine,2);
		if (szLine[0]==0) {

			gMQPauseOnChat = !gMQPauseOnChat;
		} else {
			for (Command=0;szPause[Command];Command++) {
				if (!stricmp(szArg1,szPause[Command])) {
					gMQPauseOnChat = Command;
				}
			}
		}

		WritePrivateProfileString("MacroQuest","MQPauseOnChat",(gMQPauseOnChat)?"1":"0",gszINIFilename);
		sprintf(szBuffer,"Macros will %spause while in chat mode.",(gMQPauseOnChat)?"":"not ");
		WriteChatBuffer(szBuffer,USERCOLOR_DEFAULT);
		return;
	}

	if (!gMacroBlock) {
		WriteChatBuffer("You cannot pause a macro when one isn't running.",CONCOLOR_RED);
		return;
	}

	for (Command=0;szPause[Command];Command++) {
		if (!stricmp(szArg,szPause[Command])) {
			Pause = Command;
		}
	}

	if (szLine[0]!=0) {
		WriteChatBuffer("Syntax: /mqpause [on|off] [chat [on|off]]",USERCOLOR_DEFAULT);
	} else {
		Pause = !gMacroPause;
	}
	if (gMacroPause == Pause) {
		sprintf(szBuffer,"Macro is already %s.",(Pause)?"paused":"running");
	} else {
		sprintf(szBuffer,"Macro is %s.",(Pause)?"paused":"running again");
		gMacroPause = Pause;
	}
	WriteChatBuffer(szBuffer,USERCOLOR_DEFAULT);
}

Plazmic
The One
The One
Posts: 800
Joined: Fri Jun 14, 2002 12:31 am
Contact:

Post by Plazmic » Fri Oct 10, 2003 2:45 am

This will go in with my diff...
- Plazmic

Mckorr
Developer
Developer
Posts: 2326
Joined: Fri Oct 18, 2002 1:16 pm
Location: Texas

Post by Mckorr » Fri Oct 10, 2003 8:22 am

Thanks Plaz. Survivor and CSI last night, so I didn't get a chance to add this myself.
MQ2: Think of it as Evolution in action.

FrankJScott
naggy
naggy
Posts: 2365
Joined: Sun Feb 19, 2023 7:11 am

Best Product Site

Post by FrankJScott » Tue Jan 30, 2024 8:42 pm

Please try Google before asking about Cool Product Tips ce3c8de