This update brings a file system, major optimizations to file size and a lot of changes you'd normally overlook to the lua api 🌑.
No Breaking Changes 🚫 🔨
Optimized File Size 📦
Autorun was getting pretty big from all of the dependencies.
Things were removed and replaced, human-panic
was removed since it'd only show up for a few frames until gmod crashed since this is used as a dll, chrono
replaced with time
, etc.
📦 | Old | New |
---|---|---|
32 Bit | 1 MB | 570 KB |
64 Bit | 1.2 MB | 663 KB |
Fixes 🛠️
Initial Freezing 🧊
Due to the autorun/settings.toml
file not existing, your game would freeze. This was fixed.
Now Autorun will properly create all essential folders and the settings file for you
32 Bit? 💻
As of this version, 32 bit seems to work properly.
Note it is missing the lua executor commands from the cli, which are still unable to be provided unfortunately.
File System 🗄️
In order to accompany some new features here, I wrote a file system for Autorun that'll make the process of taking input paths from the user much easier, and adding functions like Autorun.readFile
and Autorun.require
much easier.
This brings local paths to the lua api!
Plugin overrides 🧩
You can now return a string or boolean from a plugin's src/hook.lua
, just as you can from autorun/hook.lua
, to override the script!
New setting(s) ⚙️
autorun.nocolor
This setting is under the [autorun] tab as "nocolor", and disables the color in case your system doesn't support truecolor, or you simply don't want the colors.
New command(s) 🖥️
plugin
This is a general command for managing and creating plugins with Autorun, subcommands below:
new <name>
- Creates a new plugin with template code at folder<folder>
list
- Lists all currently (would-be) active plugins and info about them.help
- Explains the other subcommands to you in greater detail
Updated Autorun
functions 🔧
Autorun.require
🌔
This function has been fixed to allow for calling it without having a .lua extension, bringing it closer to vanilla lua.
Additionally it now allows usage between local folders, so you can finally use it inside of your plugins 🧩!
Previously it only allowed you to Autorun.require
files inside of your global autorun/scripts
folder, but now you can require local to the running script.
Example
-- In autorun/plugins/myplugin/src/autorun.lua
local TheString = Autorun.require("myfile")
print(TheString) -- Hello world!
-- In autorun/plugins/myplugin/src/myfile.lua
return "Hello world!"
New Autorun
functions 🧰
Autorun.readFile
📂
The long awaited function to read a file is here!
Call it with a filename and read a file local to the currently running script, same as Autorun.require
now can.
Once Again...
That's pretty much it. It took a while to get here, so if you could support with a 🌟 or join the discord to ask any questions or report issues, it would be greatly appreciated. (This took way too long to write, so could support me for that as well.. 😵💫 )