Releases: ejetaxeblevich/LuaExtended
Releases · ejetaxeblevich/LuaExtended
Release list
2.2 [260731a]
- Добавлены новые методы и функции:
[F] int string.commas( string )
/* Возвращает количество запятых из строки */
[F] table table.clear( table )
/* Очищает существующую таблицу, чтобы не создавать новую.
Проходит по числовым индексам таблицы
в таблице не должно быть "дырок":
local t = {[1] = 1, [3] = 3} --> внутри таблицы t нет второго индекса (он уже nil)
= на этой дырке цикл остановится! */
[F] table table.clear2( table )
/* Очищает существующую таблицу, чтобы не создавать новую.
Проходит по всем индексам и ключам таблицы,
очищая таблицу целиком вне зависимости от наличия "дырок",
жертвуя скоростью по сравнению с [table.clear()] */Использование table.clear2:
local t = {
a = 3,
[67] = "text",
["mega_prikol"] = function() return "huy" end
}
table.clear2(t)
--> t = {}- Изменен ReadMe.
Click here for view text of the update is in English
- Added new methods and functions:
[F] int string.commas( string )
/* Returns the number of commas from a string */
[F] table table.clear( table )
/* Clears an existing table so as not to create a new one.
Passes through the numeric indexes of the table
there should be no "holes" in the table:
local t = {[1] = 1, [3] = 3} --> there is no second index inside table t (it is already nil)
= the cycle stops at this hole! */
[F] table table.clear2( table )
/* Clears an existing table so as not to create a new one.
Passes through all indexes and keys of the table,
clearing the entire table regardless of the presence of "holes",
sacrificing speed compared to [table.clear()] */Example table.clear2 usage:
local t = {
a = 3,
[67] = "text",
["mega_prikol"] = function() return "huy" end
}
table.clear2(t)
--> t = {}- Edited ReadMe.
2.0 [260720b]
- Добавлены новые методы и функции:
[F] tuple string.match( string, string pattern, int position ) /* Ищет вхождение шаблона в строку, возвращает захваченные значения. Поддерживает регулярные выражения */- Изменены Lua-функции. Глобальные методы
stringиtableперемещены изLuaEв глобальныеstring.иtable.Lua игры. Использование:
--Было
local str = LuaE:string_strip(" lg")
--Стало
local str = string.strip(" lg")- Переименованы функции
stringиtable- "_" заменены на ""; - Изменен ReadMe
- Added new methods and functions:
[F] tuple string.match( string, string pattern, int position ) /* Searches for the occurrence of a pattern in a string, returns the captured values. Supports regular expressions */- Changed Lua-functions. Global methods
stringandtablehave been moved fromLuaEto globalstring.andtable.game Lua. Usage:
--It was
local str = LuaE:string_strip(" lg")
--Become
local str = string.strip(" lg")- Renamed the functions
stringandtable- "_" replaced by ""; - Edit ReadMe
1.1 [260703a] stable
- Добавлены новые методы и функции:
Class LuaE
{
[M] int string_int( string ) /* Возвращает все цифры из строки как одно число int */
[M] string string_shield( string, bool Reverse ) /* Ставит или убирает экранирование спецсимволов в строке. Примеры: [LuaE:string_shield("Текст?.+-%")] --> "Текст%?%.%+%-%%"; [LuaE:string_shield("Текст%?%.%+%-%%", true)] --> "Текст?.+-%" */
[M] table string_to_table( string Table ) /* Преобразует строку-таблицу в таблицу */
[M] string table_to_string( table ) /* Преобразует таблицу в строку */
[M] void script_pause( string CoroutineName, function Callback, int Delay ) /* Создает корутину CoroutineName к которой можно обратиться в любом месте через [script_resume]. Если при обращении к корутине реальное время Delay (секунды) вышло, будет вызвана функция Callback: без скобочек "()", просто имя функции, либо целиком тело функции */
[M] AIParam script_resume( string CoroutineName ) /* Обращается к корутине CoroutineName, созданной в [script_pause] */
}- Добавлен список экранирования
LuaE.shield; - Изменен ReadMe.
- Added new methods and functions:
Class LuaE
{
[M] int string_int( string ) /* Returns all digits from a string as a single int number */
[M] string string_shield( string, bool Reverse ) /* Sets or removes the escaping of special characters in the string. Examples: [LuaE:string_shield("Text?.+-%")] --> "Text%?%.%+%-%%"; [LuaE:string_shield("Text%?%.%+%-%%", true)] --> "Text?.+-%" */
[M] table string_to_table( string Table ) /* Converts a string-table to a table */
[M] string table_to_string( table ) /* Converts a table to a string */
[M] void script_pause( string CoroutineName, function Callback, int Delay ) /* Creates a CoroutineName that can be accessed anywhere via [script_resume]. If the real Delay time (seconds) has expired when accessing the coroutine, the Callback function will be called: without the parentheses "()", just the function name, or the entire function body. */
[M] AIParam script_resume( string CoroutineName ) /* Accesses the CoroutineName created in [script_pause] */
}- Added a list of escapes
LuaE.shield; - Edited ReadMe.
1.0 [260628a]
Это первая публичная версия LuaExtended. Автор допускает возможное возникновение ошибок в работе.
This is the first public version of LuaExtended. The author admits the possible occurrence of errors in the work.