Macroquest code question

Help section from before the user variable changes that broke all macros

Moderator: MacroQuest Developers

devestator
a ghoul
a ghoul
Posts: 121
Joined: Thu Feb 27, 2003 4:25 pm

Macroquest code question

Post by devestator » Thu Feb 27, 2003 4:33 pm

I'm not sure if anyone will be willing to help me or not but I wanted to come over and ask anyway worse yall can do is flame me :)

Anyway I'm wondering how does macroquest get mana information? Dont get me wrong now I'm not lazy I plan to download the code tonight when I get home and try to figure it out myself but I figured if yall could tell me it would save me some time.

I'm working on eq utility program of my own that needs to be able to get mana information. If at all possible I'm going to do this without modifying the memory or anything like that. I seen from scripts that in macroquest there is a $char(type, ???) sub.. that would let me get $char(mana, pct) in a macroquest script so if I have to download the code to look I guess that is where I'll start.

Anyway though, if someone wants to help me without me having to dig through the code that would be great.. a privat pm or an email to robertsmithw@yahoo.com will work just as good as a post here.

Thanks and if you do flame be gentle please I mean no harm! =P

lifewolf
a ghoul
a ghoul
Posts: 143
Joined: Fri Oct 18, 2002 6:29 pm

Post by lifewolf » Thu Feb 27, 2003 5:51 pm

C:\Windows\Desktop\IRC-20030111\IRC-20030111\EQLib\EQLib.cpp

Code: Select all

DWORD GetMaxMana(VOID)
{
	DWORD MaxMana = 0;
	DWORD CharInfo = NULL;
	if (!EQADDR_CHAR_INFO) return 0;
	if (!*EQADDR_CHAR_INFO) return 0;
	CharInfo = (DWORD)*EQADDR_CHAR_INFO;
	__asm {
		push eax;
		push ecx;
		mov ecx, dword ptr [CharInfo];
		call dword ptr [EQADDR_MAXMANA];
		movsx eax, ax;
		mov [MaxMana], eax;
		pop ecx;
		pop eax;
	}
	return MaxMana;
}
Apparently MQ gets its max mana from call dword ptr [EQADDR_MAXMANA]; which is seemingly a function in EQ. I havent looked into Cur. Mana really at all since its nap time but this has to help some..
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Searching for 'Mana'...
\EQLib\EQLib.cpp(541):DWORD GetMaxMana(VOID)
\EQLib\EQLib.cpp(543): DWORD MaxMana = 0;
\EQLib\EQLib.cpp(552): call dword ptr [EQADDR_MAXMANA];
\EQLib\EQLib.cpp(554): mov [MaxMana], eax;
\EQLib\EQLib.cpp(558): return MaxMana;
\EQLib\EQLib.cpp(1050): GetPrivateProfileString("Function Locations","MaxMana","0",szBuffer,MAX_STRING,ClientINI); EQADDR_MAXMANA = strtoul(szBuffer,NULL,16);
\EQLib\EQLib.cpp(5434): // $char(mana,max)
\EQLib\EQLib.cpp(5435): } else if (!strncmp("char(mana,max)",szVar,14)) {
\EQLib\EQLib.cpp(5438): itoa(GetMaxMana(),szTemp,10);
\EQLib\EQLib.cpp(5442): // $char(mana,cur)
\EQLib\EQLib.cpp(5443): } else if (!strncmp("char(mana,cur)",szVar,14)) {
\EQLib\EQLib.cpp(5446): itoa(pCharInfo->Mana,szTemp,10);
\EQLib\EQLib.cpp(5450): // $char(mana,pct)
\EQLib\EQLib.cpp(5451): } else if (!strncmp("char(mana,pct)",szVar,14)) {
\EQLib\EQLib.cpp(5454): DWORD MaxMana = GetMaxMana();
\EQLib\EQLib.cpp(5455): if (MaxMana==0) {
\EQLib\EQLib.cpp(5458): itoa((INT)(100*(FLOAT)pCharInfo->Mana/(FLOAT)MaxMana),szTemp,10);
\EQLib\EQLib.cpp(5874): } else if (!strncmp(szArg,"mana",4)) {
\EQLib\EQLib.cpp(5875): itoa(pSpell->Mana,szTemp,10);
\EQLib\EQLib.cpp(9059): if (pCharInfo->Cursor->Common.Mana) {
\EQLib\EQLib.cpp(9060): sprintf(szTmp,"%dMana ",pCharInfo->Cursor->Common.Mana);
\EQLib\EQLib.h(4):DWORD EQADDR_MAXMANA=0;
\EQLib\MQ.h(216): signed long Mana;
\EQLib\MQ.h(310): DWORD Mana;
\EQLib\MQ.h(583): DWORD Mana;
\EQLib\weapons.h(75): "Manastone", // 0x44
\PerlCore\inc\config.h(1483): * many memory management calls.
\PerlCore\inc\embed.h(6):/* (Doing namespace management portably in C is really gross.) */
\PerlCore\inc\embedvar.h(6):/* (Doing namespace management portably in C is really gross.) */
\PerlCore\inc\intrpvar.h(131):/* memory management */
30 occurrence(s) have been found.