View Single Post
  #5  
Unread 03-26-2011, 01:29 PM
Garan's Avatar
Garan Garan is offline
The Undying
Interface Author - Click to view interfaces
 
Join Date: Oct 2010
Posts: 343
Quote:
Originally Posted by aens
I don't get it. You can perform emotes with Lua (with quickslots, yes), but you can't do it at a set interval. How is that protected? If I can print "Hello world" every 5 minutes, setting the interval to a function containing "Turbine.Shell.WriteLine "Hello world";", can't you put the "use quickslot" code inside that function and make it work that way?
The text written to the standard channel by the WriteLine method does not get processed by the chat window, i.e. no "/" commands actually get run, the text is just output, unprocessed, to your chat window, and ONLY your chat window, no one else sees the text. So, you can't actually "perform" emotes programmatically, all you can do is change the alias in the Lua quickslot so that the next time the user clicks the Lua quickslot the alias is processed (and if it is an emote, the emote is performed). Additionally, the quickslots we can change are those that are created as part of a Lua plugin, NOT to be confused with the Quickslot bars that are part of the UI - we have no control over the built-in Quickslot bars via Lua.

When using an icon to cover a quickslot, remember to SetMouseVisible(false) on the icon so that mouse clicks get passed through to the shortcut. It also helps to put the quickslot inside another additional container Control, size the quickslot larger than it's container and position it at negative coordinates so that the ugly text part of the quickslot is hidden from any transparent portions of your image. Also be sure to set dragdrop(false) on the quickslot if you don't want your users overriding your alias and add a MouseLeave event handler that resets the alias since even with dragdrop(false), the user can still drag the alias out of the quickslot.
Reply With Quote