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

Gammon Software Solutions 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

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page


Posted by WillFa   USA  (517 posts)  [Biography] bio
Date Wed 19 Nov 2008 05:07 AM (UTC)  quote  ]
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  (867 posts)  [Biography] bio
Date Reply #1 on Wed 19 Nov 2008 06:20 AM (UTC)  quote  ]

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  (517 posts)  [Biography] bio
Date Reply #2 on Wed 19 Nov 2008 06:56 AM (UTC)  quote  ]
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  (18,797 posts)  [Biography] bio   Forum Administrator
Date Reply #3 on Wed 19 Nov 2008 10:40 PM (UTC)  quote  ]
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  (867 posts)  [Biography] bio
Date Reply #4 on Thu 20 Nov 2008 (UTC)  quote  ]
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.


1,748 views.

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

[Home]

Written by Nick Gammon - 5K

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

[Best viewed with any browser - 2K]    [Internet Contents Rating Association (ICRA) - 2K]    [Web site powered by FutureQuest.Net]