WowAddons

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

fileNamecstring

canaccessallvalues

canAccessAllValues = canaccessallvalues(values)

Returns true if the immediate calling function has appropriate permissions to access and operate on all supplied values.

Arguments

valuesLuaValueReference

Returns

canAccessAllValuesbool

canaccesssecrets

canAccessSecrets = canaccesssecrets()

Returns true if the immediate calling function has appropriate permissions to access or operate on secret values.

Returns

canAccessSecretsbool

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

tableLuaValueReference

Returns

canAccessTablebool

canaccessvalue

canAccessValue = canaccessvalue(value)

Returns true if the immediate calling function has appropriate permissions to access and operate on a specific value.

Arguments

valueLuaValueReference

Returns

canAccessValuebool

CreateFrameWithOptions

frame = CreateFrameWithOptions(options)

Arguments

optionsCreateFrameOptions

Returns

frameSimpleFrame

CreateFromMixins

object = CreateFromMixins(mixins)

Arguments

mixinsLuaValueVariant

Returns

objectLuaValueVariant

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

luaFunctionLuaValueReferenceThe Lua function to invoke through the secure delegate.
optionsSecureDelegateOptions may be nilOptional settings controlling secure delegate behavior. If omitted, default options are used.

Returns

secureDelegateFunctionLuaValueReferenceA secure delegate function that calls through to the original Lua function.

CreateWindow

window = CreateWindow([popupStyle], [topMost])

Arguments

popupStylebool default true
topMostbool default false

Returns

windowSimpleWindow 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

valueLuaValueReference may be nil

Returns

resultLuaValueReference may be nil

GetCallstackHeight

height = GetCallstackHeight()

Returns

heightnumber

GetCurrentEventID

eventID = GetCurrentEventID()

Returns

eventIDnumber may be nil

GetErrorCallstackHeight

height = GetErrorCallstackHeight()

Returns

heightnumber may be nil

GetEventTime

totalElapsedTime, numExecutedHandlers, slowestHandlerName, slowestHandlerTime = GetEventTime(eventProfileIndex)

May return nothing.

Arguments

eventProfileIndexnumber

Returns

totalElapsedTimenumber
numExecutedHandlersnumber
slowestHandlerNamecstring
slowestHandlerTimenumber

GetForbiddenObjectTable

forbiddenTable = GetForbiddenObjectTable(object)

Arguments

objectFrameScriptObject

Returns

forbiddenTableFrameScriptObject

GetScriptBucketThrottleLimits

limits = GetScriptBucketThrottleLimits()

Returns

limitsScriptBucketThrottleLimits

GetSourceLocation

location = GetSourceLocation()

May return nothing.

Returns

locationstring

hasanysecretvalues

isAnyValueSecret = hasanysecretvalues(values)

Returns true if a supplied value is a secret value.

Arguments

valuesLuaValueReference

Returns

isAnyValueSecretbool

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

tableLuaValueReference

Returns

isSecretOrContentsSecretbool

issecretvalue

isSecret = issecretvalue(value)

Returns true if a supplied value is a secret value.

Arguments

valueLuaValueReference

Returns

isSecretbool

mapvalues

mapped = mapvalues(func, values)

Applies a given function over all supplied values individually, replacing the value with the result of the call.

Arguments

funcLuaValueReference
valuesLuaValueReference

Returns

mappedLuaValueReference

Mixin

outObject = Mixin(object, mixins)

Arguments

objectLuaValueVariant
mixinsLuaValueVariant

Returns

outObjectLuaValueVariant

RegisterEventCallback

RegisterEventCallback(eventName, callback)

Arguments

eventNamecstring
callbackEventCallbackType

RegisterUnitEventCallback

RegisterUnitEventCallback(eventName, callback, unit)

Arguments

eventNamecstring
callbackEventCallbackType
unitUnitToken

RunScript

RunScript(text)

Arguments

textcstring

scrubsecretvalues

scrubbed = scrubsecretvalues(values)

Returns a transformed list of values with inputs that are secret values replaced by nil values.

Arguments

valuesLuaValueReference

Returns

scrubbedLuaValueReference

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

valuesLuaValueReference

Returns

scrubbedLuaValueReference

secretunwrap

unwrapped = secretunwrap(values)

Unwraps all supplied secrets, converting them back to regular values.

Arguments

valuesLuaValueReference

Returns

unwrappedLuaValueReference

secretwrap

wrapped = secretwrap(values)

Converts all supplied values to secret values, preventing most operations on them from occurring on tainted code paths.

Arguments

valuesLuaValueReference

Returns

wrappedLuaValueReference

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

objectLuaValueReferenceThe table on which to look up the named method from. Lookup of the method uses raw access and ignores any associated metatable.
methodcstringThe name of a method to retrieve.
argumentsLuaValueReferenceArguments to supply to the method. The initial 'object' parameter is always supplied as the first argument, followed by these values.

Returns

resultsLuaValueReferenceResults 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

valueLuaValueReference may be nilThe Lua value to copy.
optionsSecureCopyOptions may be nilOptional settings controlling value copying behavior. If omitted, default secure copy options are used.

Returns

copyLuaValueReferenceThe copied value. For tables, recursive and shared references within the copied graph are preserved.

SetErrorCallstackHeight

SetErrorCallstackHeight([height])

Arguments

heightnumber may be nil

settablesecurity

settablesecurity(table, option)

Arguments

tableLuaValueVariant
optionTableSecurityOption

UnregisterEventCallback

UnregisterEventCallback(eventName, callback)

Arguments

eventNamecstring
callbackEventCallbackType

UnregisterUnitEventCallback

UnregisterUnitEventCallback(eventName, callback, unit)

Arguments

eventNamecstring
callbackEventCallbackType
unitUnitToken

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

elapsedMillisecondsnumber

Tables

Enum.TableSecurityOption enumeration

DisallowTaintedAccess0
DisallowSecretKeys1
SecretWrapContents2

CreateFrameOptions structure

frameTypecstring
namecstring may be nil
parentSimpleFrame may be nil
inheritscstring[] may be nil
idnumber may be nil
forbiddenbool default false
hiddenbool default false

ScriptBucketThrottleLimits structure

luaScriptBucketThrottleMaxMsPerSecondNormalnumber
luaScriptBucketThrottleMaxMsPerSecondRestrictednumber
luaScriptBucketThrottleMaxMsBurstNormalnumber
luaScriptBucketThrottleMaxMsBurstRestrictednumber

SecureCopyOptions structure

maxTraversalDepthnumber default 100Maximum table nesting depth allowed during recursive copying.
wrapUntrustedFunctionsbool default trueWrap function values in secure closures that call through using the original function taint.
permitScriptObjectsbool default falseIf true, preserve references to script objects in the copied output. By default, script objects will raise an error.

SecureDelegateOptions structure

wrapUntrustedFunctionsbool default trueWrap function arguments in secure closures that call through using the original function taint.

EventCallbackType callbacktype

It takes WowAddons

Free, for Windows, macOS and Linux: it puts the addon in your game in one click and keeps it up to date. Open it once, then press Install again.

WowAddons runs on your computer: open wowaddons.gg there.

Download for Windows