client sided shift+click warehouse deposit

10/07/2024 22:34 munchn#1
i am just now getting back into private servers.. nothing serious, just goofing off. ive searched all around the forum but cant seem to find any information on how i would make it so that i could shift+click an item to deposit from inventory to warehouse. its for a 5095 server, but its not server sided? how would i go about achieving something like this
10/09/2024 08:54 teroareboss1#2
1. You need to hook the select item function from inventory to get the itemID and to process the Shift + click.
2. You need to identify the target windows. (Warehouse,Shop,Compouse,Improve...)
- The easy way is to hook MoveWindow to get this.
3. You need to identify the target window childs by id.
- You can use Spy++ to get this.
4. Send click on target window:
Code:
int CDlgActions::InventorySelectProcess()
{
	if ((GetAsyncKeyState(VK_SHIFT) & 0x8000) == 0)
		return 1;

	if (IsWindowEnabled(ShophWnd) && IsWindowVisible(ShophWnd))
		SendClick(ShophWnd, 0x610);
	else if (IsWindowEnabled(ImprovehWnd) && IsWindowVisible(ImprovehWnd))
	{
		if (SelectedItemId == 1088000 || SelectedItemId == 1088001 || SelectedItemId == 1088002)
			SendClick(ImprovehWnd, 0x65D);
		else
			SendClick(ImprovehWnd, 0x65C);
	}
.....

}
Code:
void CDlgActions::SendClick(HWND hWnd, int id)
{
	HWND hWndButton = GetDlgItem(hWnd, id);
	if (IsWindowEnabled(hWndButton) && IsWindowVisible(hWndButton))
	{
		PostMessage(hWndButton, WM_LBUTTONDOWN, 2, 0);
		PostMessage(hWndButton, WM_LBUTTONUP, 2, 0);
	}
}