I haven't ran this myself yet.. It was created for someone who was having trouble getting a macro to do the job and I figured I'd put it here in case anyone finds it useful.. If there's any interest in this, I may add more features (such as an INI file or some way other than re-compiling to save the default master and password.) It's more of a snippit than a plugin.
Code:
#include "../MQ2Plugin.h"
PreSetup("MQ2RemoteCamp");
char MasterName[MAX_STRING] = {"Name of master toon"};
char Password[MAX_STRING] = {"Password or phrase you want to use to force camp"};
bool RemoteCamp = true;
VOID SetMaster(PSPAWNINFO pChar, PCHAR szLine)
{
sprintf(MasterName,szLine);
WriteChatf("Master now set to: %s",szLine);
}
VOID SetPassword(PSPAWNINFO pChar, PCHAR szLine)
{
sprintf(Password,szLine);
WriteChatf("Remote Camp password now set to: %s",szLine);
}
VOID ToggleRemoteCamp(PSPAWNINFO pChar, PCHAR szLine)
{
RemoteCamp=!RemoteCamp;
WriteChatf("Remote camp is now: %s", RemoteCamp?"Enabled":"Disabled");
}
VOID DoCamp(VOID)
{
DoCommand(NULL,"/r As you wish");
DoCommand(NULL,"/camp desktop");
}
PLUGIN_API VOID InitializePlugin(VOID)
{
AddCommand("/campmaster",SetMaster);
AddCommand("/camppassword",SetPassword);
AddCommand("/remotecamp",ToggleRemoteCamp);
}
PLUGIN_API VOID ShutdownPlugin(VOID)
{
RemoveCommand("/campmaster");
RemoveCommand("/camppassword");
RemoveCommand("/remotecamp");
}
PLUGIN_API DWORD OnIncomingChat(PCHAR Line, DWORD Color)
{
if ((strstr(Line,MasterName)) && (strstr(Line,"tells you")) && (strstr(Line,Password)))
DoCamp();
return 0;
}
Last edited by a moderator: