UseItemCmd referenced by ISXEQ source but not defined

Moderator: MacroQuest Developers

rlane187
orc pawn
orc pawn
Posts: 19
Joined: Sat Jun 18, 2005 12:00 pm

UseItemCmd referenced by ISXEQ source but not defined

Post by rlane187 » Wed May 13, 2015 8:13 pm

MQ2Utilities.cpp, when compiling ISXEQ uses this function.

Code: Select all

DWORD __stdcall RefreshMountKeyRingThread(PVOID pData)
{
	pkrdata kr = (pkrdata)pData;
	if(kr) {
		CXWnd *krwnd = kr->phWnd;
		bool bExact = kr->bExact;
		bool bUseCmd = kr->bUseCmd;
		CHAR szItemName[256] = {0};
		strcpy_s(szItemName,kr->ItemName);
		LocalFree(kr);
		if(krwnd) {
			bool bToggled = 0;
			if(!krwnd->dShow) {
				bToggled = true;
				DWORD ShowWindow = (DWORD)krwnd->pvfTable->ShowWindow;
				__asm {
					push ecx;
					mov ecx, [krwnd];
					call dword ptr [ShowWindow];
					pop ecx;
				}
				((CSidlScreenWnd*)krwnd)->StoreIniVis();
			}
			if(CTabWnd *pTab = (CTabWnd*)((CSidlScreenWnd*)(krwnd))->GetChildItem("IW_Subwindows")) {
				pTab->SetPage(6,true, true);//tab 6 is the mount key ring tab...
				gMouseEventTime = GetFastTime();
			}
			if(CListWnd *clist = (CListWnd*)krwnd->GetChildItem("IW_Mounts_MountList")) {
				ULONGLONG now = MQGetTickCount64();
				while(!((CSidlScreenWnd*)clist)->Items) {
					Sleep(10);
					if(now+5000 < MQGetTickCount64()) {
						WriteChatColor("Timed out waiting for mount keyring refresh",CONCOLOR_YELLOW);
						break;
					}				
				}
				if(bToggled) {
					((CXWnd*)krwnd)->Show(0,1);
					((CSidlScreenWnd*)krwnd)->StoreIniVis();
				}
				if(bUseCmd && ((CSidlScreenWnd*)clist)->Items) {
				        UseItemCmd(GetCharInfo()->pSpawn,szItemName);
				}
			}
		}
	}
	return 0;
}
The offending line is:

Code: Select all

UseItemCmd(GetCharInfo()->pSpawn,szItemName);
UseItemCmd is not defined in ISXEQ. I do not know why. You would think /useitem would be accessible in ISXEQ but alas, none of the / commands are defined in MQ2Commands. The entire file is greyed out in intellisense. Why?

EqMule
Developer
Developer
Posts: 2697
Joined: Fri Jan 03, 2003 9:57 pm
Contact:

Re: UseItemCmd referenced by ISXEQ source but not defined

Post by EqMule » Tue May 19, 2015 6:01 pm

don't know if it works now but latest zip should at least build without errors
My status o/
If you like MQ2 and would like to contribute, please do. My goal is 25 donations per month.
So far I've received Image donations for this month's patches.

Bitcoin: 1Aq8ackjQ4f7AUvbUL7BE6oPfT8PmNP4Zq
Krono: PM me.
I can always use characters for testing, PM me if you can donate one.

iluvseq
Clueless Mudslinger
Posts: 269
Joined: Mon Apr 14, 2003 10:05 am

Re: UseItemCmd referenced by ISXEQ source but not defined

Post by iluvseq » Wed May 20, 2015 3:33 pm

/useitem isn't needed in ISXEQ.

Instead, use /cast item "name of item"

Does the same thing.

FrankJScott
naggy
naggy
Posts: 2365
Joined: Sun Feb 19, 2023 7:11 am

High Rated Interior Design Blog

Post by FrankJScott » Thu Aug 10, 2023 11:03 pm

Why don't you Google it! before you post

FrankJScott
naggy
naggy
Posts: 2365
Joined: Sun Feb 19, 2023 7:11 am

High Rated Interior Design Blog

Post by FrankJScott » Fri Aug 11, 2023 1:21 am

Why don't you Google it! before you post