Weave.Inject

Injects and executes raw Lua code directly into the context of another resource.

Syntax

Weave.Inject(resourceName, code, mode)

Parameters

resourceNamestring

The target resource or "any"

codestring

Lua code to inject

modenumber

0 for New Thread, 1 for No Thread (Direct execution)

Example

-- Inject code into specific resource
Weave.Inject("myResource", "print('Hello from injection!')", 0)

-- Inject into any resource
Weave.Inject("any", "print('Injected into any resource')", 0)