Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUSHclient ➜ Lua ➜ keyboard events/send/execute

keyboard events/send/execute

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


Posted by Ogomez92   (42 posts)  Bio
Date Mon 03 May 2010 06:16 PM (UTC)
Message
Hi,
I'm trying to code a little function for the tts plugins that interrupts when the user hits enter. I tried using OnPluginCommandEntered for this, and it worked fine but whenever the plugin uses world.Execute for aliases, it stops speech and we don't want that. So, is there a way to send a command for aliases to process without it actually going through OnPluginCommandEntered? I tried Send, but of course send wouldn't process the aliases.
Alternatively, I could use some kind of OnKeyPress so when the user hits enter it stops the speech.
Thnx all.
Top

Posted by Ogomez92   (42 posts)  Bio
Date Reply #1 on Mon 03 May 2010 06:22 PM (UTC)
Message
If any of you are wondering why we use alias calls inside scripting is so we can call plugin functions inside other plugins without having to use callPlugin. It's easier to use Execute("history_add text") than CallPlugin("longid","func","param")
:)
Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #2 on Mon 03 May 2010 08:31 PM (UTC)
Message
Would backslash be acceptable? That is just above Enter on a lot of keyboards and is usually a bit larger than the other keys. Then you can just use the AcceleratorTo script function to stop the speech.

Or do you mean not so much "when the player hits enter" as "when the player manually enters a command"?

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Ogomez92   (42 posts)  Bio
Date Reply #3 on Mon 03 May 2010 09:17 PM (UTC)
Message
I mean when the player manually enters a command. By backslash, you mean that instead of pressing enter we'd have to hit backslash to send text? Or, do you mean binding enter to an accelerator - if that's even possible - to stop the speech and send the text?
If so, I guess that would work just as well.
Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #4 on Mon 03 May 2010 10:12 PM (UTC)
Message
Ogomez92 said:

I tried using OnPluginCommandEntered for this, and it worked fine but whenever the plugin uses world.Execute for aliases, it stops speech and we don't want that.


According to this:

Template:post=6572 Please see the forum thread: http://gammon.com.au/forum/?id=6572.


... OnPluginCommandEntered should *not* be called when you call world.Execute. And indeed a quick test shows that if you call Execute it does not call OnPluginCommandEntered. So you should be able to use OnPluginCommandEntered to distinguish between manually-entered commands and scripted commands.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
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.


16,498 views.

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

Go to topic:           Search the forum


[Go to top] top

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