Plugin:MirLua: Difference between revisions

From Miranda NG
Plugin:MirLua
Jump to navigation Jump to search
(Marked this version for translation)
No edit summary
Line 3: Line 3:
<!--T:1-->
<!--T:1-->
Extends Miranda NG functionality with Lua scripts.
Extends Miranda NG functionality with Lua scripts.
</translate>


== Modules == <!--T:2-->
<translate>
== Lua == <!--T:2-->
The plugin uses Lua 5.3.4 which shipped as shared library lua53.dll.
</translate>
 
<translate>
== Additional functions == <!--T:2-->
</translate>
<translate>
=== toansi===
Encodes lua utf-8 string to ansi. It can be usefull for passing string as parameter to ansi function.
<code>m.CallService('mRadio/Import', 0, toansi(m.Parse('%miranda_path%\\Plugins\\mradio.ini')))</code>
Also it has a short version '''a'''.
<code>m.CallService('DB/Ini/ImportFile', 0, a'import\\autoexec.ini')</code>
</translate>
<translate>
=== toucs2 ===
Same as '''toansi''' but for utf-16. Also it has a short version '''u'''.
</translate>
<translate>
=== tonumber ===
If it receives '''light userdata''' parameter then returns it address as number, otherwise uses standard lua '''tonumber''' behaviour.
</translate>
<translate>
=== topointer ===
Converts lua types '''bool''', '''number''', '''string''' to  '''light userdata'''.
</translate>
<translate>
=== string.interpolate ===
Provides a more readable and convenient syntax to format string output.
<code>
local h = 'Hello'
print('{h}, {w}!' % {w = 'World'})
</code>
</translate>
 
<translate>
== Internal modules == <!--T:2-->
</translate>
</translate>



Revision as of 02:01, 5 April 2018

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.

Lua

The plugin uses Lua 5.3.4 which shipped as shared library lua53.dll.

Additional functions

toansi

Encodes lua utf-8 string to ansi. It can be usefull for passing string as parameter to ansi function. m.CallService('mRadio/Import', 0, toansi(m.Parse('%miranda_path%\\Plugins\\mradio.ini'))) Also it has a short version a. m.CallService('DB/Ini/ImportFile', 0, a'import\\autoexec.ini')

toucs2

Same as toansi but for utf-16. Also it has a short version u.

tonumber

If it receives light userdata parameter then returns it address as number, otherwise uses standard lua tonumber behaviour.

topointer

Converts lua types bool, number, string to light userdata.

string.interpolate

Provides a more readable and convenient syntax to format string output. local h = 'Hello' print('{h}, {w}!' % {w = 'World'})

Internal modules

Examples

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

External links