https://github.com/xan105/anylua
Lua Scripting in any game!
https://github.com/xan105/anylua
lua luajit
Last synced: 2 months ago
JSON representation
Lua Scripting in any game!
- Host: GitHub
- URL: https://github.com/xan105/anylua
- Owner: xan105
- License: mit
- Created: 2025-02-15T03:53:34.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-02-15T04:05:32.000Z (about 1 year ago)
- Last Synced: 2025-02-15T05:17:52.829Z (about 1 year ago)
- Topics: lua, luajit
- Language: C++
- Homepage:
- Size: 9.07 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
About
=====
This project adds a Lua Script engine to any process through DLL injection or sideloading.
It is based on Lua 5.1 (LuaJIT) extended with custom libraries to handle things like memory manipulation and classic Win32 APIs.
🐧 This software has an emphasis on being compatible with Linux/Proton.
💻 This software is for my own personal use but feel free to use it.
> [!IMPORTANT]
> This project is in its early stages, it is a work in progress.
Example
=======
//TODO
Usage
=====
Upon injection the process will load `main.lua` relative to the process dir (**not** the current working dir).
The path of the Lua script to load can be override with the env var `LUA_FILEPATH`.
//TODO
## A) DLL Sideloading
//TODO
## B) DLL Injection
//TODO
LUA Scripting
=============
Standard libs available are:
- Package
- Basic
- Table
- String
- Math
- bit (LuaJIT)
Some standard libraries are not enabled by design.
The followings are exposed to the Lua VM, I might add more later on.
## 🌐 Globals
### sleep(ms: number)
Suspends the execution of the Lua engine until the time-out interval elapses.
- `ms: number`
Time interval in milliseconds.
```lua
print("HELLO")
sleep(1000)
print("WORLD")
```
## 📦 Process
```lua
local process = require("process")
```
### `pid: number`
Process pid.
### `name: string`
Process executable name.
### `dir: string`
Process executable dir.
> [!TIP]
> Not be confused with the process current working dir.
### `exit(code: number)`
Ends the process and all its threads.
- `code: number`
The exit code for the process and all threads.
## 📦 Memory
```lua
local memory = require("memory")
```