Lua..::..LuaDoString<(Of <(<'T>)>)> Method (String, String)
Execute lua code and get result.
Namespace:
wManager.Wow.HelpersAssembly: wManager (in wManager.dll)
Syntax
Type Parameters
- T
Parameters
- command
- Type: String
The lua code.
- returnVariableName
- Type: String
Name of variable where is save the result (if empty, return result).
Return Value
resultExamples
C#
// Example get level: int level1 = Lua.LuaDoString<int>("return UnitLevel('player')"); // or int level2 = Lua.LuaDoString<int>("resultLevel = UnitLevel('player')", "resultLevel"); // Example return list: List<int> array1 = Lua.LuaDoString<List<int>>(@" local r = {} table.insert(r, 1); table.insert(r, 2); table.insert(r, 3); return unpack(r);"); // or List<string> array2 = Lua.LuaDoString<List<string>>(@"return 'A' .. '#LUASEPARATOR#' .. 'B' .. '#LUASEPARATOR#' .. 'C' .. '#LUASEPARATOR#'".Replace("#LUASEPARATOR#", Lua.ListSeparator));