You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Added settings folder which is created if it does not already exist. See the default parameters in autorun/src/configs/settings.toml
* Overview of settings added: Ability to hide console on startup, disable plugins, disable filesteal, disable logging, and change the name of generated filesteal folders
* Added examples in the /examples/ directory
* Added ``settings`` command which gives an overview of your current autorun settings
* Remove ``sautorun`` alias
The only things left to do for 1.0.0 were fix 32 bit (which is not possible without nightly) and make require work relatively. I think I'll push require to be changed in 1.1, there's too many changes to have in just betas, so here it is. 1.0.0
Fixes#36Fixes#29
Copy file name to clipboardExpand all lines: README.md
+30-36Lines changed: 30 additions & 36 deletions
Original file line number
Diff line number
Diff line change
@@ -5,28 +5,28 @@
5
5
## Features
6
6
* Dumping all lua scripts to ``C:\Users\<User>\autorun\lua_dumps\<ServerIP>\..``
7
7
* Runtime lua loading through ``lua_run`` and ``lua_openscript`` in an external console
8
-
* Supports both 32 and 64 bit branches (WARNING: See [#22](https://github.com/Vurv78/Autorun-rs/issues/22))
8
+
* Supports both 32* and 64 bit branches (*See [#22](https://github.com/Vurv78/Autorun-rs/issues/22))
9
9
* Running a script before autorun (``autorun.lua``), to detour and bypass any 'anticheats'
10
10
* Scripthook, stop & run scripts before anything runs on you, gives information & functions to assist in a safe separate lua environment
11
11
* File logging (to ``autorun/logs``)
12
+
* Plugin system (``autorun/plugins``)
13
+
*[Settings using TOML](autorun/src/configs/settings.toml)
12
14
13
15
## 🤔 Usage
14
16
### 🧩 Menu Plugin
15
17
Autorun can also be used as a menu plugin / required from lua automatically from the menu state.
16
-
1.[Get the DLL](#downloading)
17
-
1. Put the ``gmsv_autorun_win<arch>.dll`` file into your ``garrysmod/lua/bin`` folder.
18
+
1. Put [the dll](#⬇️-downloading)``gmsv_autorun_win<arch>.dll`` file into your ``garrysmod/lua/bin`` folder.
18
19
2. Add ``require("autorun")`` at the bottom of ``garrysmod/lua/menu/menu.lua``
19
20
**It will now run automatically when garrysmod loads at the menu.**
20
21
21
22
### 💉 Injecting
22
23
The traditional (but more inconvenient) method to use this is to just inject it.
23
24
1. Get an injector (Make sure it's compatible to inject 32/64 bit code depending on your use).
24
-
2.[Get the DLL](#downloading)
25
-
3. Inject into gmod while you're in the menu
25
+
2. Inject [the dll](#⬇️-downloading) into gmod while you're in the menu
26
26
27
27
## 📜 Scripthook
28
28
Autorun features scripthook, which means we'll run your script before any other garrysmod script executes to verify if you want the code to run by running your own hook script.
29
-
*This runs in a separate environment from ``_G``, so to modify globals, do ``_G.foo = bar*``
29
+
*This runs in a separate environment from ``_G``, so to modify globals, do ``_G.foo = bar``
30
30
31
31
Also note that if you are running in ``autorun.lua`` Functions like ``http.Fetch`` & ``file.Write`` won't exist.
32
32
Use their C counterparts (``HTTP`` and ``file.Open``)
@@ -37,55 +37,49 @@ __See an example project using the scripthook [here](https://github.com/Vurv78/S
37
37
```golo
38
38
C:\Users\<User>\autorun
39
39
├── \autorun.lua # Runs *once* before autorun
40
-
├── \hook.lua # Runs for every script (including init.lua, which triggers autorun.lua)
40
+
├── \hook.lua # Runs for every script
41
41
├── \lua_dumps\ # Each server gets it's own folder named by its IP
42
-
│ ├── \192.168.1.1\
43
-
│ ├── \192.168.1.2\
44
-
│ └── \241241.352.1.3\
45
-
│ \logs\
42
+
│ ├── \192.168.1.55_27015\
43
+
│ └── \X.Y.Z.W_PORT\
44
+
├── \logs\ # Logs are saved here
46
45
│ └── August 02, 2021 01-00 pm.log
46
+
├── \plugins\ # Folder for Autorun plugins, same behavior as above autorun and hook.lua, but meant for plugin developers.
47
+
│ └── \Safety\
48
+
│ ├── \src\
49
+
| | ├── autorun.lua
50
+
| | └── hook.lua
51
+
│ └── plugin.toml
52
+
├── settings.toml # See autorun/src/configs/settings.toml
47
53
└── ...
48
54
```
49
55
50
56
### 🗃️ Fields
51
-
Here are the fields for the ``sautorun`` table that gets passed in scripthook.
52
-
| Field | Type | Description |
53
-
| --- | --- | --- |
54
-
| NAME | string | Name of the script, ex: @lua/this/that.lua |
55
-
| CODE | string | The contents of the script |
56
-
| CODE_LEN | number | Length of the script |
57
-
| IP | string | IP of the server you are currently connected to |
58
-
| STARTUP | boolean | Whether the script is running from ``autorun.lua`` (true) or false |
59
-
| log | fn(string, uint?)| A function that logs to your autorun console. Second param is level ascending with urgency, 1 being error, 2 warning, 3, info, 4 debug, 5 trace. Default 3 |
60
-
| require | fn(string) | Works like gmod's include function. Does not cache like regular lua's require for now. Runs a script local to autorun/scripts and passes the returned values |
57
+
You can find what is passed to the scripthook environment in [examples/fields.lua](examples/fields.lua) as an EmmyLua definitions file.
58
+
This could be used with something like a vscode lua language server extension for intellisense 👍
61
59
62
60
### ✍️ Examples
63
61
__hook.lua__
64
62
This file runs before every single lua script run on your client from addons and servers.
63
+
You can ``return true`` to not run the script, or a string to replace it.
65
64
```lua
66
-
localscript=sautorun.CODE
65
+
-- Replace all 'while true do end' scripts with 'while false do end' 😎
66
+
localscript=Autorun.CODE
67
67
ifscript:find("while true do end") then
68
-
sautorun.log("Found an evil script!")
69
-
-- Run our modified script that will replace all ``while true do end`` with ``while false do end``. 😎
70
-
68
+
Autorun.log("Found an evil script!")
71
69
returnstring.Replace(script, "while true do end", "while false do end")
72
-
73
-
-- OR: return true to not run the script at all.
74
70
end
75
71
```
76
-
__autorun.lua__
77
-
This will be the first lua script to run on your client when you join a server, use this to make detours and whatnot.
sautorun.log( "Connected to server " ..sautorun.IP, DEBUG )
81
-
```
72
+
73
+
You can find more [here](examples)
82
74
83
75
## ⬇️ Downloading
84
-
### Stable
76
+
### 🦺 Stable
85
77
You can get a 'stable' release from [the releases](https://github.com/Vurv78/Autorun-rs/releases/latest).
86
-
### Bleeding Edge
78
+
### 🩸 Bleeding Edge
87
79
You can get the absolute latest download (from code in the repo) in [the Github Actions tab](https://github.com/Vurv78/Autorun-rs/actions/workflows/downloads.yml)
88
-
Note it may not work as expected.
80
+
Note it may not work as expected (but I'd advise to try this out before trying to report an issue to see if it has been fixed)
81
+
82
+
__If you are using this as a menu plugin 🧩, make sure the DLL is named ``gmsv_autorun_win<arch>.dll``__
89
83
90
84
## 🛠️ Building
91
85
You may want to build this yourself if you want to make changes / contribute (or don't trust github actions for whatever reason..)
0 commit comments