<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://addonstudio.org/mw1/index.php?action=history&amp;feed=atom&amp;title=WildStar%3AUI_Lua</id>
	<title>WildStar:UI Lua - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://addonstudio.org/mw1/index.php?action=history&amp;feed=atom&amp;title=WildStar%3AUI_Lua"/>
	<link rel="alternate" type="text/html" href="https://addonstudio.org/mw1/index.php?title=WildStar:UI_Lua&amp;action=history"/>
	<updated>2026-04-17T16:24:51Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://addonstudio.org/mw1/index.php?title=WildStar:UI_Lua&amp;diff=7971&amp;oldid=prev</id>
		<title>Bear at 06:16, 10 August 2023</title>
		<link rel="alternate" type="text/html" href="https://addonstudio.org/mw1/index.php?title=WildStar:UI_Lua&amp;diff=7971&amp;oldid=prev"/>
		<updated>2023-08-10T06:16:39Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;a href=&quot;//addonstudio.org/mw1/index.php?title=WildStar:UI_Lua&amp;amp;diff=7971&amp;amp;oldid=7970&quot;&gt;Show changes&lt;/a&gt;</summary>
		<author><name>Bear</name></author>
	</entry>
	<entry>
		<id>https://addonstudio.org/mw1/index.php?title=WildStar:UI_Lua&amp;diff=7970&amp;oldid=prev</id>
		<title>Bear: Bear moved page WildStar://UI Lua to WildStar:UI Lua without leaving a redirect</title>
		<link rel="alternate" type="text/html" href="https://addonstudio.org/mw1/index.php?title=WildStar:UI_Lua&amp;diff=7970&amp;oldid=prev"/>
		<updated>2023-08-09T03:28:59Z</updated>

		<summary type="html">&lt;p&gt;Bear moved page &lt;a href=&quot;/mw1/index.php?title=WildStar://UI_Lua&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;WildStar://UI Lua (page does not exist)&quot;&gt;//UI Lua&lt;/a&gt; to &lt;a href=&quot;/wiki/WildStar:UI_Lua&quot; title=&quot;WildStar:UI Lua&quot;&gt;UI Lua&lt;/a&gt; without leaving a redirect&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 03:28, 9 August 2023&lt;/td&gt;
				&lt;/tr&gt;
&lt;!-- diff cache key addonstu_asmw2:diff::1.12:old-7969:rev-7970 --&gt;
&lt;/table&gt;</summary>
		<author><name>Bear</name></author>
	</entry>
	<entry>
		<id>https://addonstudio.org/mw1/index.php?title=WildStar:UI_Lua&amp;diff=7969&amp;oldid=prev</id>
		<title>Bear: Bear moved page WildStar/UI Lua to WildStar://UI Lua</title>
		<link rel="alternate" type="text/html" href="https://addonstudio.org/mw1/index.php?title=WildStar:UI_Lua&amp;diff=7969&amp;oldid=prev"/>
		<updated>2023-08-09T03:09:09Z</updated>

		<summary type="html">&lt;p&gt;Bear moved page &lt;a href=&quot;/mw1/index.php?title=WildStar:WildStar/UI_Lua&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;WildStar:WildStar/UI Lua (page does not exist)&quot;&gt;WildStar/UI Lua&lt;/a&gt; to &lt;a href=&quot;/mw1/index.php?title=WildStar://UI_Lua&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;WildStar://UI Lua (page does not exist)&quot;&gt;//UI Lua&lt;/a&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 03:09, 9 August 2023&lt;/td&gt;
				&lt;/tr&gt;
