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);
}



