• 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

MQ2AASpend -- Auto AA spending Plugin (1 Viewer)

zippzipp

Member
Joined
Nov 17, 2006
RedCents
51¢
I know a lot of people who were looking for an easy way to do this so i wrote up this plugin. It auto spends ability points.

Rich (BB code):
Usage:
/aaspend help -- lists command syntaxes in game.
/aaspend status -- lists status of brute, auto, and auto array
/aaspend "AA name" -- Spends a specific AA
/aaspend brute -- Goes down the list autospending the next available AA
/aaspend auto -- Spends AA based on abilities set in setauto
/aaspend setauto "AA name" <Auto #> -- Sets the auto array.

You must set the autoarray with /aaspend setauto before you can use /aaspend auto.

There is a max of 10 entries in the auto array.

Also make sure you have Quotes "" around the Ability Names.

MQ2AASpend.cpp
Rich (BB code):
//////////////////////////////////////////////////
//   MQ2AASpend.cpp by Zippzipp
//   Crated On:  21 Jan 2007
//
//   This plugin adds the following commands to
//   the game:
//
//   /aaspend help -- lists command syntaxes in
//                    game.
//
//   /aaspend "AA name" -- Spends a specific AA
//
//   /aaspend brute -- Goes down the list auto
//                     spending the next available
//                     AA
//
//   /aaspend auto -- Spends AA based on setAutos
//
//   /aaspend setauto "AA name" <Auto #> 
//						-- Sets the auto array. 
//
//////////////////////////////////////////////////
#include "../MQ2Plugin.h"

PreSetup("MQ2AASpend");

#define SP_Instant_AA  0x077B // 6-13-06

// zippzipp -- 21 Jan 2007
struct _PKTAASpend {
/*0000*/ DWORD FunctionM; // 1 = SetAAexp 0%, 2 = SetAAexp 100%, 3 = SpendAA
/*0004*/ DWORD Index;     // AA index
/*0008*/ CHAR unknown0x008[0x8];
} SpendPkt; // 16

void Spend(DWORD Idx);
bool autoflag = false;
bool bruteflag = false;
int bruteindex = 0;

CHAR AutoArray[10][MAX_STRING];


VOID aaSpend(PSPAWNINFO pChar, PCHAR szLine){
	CHAR szArg1[MAX_STRING] = {0};
	CHAR szArg2[MAX_STRING] = {0};
	CHAR szArg3[MAX_STRING] = {0};
	CHAR arrayprint[MAX_STRING]={0};
	GetArg(szArg1, szLine, 1);

	if(!strcmpi(szArg1, "")){
		WriteChatColor("You must specify which /aaspend command you wish to use", CONCOLOR_YELLOW);
		WriteChatColor("If you are unsure: /aaspend help will show you availiable commands", CONCOLOR_YELLOW);
		return;
	}
	if(!strcmpi(szArg1, "help")){
		WriteChatColor("--MQ2AASpend help--", CONCOLOR_YELLOW);
		WriteChatColor("/aaspend help -- Lists command syntax", CONCOLOR_YELLOW);
		WriteChatColor("/aaspend status -- Shows current status", CONCOLOR_YELLOW);
		WriteChatColor("/aaspend \"AA Name\" -- Spends a particular AA", CONCOLOR_YELLOW);
		WriteChatColor("/aaspend brute -- Goes down the list autospending the next available",CONCOLOR_YELLOW);
		WriteChatColor("/aaspend auto -- Autospends AA's based on auto array",CONCOLOR_YELLOW);
		WriteChatColor("/aaspend setauto -- Sets auto array",CONCOLOR_YELLOW);
		return;
	}
	if(!strcmpi(szArg1, "status")){
		WriteChatColor("--MQ2AASpend status--", CONCOLOR_YELLOW);
		if(bruteflag == true)
			WriteChatColor("Brute Mode: Enabled");
		else
			WriteChatColor("Brute Mode: Disabled");

		if(autoflag == true)
			WriteChatColor("Auto Mode: Enabled");
		else
			WriteChatColor("Auto Mode: Disabled");

		WriteChatColor("Auto Array:");
		for(int j = 1;j<=10;j++){
			sprintf(arrayprint,"%d. %s", j, AutoArray[j-1]);
			WriteChatColor(arrayprint);
		}
		return;
	}
	if(!strcmpi(szArg1, "setauto")){
		GetArg(szArg2, szLine, 2);
		GetArg(szArg3, szLine, 3);
		if(!strcmpi(szArg2, "") || !strcmpi(szArg2, "") || !IsNumber(szArg3)){
			WriteChatColor("Invalid ability name and or Auto number",CONCOLOR_YELLOW);
			return;
		}

		if(atoi(szArg3)<1 || atoi(szArg3) > 10){
			WriteChatColor("Auto number must be an integer from 1-10",CONCOLOR_YELLOW);
			return;
		}
		strcpy(AutoArray[atoi(szArg3)-1],szArg2);
		sprintf(arrayprint,"Ability %s set to prioirty %d",szArg2,atoi(szArg3));
		WriteChatColor(arrayprint);
		return;
	}
	if(!strcmpi(szArg1,"brute")){
		if(bruteflag == true){
			WriteChatColor("Brute Mode: Disabled");
			bruteflag = false;
		}else{
			WriteChatColor("Brute Mode: Enabled -- Autospending AA's in order of appearence");
			bruteflag = true;
		}
		autoflag = false;
		return;
	}
	if(!strcmpi(szArg1,"auto")){
		if(autoflag == true){
			WriteChatColor("Auto Mode: Disabled");
			autoflag = false;
		}else{
			WriteChatColor("Auto Mode: Enabled -- Autospending AA's based on the Autoarray");
			autoflag = true;
		}
		bruteflag = false;
		return;
	}

	for(unsigned long nAbility=0 ; nAbility<NUM_ALT_ABILITIES ; nAbility++){
		if(PALTABILITY pAbility=pAltAdvManager->GetAltAbility(nAbility)){
			if(!stricmp(pCDBStr->GetString(pAbility->nName, 1, NULL), szArg1)){
				
				if(GetCharInfo2()->AAPoints >= pAbility->Cost)
					Spend(pAbility->Index);
		
				else {
					WriteChatColor("You do not have enough AA points to buy this Ability",CONCOLOR_YELLOW);
					return;
				}
            } 
        }
	}
}

