[Home] [Downloads] [Search] [Help/forum]

Gammon Forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  Lua
. . -> [Subject]  Add an Entry to the context menu
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Add an Entry to the context menu

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page


Posted by WillFa   USA  (525 posts)  [Biography] bio
Date Wed 19 Nov 2008 05:07 AM (UTC)
Message
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.

[Go to top] top

Posted by Worstje   Netherlands  (899 posts)  [Biography] bio
Date Reply #1 on Wed 19 Nov 2008 06:20 AM (UTC)

Amended on Wed 19 Nov 2008 06:21 AM (UTC) by Worstje

Message
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.
[Go to top] top

Posted by WillFa   USA  (525 posts)  [Biography] bio
Date Reply #2 on Wed 19 Nov 2008 06:56 AM (UTC)
Message
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.


[Go to top] top

Posted by Nick Gammon   Australia  (21,417 posts)  [Biography] bio   Forum Administrator
Date Reply #3 on Wed 19 Nov 2008 10:40 PM (UTC)
Message
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).

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Worstje   Netherlands  (899 posts)  [Biography] bio
Date Reply #4 on Thu 20 Nov 2008 (UTC)
Message
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!
[Go to top] top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


4,376 views.

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at FutureQuest]