m
Move page script moved page API RunScript to WoW:API RunScript without leaving a redirect
m (Move page script moved page API RunScript to WoW:API RunScript without leaving a redirect) |
|||
| (2 intermediate revisions by one other user not shown) | |||
| Line 6: | Line 6: | ||
== Parameters == | == Parameters == | ||
=== Arguments === | === Arguments === | ||
: | :;script : string - code to be executed | ||
=== Returns === | === Returns === | ||
: | :none | ||
== Example == | == Example == | ||
:To define a function dynamically you could do: | :To define a function dynamically you could do: | ||
< | <pre> | ||
local retExpr = '"Hello " .. UnitName("target")'; | |||
RunScript("function My_GetGreeting() return " .. retExpr .. ";end"); | |||
< | </pre> | ||
=== Result === | |||
:The My_GetGreeting() function will be defined to return Hello followed by the name of your target. | :The My_GetGreeting() function will be defined to return Hello followed by the name of your target. | ||