oh I use a _tcsinc to advance a stringpointer, so you need to have a
Code: Select all
#include <tchar.h>Code: Select all
// $merchant(name)
} else if (!strncmp("merchant(name)",szVar,15)) {
CHAR szTemp[MAX_STRING] = {0};
CHAR* szOut;
i += 14;
if (!EQADDR_ACTIVEMERCHANT) return FALSE;
sprintf(szTemp,"%s",*EQADDR_ACTIVEMERCHANT);
szOut = _tcsinc(szTemp);
strncpy(szTemp,szOut,(strlen(szOut)-2));
strcat(szOutput,szTemp);
j+=strlen(szTemp);
// $merchant(xxx)
} else if (!strncmp("merchant(",szVar,9)) {
CHAR szTemp[MAX_STRING] = {0};
CHAR* szOut;
if (!strncmp("merchant()",szVar,10)) {
if (!EQADDR_ACTIVEMERCHANT) return FALSE;
sprintf(szTemp,"%s",*EQADDR_ACTIVEMERCHANT);
szOut = _tcsinc(szTemp);
strncpy(szTemp,szOut,(strlen(szOut)-2));
DebugSpew("%s",szTemp);
i += 9;
if (!strstr(szTemp, szVar)) {
strcat(szOutput,"TRUE");
j+=4;
} else {
strcat(szOutput,"FALSE");
j+=5;
}
// $merchant(has,xxx)
} else if (!strncmp("merchant(has,",szVar,13)) {
if (!EQADDR_CLASSMERCHWND) return FALSE;
PEQWINDOW pMerchWindow = NULL;
pMerchWindow = (PEQWINDOW)*EQADDR_CLASSMERCHWND;
if (!strstr(szVar,")")) {
DebugSpew("PMP - Bad $merchant() '%s'",szVar);
i--;
szOutput[j] = '@';
j++;
} else {
i += (strstr(szVar,")")-szVar);
if (pMerchWindow->Open == 1) {
PCHAR szArg = szVar+13;
if (szArg[0]=='"') szArg++;
CHAR szTemp[MAX_STRING] = {0};
DebugSpew("$merchant(has) -- looking for '%s'", szArg);
DWORD i;
BOOL Found = FALSE;
for (i=0;i<79;i++) {
if (pMerchWindow->ItemDesc[i]) {
if (!strnicmp(szArg,pMerchWindow->ItemDesc[i]->Name,strlen(pMerchWindow->ItemDesc[i]->Name))) {
Found=TRUE;
DebugSpew("Merchant does have: %s",pMerchWindow->ItemDesc[i]->Name);
break;
}
}
}
if (Found) {
strcat(szOutput,"TRUE");
j+=4;
} else {
strcat(szOutput,"FALSE");
j+=5;
}
} else {
strcat(szOutput,"FALSE");
j+=5;
}
}
// $merchant(Unknown)
} else {
DebugSpew("PMP - Bad $merchant() '%s'",szVar);
i--;
szOutput[j] = '@';
j++;
}
// $merchant
} else if (!strncmp("merchant",szVar,8)) {
if (!EQADDR_CLASSMERCHWND) return FALSE;
PEQWINDOW pMerchWindow = NULL;
pMerchWindow = (PEQWINDOW)*EQADDR_CLASSMERCHWND;
i += 7;
if (pMerchWindow->Open == 1) {
strcat(szOutput,"TRUE");
j+=4;
} else {
strcat(szOutput,"FALSE");
j+=5;
}Code: Select all
extern PCHAR *EQADDR_ACTIVEMERCHANT;Code: Select all
PCHAR *EQADDR_ACTIVEMERCHANT=0;Code: Select all
GetPrivateProfileString("Memory Locations","ActiveMerchant","0",szBuffer,MAX_STRING,ClientINI); EQADDR_ACTIVEMERCHANT = (PCHAR*)strtoul(szBuffer,NULL,16); Code: Select all
ActiveMerchant=00714970
donations for this month's patches.