
Список изменений
loader.lua changes and optmizations
- 1.1 - Optmizations
Multiple sections were optimized with the new function file(), a new and powerful tool.
- 1.2 - Hidden files
Unnecessary files are now hidden from the normal scope (access with ".filename".)
- 1.3 - setrepo() now accepts https.
setrepo() accepts https (string).
- [+] 1.4 - New function, autoimport(lib).
Automatically imports files from the repository in every refresh. Toggle on and off to activate the automatic importation. Still no way to remove files from the auto importing file, so access it with ".autoimport" and manually remove unwanted files.
- [+] 1.5 - New function, file(file, act, v, t)
Explanation further in the changelog (down here).
file(file, act, v, t)
- 2.1 - A better way to manage fs with just one line.
- 2.2 - Variables to use the function (act)
w - write
a - add
r - read
c - clean
rmv - remove
del - delete
[Other] this() - 2.3 - Using this()
Used to perform the action in tables. Can be used with "t" to select a specific table.
- 2.4 - Creating a file:
file("filename", c)
Altough "c" is used to clean, can also be used to create a file. - 2.5 - Demonstration
file(".newfile", w, "hello") -- Writes "hello" in the file.
file(".newfile", a, "hi") -- Adds "hi" to the file.
local content = file(".newfile", r) -- Reads the file and returns it. - 2.6 - Limitations
file() can't operate with multiple unnamed tables, something that will definetly change in the next update.
Using the functions
- 3.1 - autoimport(file) to automatically import files.
>> autoimport(filex) -- Added "filex" to the importing table, but autoimport is still off.
------------------------------
>> autoimport(filex, true) -- Now it's also activated
> Set autoimport to true
------------------------------
>> autoimport(true)
> Set autoimport to true
>> autoimport(false)
> Set autoimport to false
>> autoimport(false) -- Won't print twice, only when changing states
>
- 3.2 - file(file, act, v, t) manages the file system (fs).
>> file("file", w, "hello") -- If it doesn't exist, it will ask if you want to create it.
> File doesn't exist, Create one? (y/n)
> y
>
-----------------------------
>> file("file", c) -- Creates the file if it doesn't exists.
>> file("file", c) -- Cleans the file if it exists.
>> file("file", w, "hello") -- Writes "hello" in the file.
>> local content = file("file", r) -- Reads the file.
...
Note:
>> The file system still got much room to development.
