Issue #1
After using /selectitem, $selecteditem doesn't work. After opening the merchant window, or clicking on any item, /echo $selecteditem() returns the name of the item without problem. If I use /selectitem slot 2 merchant, the appropriate item will be selected, but now /echo $selecteditem() returns "$selecteditem()" back to me instead of the item name. Also, if I play around with /selectitem and real mouse clicks, I can get 2 items selected (highlighted in yellow) simultaneously. Not a good sign.
Issue #2
Using /selectitem four or five times causes CTD. Thanks to Lax's supercool new explanation on how to trap access violations exceptions, I have the debug on the crash. Here is the call stack:
I'm using these commands for testing from in game command line, but here is the tail of the debug:MQ2MAIN! 01338743() (Yellow arrow here)
MQ2MAIN! 01334f25()
EQGAME! 004e2c5e()
EQGAME! 005821a7() (Green triangle here)
Here is the disassembly around the yellow arrow:[MQ2]CCommandHook::Detour(/echo $selecteditem(itemslot2))
[MQ2]Echo - [MQ2] 367
[MQ2]WriteChatColor([MQ2] 367)
[MQ2]CCommandHook::Detour(/selectitem slot 4 merchant)
[MQ2]/selectitem : yes the command works at least to this point
[MQ2]CChatHook::Detour(Stable Hand Brack tells you, 'That'll be 8399 platinum 9 gold 9 silver 9 copper for the Brown Rope Bridle.')
[MQ2]CCommandHook::Detour(/selectitem slot 4 merchant)
[MQ2]/selectitem : yes the command works at least to this point
Don't know if it's relevant, but the new ${merchant} commands don't seem to be working for me either. I just get NULL in response to anything.01338691 je 013386FA
01338693 mov edx,dword ptr [ebp-214Ch]
01338699 mov eax,dword ptr [ebp-1030h]
0133869F mov ecx,dword ptr [eax+edx*4+4]
013386A3 mov dword ptr [ebp-101Ch],ecx
013386A9 mov edx,dword ptr [ebp-101Ch]
013386AF mov eax,dword ptr [edx+4]
013386B2 mov dword ptr [ebp-1010h],eax
013386B8 mov ecx,dword ptr [ebp-1010h]
013386BE mov edx,dword ptr [ecx+118h]
013386C4 cmp edx,dword ptr [ebp-1014h]
013386CA jne 013386FA
013386CC mov eax,dword ptr [ebp-101Ch]
013386D2 mov dword ptr [ebp-1008h],eax
013386D8 mov ecx,dword ptr [ebp-1010h]
013386DE mov dword ptr [ebp-2040h],ecx
013386E4 mov dword ptr [ebp-804h],1
013386EE mov dword ptr [ebp-100Ch],1
013386F8 jmp 013386FF
013386FA jmp 01338668
013386FF mov dword ptr [ebp-102Ch],0
01338709 cmp dword ptr [ebp-100Ch],1
01338710 jne 013388A6
01338716 mov edx,dword ptr [ebp-102Ch]
0133871C mov eax,dword ptr [ebp-1020h]
01338722 cmp dword ptr [eax+edx*4+158h],0
0133872A je 013388A6
01338730 cmp dword ptr [ebp-804h],0
01338737 jne 013387E2
0133873D mov ecx,dword ptr [ebp-1024h]
01338743 mov edx,dword ptr [ecx+4] (Yellow arrow here)
01338746 mov dword ptr [ebp-1034h],edx
0133874C mov eax,dword ptr [ebp-1034h]
01338752 mov dword ptr [eax+12Ch],0
0133875C mov ecx,dword ptr [ebp-102Ch]
01338762 mov edx,dword ptr [ebp-1020h]
01338768 cmp dword ptr [edx+ecx*4+2B4h],0
01338770 jne 01338777
01338772 jmp 013388A6
01338777 mov eax,dword ptr [ebp-102Ch]
0133877D mov ecx,dword ptr [ebp-1020h]
01338783 mov edx,dword ptr [ecx+eax*4+2B4h]
0133878A mov dword ptr [ebp-1018h],edx
01338790 mov eax,dword ptr [ebp-1018h]
01338796 mov dword ptr [eax+12Ch],1
013387A0 mov ecx,dword ptr ds:[13AC368h]
013387A6 mov edx,dword ptr [ebp-1018h]
013387AC mov eax,dword ptr [edx+130h]
013387B2 mov dword ptr [ecx],eax
013387B4 mov ecx,dword ptr [ebp-1018h]
013387BA mov edx,dword ptr [ecx+124h]
013387C0 mov dword ptr [ebp-2150h],edx
013387C6 cmp dword ptr [ebp-2150h],0
013387CD jne 013387D4
013387CF jmp 013388A6
013387D4 cmp dword ptr [ebp-1014h],0
013387DB jne 013387E2
013387DD jmp 013388A6
013387E2 cmp dword ptr [ebp-804h],1
013387E9 jne 0133888B
013387EF mov eax,dword ptr [ebp-1024h]
013387F5 mov ecx,dword ptr [eax+4]
013387F8 mov dword ptr [ebp-1034h],ecx
013387FE mov edx,dword ptr [ebp-1034h]
01338804 mov dword ptr [edx+12Ch],0
0133880E cmp dword ptr [ebp-1008h],0
01338815 jne 0133881C
01338817 jmp 013388A6
0133881C cmp dword ptr [ebp-2040h],0
01338823 jne 01338827
01338825 jmp 013388A6
01338827 mov eax,dword ptr [ebp-2040h]
0133882D mov dword ptr [ebp-1018h],eax
01338833 mov ecx,dword ptr [ebp-1018h]
Let me know if you need anything else.
And thanks!
--Vexix
