Plugin:MirLua/en: Difference between revisions

From Miranda NG
Plugin:MirLua/en
Jump to navigation Jump to search
(+external links)
No edit summary
Line 6: Line 6:
{{Content:MirLua/Examples}}
{{Content:MirLua/Examples}}


== Functions ==
{{Content:MirLua/NamedEvents}}


== External links ==
== External links ==

Revision as of 23:52, 9 December 2015

MirLua
MirLua
Filename MirLua.dll
Author Miranda NG team
Download links
Stable version: 32-bit, 64-bit
Development version: 32-bit, 64-bit

Extends Miranda NG functionality with Lua scripts.


Examples

{{#subpages:Content:MirLua/Examples}}

Functions

Function Description Extended description Settings Example
CreateHookableEvent Creates a hookable event. name
Type: string
Event name.
Result
Type: light userdata
Returns event descriptor if event was created successfully, else nil.
local hEvent = m.CreateHookableEvent('MyEvent')
HookEvent Sets a callback function ("trap") to react to event call. Traps are called one by one in the order they were added to the sequence.

Trap signature: function (wParam, lParam) return 0 end.

Correct result for a trap is 0. When 1 is returned, the following traps in a sequence won't be called.
name
Type: string
Event name.

hook

Type: function
Trap function to be called when event occurs.
Result
Type: light userdata
Returns trap descriptor if trap was created successfully, else nil.
local hHook = m.HookEvent('MyEvent', function(w, l)
  print('MyEvent is raised!')
end)
UnhookEvent Removes "trap" from event call sequence. hEvent
Type: light userdata
Event descriptor received on CreateHookableEvent call.
Result
Type: boolean
Returns true if trap function was removed successfully, else false.
m.UnhookEvent(hHook)
NotifyEventHooks Calls all "traps" of event call sequence one by one. hEvent
Type: light userdata
Event descriptor received on CreateHookableEvent call.

wParam
lParam

Result
Type: boolean
Returns true if all trap functions were called, else false.
m.NotifyEventHooks(hEvent)

External links