Add an Entry to the context menu

Posted by WillFa on Wed 19 Nov 2008 05:07 AM — 5 posts, 20,057 views.

USA #0
I wanted to add a menu item to the right-click menu so that I could highlight some output, right click, and send that to an alias.

for example,
function qSearch(Text)
  for x in  Text:gmatch("%w+") do
    Send("exa " .. x)
    Send("search " .. x)
  end
end


I can figure out the code to get the selection length, and such, to supply that to the function, but I can't see if there's a way so that while I've got my hand on the mouse and highlighting the output, if I could just right click and execute that script, or another script that gets the selection and fires the above.

Thanks for any help.

Netherlands #1
I don't think that's possible currently.

Also, if you want to call an alias, you may want to use Execute() instead of Send(). And that loop doesn't seem really sane either, unless you want to call two aliases per selected word, rather than one alias depending on the menu item selected.
Amended on Wed 19 Nov 2008 06:21 AM by Worstje
USA #2
exa (examine) and search are mud commands. It's basically to hit all the nouns in a block of text to get their descriptions. It's a brute force method to questing on 3Kingdoms.


Australia Forum Administrator #3
You can't add to the context menu, but you can build your own menu that appears when you do Ctrl+Left-click.

Simply make an alias to do what you want, give it a name, and check "Menu". It then appears in that menu (by the name you give it).
Netherlands #4
I never saw that menu option in the alias window. It -does-, however, explain how the hell to fill that menu I occasionally managed to randomclick into appearance.

/me is fully content now!