Skip to content

EgLib API Reference

Plugin version: 0.4.0

API Design

Due to the potential confusion between Lua static method calls (using .) and instance method calls (using :), we have decided to have module functions use instance methods (i.e., called with :) as much as possible to prevent user confusion, event if the function is a static method.

Error Handling

Yes, REFramework will automatically catch script exceptions. However, due to some technical issues, while errors generated by calling EgLib will be caught, the error messages will be lost, which is very unfavorable for debugging.

We recommend using pcall or other methods to wrap potentially error-prone functions and then print out the error messages.

Example:

lua
local ok, result = pcall(function()
    -- your code here
    eglib.memory.patch(0x0, {0x90, 0x90}) -- this line will raise an error
end)
if not ok then
    -- handle the error here, or raise it again
    error(tostring(result))
end