Plugin:MirLua: Difference between revisions
(Marked this version for translation) |
Dart Raiden (talk | contribs) No edit summary |
||
(15 intermediate revisions by 3 users not shown) | |||
Line 3: | Line 3: | ||
<!--T:1--> | <!--T:1--> | ||
Extends Miranda NG functionality with Lua scripts. | Extends Miranda NG functionality with Lua scripts. | ||
</translate> | |||
== Lua == | |||
<translate> | |||
<!--T:8--> | |||
The plugin uses <tvar|Lua_and_version>Lua 5.3.4</> which is shipped as a shared library <tvar|dll_name>lua53.dll</>. | |||
== Additional functions == <!--T:9--> | |||
</translate> | |||
=== toansi === | |||
<translate> | |||
<!--T:10--> | |||
Encodes lua utf-8 string to ansi. It can be useful for passing string as parameter to ansi function. | |||
</translate> | |||
<code>m.CallService('mRadio/Import', 0, toansi(m.Parse('%miranda_path%\\Plugins\\mradio.ini')))</code> | |||
<translate> | |||
<!--T:11--> | |||
Also it has a short version <tvar|a_syntax_symbol>'''<code>a</code>'''</>. | |||
</translate> | |||
<code>m.CallService('DB/Ini/ImportFile', 0, a'import\\autoexec.ini')</code> | |||
=== toucs2 === | |||
<translate> | |||
<!--T:12--> | |||
Same as <tvar|toansi><code>toansi</code></> but for utf-16. Also it has a short version <tvar|u_syntax_symbol>'''<code>u</code>'''</>. | |||
</translate> | |||
=== tonumber === | |||
<translate> | |||
<!--T:13--> | |||
If it receives <tvar|light_userdata><code>light userdata</code></> parameter then returns it address as number, otherwise uses standard lua <tvar|tonumber><code>tonumber</code></> behavior. | |||
</translate> | |||
=== topointer === | |||
<translate> | |||
<!--T:14--> | |||
Converts lua types <tvar|bool><code>bool</code></>, <tvar|number><code>number</code></>, <tvar|string><code>string</code></> to <tvar|light_userdata><code>light userdata</code></>. | |||
</translate> | |||
== | === string.interpolate === | ||
<translate> | |||
<!--T:15--> | |||
Provides a more readable and convenient syntax to format string output. | |||
</translate> | </translate> | ||
* [[Plugin:MirLua/ | <code> | ||
* [[Plugin:MirLua/en/m_core|m_core]] | local h = 'Hello' | ||
* [[Plugin:MirLua/en/m_database|m_database]] | print('{h}, {w}!' % {w = 'World'}) | ||
* [[Plugin:MirLua/en/m_genmenu|m_genmenu]] | </code> | ||
* [[Plugin:MirLua/en/m_hotkeys|m_hotkeys]] | |||
* [[Plugin:MirLua/en/m_icolib|m_icolib]] | <translate> | ||
* [[Plugin:MirLua/en/m_sounds|m_sounds]] | == Internal modules == <!--T:2--> | ||
</translate> | |||
* [[Special:MyLanguage/Plugin:MirLua/Module/m_clist|m_clist]] | |||
* [[Special:MyLanguage/Plugin:MirLua/Module/m_core|m_core]] | |||
* [[Special:MyLanguage/Plugin:MirLua/Module/m_database|m_database]] | |||
* [[Special:MyLanguage/Plugin:MirLua/Module/m_genmenu|m_genmenu]] | |||
* [[Special:MyLanguage/Plugin:MirLua/Module/m_hotkeys|m_hotkeys]] | |||
* [[Special:MyLanguage/Plugin:MirLua/Module/m_http|m_http]] | |||
* [[Special:MyLanguage/Plugin:MirLua/Module/m_icolib|m_icolib]] | |||
* [[Special:MyLanguage/Plugin:MirLua/Module/m_json|m_json]] | |||
* [[Special:MyLanguage/Plugin:MirLua/Module/m_message|m_message]] | |||
* [[Special:MyLanguage/Plugin:MirLua/Module/m_options|m_options]] | |||
* [[Special:MyLanguage/Plugin:MirLua/Module/m_protocols|m_protocols]] | |||
* [[Special:MyLanguage/Plugin:MirLua/Module/m_sounds|m_sounds]] | |||
* [[Special:MyLanguage/Plugin:MirLua/Module/m_srmm|m_srmm]] | |||
* EN | |||
** [[Plugin:MirLua/en/m_core|m_core]] | |||
** [[Plugin:MirLua/en/m_database|m_database]] | |||
** [[Plugin:MirLua/en/m_genmenu|m_genmenu]] | |||
** [[Plugin:MirLua/en/m_hotkeys|m_hotkeys]] | |||
** [[Plugin:MirLua/en/m_icolib|m_icolib]] | |||
** [[Plugin:MirLua/en/m_sounds|m_sounds]] | |||
* RU | |||
** [[Plugin:MirLua/ru/m_clist|m_clist]] | |||
** [[Plugin:MirLua/ru/m_core|m_core]] | |||
** [[Plugin:MirLua/ru/m_database|m_database]] | |||
** [[Plugin:MirLua/ru/m_genmenu|m_genmenu]] | |||
** [[Plugin:MirLua/ru/m_hotkeys|m_hotkeys]] | |||
** [[Plugin:MirLua/ru/m_icolib|m_icolib]] | |||
** [[Plugin:MirLua/ru/m_sounds|m_sounds]] | |||
<translate> | <translate> | ||
== Examples == <!--T:3--> | == Examples == <!--T:3--> | ||
<!--T:16--> | |||
[[Special:PrefixIndex/Content:MirLua/Examples/|Some examples]]. | |||
</translate> | </translate> | ||
{{Content:MirLua/Examples}} | <!-- Todo use this after https://github.com/ProfessionalWiki/SubPageList/issues/74 will be fixed | ||
{{Content:MirLua/Examples}} --> | |||
<translate> | <translate> |
Latest revision as of 17:54, 28 September 2023
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 is shipped as a shared library lua53.dll.
Additional functions
toansi
Encodes lua utf-8 string to ansi. It can be useful 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
behavior.
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
- m_core
- m_database
- m_genmenu
- m_hotkeys
- m_http
- m_icolib
- m_json
- m_message
- m_options
- m_protocols
- m_sounds
- m_srmm
- EN
Examples
External links