void Spend(DWORD Idx){
	ZeroMemory(&SpendPkt, sizeof(SpendPkt)); 
	SpendPkt.FunctionM = 3;
	SpendPkt.Index = Idx;
	SendEQMessage(SP_Instant_AA, &SpendPkt, sizeof(SpendPkt));
}

PLUGIN_API VOID OnPulse(VOID){

	if(bruteflag == true){
		for(unsigned long nAbility=0 ; nAbility<NUM_ALT_ABILITIES ; nAbility++){
			if(PALTABILITY pAbility=pAltAdvManager->GetAltAbility(nAbility)){
				if(GetCharInfo2()->AAPoints >= pAbility->Cost)
					Spend(pAbility->Index);
				else
					return;
			}
		}
	}

	if(autoflag == true){
		for(int q = 0; q < 10;q++){
			for(unsigned long nAbility=0 ; nAbility<NUM_ALT_ABILITIES ; nAbility++){
				if(PALTABILITY pAbility=pAltAdvManager->GetAltAbility(nAbility)){
					if(!stricmp(pCDBStr->GetString(pAbility->nName, 1, NULL), AutoArray[q])){
						if(GetCharInfo2()->AAPoints >= pAbility->Cost)
							Spend(pAbility->Index);
						else
							return;
					}
				}
			}
		}
	}
}

PLUGIN_API VOID InitializePlugin(VOID){
	DebugSpewAlways("Initializing MQ2AASpend");
	WriteChatColor("MQ2AASpend -- By Zippzipp",CONCOLOR_YELLOW);
	AddCommand("/aaspend",aaSpend);
}

PLUGIN_API VOID ShutdownPlugin(VOID){
	DebugSpewAlways("Shutting down MQ2AASpend");
	RemoveCommand("/aaspend");
}

Enjoy!!!

--Zippzipp

(like my stuff? Wanna donate? [email protected] is my paypal)
 
Last edited:
I must wait at least 24 hours, and then I have to spread reputation around... Very nice work, using it as I speak.
 
Pretty good, but you should make the autoarray a vector instead of an array. That way it can change size and have no limits. Also, I noticed some of the spam mentions an INI, yet I see no INI support. Was this something you abandoned?
 
Yea an INI file is something i abandoned, figured there are so many AA's people arent gonna wanna customize an ini every time they want to spend them. Thats why i did it as a changeable array. Guess i missed one of the spams that talked about the ini.

--Zippzipp
 
From my understanding this can only be set to be so far into he future? Meaning i can only pre select x number of aa's? If that's true it would be more useful if this could be modified to include some form of ini that you could list any number of aa.

Basically looking to use this in a AFK macro as it sounds like it will work better then my sub to buy aa's but i prefer not to brute aa's and miss out on the good ones first.
 
WickedMetalHead said:
From my understanding this can only be set to be so far into he future? Meaning i can only pre select x number of aa's? If that's true it would be more useful if this could be modified to include some form of ini that you could list any number of aa.

Basically looking to use this in a AFK macro as it sounds like it will work better then my sub to buy aa's but i prefer not to brute aa's and miss out on the good ones first.

NO, its set to spend to completion up to 10 AA categories, set your array like this
/aaspend setauto "innate strength" 1
/aaspend setauto "innate Stamina" 2
/aaspend setauto "Death Blow" 3

It will spend your AA's until #1 is complete then move to number 2 so your innate strength will fill first tehn the next aa's will go to stamina and once thats complete it will move on to death blow and so on.

If you can spend that many AA's that you can fill more then 10 catagories before you come back to the computer please drop me a line and fill me in on what the hell your using because I would sure like to run it.

So basicly the answer to your question is NO it does not earmark 10 AA's it ear marks 10 AA abilities to fill in order of the importance you set
 
