• 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
Resource icon

Release MQ2PlatTracker

Joined
Sep 20, 2005
RedCents
1,793¢
Tracks platinum changes and shows a total gained/lost since loading plugin or resetting start amount.

Rich (BB code):
/plat :: Lists command syntax
/plat reset :: Resets starting amount of platinum to current platinum.
/plat show :: Shows amount of platinum gained or lost since last reset.

Source
Rich (BB code):
// MQ2PlatTracker.cpp :: RedGuides exclusive plugin to track platinum changes
// v1.00 :: Sym - 2012-11-11
// v1.01 :: Sym - 2013-01-03 - Added plat per hour average
// v1.02 :: Sym - 2013-01-27 - Fixed timer reset for plat per hour average

#include "../MQ2Plugin.h"

PLUGIN_VERSION(1.02);
PreSetup("MQ2PlatTracker");

#define SECOND 1000
#define MINUTE (60 * SECOND)
#define HOUR (60 * MINUTE)
#define DAY (24 * HOUR)

DWORD StartTime = GetTickCount();
unsigned int sCash = 0;
unsigned int cCash = 0;

bool didInit = false;
char szTemp[MAX_STRING];

void ShowHelp(void) {
	WriteChatf("\atMQ2PlatTracker :: v%1.2f :: by Sym for RedGuides.com\ax", MQ2Version);
	WriteChatf("/plat :: Lists command syntax");
	WriteChatf("/plat reset :: Resets starting amount of platinum to current platinum.");
	WriteChatf("/plat show :: Shows amount of platinum gained or lost since last reset along with the average per hour.");
}

void PlatTrackerCommand(PSPAWNINFO pChar, PCHAR szLine) {
    int b = 0;
    GetArg(szTemp,szLine,1);
    if(!strnicmp(szTemp,"reset",5)) {
		sCash=GetCharInfo2()->Plat*1000+GetCharInfo2()->Gold*100+GetCharInfo2()->Silver*10+GetCharInfo2()->Copper;
		WriteChatf("MQ2PlatTracker :: \ayStarting amount reset to %.3f platinum\ax", float(sCash)/1000);
		StartTime = GetTickCount();
        return;
    }
	if(!strnicmp(szTemp,"show",5)) {
		cCash = GetCharInfo2()->Plat*1000+GetCharInfo2()->Gold*100+GetCharInfo2()->Silver*10+GetCharInfo2()->Copper;
	    DWORD RunningTime = GetTickCount() - StartTime;
	    FLOAT RunningTimeFloat = (float)RunningTime/HOUR;

		if (cCash > sCash) {
			WriteChatf("MQ2PlatTracker :: \agYou have gained a total of %.3f platinum (%.3f platinum per hour)\ax", float(cCash - sCash) / 1000, float(((cCash - sCash) / 1000)/RunningTimeFloat));
		} else if (cCash < sCash) {
			WriteChatf("MQ2PlatTracker :: \arYou have lost a total of %.3f platinum (%.3f platinum per hour)\ax", float(sCash - cCash) / 1000, float(((sCash - cCash) / 1000)/RunningTimeFloat));
		} else {
			WriteChatf("MQ2PlatTracker :: \ayNo platinum changes detected yet\ax");
		}
		return;
	}
	ShowHelp();
}

// Called once, when the plugin is to initialize
PLUGIN_API VOID InitializePlugin(VOID) {
    DebugSpewAlways("Initializing MQ2PlatTracker");

    //Add commands, MQ2Data items, hooks, etc.
    AddCommand("/plat",PlatTrackerCommand);
}

// Called once, when the plugin is to shutdown
PLUGIN_API VOID ShutdownPlugin(VOID) {
    DebugSpewAlways("Shutting down MQ2PlatTracker");

    RemoveCommand("/plat");
}



// Called once directly after initialization, and then every time the gamestate changes
PLUGIN_API VOID SetGameState(DWORD GameState) {
    DebugSpewAlways("MQ2PlatTracker::SetGameState()");
    if (GameState==GAMESTATE_INGAME && !didInit) {
		didInit = true;
		StartTime = GetTickCount();
		sCash=GetCharInfo2()->Plat*1000+GetCharInfo2()->Gold*100+GetCharInfo2()->Silver*10+GetCharInfo2()->Copper;
		WriteChatf("\atMQ2PlatTracker :: v%1.2f :: by Sym for RedGuides.com\ax", MQ2Version);
	}
}
 
Last edited:
very nice sym... hope to see this in the main compile

maybe with a gui or TLOs showing plat per a hr/min ect... that would be sweet for plat farmers
 
MQ2PlatTracker - Tracks platinum changes and shows a total gained/lost since loading plugin or resetting start amount.

Rich (BB code):
/plat - Lists command syntax
/plat reset - Resets starting amount of platinum to current platinum. 
/plat show - Shows amount of platinum gained or lost since last reset.
 
I don't suppose you have the source for this plugin available ... Is like to add the ability to save the plat amounts to an INI between sessions.

Classes are over in 3 weeks and I'll have time to putter around.
 
Its part of RedGuides custom source code but this one is Syms so its up to him whether he wants to share it our not.
 
Here are my updates to work with an INI file.

The ini file used is SERVER_CHARACTERNAME.ini
The Section added is: [PlatTracker]

It automatically saves the plat on the character and the total time since the last reset if you camp to character select.
However it does not auto save the information to the ini if "/camp desktop" or "/ex" is used.

you also have the option to save the information manually with the command "/plat save"

"/plat reset" will also reset the plat in the ini to the current amount of plat on the character and the running time to 0.

Sym feel free to take or trash my changes as you wish.
 
Last edited:
I'll try this out soon. You could probably put the save to ini in the ShutdownPlugin function to catch /ex and /camp desktop.
 
Here are my updates to work with an INI file.

The ini file used is SERVER_CHARACTERNAME.ini
The Section added is: [PlatTracker]

It automatically saves the plat on the character and the total time since the last reset if you camp to character select.
However it does not auto save the information to the ini if "/camp desktop" or "/ex" is used.

you also have the option to save the information manually with the command "/plat save"

"/plat reset" will also reset the plat in the ini to the current amount of plat on the character and the running time to 0.

Sym feel free to take or trash my changes as you wish.

Red Cented Thanks for sharing
 
ill try that ... I didn't use it because it seemed only to fire when a plugin was forcibly unloaded but i never watched the spew on a /ex or /camp desktop to see if it fired then.
 
/sigh I knew I should have waited ... there were some bugs in what I posted.

I have attached the revision that fixes the problems.
 

Attachments

@Sym I like the plat and kill tracker.
I was curious if there was an experience tracker?

I wanted to compare if it is better to do a fellowship or a raid and stuff like that.
 
@Sym I like the plat and kill tracker.
I was curious if there was an experience tracker?

I wanted to compare if it is better to do a fellowship or a raid and stuff like that.

MQ2Xptracker is included in the Vanilla build and should work I believe. Haven't leveled any characters in a while so I haven't used it in a few patches, though.
 
Release MQ2PlatTracker

Users who are viewing this thread

Back
Top
Cart