• You've discovered RedGuides, an EverQuest multi-boxing and scripting community 🧙‍♀️⚙️. We want you to play several EQ characters at once, come join us and say hello! 👋

  • A TLP without truebox has thawed (Very Vanilla ready)
    Frostreaver

Plugin: MQ2LogDKP v1.0 by HardOne

HardOne

Member
Joined
Jan 15, 2006
RedCents
61¢
Plugin: MQ2LogDKP v1.1 by HardOne

I Wrote a DKP log Updating Plugin, to Replace my Macro Found here: http://www.redguides.com/community/showthread.php?t=11825
It performs the Same base function of my parsing macro.
The Added Benifits:
-You can have this running, without a macro running, or having to incorporate into your macro.
-It will automatically turn your EQ log on (Does not turn it off, in case you like to keep logs going)

To customize for your channels, go to the bottom of the file and change DoCommand(pSpawn, "/list 1");, make /list 1 match your channel (ex /list raidchannel, or /list 4)

Changes:
v1.0 - Original
v1.1 - Added /forcedkp command, it will Force a /who & /list set (Usefull for checking raid start time and stop time, if it dosent fall in line with the timer).
- Will now Automatically do a /who & /list every time you zone.


Rich (BB code):
/*
MQ2LogDKP.cpp v1.1
By: HardOne
MQ2LogDKP is a Plugin to Replace my DKP Logging Macro.
Useage: 	/startdkp = Turns your eqlog on, and will do a /who, and /list for your specified channels (Default: /who, /list 1, /list 2 (Channel Names can also be used)).
			/stopdkp = Turns your eqlog off and stops doing the /who, /list, etc.
			/forcedkp = Forces a /who and /list to happen. (DKP Logging must already be on thru /startdkp)
The Default Delay between each /who & /list is 15 Minutes (#define LOGINTERVAL 900000) (60000 = 1 minute) You can also change this to your liking. 
Changes:
	v1.0	- Original
	v1.1	- Added /forcedkp command, it will Force a /who & /list set (Usefull for checking raid start time and stop time, if it dosent fall in line with the timer).
			- Will now Automatically do a /who & /list every time you zone.
*/

#include "../MQ2Plugin.h"

VOID LogDKP(PSPAWNINFO pChar, PCHAR szLine);
VOID LogDKPStop(PSPAWNINFO pChar, PCHAR szLine);
VOID LogDKPForce(PSPAWNINFO pChar, PCHAR szLine);
VOID GetDKP(PSPAWNINFO pChar);

PreSetup("MQ2LogDKP");

#define LOGINTERVAL 900000  // 15 minute delay
DWORD PulseTime=0;
bool MQ2LogDKPEnabled=false;

PLUGIN_API VOID InitializePlugin(VOID)
{
	AddCommand("/startdkp", LogDKP);
	AddCommand("/stopdkp", LogDKPStop);
	AddCommand("/forcedkp", LogDKPForce);
	if(gbInZone && GetCharInfo() && GetCharInfo()->pSpawn){
		WriteChatColor("MQ2LogDKP Loaded Successfully.",CONCOLOR_GREEN);
	}
}
PLUGIN_API VOID ShutdownPlugin(VOID)
{
	RemoveCommand("/startdkp");
	RemoveCommand("/stopdkp");
	RemoveCommand("/forcedkp");
}
PLUGIN_API VOID OnPulse(VOID)
{
	if(MQ2LogDKPEnabled && gbInZone && GetCharInfo() && GetCharInfo()->pSpawn && (DWORD)clock()>PulseTime){
		GetDKP(GetCharInfo()->pSpawn);
	}
}
PLUGIN_API VOID OnZoned(VOID)
{
	if(MQ2LogDKPEnabled && gbInZone && GetCharInfo() && GetCharInfo()->pSpawn){
		GetDKP(GetCharInfo()->pSpawn);
	}
}
VOID LogDKP(PSPAWNINFO pChar, PCHAR szLine)
{
	if (MQ2LogDKPEnabled && gbInZone && GetCharInfo() && GetCharInfo()->pSpawn) {
		return;
	}
	if (!MQ2LogDKPEnabled && gbInZone && GetCharInfo() && GetCharInfo()->pSpawn) {
		if (MQ2Globals::gGameState==GAMESTATE_INGAME) {
			DoCommand(pChar, "/log on");
			MQ2LogDKPEnabled=true;
			WriteChatColor("Automatic DKP Logging Enabled",CONCOLOR_GREEN);
			GetDKP(GetCharInfo()->pSpawn);
		} else {
			MQ2LogDKPEnabled=false;
		}
	}
}
VOID LogDKPStop(PSPAWNINFO pChar, PCHAR szLine)
{
	if (!MQ2LogDKPEnabled && gbInZone && GetCharInfo() && GetCharInfo()->pSpawn) {
		return;
	}
	if (MQ2LogDKPEnabled && gbInZone && GetCharInfo() && GetCharInfo()->pSpawn) {
		MQ2LogDKPEnabled=false;
		WriteChatColor("Automatic DKP Logging Disabled",CONCOLOR_RED);
	}
}
VOID LogDKPForce(PSPAWNINFO pChar, PCHAR szLine)
{
	if(MQ2LogDKPEnabled && gbInZone && GetCharInfo() && GetCharInfo()->pSpawn){
		GetDKP(GetCharInfo()->pSpawn);
		WriteChatColor("Forced DKP /who & /list Successfully",CONCOLOR_GREEN);
	}
}
VOID GetDKP(PSPAWNINFO pSpawn)
{
	//Change/Add/Delete these entries to meet your channel needs.
	DoCommand(pSpawn, "/");
	DoCommand(pSpawn, "/list 1");
	DoCommand(pSpawn, "/list 2");
	DoCommand(pSpawn, "/echo [${Time}] # Updating Logs for DKP.");
	PulseTime=(DWORD)clock()+LOGINTERVAL;
}
 
Last edited:
Changes:
v1.1 - Added /forcedkp command, it will Force a /who & /list set (Usefull for checking raid start time and stop time, if it dosent fall in line with the timer).
- Will now Automatically do a /who & /list every time you zone.
 
So anyone even using this, I see a couple Downloads. But no Feedback, let me know how it's working, etc etc.
 
tested this tonight worked like a charm ..
would like to see it not restart timer when you zone and turn log on and off if that is even posable
 
It seems the posted source does not have a /log off command in it, recompile using that source and you'll be set.


Remove this portion of the source to not do a who on zoning

Rich (BB code):
PLUGIN_API VOID OnZoned(VOID)
{
	if(MQ2LogDKPEnabled && gbInZone && GetCharInfo() && GetCharInfo()->pSpawn){
		GetDKP(GetCharInfo()->pSpawn);
	}
}

Because when you zone it calls the same function as when the normal timer is up, it's going to reset the timer, without making a whole new function without a timer reset in it.
 
Plugin: MQ2LogDKP v1.0 by HardOne

Users who are viewing this thread

Back
Top
Cart