Learningcurve said:
NO, its set to spend to completion up to 10 AA categories, set your array like this
/aaspend setauto "innate strength" 1
/aaspend setauto "innate Stamina" 2
/aaspend setauto "Death Blow" 3

It will spend your AA's until #1 is complete then move to number 2 so your innate strength will fill first tehn the next aa's will go to stamina and once thats complete it will move on to death blow and so on.

If you can spend that many AA's that you can fill more then 10 catagories before you come back to the computer please drop me a line and fill me in on what the hell your using because I would sure like to run it.

So basicly the answer to your question is NO it does not earmark 10 AA's it ear marks 10 AA abilities to fill in order of the importance you set
It seemed to work slightly different than how you describe above.

The first AA you setauto will spend like it's supposed to, but after the 1st autospend AA is done, it works differently.

For example, my AA list was this:

1. Weightless Steps (already had rank 1) 6/9
2. Lightning Reflexes 3/3/3/3/3
3. Innate Defense 3/3/3/3/3
4. Combat Fury 2/4/6
5. Strikethrough 3/6/9
6. Kick Mastery 3/6/9
7..
8..
9..
10..

7-10 were filled also, but they are not important.

After #1 was finished, it should've saved only 3 to spend on Lightning Reflexes rk 1. Instead, it saved up 9, and spent:

3 on LR rk1
3 on ID rk1
2 on CF rk1

which left me with 1 AA unspent. I kept it running, and it saved up 9 again, and it spent:

3 on LR rk2
3 on ID rk2
3 on Strikethrough rk1

All AA's were spent, but I kept it running some more. It saved up 9 again, and spent:

3 on LR rk3
3 on ID rk3
3 on Kick Mastery rk1

For some reason, it is pre-calculating your Array to see what combinations of 9 it can spend the saved AA's on. When it reaches 9 unspent, it divvy's them up to as many differen't AA categories as it can before it spends all 9.

It doesn't sound like this is intended, and really isn't that big of a deal (aa's gonna be bought anyways), but just a heads up.
 
Figuring i'm normally asleep 8-9 hours i can get 400ish aa non LOTD while im asleep, not counting the time i run it when im just watching TV. I currently use BuyAA.inc and it works alright, sometimes it skips around, but i lose *some* xp when the aa is buying, moving it to a plugin would allow it to operate better overall.
 
if you can get 400 aa a night, why are you worrying about missing the good ones first? you will be done with all possible aa in five days.
 
Because i have multiple characters and i don't wish to run 1 through, then the next, i was hoping on being able to get the important ones for each one first, i can see this wont do it now, and i'll stick to my BuyAA.inc until i am done or until i get around o seeing if i can make this include that.
 
WickedMetalHead said:
Figuring i'm normally asleep 8-9 hours i can get 400ish aa non LOTD while im asleep, not counting the time i run it when im just watching TV. I currently use BuyAA.inc and it works alright, sometimes it skips around, but i lose *some* xp when the aa is buying, moving it to a plugin would allow it to operate better overall.
And where are you exping to get this kind of experience in this amount of time?

Thanks for the plugin Zipp, the brute command is nice.

plink
 
Anguish with nodelay and an afk macro eating hanvars guards I would guess.
 
WMH, as a temp thing, you could set up a sub that checked for having those AAs completed, then when they are, issue a command for the next 10, set via INI.
 
I like the plugin... I get about 160 AA's a night with my AFK macro, and after a bit I check back and toss in some more to the list
 
Still loving the plugin, I don't like the idea of them resetting everytime I restart my computer, but I guess this works better than nothing.
 
How in the heck is everyone getting so many AA's to even need this plugin to begin with? I solo and it takes me about 2 hours per AA, if I am lucky. I have huge AA envy for all of you. Anyone want to hook up a 75 cleric with some clues?
 
ill update it within next day or 2, i have to finish a class project first tho.

--zippzipp
 
Ah, Zip. Really looking forward to an update to this one.

Great work, loved it when I had it.
 
Is the nodelay plugin trackable? I mean as long as your not using it around others, is it seen serverside?
 
Alez, pretty sure it qualifies as an "active" hack, so yeah. Plus, if you consider that most people use it with GK, which is definitely active...
 
Yep its trackable, doing massave DPS is easly seen, and btw any have an update for this yet?? or something like it?
 
I recompiled this early this morning, and it did not seem to be working. I will be doing some tracing through the code to see where it is messing up later tonight after raids and such. Just had a few minutes to look it over this morning, and on the autospend it does not seem to be entering this section at all from what I have determined:

Code:
if(PALTABILITY pAbility=pAltAdvManager->GetAltAbility(nAbility))
	{
	if(!stricmp(pCDBStr->GetString(pAbility->nName, 1, NULL), AutoArray[q])){
		if(GetCharInfo2()->AAPoints >= pAbility->Cost)
			Spend(pAbility->Index);
		else
			return;
	}

I will do some more debugging later tonight once I actually get home and can work on it.
 
MQ2AASpend -- Auto AA spending Plugin

Users who are viewing this thread

Back
Top
Cart