Page 1 of 1

Question about SetContextMenuHook

Posted: 09.05.2012 9:40
by Ray

Code: Select all

procedure SetContextMenuHook(MenuID : Cardinal; EntryNumber : Byte)
What is the MenuID and how can I get it?

Re: Question about SetContextMenuHook

Posted: 09.05.2012 10:09
by CFA
Ray wrote:

Code: Select all

procedure SetContextMenuHook(MenuID : Cardinal; EntryNumber : Byte)
What is the MenuID and how can I get it?
menuID = npc ID, you can see menu content in uo jounral tab when menu requested by client or by function RequestContextMenu. Or use function GetContextMenu for get content of menu. Also EntryNumber can be seen ibid

Re: Question about SetContextMenuHook

Posted: 09.05.2012 10:30
by Ray

Code: Select all

Program ContextMenu;
Const
NPCID = $0052F8B9;
begin
RequestContextMenu(NPCID);
end.

Code: Select all

[15:31:24:500] System: ContexMenu! MenuID $0052F8B9 EntriesNumber: 03
[15:31:24:500] System:  Entry0: Tag $0208 Flags: 0000 Text: Open Paperdoll
[15:31:24:500] System:  Entry1: Tag $006E Flags: 0000 Text: Buy
[15:31:24:500] System:  Entry2: Tag $006F Flags: 0000 Text: Sell
But I cannot use SetContextMenuHook(NPCID,1) to Open the Buy Gump whatever i put the command before or after the RequestContextMenu()

Re: Question about SetContextMenuHook

Posted: 09.05.2012 12:10
by Ray
Is it the problem case by the difference packet between OSI and freeshard..
I found that the outgoing packet by using SetContextMenuHook($0052FB6A,1);

Code: Select all

17:13:19:231: Ray, Client -> Server: 0xBF, len: 11
0000: BF 00 0B 00 15 00 52 FB 6A 00 01   
is different from i click it by hand

Code: Select all

17:14:40:780: Ray, Client -> Server: 0xBF, len: 11
0000: BF 00 0B 00 15 00 52 FB 6A 00 6E  

Code: Select all

[17:13:19:215] System: ContexMenu! MenuID $0052FB6A EntriesNumber: 03
[17:13:19:215] System:  Entry0: Tag $0208 Flags: 0000 Text: Open Paperdoll
[17:13:19:215] System:  Entry1: Tag $006E Flags: 0000 Text: Buy
[17:13:19:215] System:  Entry2: Tag $006F Flags: 0000 Text: Sell
I think the freeshard use the index instead of the Tag value for exchange information... :oops:

Re: Question about SetContextMenuHook

Posted: 09.05.2012 12:40
by CFA
yep, i fixed this. in short time update will be posted
on free shards tag=entry number, therefore, there was confusion

Re: Question about SetContextMenuHook

Posted: 09.05.2012 14:07
by CFA