Esempio n. 1
0
VOID BzSrchMe(PSPAWNINFO pChar, PCHAR szLine)
{
	lockit lk(bzsrchhandle);

	CHAR szArg[MAX_STRING] = { 0 };
	CHAR szItem[MAX_STRING] = { 0 };
    PCHARINFO pCharInfo = GetCharInfo();
    BOOL bArg = TRUE;
	bool first = true;


	if (CButtonWnd *ptr = (CButtonWnd *)pBazaarSearchWnd->GetChildItem("BZR_Default")) {
		SendWndClick2((CXWnd*)ptr, "leftmouseup");
	}
	while (bArg) {
		GetArg(szArg, szLine, 1);
		szLine = GetNextArg(szLine, 1);
		if (szArg[0] == 0) {
			bArg = FALSE;
		} else if (!strcmp(szArg, "class")) {
			GetArg(szArg, szLine, 1);
			szLine = GetNextArg(szLine, 1);
			DoClass(szArg);
		} else if (!_stricmp(szArg, "race")) {
			GetArg(szArg, szLine, 1);
			szLine = GetNextArg(szLine, 1);
			DoRace(szArg);
		} else if (!_stricmp(szArg, "stat")) {
			GetArg(szArg, szLine, 1);
			szLine = GetNextArg(szLine, 1);
			DoCombo(szArg, "Stat", "BZR_StatSlotCombobox");
		} else if (!_stricmp(szArg, "slot")) {
			GetArg(szArg, szLine, 1);
			szLine = GetNextArg(szLine, 1);
			DoCombo(szArg, "Slot", "BZR_ItemSlotCombobox");
		} else if (!_stricmp(szArg, "type")) {
			GetArg(szArg, szLine, 1);
			szLine = GetNextArg(szLine, 1);
			DoCombo(szArg, "Type", "BZR_ItemTypeCombobox");
		} else if (!strcmp(szArg, "price")) {
			GetArg(szArg, szLine, 1);
			szLine = GetNextArg(szLine, 1);
			if (szArg[0] == 0) {
				MacroError("Bad price low.");
				goto error_out;
			}
			if (CXWnd *pEdit = (CXWnd *)pBazaarSearchWnd->GetChildItem("BZR_MinPriceInput")) {
				pEdit->SetWindowTextA(CXStr(szArg));
			}
			GetArg(szArg, szLine, 1);
			szLine = GetNextArg(szLine, 1);
			if (szArg[0] == 0) {
				MacroError("Bad price high.");
				goto error_out;
			}
			if (CXWnd *pEdit = (CXWnd *)pBazaarSearchWnd->GetChildItem("BZR_MaxPriceInput")) {
				pEdit->SetWindowTextA(CXStr(szArg));
			}
		} else if (!_stricmp(szArg, "trader")) {
			GetArg(szArg, szLine, 1);
			szLine = GetNextArg(szLine, 1);
			DoCombo(szArg, "Trader", "BZR_PlayersCombobox");
		} else if (!_stricmp(szArg, "prestige")) {
			GetArg(szArg, szLine, 1);
			szLine = GetNextArg(szLine, 1);
			DoCombo(szArg, "Prestige", "BZR_ItemPrestigeCombobox");
		} else if (!_stricmp(szArg, "augment")) {
			GetArg(szArg, szLine, 1);
			szLine = GetNextArg(szLine, 1);
			DoCombo(szArg, "Augment", "BZR_ItemAugmentCombobox");
		} else {
			if (first) {
				first = false;
			} else {
				strcat(szItem, " ");
			}
			strcat(szItem, szArg);
		}
	}
	if (CXWnd *pEdit = (CXWnd *)pBazaarSearchWnd->GetChildItem("BZR_ItemNameInput")) {
		pEdit->SetWindowTextA(CXStr(szItem));
		DWORD nThreadID = 0;
		CreateThread(NULL, NULL, searchthread, 0, 0, &nThreadID);
	}
error_out:
	return;
}
Esempio n. 2
0
VOID BzSrchMe(PSPAWNINFO pChar, PCHAR szLine)
{
	lockit lk(bzsrchhandle,"BzSrchMe");
	BzDone = FALSE;
	CHAR szArg[MAX_STRING] = { 0 };
	CHAR szItem[MAX_STRING] = { 0 };
    PCHARINFO pCharInfo = GetCharInfo();
    BOOL bArg = TRUE;
	bool first = true;

	if (CButtonWnd *pDefaultButton = (CButtonWnd *)pBazaarSearchWnd->GetChildItem("BZR_Default")) {
		if (pDefaultButton && pDefaultButton->Enabled) {
			SendWndClick2((CXWnd*)pDefaultButton, "leftmouseup");
		} else {
			MacroError("Whats wrong? BZR_Default wasnt enabled.");
		}
	} else {
		MacroError("Whats wrong? Counldnt find the BZR_Default window.");
	}
	if (CListWnd *pList = (CListWnd *)pBazaarSearchWnd->GetChildItem("BZR_ItemList")) {
		pList->DeleteAll();
	}
	BzCount = 0;
	while (bArg) {
		GetArg(szArg, szLine, 1);
		szLine = GetNextArg(szLine, 1);
		if (szArg[0] == 0) {
			bArg = FALSE;
		} else if (!strcmp(szArg, "class")) {
			GetArg(szArg, szLine, 1);
			szLine = GetNextArg(szLine, 1);
			DoClass(szArg);
		} else if (!_stricmp(szArg, "race")) {
			GetArg(szArg, szLine, 1);
			szLine = GetNextArg(szLine, 1);
			DoRace(szArg);
		} else if (!_stricmp(szArg, "stat")) {
			GetArg(szArg, szLine, 1);
			szLine = GetNextArg(szLine, 1);
			DoCombo(szArg, "Stat", "BZR_StatSlotCombobox");
		} else if (!_stricmp(szArg, "slot")) {
			GetArg(szArg, szLine, 1);
			szLine = GetNextArg(szLine, 1);
			DoCombo(szArg, "Slot", "BZR_ItemSlotCombobox");
		} else if (!_stricmp(szArg, "type")) {
			GetArg(szArg, szLine, 1);
			szLine = GetNextArg(szLine, 1);
			DoCombo(szArg, "Type", "BZR_ItemTypeCombobox");
		} else if (!strcmp(szArg, "price")) {
			GetArg(szArg, szLine, 1);
			szLine = GetNextArg(szLine, 1);
			if (szArg[0] == 0) {
				MacroError("Bad price low.");
				goto error_out;
			}
			if (CXWnd *pEdit = (CXWnd *)pBazaarSearchWnd->GetChildItem("BZR_MinPriceInput")) {
				pEdit->SetWindowTextA(CXStr(szArg));
			}
			GetArg(szArg, szLine, 1);
			szLine = GetNextArg(szLine, 1);
			if (szArg[0] == 0) {
				MacroError("Bad price high.");
				goto error_out;
			}
			if (CXWnd *pEdit = (CXWnd *)pBazaarSearchWnd->GetChildItem("BZR_MaxPriceInput")) {
				pEdit->SetWindowTextA(CXStr(szArg));
			}
		} else if (!_stricmp(szArg, "trader")) {
			GetArg(szArg, szLine, 1);
			szLine = GetNextArg(szLine, 1);
			DoCombo(szArg, "Trader", "BZR_PlayersCombobox");
		} else if (!_stricmp(szArg, "prestige")) {
			GetArg(szArg, szLine, 1);
			szLine = GetNextArg(szLine, 1);
			DoCombo(szArg, "Prestige", "BZR_ItemPrestigeCombobox");
		} else if (!_stricmp(szArg, "augment")) {
			GetArg(szArg, szLine, 1);
			szLine = GetNextArg(szLine, 1);
			DoCombo(szArg, "Augment", "BZR_ItemAugmentCombobox");
		} else {
			if (first) {
				first = false;
			} else {
				strcat_s(szItem, " ");
			}
			strcat_s(szItem, szArg);
		}
	}
	if (CXWnd *pMaxEdit = (CXWnd *)pBazaarSearchWnd->GetChildItem("BZR_MaxResultsPerTraderInput")) {
		pMaxEdit->SetWindowTextA(CXStr("200"));
	} else {
		MacroError("Whats wrong? couldnt find the BZR_MaxResultsPerTraderInput window.");
	}
	if (CXWnd *pEdit = (CXWnd *)pBazaarSearchWnd->GetChildItem("BZR_ItemNameInput")) {
		pEdit->SetWindowTextA(CXStr(szItem));
		DWORD nThreadID = 0;
		CreateThread(NULL, NULL, searchthread, 0, 0, &nThreadID);
	} else {
		MacroError("Whats wrong? couldnt find the BZR_ItemNameInput window.");
	}
error_out:
	return;
}