[Release] Mini-lib Lua

11/17/2018 23:01 Gangor#1
Hi to all,

Today i shared two mini library for lua , maybe it could be useful to some or not :p

Date : Create/Edit/Get a date.
Sample :
Code:
-- Constructor
local date = date:new()

-- Get date method
local day, month, year, hour, min, second = date:getDate()
local str = date:format("%d/%m/%Y %H:%M:%S")
local time = date:getTimespamp()

-- Add date method
date:addDay(1)

-- Set date method
date:setDate(day, month, year, hour, min, 0)
date:setMonth(2)
List : Create/Load/Save/Manage/Get a list
Sample :
Code:
-- Constructor
local list = list:new()

-- Get date method
list:totable("{'test2','test3'}") 	-- From string
list:load("mylist") 			-- From global_variable
list:save("mylist") 			-- To global_variable

-- Manage list method
list:insert("test50")
list:removeAt(1)

-- Get list method
cprint("first -> ".. list:first() )
cprint("last -> ".. list:last() )
If there are any questions, ask me.