Page 1 of 1

NEW FEATURE: $char(hotbutton,xx)

Posted: Thu Jul 31, 2003 9:06 am
by EqMule
ok here it is... I needed this for some AA hotbuttons...
syntax example:

Code: Select all

/echo $char(hotbutton,3)
will return TRUE if there is a hotbutton in slot 3 which can be activated. it will return FALSE if its not "refreshed" or if there is no hotbutton in that slot.

in EQLib_MacroParser.cpp

Code: Select all

						// $char(hotbutton,x) example: /echo $char(hotbutton,1)
						} else if (!strncmp("char(hotbutton,",szVar,15)) {
							if (!strstr(szVar,")")) {
								DebugSpew("PMP - Bad $char() '%s'",szVar);
								i--;
								szOutput[j] = '@';
								j++;
							} else {
								CHAR szTemp[MAX_STRING] = {0};
								if (EQADDR_CLASSHOTBUTTONWND) {
									PEQHOTBUTTONWINDOW pHotButtonWindow = NULL;
									PEQHOTBUTTONWINDOW pHotButton = NULL;
									pHotButtonWindow = (PEQHOTBUTTONWINDOW)*EQADDR_CLASSHOTBUTTONWND;
									i += (strstr(szVar,")")-szVar);
											
									PCHAR szArg = szVar+15;
									DWORD HB = atoi(szArg);
									if (HB>0 && HB<11) {
										HB--;
										if (pHotButtonWindow->HotButtons[HB]){
											pHotButton = NULL;
											pHotButton = (PEQHOTBUTTONWINDOW)pHotButtonWindow->HotButtons[HB];
											DebugSpew("hotbutton check for HB %x and arg passed was %s",HB,szArg);
											if (pHotButton->HBRefreshed != 0) {
												strcpy(szTemp,"FALSE");
											} else {
												strcpy(szTemp,"TRUE");
											}
										} else {
											strcpy(szTemp,"NULL");
										}
									}
								}else {
									strcpy(szTemp,"offset error");
								}
							strcat(szOutput,szTemp);
							j += strlen(szTemp);
							}[color=red]
						// $char(buff,xxx)[/color] 
in EQLib.h

Code: Select all

DWORD *EQADDR_CLASSHOTBUTTONWND;
in EQLib_Main.cpp

Code: Select all

extern DWORD *EQADDR_CLASSHOTBUTTONWND;

Code: Select all

	GetPrivateProfileString("Class Locations","ClassHotButtonWnd","0",szBuffer,MAX_STRING,ClientINI);		EQADDR_CLASSHOTBUTTONWND = (PDWORD)strtoul(szBuffer,NULL,16);
and finally a new struct is needed in MQ.h

Code: Select all

typedef struct _EQHOTBUTTONWINDOW {
			DWORD   WindowID; 
			DWORD   TimeMouseOver;         //how many ms the window has had the mouse over it... 
			DWORD   Unknown0x008;      // 2000 seems a common value 
			DWORD   Unknown0x00c;      //500 seems a common value 
			BYTE    Flag; 
			BYTE    MouseOver;         //01 yes 00 no 
			BYTE    Unknown0x012; 
			BYTE    Unknown0x013; 
			BYTE    Unknown0x014[12]; 
			struct  _EQWINDOW *pDownTheTreeOnSameWindow; 
			struct  _EQWINDOW *pNextWindow; 
			DWORD   Flags4; 
			DWORD   Z;               //not sure but its logical to assume it at this point... 
			DWORD   X; 
			DWORD   Y; 
			DWORD   Height; 
			DWORD   Width; 
            DWORD   Depth;            //hmmm... 
            BYTE    Unknown0x040[12]; 
            BYTE    Open;            //1 open 0 closed 
            BYTE    Unknown0x051[7]; 
            DWORD   somekindofID; 
            DWORD   *pUnknownStruct0x060; 
            struct  _EQWINDOWINFO *Info; 
			BYTE	Unknown[88];
			BYTE	Unknown1[68];
			DWORD	SlotID;
			DWORD	Unknown2;
			DWORD	HBRefreshed;
			DWORD	Unknown3[2];
			BYTE	Selector;		//this graphically selects an item on/off
			BYTE	Unknown4[7];
			BYTE	Unknown5[40];
			DWORD	HotButtonWndView;//0 to 9 for the different views
struct _EQHOTBUTTONWINDOW	*HotButtons[10];//theese will change when you switch page...
} EQHOTBUTTONWINDOW, *PEQHOTBUTTONWINDOW;
and as usual in eqgame.ini we need the offset to the class

Code: Select all

[Class Locations]
ClassHotButtonWnd=005fe230
play nice.

Posted: Sun Aug 03, 2003 6:48 am
by kagonis
EqMule on a coding spree? :)
Very nice feature. I assume this works with AA buttons too?
Now I'll go read the AA request thingie and probably see that this is in fact what it does :)

Posted: Sun Aug 03, 2003 8:15 am
by wassup
Question on this...

I would like to use a hotkey with /alt activate #. The reason I don't use a socials button with /alt activate # is because I can never see when the AA Ability is ready to be used.

Will this only work if you put the actual AA hotbutton in a hotkey slot, or will it work if I also put a socials key with /alt activate # in the hotkeys slot.

I was thinking the function would let you know when an AA ability has refreshed.

Posted: Sun Aug 03, 2003 8:58 am
by EqMule
Wassup wrote:Will this only work if you put the actual AA hotbutton in a hotkey slot, or will it work if I also put a socials key with /alt activate # in the hotkeys slot.
try it... I dont know, but I do know this, if you have created a AA hotbutton and you place that in hotbutton window slot 1 you can check if its ready to use with this function...

off course it will work with other buttons as well, forage for example, but we allready have another function for that dont we...

Posted: Tue Aug 05, 2003 8:50 pm
by EqMule
can I get this tested and cvsed? 8)

Posted: Fri Aug 08, 2003 9:30 am
by wassup
I was looking through some stuff from that map file that was accidently released a bit ago and found this:

Code: Select all

public: bool __thiscall AltAdvManager::IsAbilityReady(class EQ_PC *,int const &,int *)		0046552d	?IsAbilityReady@AltAdvManager@@QAE_NPAVEQ_PC@@ABHPAH@Z	f		EQ_AltAdvManager.obj	0001:0006452d
Would this be of any use to you at all?

Posted: Fri Aug 08, 2003 3:26 pm
by EqMule
looks easy to call Ill take a look at it. thanks

Re: NEW FEATURE: $char(hotbutton,xx)

Posted: Thu Jan 22, 2026 11:58 pm
by xyilla

Re: NEW FEATURE: $char(hotbutton,xx)

Posted: Thu Jan 22, 2026 11:59 pm
by xyilla

Re: NEW FEATURE: $char(hotbutton,xx)

Posted: Fri Jan 23, 2026 12:00 am
by xyilla

Re: NEW FEATURE: $char(hotbutton,xx)

Posted: Fri Jan 23, 2026 12:02 am
by xyilla

Re: NEW FEATURE: $char(hotbutton,xx)

Posted: Fri Jan 23, 2026 12:04 am
by xyilla

Re: NEW FEATURE: $char(hotbutton,xx)

Posted: Fri Jan 23, 2026 12:05 am
by xyilla

Re: NEW FEATURE: $char(hotbutton,xx)

Posted: Fri Jan 23, 2026 12:06 am
by xyilla