World of Warcraft Forever API · FrameScript.md, for your AI
FrameScript (global functions)
38 functions, 6 tables, as Blizzard documents them for Forever 1.60.1 (70959).
Making an addon with an AI? Tell it: Read https://wowaddons.gg/agents.md, then make me a World of Warcraft Forever addon that …, try it with me in the game, and publish it. It checks every call against this API before you try it in the game, then publishes it here. How it works.
Functions
AddSourceLocationExclude
AddSourceLocationExclude(fileName)
Arguments
fileName | cstring |
|---|
canaccessallvalues
canAccessAllValues = canaccessallvalues(values)
Returns true if the immediate calling function has appropriate permissions to access and operate on all supplied values.
Arguments
values | LuaValueReference |
|---|
Returns
canAccessAllValues | bool |
|---|
canaccesssecrets
canAccessSecrets = canaccesssecrets()
Returns true if the immediate calling function has appropriate permissions to access or operate on secret values.
Returns
canAccessSecrets | bool |
|---|
canaccesstable
canAccessTable = canaccesstable(table)
Returns true if the immediate calling function has appropriate permissions to index secret tables. This will return false if the caller cannot access the table value itself, or if access to the table contents is disallowed by taint.
Arguments
table | LuaValueReference |
|---|
Returns
canAccessTable | bool |
|---|
canaccessvalue
canAccessValue = canaccessvalue(value)
Returns true if the immediate calling function has appropriate permissions to access and operate on a specific value.
Arguments
value | LuaValueReference |
|---|
Returns
canAccessValue | bool |
|---|
CreateFrameWithOptions
frame = CreateFrameWithOptions(options)
Arguments
options | CreateFrameOptions |
|---|
Returns
frame | SimpleFrame |
|---|
CreateFromMixins
object = CreateFromMixins(mixins)
Arguments
mixins | LuaValueVariant |
|---|
Returns
object | LuaValueVariant |
|---|
CreateSecureDelegate
secureDelegateFunction = CreateSecureDelegate(luaFunction, [options])
Creates a secure delegate closure for a Lua function. The delegate invokes the original function in a protected call context with secure execution taint, and supports passing and returning values directly.
Arguments
luaFunction | LuaValueReference | The Lua function to invoke through the secure delegate. |
|---|---|---|
options | SecureDelegateOptions may be nil | Optional settings controlling secure delegate behavior. If omitted, default options are used. |
Returns
secureDelegateFunction | LuaValueReference | A secure delegate function that calls through to the original Lua function. |
|---|
CreateWindow
window = CreateWindow([popupStyle], [topMost])
Arguments
popupStyle | bool default true | |
|---|---|---|
topMost | bool default false |
Returns
window | SimpleWindow may be nil |
|---|
dropsecretaccess
dropsecretaccess()
Removes the ability for the immediate calling function to access secret values.
dumpobject
result = dumpobject([value])
Invokes the '__dump' metamethod on any value (if present), returning its result.
Arguments
value | LuaValueReference may be nil |
|---|
Returns
result | LuaValueReference may be nil |
|---|
GetCallstackHeight
height = GetCallstackHeight()
Returns
height | number |
|---|
GetCurrentEventID
eventID = GetCurrentEventID()
Returns
eventID | number may be nil |
|---|
GetErrorCallstackHeight
height = GetErrorCallstackHeight()
Returns
height | number may be nil |
|---|
GetEventTime
totalElapsedTime, numExecutedHandlers, slowestHandlerName, slowestHandlerTime = GetEventTime(eventProfileIndex)
May return nothing.
Arguments
eventProfileIndex | number |
|---|
Returns
totalElapsedTime | number | |
|---|---|---|
numExecutedHandlers | number | |
slowestHandlerName | cstring | |
slowestHandlerTime | number |
GetForbiddenObjectTable
forbiddenTable = GetForbiddenObjectTable(object)
Arguments
object | FrameScriptObject |
|---|
Returns
forbiddenTable | FrameScriptObject |
|---|
GetScriptBucketThrottleLimits
limits = GetScriptBucketThrottleLimits()
Returns
limits | ScriptBucketThrottleLimits |
|---|
GetSourceLocation
location = GetSourceLocation()
May return nothing.
Returns
location | string |
|---|
hasanysecretvalues
isAnyValueSecret = hasanysecretvalues(values)
Returns true if a supplied value is a secret value.
Arguments
values | LuaValueReference |
|---|
Returns
isAnyValueSecret | bool |
|---|
issecrettable
isSecretOrContentsSecret = issecrettable(table)
Returns true if a supplied value is a secret table. This function will return true if the table value itself is secret, or if flags on the table are set such that accesses of the table would produce secrets.
Arguments
table | LuaValueReference |
|---|
Returns
isSecretOrContentsSecret | bool |
|---|
issecretvalue
isSecret = issecretvalue(value)
Returns true if a supplied value is a secret value.
Arguments
value | LuaValueReference |
|---|
Returns
isSecret | bool |
|---|
mapvalues
mapped = mapvalues(func, values)
Applies a given function over all supplied values individually, replacing the value with the result of the call.
Arguments
func | LuaValueReference | |
|---|---|---|
values | LuaValueReference |
Returns
mapped | LuaValueReference |
|---|
Mixin
outObject = Mixin(object, mixins)
Arguments
object | LuaValueVariant | |
|---|---|---|
mixins | LuaValueVariant |
Returns
outObject | LuaValueVariant |
|---|
RegisterEventCallback
RegisterEventCallback(eventName, callback)
Arguments
eventName | cstring | |
|---|---|---|
callback | EventCallbackType |
RegisterUnitEventCallback
RegisterUnitEventCallback(eventName, callback, unit)
Arguments
eventName | cstring | |
|---|---|---|
callback | EventCallbackType | |
unit | UnitToken |
RunScript
RunScript(text)
Arguments
text | cstring |
|---|
scrubsecretvalues
scrubbed = scrubsecretvalues(values)
Returns a transformed list of values with inputs that are secret values replaced by nil values.
Arguments
values | LuaValueReference |
|---|
Returns
scrubbed | LuaValueReference |
|---|
scrub
scrubbed = scrub(values)
Returns a transformed list of values with inputs that are either secret or are not string, number, or boolean type replaced by nil values.
Arguments
values | LuaValueReference |
|---|
Returns
scrubbed | LuaValueReference |
|---|
secretunwrap
unwrapped = secretunwrap(values)
Unwraps all supplied secrets, converting them back to regular values.
Arguments
values | LuaValueReference |
|---|
Returns
unwrapped | LuaValueReference |
|---|
secretwrap
wrapped = secretwrap(values)
Converts all supplied values to secret values, preventing most operations on them from occurring on tainted code paths.
Arguments
values | LuaValueReference |
|---|
Returns
wrapped | LuaValueReference |
|---|
securecallmethod
results = securecallmethod(object, method, arguments)
Invokes a named method on an object with a secure call barrier that prevents errors or taint from function lookup and execution from propagating to the caller.
Arguments
object | LuaValueReference | The table on which to look up the named method from. Lookup of the method uses raw access and ignores any associated metatable. |
|---|---|---|
method | cstring | The name of a method to retrieve. |
arguments | LuaValueReference | Arguments to supply to the method. The initial 'object' parameter is always supplied as the first argument, followed by these values. |
Returns
results | LuaValueReference | Results from the executed function. If an error occurred, this result list will be empty. |
|---|
securecopy
copy = securecopy([value], [options])
Securely copies a Lua value. Tables are deep-copied with recursive and shared references preserved. Copied values receive the current execution taint.
Arguments
value | LuaValueReference may be nil | The Lua value to copy. |
|---|---|---|
options | SecureCopyOptions may be nil | Optional settings controlling value copying behavior. If omitted, default secure copy options are used. |
Returns
copy | LuaValueReference | The copied value. For tables, recursive and shared references within the copied graph are preserved. |
|---|
SetErrorCallstackHeight
SetErrorCallstackHeight([height])
Arguments
height | number may be nil |
|---|
settablesecurity
settablesecurity(table, option)
Arguments
table | LuaValueVariant | |
|---|---|---|
option | TableSecurityOption |
UnregisterEventCallback
UnregisterEventCallback(eventName, callback)
Arguments
eventName | cstring | |
|---|---|---|
callback | EventCallbackType |
UnregisterUnitEventCallback
UnregisterUnitEventCallback(eventName, callback, unit)
Arguments
eventName | cstring | |
|---|---|---|
callback | EventCallbackType | |
unit | UnitToken |
debugprofilestart
debugprofilestart()
Starts a timer for profiling. The final time can be obtained by calling debugprofilestop.
debugprofilestop
elapsedMilliseconds = debugprofilestop()
Returns the time in milliseconds since the last debugprofilestart call.
Returns
elapsedMilliseconds | number |
|---|
Tables
Enum.TableSecurityOption enumeration
DisallowTaintedAccess | 0 |
|---|---|
DisallowSecretKeys | 1 |
SecretWrapContents | 2 |
CreateFrameOptions structure
frameType | cstring | |
|---|---|---|
name | cstring may be nil | |
parent | SimpleFrame may be nil | |
inherits | cstring[] may be nil | |
id | number may be nil | |
forbidden | bool default false | |
hidden | bool default false |
ScriptBucketThrottleLimits structure
luaScriptBucketThrottleMaxMsPerSecondNormal | number | |
|---|---|---|
luaScriptBucketThrottleMaxMsPerSecondRestricted | number | |
luaScriptBucketThrottleMaxMsBurstNormal | number | |
luaScriptBucketThrottleMaxMsBurstRestricted | number |
SecureCopyOptions structure
maxTraversalDepth | number default 100 | Maximum table nesting depth allowed during recursive copying. |
|---|---|---|
wrapUntrustedFunctions | bool default true | Wrap function values in secure closures that call through using the original function taint. |
permitScriptObjects | bool default false | If true, preserve references to script objects in the copied output. By default, script objects will raise an error. |
SecureDelegateOptions structure
wrapUntrustedFunctions | bool default true | Wrap function arguments in secure closures that call through using the original function taint. |
|---|