Plugin:MirLua: Difference between revisions
No edit summary |
(small formatting; +variables to translations; fix translation units) |
||
Line 6: | Line 6: | ||
<translate> | <translate> | ||
== Lua == | == Lua == | ||
The plugin uses Lua 5.3.4 which shipped as shared library lua53.dll. | |||
The plugin uses <tvar|Lua_and_version>Lua 5.3.4</> which shipped as shared library <tvar|dll-name>lua53.dll</>. | |||
== Additional functions == | |||
=== toansi === | |||
Encodes lua utf-8 string to ansi. It can be usefull for passing string as parameter to ansi function. | |||
</translate> | </translate> | ||
<code>m.CallService('mRadio/Import', 0, toansi(m.Parse('%miranda_path%\\Plugins\\mradio.ini')))</code> | |||
<translate> | <translate> | ||
Also it has a short version <tvar|a_syntax_symbol>'''a'''</>. | |||
</translate> | </translate> | ||
<code>m.CallService('DB/Ini/ImportFile', 0, a'import\\autoexec.ini')</code> | <code>m.CallService('DB/Ini/ImportFile', 0, a'import\\autoexec.ini')</code> | ||
<translate> | <translate> | ||
=== toucs2 === | === toucs2 === | ||
Same as '''toansi''' but for utf-16. Also it has a short version '''u''' | |||
</ | Same as '''toansi''' but for utf-16. Also it has a short version <tvar|u_syntax_symbol>'''u'''</>. | ||
=== tonumber === | === tonumber === | ||
If it receives '''light userdata''' parameter then returns it address as number, otherwise uses standard lua '''tonumber''' behaviour. | If it receives '''light userdata''' parameter then returns it address as number, otherwise uses standard lua '''tonumber''' behaviour. | ||
=== topointer === | === topointer === | ||
Converts lua types '''bool''', '''number''', '''string''' to '''light userdata'''. | Converts lua types '''bool''', '''number''', '''string''' to '''light userdata'''. | ||
=== string.interpolate === | === string.interpolate === | ||
Provides a more readable and convenient syntax to format string output. | Provides a more readable and convenient syntax to format string output. | ||
</translate> | |||
<code> | <code> | ||
local h = 'Hello' | local h = 'Hello' | ||
print('{h}, {w}!' % {w = 'World'}) | print('{h}, {w}!' % {w = 'World'}) | ||
</code> | </code> | ||
<translate> | <translate> |
Revision as of 16:06, 5 April 2018
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
- m_clist
- Plugin:MirLua/Module/m core
- Plugin:MirLua/Module/m database
- Plugin:MirLua/Module/m genmenu
- Plugin:MirLua/Module/m hotkeys
- Plugin:MirLua/Module/m icolib
- Plugin:MirLua/Module/m sounds
Examples
{{#subpages:Content:MirLua/Examples}}
External links