InjectResource
Queue a Lua code injection into a target resource’s VM.
Syntax
Susano.InjectResource(resourceName, luaCode) -> voidParameters
Return(s)
Behavior
Example(s)
-- inject a simple logger into resource "gamemode"
Susano.InjectResource("gamemode", [[
print("[inject] gamemode init hook installed")
-- Susano.* calls will NOT work here
]])
-- inject code that overrides a function in the target resource
Susano.InjectResource("ui_resource", [[
local old = _G.ShowNotification
_G.ShowNotification = function(msg)
return old("[INJECTED] "..tostring(msg))
end
]])
-- inject into the first available resource
Susano.InjectResource("any", [[
print("[inject] any init hook installed")
-- Susano.* calls will NOT work here
]])Last updated