&lt;!-- diff cache key addonstu_asmw2:diff::1.12:old-7965:rev-7969 --&gt;
&lt;/table&gt;</summary>
		<author><name>Bear</name></author>
	</entry>
	<entry>
		<id>https://addonstudio.org/mw1/index.php?title=WildStar:UI_Lua&amp;diff=7965&amp;oldid=prev</id>
		<title>Bear: Created page with &quot;__NOWYSIWYG__{{../wslua}} This is the main reference for the WildStar Lua runtime, as implemented in the WildStar UI. See also ../UI API/.  The [[w:c:wildstaronlin...&quot;</title>
		<link rel="alternate" type="text/html" href="https://addonstudio.org/mw1/index.php?title=WildStar:UI_Lua&amp;diff=7965&amp;oldid=prev"/>
		<updated>2020-07-07T04:57:33Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;__NOWYSIWYG__{{../wslua}} This is the main reference for the WildStar &lt;a href=&quot;/wiki/WildStar:Lua&quot; class=&quot;mw-redirect&quot; title=&quot;WildStar:Lua&quot;&gt;Lua&lt;/a&gt; runtime, as implemented in the WildStar &lt;a href=&quot;/wiki/WildStar:UI&quot; class=&quot;mw-redirect&quot; title=&quot;WildStar:UI&quot;&gt;UI&lt;/a&gt;. See also [[../UI API/]].  The [[w:c:wildstaronlin...&amp;quot;&lt;/p&gt;
&lt;a href=&quot;//addonstudio.org/mw1/index.php?title=WildStar:UI_Lua&amp;amp;diff=7965&amp;amp;oldid=7968&quot;&gt;Show changes&lt;/a&gt;</summary>
		<author><name>Bear</name></author>
	</entry>
	<entry>
		<id>https://addonstudio.org/mw1/index.php?title=WildStar:UI_Lua&amp;diff=7968&amp;oldid=prev</id>
		<title>Bear: /* See also */  is in the menu now under the originally created red link snippets :)</title>
		<link rel="alternate" type="text/html" href="https://addonstudio.org/mw1/index.php?title=WildStar:UI_Lua&amp;diff=7968&amp;oldid=prev"/>
		<updated>2015-11-10T22:05:46Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;See also: &lt;/span&gt;  is in the menu now under the originally created red link snippets :)&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 22:05, 10 November 2015&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l185&quot;&gt;Line 185:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 185:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* [[Lua]] - which has plenty of links to other reference material&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* [[Lua]] - which has plenty of links to other reference material&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* [[API types]] - with a list of Lua types and &amp;#039;psudo-types&amp;#039; used in WS&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* [[API types]] - with a list of Lua types and &amp;#039;psudo-types&amp;#039; used in WS&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;* [[Addon snippet Knowledgebase]] - source code examples and solutions for concrete problems and questions&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key addonstu_asmw2:diff::1.12:old-7967:rev-7968 --&gt;
&lt;/table&gt;</summary>
		<author><name>Bear</name></author>
	</entry>
	<entry>
		<id>https://addonstudio.org/mw1/index.php?title=WildStar:UI_Lua&amp;diff=7967&amp;oldid=prev</id>
		<title>WildStarWiki&gt;Shadowgrind at 15:44, 10 November 2015</title>
		<link rel="alternate" type="text/html" href="https://addonstudio.org/mw1/index.php?title=WildStar:UI_Lua&amp;diff=7967&amp;oldid=prev"/>
		<updated>2015-11-10T15:44:38Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 15:44, 10 November 2015&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l185&quot;&gt;Line 185:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 185:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* [[Lua]] - which has plenty of links to other reference material&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* [[Lua]] - which has plenty of links to other reference material&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* [[API types]] - with a list of Lua types and &amp;#039;psudo-types&amp;#039; used in WS&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* [[API types]] - with a list of Lua types and &amp;#039;psudo-types&amp;#039; used in WS&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;* [[Addon snippet Knowledgebase]] - source code examples and solutions for concrete problems and questions&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key addonstu_asmw2:diff::1.12:old-7966:rev-7967 --&gt;
&lt;/table&gt;</summary>
		<author><name>WildStarWiki&gt;Shadowgrind</name></author>
	</entry>
	<entry>
		<id>https://addonstudio.org/mw1/index.php?title=WildStar:UI_Lua&amp;diff=7966&amp;oldid=prev</id>
		<title>Bear: Created page with &quot;{{wsdev}}&quot;</title>
		<link rel="alternate" type="text/html" href="https://addonstudio.org/mw1/index.php?title=WildStar:UI_Lua&amp;diff=7966&amp;oldid=prev"/>
		<updated>2014-04-07T00:10:44Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;{{wsdev}}&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;__NOWYSIWYG__{{wslua}}&lt;br /&gt;
This is the main reference for the WildStar [[Lua]] runtime, as implemented in the WildStar [[UI]]. See also [[UI API]].&lt;br /&gt;
&lt;br /&gt;
The [[WildStar]] Lua runtime is based on Lua 5.1, and generally uses the same standard Lua functions listed on the official [http://www.lua.org Lua web site]. Some functions differ slightly in WildStar&amp;#039;s implementation and are documented here as well for consistency.&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
Nearly all of these functions are part of the default Lua 5.1 runtime environment, described [http://www.lua.org/manual/5.1/manual.html here]. Notable omissions are the  operating system, and file I/O libraries.&lt;br /&gt;
&lt;br /&gt;
 /eval Print(_VERSION)&lt;br /&gt;
 [debug]: Lua 5.1&lt;br /&gt;
&amp;lt;div class=&amp;quot;ApiList&amp;quot;&amp;gt;&amp;lt;!-- do not remove --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Basic ===&lt;br /&gt;
:{{id|API|assert}}(val[, sMsg]) returns (val) - returns &amp;#039;&amp;#039;val&amp;#039;&amp;#039; if true, else throws Lua error with sMsg&lt;br /&gt;
:{{id|API|collectgarbage}}() - forces garbage collection&lt;br /&gt;
:{{id|API|dofile}}([filename]) - opens the named file and executes its contents as a Lua chunk (stdio not usable in UI)&lt;br /&gt;
:{{id|API|error}}(sMsg, level) - throws error with message. use [[#pcall|pcall]]() to catch errors&lt;br /&gt;
:{{id|API|gcinfo}}() returns (nAddOn,nLimit) - gets AddOn memory used and current GC threshold in kB&lt;br /&gt;
:{{id|API|getfenv}}(any) returns (table) - gets stack frame of given function or stack level number&lt;br /&gt;
:{{id|API|getmetatable}}(aObject) returns (mtable) - gets metatable for table or userdata&lt;br /&gt;
:{{id|API|load}}(func [, chunkname]) returns (function) - gets Lua chunk from func stream, until empty, nil, no value&lt;br /&gt;
:{{id|API|loadfile}}([filename]) returns (function)  - similar to load, but gets from file (stdio not usable in UI)&lt;br /&gt;
:{{id|API|loadstring}}(string [, chunkname]) returns (function) - gets Lua chunk for a Lua code string&lt;br /&gt;
:{{id|API|newproxy}}(boolean or proxy) - creates a userdata with a sharable metatable&lt;br /&gt;
:{{id|API|next}}(table, index) returns (key,value) - gets next key-value pair of the table, allowing you to walk a table&lt;br /&gt;
:{{id|API|pcall}}(func, arg1, arg2, ...) returns (boolean, results or sMessage) - executes &amp;#039;func&amp;#039; and returns true and values, otherwise false and error message&lt;br /&gt;
:{{id|API|print}}(string) - prints to Lua stdio (stdio not usable from UI) &lt;br /&gt;
:{{id|API|rawequal}}(v1, v2) returns (boolean) - checks if v1 and v2 are equal, bypassing any metamethods&lt;br /&gt;
:{{id|API|rawget}}(table, index) - gets real value of table[index], bypassing any metamethods&lt;br /&gt;
:{{id|API|rawset}}(table, index, value) - sets real table[index] to value, bypassing any metamethods&lt;br /&gt;
:{{id|API|select}}(nIndex, list) returns (number or item) - gets count if &amp;#039;index&amp;#039; is &amp;quot;#&amp;quot;, or item at &amp;#039;index&amp;#039;&lt;br /&gt;
:{{id|API|setfenv}}(function or integer, table) - sets table representing the stack frame for given function or stack level&lt;br /&gt;
:{{id|API|setmetatable}}(aObject, mtable) returns (any) - sets the metatable of a table or userdata, returns aObject&lt;br /&gt;
:{{id|API|type}}(any) - gets type of variable as a string: &amp;quot;number&amp;quot;, &amp;quot;string&amp;quot;, &amp;quot;table&amp;quot;, &amp;quot;function&amp;quot; or &amp;quot;userdata&amp;quot;&lt;br /&gt;
:{{id|API|unpack}}(table[, nStart][, nEnd]) returns (...) - converts indexed values of table to an argument list &lt;br /&gt;
:{{id|API|xpcall}}(function, fCallback) returns (boolean,results) - true if successfully executes function, or executes fCallback and returns false. results are return values of function or fCallback&lt;br /&gt;
&lt;br /&gt;
WS UI offers these standard Lua global data vars&lt;br /&gt;
:{{id|API|_G}} [table] - canonical list of variables in global scope, including ones in this reference&lt;br /&gt;
:{{id|API|_VERSION}} [string] = &amp;quot;Lua 5.1&amp;quot; - printable Lua runtime version number&lt;br /&gt;
&lt;br /&gt;
=== Strings ===&lt;br /&gt;
These string functions are Carbine custom, shorthand references to or a part of the Lua string library &amp;quot;string.&amp;quot; See [http://lua-users.org/wiki/StringLibraryTutorial StringLibraryTutorial] for more info.&lt;br /&gt;
&lt;br /&gt;
:{{id|API|tonumber}}(any[, base]) returns (number) - converts any. nil if fails. non-10 bases accept only unsigned ints&lt;br /&gt;
:{{id|API|tostring}}(any) - converts to a string, or nil if fails.&lt;br /&gt;
&lt;br /&gt;
These are custom string functions available in WS but not normal Lua.&lt;br /&gt;
:{{id|API|strRound}}(any[, nPlaces]) returns (number) - converts to number and rounds, default places 0. (Carbine)&lt;br /&gt;
&lt;br /&gt;
==== {{id|API|string}} ====&lt;br /&gt;
:{{id|API|string|byte}}(string[, index]) - gets internal Lua char (byte size number) of the i-th element of string&lt;br /&gt;
:{{id|API|string|char}}(nByte[, ...]) - compiles one or more Lua chars (byte size numbers) into a string&lt;br /&gt;
:{{id|API|string|dump}}(function) - returns a binary representation of the given function code as a string&lt;br /&gt;
:{{id|API|string|find}}(s, pattern[, start[, plain]]) - find match for pattern on s. optional offset or plain sub-string&lt;br /&gt;
:{{id|API|string|format}}(sFormat[, value[, ...]]) - gets string of values formatted by sFormat format string&lt;br /&gt;
:{{id|API|string|gfind}}(s, pattern) returns iterator function for pattern over the string s. (deprecated, same as gmatch) &lt;br /&gt;
:{{id|API|string|gmatch}}(s, pattern) gets iterator that returns the next captures each call, using pattern on string s &lt;br /&gt;
:{{id|API|string|gsub}}(s, pattern, replacement[, nLimit]) - globally substitute pattern for replacement in string&lt;br /&gt;
:{{id|API|string|len}}(string) - return length of the string in Lua chars (byte size numbers)&lt;br /&gt;
:{{id|API|string|lower}}(string) - return string converted to all lower case&lt;br /&gt;
:{{id|API|string|match}}(string, pattern[, initpos]) - similar to strfind, but only returns the matches, not the positions&lt;br /&gt;
:{{id|API|string|rep}}(string, n [, sep]) - return a string which is &amp;#039;&amp;#039;n&amp;#039;&amp;#039; copies of &amp;#039;&amp;#039;s&amp;#039;&amp;#039;, with optional delimeter &amp;#039;&amp;#039;sep&amp;#039;&amp;#039; &lt;br /&gt;
:{{id|API|string|reverse}}(string) - reverses a string&lt;br /&gt;
:{{id|API|string|sub}}(string, index[, endIndex]) - return a substring of string starting at index&lt;br /&gt;
:{{id|API|string|upper}}(string) - return string converted to all upper case&lt;br /&gt;
&lt;br /&gt;
=== Tables ===&lt;br /&gt;
These table functions are shorthand references to the Lua table library (which is available via &amp;quot;table.&amp;quot;, see [http://lua-users.org/wiki/TableLibraryTutorial TableLibraryTutorial] for more info). Be aware that some table functions only work with tables with proper numerical indexes, where {[1] = &amp;quot;x&amp;quot;, [3] = &amp;quot;y&amp;quot;} would have only one indexed value at 1. Not being aware of this fact is one major causes for bugs in code written in Lua.&lt;br /&gt;
&lt;br /&gt;
:{{id|API|ipairs}}(table) - gets an iterator of type integer to traverse a table&lt;br /&gt;
:{{id|API|pairs}}(table) - gets an iterator to traverse a table&lt;br /&gt;
&lt;br /&gt;
==== {{id|API|table}} ====&lt;br /&gt;
:{{id|API|table|concat}}(table [, sep [, i [, j]]]) returns (string) - build a string from table elements&lt;br /&gt;
:{{id|API|table|foreach}}(table, function) - runs function for each name-value in table. (deprecated, use pairs)&lt;br /&gt;
:{{id|API|table|foreachi}}(table, function) - runs function for each index in table, in order. (deprecated, use ipairs)&lt;br /&gt;
:{{id|API|table|getn}}(table) returns (number) - gets cached size of table &amp;#039;&amp;#039;array&amp;#039;&amp;#039; values. (deprecated, use #table operator)&lt;br /&gt;
:{{id|API|table|insert}}(table[, pos], value) - insert value into table at pos. default is end of table&lt;br /&gt;
:{{id|API|table|maxn}}(table) returns (number) - last positive numerical index. requires scan of whole table&lt;br /&gt;
:{{id|API|table|remove}}(table[, pos]) returns (any) - remove and return element at pos. default is last entry in table&lt;br /&gt;
:{{id|API|table|setn}}(table, number) - attempts to set cached table size value. (deprecated, like getn)&lt;br /&gt;
:{{id|API|table|sort}}(table[, comp]) - sort the elements in the table in-place, optionally using a custom comparator.&lt;br /&gt;
&lt;br /&gt;
=== Arithmetic ===&lt;br /&gt;
&lt;br /&gt;
==== {{id|API|math}} ====&lt;br /&gt;
:{{id|API|math|abs}}(value) - returns the absolute value of the number&lt;br /&gt;
:{{id|API|math|acos}}(value) - returns the arc cosine of the value in degrees&lt;br /&gt;
:{{id|API|math|asin}}(value) - returns the arc sine of the value in degrees&lt;br /&gt;
:{{id|API|math|atan}}(value) - returns the arc tangent of the value in degrees&lt;br /&gt;
:{{id|API|math|atan2}}(y, x) - returns the arc tangent of Y/X in degrees&lt;br /&gt;
:{{id|API|math|ceil}}(value) - returns the ceiling of value&lt;br /&gt;
:{{id|API|math|cos}}(degrees) - returns the cosine of the degree value&lt;br /&gt;
:{{id|API|math|cosh}}(value) - returns the hyperbolic cosine of value&lt;br /&gt;
:{{id|API|math|deg}}(radians) - returns the degree equivalent of the radian value&lt;br /&gt;
:{{id|API|math|exp}}(value) - returns the exponent of value&lt;br /&gt;
:{{id|API|math|floor}}(value) - returns the floor of value&lt;br /&gt;
:{{id|API|math|fmod}}(x, y) - returns remainder of division of x by y, rounding quotient toward zero&lt;br /&gt;
:{{id|API|math|frexp}}(num) - Extract mantissa and exponent from a floating point number&lt;br /&gt;
:{{id|API|math|huge}} = 1.#INF&lt;br /&gt;
:{{id|API|math|ldexp}}(value, exponent) - Load exponent of a floating point number&lt;br /&gt;
:{{id|API|math|log}}(value) - returns the natural logarithm (log base e) of value&lt;br /&gt;
:{{id|API|math|log10}}(value) - returns the base-10 logarithm of value&lt;br /&gt;
:{{id|API|math|max}}(value[, values...]) - returns the numeric maximum of the input values&lt;br /&gt;
:{{id|API|math|min}}(value[,values...]) - returns the numeric minimum of the input values&lt;br /&gt;
:{{id|API|math|mod}}(a, b) - returns the integer remainder of a divided by b&lt;br /&gt;
:{{id|API|math|modf}}(x) - returns two numbers. integral part of x, and fractional part of x&lt;br /&gt;
:{{id|API|math|pi}} = 3.1415926535898&lt;br /&gt;
:{{id|API|math|pow}}(x, y) - returns x to power of y. can also use operator ^, as expression x^y&lt;br /&gt;
:{{id|API|math|rad}}(degrees) - returns the radian equivalent of the degree value&lt;br /&gt;
:{{id|API|math|random}}([ [lower,] upper]) - returns a random number, optionally bounded integer value&lt;br /&gt;
:{{id|API|math|randomseed}}(x) - sets x &amp;quot;seed&amp;quot; for random generator. seed always makes same sequence&lt;br /&gt;
:{{id|API|math|sin}}(degrees) - returns the sine of the degree value&lt;br /&gt;
:{{id|API|math|sinh}}(value) - returns the hyperbolic sine of value&lt;br /&gt;
:{{id|API|math|sqrt}}(x) - returns the square root of x&lt;br /&gt;
:{{id|API|math|tan}}(degrees) - returns the tangent of the degrees value&lt;br /&gt;
:{{id|API|math|tanh}}(x) - returns the hyperbolic tangent of x&lt;br /&gt;
&lt;br /&gt;
=== Bitwise ===&lt;br /&gt;
WildStar includes the Lua BitLib library, which is available via &amp;quot;bit32.&amp;quot; table, which provides access to C-style bitwise manipulation operators. This library uses the 32-bit integer size, e.g. bit32.lshift(2147483648, 1) = 0, because 1000 0000 0000 0000 0000 0000 0000 0000 -&amp;gt; 0000 0000 0000 0000 0000 0000 0000 0000.&lt;br /&gt;
&lt;br /&gt;
==== {{id|API|bit32}} ====&lt;br /&gt;
:{{id|API|bit32|arshift}}(a, b) - returns a shifted arithmetically right b places&lt;br /&gt;
:{{id|API|bit32|band}}(w1, ...) - returns the bitwise &amp;#039;&amp;#039;and&amp;#039;&amp;#039; of the w&amp;#039;s&lt;br /&gt;
:{{id|API|bit32|bnot}}(a) - returns the &amp;#039;&amp;#039;one&amp;#039;s complement&amp;#039;&amp;#039; of a&lt;br /&gt;
:{{id|API|bit32|bor}}(w1, ...) - returns the bitwise &amp;#039;&amp;#039;or&amp;#039;&amp;#039; of the w&amp;#039;s&lt;br /&gt;
:{{id|API|bit32|btest}}(···) returns (boolean) - true if &amp;#039;&amp;#039;bitwise and&amp;#039;&amp;#039; of all operands is not zero &lt;br /&gt;
:{{id|API|bit32|bxor}}(w1, ...) - returns the bitwise &amp;#039;&amp;#039;exclusive or&amp;#039;&amp;#039; of the w&amp;#039;s&lt;br /&gt;
:{{id|API|bit32|extract}}(n, start[, width]) - gets set of bits from n. start is 0-31. default width is 1&lt;br /&gt;
:{{id|API|bit32|lrotate}}(x, disp) - returns x rotated left disp places&lt;br /&gt;
:{{id|API|bit32|lshift}}(a, b) - returns a &amp;#039;&amp;#039;shifted left&amp;#039;&amp;#039; b places&lt;br /&gt;
:{{id|API|bit32|replace}}(n, v, start [, width]) - gets copy n with bits set from value v. start is 0-31. default width is 1&lt;br /&gt;
:{{id|API|bit32|rrotate}}(x, disp) - returns x rotated right disp places&lt;br /&gt;
:{{id|API|bit32|rshift}}(a, b) - returns a shifted logically right b places&lt;br /&gt;
&lt;br /&gt;
=== System ===&lt;br /&gt;
The system functions whaich are generally just a subset of the Lua standard &amp;#039;&amp;#039;os&amp;#039;&amp;#039; library. Alternatively the {{api||Apollo}} and {{api|GameLib}} libraries offer standard WS UI date and time functions, like {{api||GameLib|GetLocalTime}}, {{api||GameLib|GetServerTime}} and {{api||Apollo|GetTickCount}}.   &lt;br /&gt;
&lt;br /&gt;
==== {{id|API|os}} ====&lt;br /&gt;
:{{id|API|clock}}() - returns an approximation in seconds of CPU time used by the program&lt;br /&gt;
:{{id|API|difftime}}(t2, t1) - returns diff in seconds between t1 and t2. in Windows and others is exactly t2-t1&lt;br /&gt;
:{{id|API|time}}([table]) returns (number) - current machine time, or from date table, in secs since 00:00 Jan 1 1970  &lt;br /&gt;
:{{id|API|date}}([format[, time]]) returns (table or string) - gets table or &amp;#039;&amp;#039;format&amp;#039;&amp;#039; string, of current or &amp;#039;&amp;#039;time&amp;#039;&amp;#039; date&lt;br /&gt;
&lt;br /&gt;
=== Debugging ===&lt;br /&gt;
The debugging functions which are generally just a subset of the Lua stardard &amp;#039;&amp;#039;debug&amp;#039;&amp;#039; library.&lt;br /&gt;
&lt;br /&gt;
==== {{id|API|debug}} ====&lt;br /&gt;
:{{id|API|debug|debug}}() enters an interactive mode with the user (not useable from UI)&lt;br /&gt;
:{{id|API|debug|gethook}}([thread]) - gets thread&amp;#039;s hook settings: function, mask, count&lt;br /&gt;
:{{id|API|debug|getinfo}}([thread,] f [, what]) - gets table of information about a function &amp;#039;&amp;#039;f&amp;#039;&amp;#039; as: nups, what, func, lastlinedefined, source, currentline, namewhat, linedefined, short_src&lt;br /&gt;
:{{id|API|debug|getlocal}}([thread,] nLevel, nLocal) - gets name and value of the variable at &amp;#039;&amp;#039;nLocal&amp;#039;&amp;#039; in stack &amp;#039;&amp;#039;nLevel&amp;#039;&amp;#039; &lt;br /&gt;
:{{id|API|debug|getmetatable}}(obj) returns (mtable) - gets metatable for table or userdata (same as _G.getmetatable)&lt;br /&gt;
:{{id|API|debug|getregistry}}() - returns the registry table (not useable from UI)&lt;br /&gt;
:{{id|API|debug|getupvalue}}(f, nUp) - gets name, value of upvalue nUp of function f. nil if no upvalue&lt;br /&gt;
:{{id|API|debug|sethook}}([thread,] f, sMask [, count]) - sets function f as to be called for event sMask&lt;br /&gt;
:{{id|API|debug|setlocal}}([thread,] nLevel, nLocal, value) - assigns value to nLocal at stack nLevel. gets name, or nil if no nLocal. throws if no nLevel&lt;br /&gt;
:{{id|API|debug|setmetatable}}(obj, mtable) returns (obj) - sets metatable for table or userdata (same as _G.setmetatable)&lt;br /&gt;
:{{id|API|debug|setupvalue}}(f, nUp, value) - assigns value to upvalue nUp of function f. gets name or nil if no upvalue&lt;br /&gt;
:{{id|API|debug|traceback}}([thread,] [sMessage [, nLevel]]) - gets string with a trace of call stack, starting at nLevel.&lt;br /&gt;
&lt;br /&gt;
References added to &amp;#039;&amp;#039;debug.&amp;#039;&amp;#039; in WildStar&lt;br /&gt;
:{{id|API|debug|getfenv}}(any) returns (table) - stack frame of given function or stack level (same as _G.getfenv)&lt;br /&gt;
:{{id|API|debug|setfenv}}(function or nLevel, table) - sets table for stack frame for func or level (same as _G.setfenv)&lt;br /&gt;
&lt;br /&gt;
=== Modules ===&lt;br /&gt;
The modules functions which are generally just a subset of the Lua stardard package library. Other than using the [[#require|require]] keyword to access standard Carbine WS modules, the {{api||Apollo}} library should be used instead for AddOns and Lua libraries, like {{api||Apollo|RegisterAddon}} and {{api||Apollo|RegisterPackage}}. &lt;br /&gt;
&lt;br /&gt;
:{{id|API|module}}(name [, ···]) - sets this Lua chunk as named Lua &amp;#039;&amp;#039;module&amp;#039;&amp;#039;, in package.loaded[name] and _G[name]&lt;br /&gt;
:{{id|API|require}}(modname) - loads a module as reference in this Lua chunk, from package.loaded[name] or loader&lt;br /&gt;
&lt;br /&gt;
==== {{id|API|package}} ====&lt;br /&gt;
:{{id|API|package|config}} [string] = &amp;quot;\\\n;\n?\n!\n-&amp;quot; - list of chunk string seperators (undocumented)&lt;br /&gt;
:{{id|API|package|cpath}} [string] = &amp;quot;.\?.dll;!\?.dll;!\loadall.dll&amp;quot; - require path for C loader&lt;br /&gt;
:{{id|API|package|loaded}} [table] - table used by require for modules are already loaded&lt;br /&gt;
:{{id|API|package|loaders}} [table] - table used by require for how to load modules&lt;br /&gt;
:{{id|API|package|loadlib}}(libname, sFunc) - loads and links a C Lua library&lt;br /&gt;
:{{id|API|package|path}} [string] = &amp;quot;.\?.lua;!\lua\?.lua;!\lua\?\init.lua;!\?.lua;!\?\init.lua&amp;quot; - require path for Lua loader&lt;br /&gt;
:{{id|API|package|preload}} [table] - table to store loaders for specific modules&lt;br /&gt;
:{{id|API|package|seeall}}(module) - sets metatable on module so inherits from global environment. option to [[#module|module]]()&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;!-- do not remove --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Lua]] - which has plenty of links to other reference material&lt;br /&gt;
* [[API types]] - with a list of Lua types and &amp;#039;psudo-types&amp;#039; used in WS&lt;/div&gt;</summary>
		<author><name>Bear</name></author>
	</entry>
</feed>