Forum in READ ONLY mode! All questions and discussions on Discord official server, invite link: https://discord.gg/VxsGzJ7

Question about SetContextMenuHook

Ask for help
Post Reply
Ray
Neophyte
Neophyte
Posts: 28
Joined: 04.05.2012 7:13

Question about SetContextMenuHook

Post by Ray »

Code: Select all

procedure SetContextMenuHook(MenuID : Cardinal; EntryNumber : Byte)
What is the MenuID and how can I get it?
CFA
Developer
Developer
Posts: 492
Joined: 20.04.2006 6:03
Contact:

Re: Question about SetContextMenuHook

Post 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
Ray
Neophyte
Neophyte
Posts: 28
Joined: 04.05.2012 7:13

Re: Question about SetContextMenuHook

Post 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()
Ray
Neophyte
Neophyte
Posts: 28
Joined: 04.05.2012 7:13

Re: Question about SetContextMenuHook

Post 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:
CFA
Developer
Developer
Posts: 492
Joined: 20.04.2006 6:03
Contact:

Re: Question about SetContextMenuHook

Post by CFA »

yep, i fixed this. in short time update will be posted
on free shards tag=entry number, therefore, there was confusion
CFA
Developer
Developer
Posts: 492
Joined: 20.04.2006 6:03
Contact:

Re: Question about SetContextMenuHook

Post by CFA »

Post Reply