void CCommandSystem::UnregisterCommands() { RemoveCommand("q"); // Funkcje do zarz¹dzania zasobami. RemoveCommand("loadresource"); RemoveCommand("unloadresource"); RemoveCommand("restartresource"); }
// Called once, when the plugin is to shutdown PLUGIN_API VOID ShutdownPlugin(VOID) { if (bzsrchhandle) { ReleaseMutex(bzsrchhandle); CloseHandle(bzsrchhandle); bzsrchhandle = 0; } DebugSpewAlways("Shutting down MQ2Bzsrch"); // Remove commands, macro parameters, hooks, etc. RemoveDetour(CBazaarSearchWnd__HandleBazaarMsg); RemoveMQ2Data("Bazaar"); //RemoveCommand("/pricecheck"); RemoveCommand("/mq2bzsrch"); RemoveCommand("/breset"); RemoveCommand("/bzsrch"); delete pBazaarType; delete pBazaarItemType; }
PLUGIN_API VOID ShutdownPlugin() { DebugSpewAlways("Shutting down MQ2ChatWnd"); while(pPendingChat) { ChatBuffer *pNext=pPendingChat->pNext; delete pPendingChat; pPendingChat=pNext; } pPendingChatTail=0; PendingChatLines=0; // Remove commands, macro parameters, hooks, etc. RemoveCommand("/style"); RemoveCommand("/mqfont"); RemoveCommand("/mqmin"); RemoveCommand("/mqclear"); RemoveMQ2KeyBind("MQ2CHAT"); RemoveMQ2Benchmark(bmStripFirstStmlLines); DestroyChatWnd(); }
/* ================= ServerCommand ServerCommand will be called when an "sv" command is issued. The game can issue gi.argc() / gi.argv() commands to get the rest of the parameters ================= */ void ServerCommand (void) { char *cmd; cmd = gi.argv(1); if (Q_stricmp (cmd, "test") == 0) Svcmd_Test_f (); else if (Q_stricmp (cmd, "savechain") == 0) SaveChain (); else if (Q_stricmp (cmd, "spb") == 0) { if(gi.argc() <= 1) SpawnCommand(1); else SpawnCommand (atoi(gi.argv(2))); } else if (Q_stricmp (cmd, "rspb") == 0) { if(gi.argc() <= 1) RandomSpawnCommand(1); else RandomSpawnCommand (atoi(gi.argv(2))); } else if (Q_stricmp (cmd, "rmb") == 0) { if(gi.argc() <= 1) RemoveCommand(1); else RemoveCommand (atoi(gi.argv(2))); } else if (Q_stricmp (cmd, "dsp") == 0) { if(gi.argc() <= 1) DebugSpawnCommand(1); else DebugSpawnCommand (atoi(gi.argv(2))); } else if (Q_stricmp (cmd, "addip") == 0) SVCmd_AddIP_f (); else if (Q_stricmp (cmd, "removeip") == 0) SVCmd_RemoveIP_f (); else if (Q_stricmp (cmd, "listip") == 0) SVCmd_ListIP_f (); else if (Q_stricmp (cmd, "writeip") == 0) SVCmd_WriteIP_f (); else gi.cprintf (NULL, PRINT_HIGH, "Unknown server command \"%s\"\n", cmd); }
// Called once, when the plugin is to shutdown PLUGIN_API VOID ShutdownPlugin(VOID) { DebugSpewAlways("Shutting down MQ2HUD"); ClearElements(); RemoveCommand("/loadhud"); RemoveCommand("/unloadhud"); RemoveCommand("/defaulthud"); RemoveCommand("/backgroundhud"); RemoveCommand("/classhud"); RemoveCommand("/zonehud"); RemoveMQ2Data("HUD"); }
// Called once, when the plugin is to shutdown PLUGIN_API VOID ShutdownPlugin(VOID) { DebugSpewAlways("Shutting down MQ2CustomBinds"); RemoveCommand("/custombind"); //SaveCustomBinds(); for (unsigned long N = 0 ; N < CustomBinds.Size ; N++) if (PCUSTOMBIND pBind=CustomBinds[N]) { RemoveMQ2KeyBind(pBind->Name); } CustomBinds.Cleanup(); // Remove commands, macro parameters, hooks, etc. // RemoveMQ2Benchmark(bmMyBenchmark); // RemoveParm("$myparm(x)"); // RemoveCommand("/mycommand"); // RemoveXMLFile("MQUI_MyXMLFile.xml"); }
// Called once, when the plugin is to shutdown PLUGIN_API VOID ShutdownPlugin(VOID) { RemoveCommand("/while"); RemoveCommand("/endwhile"); RemoveCommand("/do"); RemoveCommand("/until"); RemoveCommand("/break"); RemoveCommand("/continue"); #ifdef __MQ2QUEUETYPE__ RemoveMQ2Data("Queue"); delete pQueueType; #endif }
void CBCommandTable::Receive ( JBroadcaster* sender, const Message& message ) { if (sender == itsAddCmdButton && message.Is(JXButton::kPushed)) { AddCommand(); } else if (sender == itsRemoveCmdButton && message.Is(JXButton::kPushed)) { RemoveCommand(); } else if (sender == itsDuplicateCmdButton && message.Is(JXButton::kPushed)) { DuplicateCommand(); } else if (sender == itsOptionsMenu && message.Is(JXMenu::kNeedsUpdate)) { UpdateOptionsMenu(); } else if (sender == itsOptionsMenu && message.Is(JXMenu::kItemSelected)) { const JXMenu::ItemSelected* selection = dynamic_cast<const JXMenu::ItemSelected*>(&message); assert( selection != NULL ); HandleOptionsMenu(selection->GetIndex()); } else { if (sender == &(GetTableSelection())) { UpdateButtons(); } JXEditTable::Receive(sender, message); } }
void MQ2NavigationPlugin::Plugin_Shutdown() { if (!m_initialized) return; RemoveCommand("/navigate"); RemoveMQ2Data("Navigation"); Stop(); // shut down all of the modules for (const auto& m : m_modules) { m.second->Shutdown(); } // delete all of the modules m_modules.clear(); ShutdownRenderer(); ShutdownHooks(); m_initialized = false; }
bool wxFileTypeImpl::RemoveOpenCommand() { return RemoveCommand(wxT("open")); }
void InitializeMQ2Commands() { int i; DebugSpew("Initializing Commands"); InitializeCriticalSection(&gCommandCS); EzDetour(CEverQuest__InterpretCmd,&CCommandHook::Detour,&CCommandHook::Trampoline); // Import EQ commands PCMDLIST pCmdListOrig = (PCMDLIST)EQADDR_CMDLIST; for (i=0;pCmdListOrig[i].fAddress != 0;i++) { if (!strcmp(pCmdListOrig[i].szName,"/who")) { cmdWho = (fEQCommand)pCmdListOrig[i].fAddress; AddCommand("/",pCmdListOrig[i].fAddress,TRUE,1,1); // make sure / does EQ who by default } else if (!strcmp(pCmdListOrig[i].szName,"/whotarget")) { cmdWhoTarget = (fEQCommand)pCmdListOrig[i].fAddress; } else if (!strcmp(pCmdListOrig[i].szName,"/location")) { cmdLocation = (fEQCommand)pCmdListOrig[i].fAddress; } else if (!strcmp(pCmdListOrig[i].szName,"/help")) { cmdHelp = (fEQCommand)pCmdListOrig[i].fAddress; } else if (!strcmp(pCmdListOrig[i].szName,"/target")) { cmdTarget = (fEQCommand)pCmdListOrig[i].fAddress; } else if (!strcmp(pCmdListOrig[i].szName,"/charinfo")) { cmdCharInfo = (fEQCommand)pCmdListOrig[i].fAddress; } else if (!strcmp(pCmdListOrig[i].szName,"/filter")) { cmdFilter = (fEQCommand)pCmdListOrig[i].fAddress; } else if (!strcmp(pCmdListOrig[i].szName,"/doability")) { cmdDoAbility = (fEQCommand)pCmdListOrig[i].fAddress; } else if (!strcmp(pCmdListOrig[i].szName,"/cast")) { cmdCast = (fEQCommand)pCmdListOrig[i].fAddress; } else if (!strcmp(pCmdListOrig[i].szName,"/useitem")) { cmdUseItem = (fEQCommand)pCmdListOrig[i].fAddress; } AddCommand(pCmdListOrig[i].szName,pCmdListOrig[i].fAddress,TRUE,1,1); } // Add MQ commands... struct _NEWCOMMANDLIST { PCHAR szCommand; fEQCommand pFunc; BOOL Parse; BOOL InGame;} NewCommands[] = { {"/who", SuperWho,1,1}, {"/whotarget", SuperWhoTarget,1,1}, {"/location", Location,1,1}, {"/help", Help,1,0}, {"/target", Target,1,1}, {"/alias", Alias,0,0}, {"/aa", AltAbility,0,1}, {"/substitute", Substitute,0,0}, {"/filter", Filter,1,0}, {"/whofilter", SWhoFilter,1,1}, {"/spewfile", DebugSpewFile,1,0}, {"/char", CharInfo,1,1}, {"/face", Face,1,1}, {"/identify", Identify,1,1}, {"/where", Where,1,1}, {"/skills", Skills,1,1}, {"/unload", Unload,1,0}, {"/macro", Macro,1,0}, {"/buyitem", BuyItem,1,1}, {"/sellitem", SellItem,1,1}, {"/memspell", MemSpell,1,1}, {"/loadspells", LoadSpells,1,1}, {"/loginname", DisplayLoginName,1,0}, {"/endmacro", EndMacro,1,0}, {"/listmacros", ListMacros,1,0}, {"/echo", Echo,1,0}, {"/msgbox", MQMsgBox,1,0}, {"/lootall", LootAll,1,0}, {"/alert", Alert,1,1}, {"/click", Click,1,0}, {"/mqpause", MacroPause,1,0}, {"/items", Items,1,1}, {"/itemtarget", ItemTarget,1,1}, {"/doability", DoAbility,1,1}, {"/doors", Doors,1,1}, {"/doortarget", DoorTarget,1,1}, {"/beep", MacroBeep,1,0}, {"/cast", Cast,1,1}, {"/mqlog", MacroLog,1,0}, {"/seterror", SetError,1,0}, {"/declare", NewDeclareVar,1,0}, {"/deletevar", NewDeleteVarCmd,1,0}, {"/varcalc", NewVarcalc,1,0}, {"/varset", NewVarset,1,0}, {"/vardata", NewVardata,1,0}, {"/delay", Delay,0,0}, // do not parse {"/cleanup", Cleanup,1,0}, {"/doevents", DoEvents,1,0}, {"/goto", Goto,1,0}, {"/for", For,1,0}, {"/next", Next,1,0}, {"/call", Call,1,0}, {"/return", Return,1,0}, {"/updateitems",UpdateItemInfo,1,1}, {"/ini", IniOutput,1,0}, {"/dumpstack", DumpStack,1,0}, {"/setautorun", SetAutoRun,0,1}, {"/banklist", BankList,1,1}, {"/look", Look,1,1}, {"/keepkeys", KeepKeys,1,0}, {"/windowstate",WindowState,1,0}, {"/plugin", PluginCommand,1,0}, {"/destroy", EQDestroyHeldItemOrMoney,1,1}, {"/exec", Exec,1,0}, {"/keypress", DoMappable,1,0}, {"/popup", PopupText,1,1}, {"/multiline", MultilineCommand,0,0}, {"/bind", MQ2KeyBindCommand,1,0}, {"/ranged", do_ranged,1,1}, {"/loadcfg", LoadCfgCommand,1,0}, {"/dumpbinds", DumpBindsCommand,1,0}, {"/squelch", SquelchCommand,1,0}, {"/dosocial", DoSocial,1,1}, {"/docommand", DoCommandCmd,1,0}, {"/ctrlkey", DoCtrlCmd,0,0}, {"/altkey", DoAltCmd,0,0}, {"/shiftkey", DoShiftCmd,0,0}, {"/timed", DoTimedCmd,0,0}, {"/if", NewIf,1,0}, {"/while", WhileCmd,1,0}, {"/combine", CombineCmd,1,1}, {"/clearerrors",ClearErrorsCmd,1,0}, {"/drop", DropCmd,1,0}, {"/hud", HudCmd,1,0}, {"/caption", CaptionCmd,0,0}, {"/captioncolor",CaptionColorCmd,1,0}, {"/noparse", NoParseCmd,0,0}, {"/nomodkey", NoModKeyCmd,0,0}, {"/useitem", UseItemCmd,1,1}, {"/spellslotinfo",SpellSlotInfo,1,1}, {"/getwintitle",GetWinTitle,1,0}, {"/setwintitle",SetWinTitle,1,0}, {"/removebuff",RemoveBuff,1,1}, {"/makemevisible",MakeMeVisible,0,1}, {NULL, NULL,0,1}, }; // Remove replaced commands first for (i = 0 ; NewCommands[i].szCommand && NewCommands[i].pFunc ; i++) { RemoveCommand(NewCommands[i].szCommand); AddCommand(NewCommands[i].szCommand,NewCommands[i].pFunc,0,NewCommands[i].Parse,NewCommands[i].InGame); } /* ALIASES FOR OUT OF ORDER SHORTHAND COMMANDS */ AddAlias("/d","/duel"); AddAlias("/t","/tell"); AddAlias("/w","/who"); AddAlias("/a","/anonymous"); AddAlias("/ta","/tap"); AddAlias("/c","/consider"); AddAlias("/cha","/channel"); AddAlias("/f","/feedback"); AddAlias("/fa","/fastdrop"); AddAlias("/m","/msg"); AddAlias("/load","/loadspells"); AddAlias("/b","/bazaar"); AddAlias("/ba","/bazaar"); AddAlias("/g","/gsay"); AddAlias("/gu","/guildsay"); AddAlias("/key","/keys"); AddAlias("/r","/reply"); AddAlias("/newif","/if"); /* NOW IMPORT THE USER'S ALIAS LIST, THEIR MODIFICATIONS OVERRIDE EXISTING. */ CHAR AliasList[MAX_STRING*10] = {0}; CHAR szBuffer[MAX_STRING] = {0}; CHAR MainINI[MAX_STRING] = {0}; sprintf(MainINI,"%s\\macroquest.ini",gszINIPath); GetPrivateProfileString("Aliases",NULL,"",AliasList,MAX_STRING*10,MainINI); PCHAR pAliasList = AliasList; while (pAliasList[0]!=0) { GetPrivateProfileString("Aliases",pAliasList,"",szBuffer,MAX_STRING,MainINI); if (szBuffer[0]!=0) { AddAlias(pAliasList,szBuffer); } pAliasList+=strlen(pAliasList)+1; } // Here is where you can add in permanent Substitutions AddSubstitute("omg","Oh My God"); //Importing the User's Substitution List from .ini file CHAR SubsList[MAX_STRING*10] = {0}; CHAR szBuffer2[MAX_STRING] = {0}; sprintf(MainINI,"%s\\macroquest.ini",gszINIPath); GetPrivateProfileString("Substitutions",NULL,"",SubsList,MAX_STRING*10,MainINI); PCHAR pSubsList = SubsList; while (pSubsList[0]!=0) { GetPrivateProfileString("Substitutions",pSubsList,"",szBuffer2,MAX_STRING,MainINI); if (szBuffer[0]!=0) { AddSubstitute(pSubsList,szBuffer2); } pSubsList+=strlen(pSubsList)+1; } }
//------------------------------------------------------------------------------ bool GmatCommandUtil::ClearCommandSeq(GmatCommand *seq, bool leaveFirstCmd, bool callRunComplete) { #ifdef DEBUG_SEQUENCE_CLEARING MessageInterface::ShowMessage("CommandUtil::ClearCommandSeq() entered\n"); #endif GmatCommand *cmd = seq, *removedCmd = NULL; if (cmd == NULL) { #ifdef DEBUG_SEQUENCE_CLEARING MessageInterface::ShowMessage ("CommandUtil::ClearCommandSeq() exiting, first command is NULL\n"); #endif return true; } #ifdef DEBUG_SEQUENCE_CLEARING GmatCommand *current = cmd; MessageInterface::ShowMessage("\nClearing this command list:\n"); while (current) { ShowCommand(" ", current); current = current->GetNext(); } MessageInterface::ShowMessage("\n"); #endif cmd = cmd->GetNext(); while (cmd) { if (callRunComplete) { // Be sure we're in an idle state first #ifdef DEBUG_SEQUENCE_CLEARING MessageInterface::ShowMessage (" Calling %s->RunComplete\n", cmd->GetTypeName().c_str()); #endif cmd->RunComplete(); } removedCmd = RemoveCommand(seq, cmd); if (removedCmd != NULL) { #ifdef DEBUG_MEMORY MemoryTracker::Instance()->Remove (removedCmd, removedCmd->GetTypeName(), "CommandUtil::ClearCommandSeq()"); #endif delete removedCmd; } removedCmd = NULL; cmd = seq->GetNext(); } // if first command is to be delete if (!leaveFirstCmd) { #ifdef DEBUG_SEQUENCE_CLEARING MessageInterface::ShowMessage(" seq=<%p>\n", seq); #endif #ifdef DEBUG_MEMORY MemoryTracker::Instance()->Remove (seq, seq->GetTypeName(), "CommandUtil::ClearCommandSeq()"); #endif delete seq; seq = NULL; } #ifdef DEBUG_SEQUENCE_CLEARING MessageInterface::ShowMessage("CommandUtil::ClearCommandSeq() returning true\n"); #endif return true; }
void InitializeMQ2Commands() { int i = 0; DebugSpew("Initializing Commands"); InitializeCriticalSection(&gCommandCS); if (!ghCCommandLock) ghCCommandLock = CreateMutex(NULL, FALSE, NULL); EzDetourwName(CEverQuest__InterpretCmd,&CCommandHook::Detour,&CCommandHook::Trampoline,"CEverQuest__InterpretCmd"); // Import EQ commands PCMDLIST pCmdListOrig = (PCMDLIST)EQADDR_CMDLIST; for (i=0;pCmdListOrig[i].fAddress != 0;i++) { if (!strcmp(pCmdListOrig[i].szName,"/who")) { cmdWho = (fEQCommand)pCmdListOrig[i].fAddress; AddCommand("/",pCmdListOrig[i].fAddress,TRUE,1,1); // make sure / does EQ who by default } else if (!strcmp(pCmdListOrig[i].szName,"/whotarget")) { cmdWhoTarget = (fEQCommand)pCmdListOrig[i].fAddress; } else if (!strcmp(pCmdListOrig[i].szName,"/location")) { cmdLocation = (fEQCommand)pCmdListOrig[i].fAddress; } else if (!strcmp(pCmdListOrig[i].szName,"/help")) { cmdHelp = (fEQCommand)pCmdListOrig[i].fAddress; } else if (!strcmp(pCmdListOrig[i].szName,"/target")) { cmdTarget = (fEQCommand)pCmdListOrig[i].fAddress; } else if (!strcmp(pCmdListOrig[i].szName,"/charinfo")) { cmdCharInfo = (fEQCommand)pCmdListOrig[i].fAddress; } else if (!strcmp(pCmdListOrig[i].szName,"/filter")) { cmdFilter = (fEQCommand)pCmdListOrig[i].fAddress; } else if (!strcmp(pCmdListOrig[i].szName,"/doability")) { cmdDoAbility = (fEQCommand)pCmdListOrig[i].fAddress; } else if (!strcmp(pCmdListOrig[i].szName,"/cast")) { cmdCast = (fEQCommand)pCmdListOrig[i].fAddress; } else if (!strcmp(pCmdListOrig[i].szName,"/useitem")) { cmdUseItem = (fEQCommand)pCmdListOrig[i].fAddress; } else if (!strcmp(pCmdListOrig[i].szName,"/pet")) { cmdPet = (fEQCommand)pCmdListOrig[i].fAddress; } else if (!strcmp(pCmdListOrig[i].szName,"/mercswitch")) { cmdMercSwitch = (fEQCommand)pCmdListOrig[i].fAddress; } else if (!strcmp(pCmdListOrig[i].szName,"/advloot")) { cmdAdvLoot = (fEQCommand)pCmdListOrig[i].fAddress; } else if (!strcmp(pCmdListOrig[i].szName,"/pickzone")) { cmdPickZone = (fEQCommand)pCmdListOrig[i].fAddress; } else if (!strcmp(pCmdListOrig[i].szName,"/assist")) { cmdAssist = (fEQCommand)pCmdListOrig[i].fAddress; } AddCommand(pCmdListOrig[i].szName,pCmdListOrig[i].fAddress,TRUE,1,1); } // Add MQ commands... struct _NEWCOMMANDLIST { PCHAR szCommand; fEQCommand pFunc; BOOL Parse; BOOL InGame;} NewCommands[] = { {"/whotarget", SuperWhoTarget,1,1}, {"/location", Location,1,1}, {"/help", Help,1,0}, {"/target", Target,1,1}, {"/alias", Alias,0,0}, {"/aa", AltAbility,0,1}, {"/substitute", Substitute,0,0}, {"/filter", Filter,1,0}, {"/whofilter", SWhoFilter,1,1}, {"/spewfile", DebugSpewFile,1,0}, {"/char", CharInfo,1,1}, {"/face", Face,1,1}, {"/identify", Identify,1,1}, {"/where", Where,1,1}, {"/skills", Skills,1,1}, {"/unload", Unload,1,0}, {"/selectitem", SelectItem,1,1}, {"/buyitem", BuyItem,1,1}, {"/sellitem", SellItem,1,1}, {"/memspell", MemSpell,1,1}, {"/loadspells", LoadSpells,1,1}, {"/loginname", DisplayLoginName,1,0}, {"/echo", Echo,1,0}, {"/msgbox", MQMsgBox,1,0}, {"/lootall", LootAll,1,0}, {"/alert", Alert,1,1}, {"/click", Click,1,0}, {"/mouseto", MouseTo,1,0}, {"/items", Items,1,1}, {"/itemtarget", ItemTarget,1,1}, {"/doability", DoAbility,1,1}, {"/doors", Doors,1,1}, {"/doortarget", DoorTarget,1,1}, {"/beep", MacroBeep,1,0}, {"/cast", Cast,1,1}, {"/mqlog", MacroLog,1,0}, {"/updateitems",UpdateItemInfo,1,1}, {"/ini", IniOutput,1,0}, {"/setautorun", SetAutoRun,0,1}, {"/banklist", BankList,1,1}, {"/look", Look,1,1}, {"/windowstate",WindowState,1,0}, {"/destroy", EQDestroyHeldItemOrMoney,1,1}, {"/popup", PopupText,1,1}, {"/popcustom", PopupTextCustom,1,1}, {"/popupecho", PopupTextEcho,1,1}, {"/exec", Exec,1,0}, {"/keypress", DoMappable,1,0}, {"/multiline", MultilineCommand,0,0}, {"/ranged", do_ranged,1,1}, {"/loadcfg", LoadCfgCommand,1,0}, {"/squelch", SquelchCommand,1,0}, {"/docommand", DoCommandCmd,1,0}, {"/ctrlkey", DoCtrlCmd,0,0}, {"/altkey", DoAltCmd,0,0}, {"/shiftkey", DoShiftCmd,0,0}, {"/timed", DoTimedCmd,0,0}, #ifndef ISXEQ_LEGACY {"/bind", MQ2KeyBindCommand,1,0}, #endif {"/noparse", NoParseCmd,0,0}, {"/nomodkey", NoModKeyCmd,0,0}, {"/dumpbinds", DumpBindsCommand,1,0}, {"/dosocial", DoSocial,1,1}, {"/combine", CombineCmd,1,1}, {"/drop", DropCmd,1,0}, {"/delay", Delay,0,0}, // do not parse {"/hud", HudCmd,1,0}, {"/caption", CaptionCmd,0,0}, {"/captioncolor",CaptionColorCmd,1,0}, {"/useitem", UseItemCmd,1,1}, {"/spellslotinfo",SpellSlotInfo,1,1}, {"/getwintitle",GetWinTitle,1,0}, {"/setwintitle",SetWinTitle,1,0}, {"/removebuff", RemoveBuff,1,1}, {"/removepetbuff", RemovePetBuff,1,1}, {"/makemevisible",MakeMeVisible,0,1}, {"/pet", PetCmd,1,1}, {"/mercswitch", MercSwitchCmd,1,1}, {"/removeaura", RemoveAura,0,1}, {"/advloot", AdvLootCmd,1,1}, {"/pickzone", PickZoneCmd,1,1}, {"/assist", AssistCmd,1,1}, {"/setprio", SetProcessPriority,1,0}, {"/screenmode", ScreenModeCmd,1,0}, {"/usercamera", UserCameraCmd,1,0}, {"/mapzoom", MapZoomCmd,1,0}, {"/foreground", ForeGroundCmd,1,0}, {NULL, NULL,0,1}, }; // Remove replaced commands first for (i = 0 ; NewCommands[i].szCommand && NewCommands[i].pFunc ; i++) { RemoveCommand(NewCommands[i].szCommand); AddCommand(NewCommands[i].szCommand,NewCommands[i].pFunc,0,NewCommands[i].Parse,NewCommands[i].InGame); } //truebox builds are not supported anymore. //This code is here to make sure we are NOT run on truebox. //(bypassing these calls will severly cripple your mq2) -eqmule typedef DWORD(__cdecl *fAuthenticateTrueBox)(DWORD); fAuthenticateTrueBox AuthenticateTrueBox = 0; typedef DWORD(__cdecl *fGetTrueBoxKey)(DWORD); fGetTrueBoxKey GetTrueBoxKey = 0; if (ghmq2ic) { AuthenticateTrueBox = (fAuthenticateTrueBox)GetProcAddress(ghmq2ic, "AuthenticateTrueBox"); GetTrueBoxKey = (fGetTrueBoxKey)GetProcAddress(ghmq2ic, "GetTrueBoxKey"); DWORD tbkey = GetTrueBoxKey(1); if (AuthenticateTrueBox) { AuthenticateTrueBox(tbkey); } } /* ALIASES FOR OUT OF ORDER SHORTHAND COMMANDS */ AddAlias("/d","/duel"); AddAlias("/t","/tell"); AddAlias("/w","/who"); AddAlias("/a","/anonymous"); AddAlias("/ta","/tap"); AddAlias("/c","/consider"); AddAlias("/cha","/channel"); AddAlias("/f","/feedback"); AddAlias("/fa","/fastdrop"); AddAlias("/m","/msg"); AddAlias("/load","/loadspells"); AddAlias("/b","/bazaar"); AddAlias("/ba","/bazaar"); AddAlias("/g","/gsay"); AddAlias("/gu","/guildsay"); AddAlias("/key","/keys"); AddAlias("/r","/reply"); AddAlias("/newif","/if"); /* NOW IMPORT THE USER'S ALIAS LIST, THEIR MODIFICATIONS OVERRIDE EXISTING. */ CHAR AliasList[MAX_STRING*10] = {0}; CHAR szBuffer[MAX_STRING] = {0}; CHAR MainINI[MAX_STRING] = {0}; sprintf_s(MainINI,"%s\\macroquest.ini",gszINIPath); GetPrivateProfileString("Aliases",NULL,"",AliasList,MAX_STRING*10,MainINI); PCHAR pAliasList = AliasList; while (pAliasList[0]!=0) { GetPrivateProfileString("Aliases",pAliasList,"",szBuffer,MAX_STRING,MainINI); if (szBuffer[0]!=0) { AddAlias(pAliasList,szBuffer); } pAliasList+=strlen(pAliasList)+1; } // Here is where you can add in permanent Substitutions AddSubstitute("omg","Oh My God"); //Importing the User's Substitution List from .ini file CHAR SubsList[MAX_STRING*10] = {0}; CHAR szBuffer2[MAX_STRING] = {0}; sprintf_s(MainINI,"%s\\macroquest.ini",gszINIPath); GetPrivateProfileString("Substitutions",NULL,"",SubsList,MAX_STRING*10,MainINI); PCHAR pSubsList = SubsList; while (pSubsList[0]!=0) { GetPrivateProfileString("Substitutions",pSubsList,"",szBuffer2,MAX_STRING,MainINI); if (szBuffer[0]!=0) { AddSubstitute(pSubsList,szBuffer2); } pSubsList+=strlen(pSubsList)+1; } }
void VCommandList::RemoveCommand(const VString& inID) { VCommand* command = _GetCommand(inID, false); if (command != NULL) RemoveCommand(command); }