<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://solarstrike.net/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Elverion</id>
		<title>SolarStrike wiki - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="https://solarstrike.net/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Elverion"/>
		<link rel="alternate" type="text/html" href="https://solarstrike.net/wiki/index.php/Special:Contributions/Elverion"/>
		<updated>2026-05-10T14:22:20Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>https://solarstrike.net/wiki/index.php?title=Process_Module&amp;diff=1291</id>
		<title>Process Module</title>
		<link rel="alternate" type="text/html" href="https://solarstrike.net/wiki/index.php?title=Process_Module&amp;diff=1291"/>
				<updated>2018-06-07T01:24:57Z</updated>
		
		<summary type="html">&lt;p&gt;Elverion: /* findByExe */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== open ==&lt;br /&gt;
'''procHandle process.open(number procId)'''&lt;br /&gt;
&lt;br /&gt;
Attempt to open and return a handle to a process for reading/writing. Accepts only the process's ID.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== close ==&lt;br /&gt;
'''process.close(handle procHandle)'''&lt;br /&gt;
&lt;br /&gt;
Closes an opened handle. If you set an open handle to nil, or if a handle goes out of scope, it will automatically close itself.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== read ==&lt;br /&gt;
'''number|string process.read(handle procHandle, string type, number address[, number length])'''&lt;br /&gt;
&lt;br /&gt;
Attempt to read memory from process 'procHandle' at the given address.&lt;br /&gt;
'type' should be &amp;quot;byte&amp;quot;, &amp;quot;ubyte&amp;quot;, &amp;quot;short&amp;quot;, &amp;quot;ushort&amp;quot;, etc.&lt;br /&gt;
When reading a string, a maximum bytes to read should be given as 'length', otherwise do not specify length.&lt;br /&gt;
&lt;br /&gt;
The type of data returned depends on the type requested. That is, requesting a byte, short, int, int64, float, or double returns a number while requesting a string returns a string. If this function should fail, it will return nil.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== readPtr ==&lt;br /&gt;
'''number|string process.readPtr(handle procHandle, string type, number address, number|table offsets[, number length])'''&lt;br /&gt;
&lt;br /&gt;
Exactly like process.read(), except it reads from a pointer.&lt;br /&gt;
&lt;br /&gt;
'offsets' can be a number (single offset) or a table (multiple offsets).&lt;br /&gt;
If a table is given for 'offsets', each value should be of type number.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== readBatch ==&lt;br /&gt;
'''table process.readBatch(handle procHandle, number address, string mask)'''&lt;br /&gt;
&lt;br /&gt;
Attempt to read memory from process 'proc' at the given address.&lt;br /&gt;
'mask' dictates what type(s) and how many variables should be read.&lt;br /&gt;
Each character in 'mask' specifies the type to read or skip. A number&lt;br /&gt;
prefixing the type can dictate the number to read (number types) or&lt;br /&gt;
the length of a string.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| Character&lt;br /&gt;
| Type&lt;br /&gt;
|-&lt;br /&gt;
| b&lt;br /&gt;
| byte&lt;br /&gt;
|-&lt;br /&gt;
| B&lt;br /&gt;
| unsigned byte&lt;br /&gt;
|-&lt;br /&gt;
| s&lt;br /&gt;
| short&lt;br /&gt;
|-&lt;br /&gt;
| S&lt;br /&gt;
| unsigned short&lt;br /&gt;
|-&lt;br /&gt;
| i&lt;br /&gt;
| int&lt;br /&gt;
|-&lt;br /&gt;
| I&lt;br /&gt;
| unsigned int&lt;br /&gt;
|-&lt;br /&gt;
| h&lt;br /&gt;
| int64&lt;br /&gt;
|-&lt;br /&gt;
| H&lt;br /&gt;
| unsigned int64&lt;br /&gt;
|-&lt;br /&gt;
| f&lt;br /&gt;
| float&lt;br /&gt;
|-&lt;br /&gt;
| F&lt;br /&gt;
| double&lt;br /&gt;
|-&lt;br /&gt;
| c&lt;br /&gt;
| string&lt;br /&gt;
|-&lt;br /&gt;
| _&lt;br /&gt;
| (skip ahead; do not return this)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;quot;3i&amp;quot; means &amp;quot;read 3 integers&amp;quot; while &amp;quot;3c&amp;quot; means &amp;quot;read a string of length 3&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== readChunk ==&lt;br /&gt;
'''chunk process.readChunk(handle procHandle, number address, number size)'''&lt;br /&gt;
&lt;br /&gt;
'''See also:''' [[MemoryChunk_class]]&lt;br /&gt;
&lt;br /&gt;
Reads a chunk of memory of a given size from a location. 'size' represents the number of bytes to read.&lt;br /&gt;
&lt;br /&gt;
The chunk is an object that you can then use to extract the various data from. It is generally faster to read a chunk then extract from it than it is to do many single reads with process.read().&lt;br /&gt;
&lt;br /&gt;
== write ==&lt;br /&gt;
'''boolean process.write(handle procHandle, string type, number address, string|number data)'''&lt;br /&gt;
&lt;br /&gt;
Attempt to write memory to process 'proc' at the given address. 'type' does not need to indicate signedness. (do not includes 'u' prefix)&lt;br /&gt;
Strings also do not require length to be given.&lt;br /&gt;
&lt;br /&gt;
Returns true on success, false on failure.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== writePtr ==&lt;br /&gt;
'''boolean process.writePtr(handle procHandle, string type, number address, number|table offsets, number|string data)'''&lt;br /&gt;
&lt;br /&gt;
See process.write().&lt;br /&gt;
&lt;br /&gt;
'offsets' can be a number (single offset) or a table (multiple offsets).&lt;br /&gt;
If a table is given for 'offsets', each value should be of type number.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== findPattern ==&lt;br /&gt;
'''number process.findPattern(handle procHandle, number address, number length, string bitmask, string szmask)'''&lt;br /&gt;
&lt;br /&gt;
Attempt to find a pattern within a process, beginning at memory address 'address', with a max scan length of 'length' (in bytes).&lt;br /&gt;
'bitmask' should contain an 'x' for a match, and '?' for wildcard. i.e. &amp;quot;xxxx?xx&amp;quot;&lt;br /&gt;
'szmask' should contain the actual data we are checking against for a match. i.e. &amp;quot;ABCD?FG&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Returns a number (the found address) on success and nil on failure or not found.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== findByWindow ==&lt;br /&gt;
'''number process.findByWindow(number hwnd)'''&lt;br /&gt;
&lt;br /&gt;
Returns the process ID that a window with handle 'hwnd' is owned by.&lt;br /&gt;
If the function fails, it returns nil.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== findByExe ==&lt;br /&gt;
'''number process.findByExe(string procname)'''&lt;br /&gt;
&lt;br /&gt;
Look up a process ID by checking for its running executable. i.e. &amp;quot;explorer.exe&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If the process you are looking for is 64-bit, then you must use a 64-bit copy of MicroMacro, otherwise the process cannot be found.&lt;br /&gt;
&lt;br /&gt;
== getModuleAddress ==&lt;br /&gt;
'''number process.getModuleAddress(number procId, string moduleName)'''&lt;br /&gt;
&lt;br /&gt;
Look up the address of a module within a process and return its origin address. Often this is used to lookup the location where a DLL is loaded. 'moduleName' should be the full name. i.e. &amp;quot;whatever.dll&amp;quot;&lt;br /&gt;
If the function fails or it could not locate the module, it returns nil.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== getModuleFilename ==&lt;br /&gt;
'''string process.getModuleFilename(handle process)'''&lt;br /&gt;
&lt;br /&gt;
Returns the fully qualified path of the main executable of an ''opened'' (see process.open) process.&lt;br /&gt;
&lt;br /&gt;
== getModules ==&lt;br /&gt;
'''table process.getModules(number procId)'''&lt;br /&gt;
&lt;br /&gt;
Returns a table of key/value pairs of every module found within the process specified by the process ID. Module names will be the key and the address within the program will be the value.&lt;br /&gt;
If the function fails, it returns nil.&lt;br /&gt;
&lt;br /&gt;
== attachInput ==&lt;br /&gt;
'''boolean process.attachInput(number hwnd)'''&lt;br /&gt;
&lt;br /&gt;
Attach our input thread to the target window. Returns true on success, false on failure.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== detachInput ==&lt;br /&gt;
'''boolean process.detachInput(number hwnd)'''&lt;br /&gt;
&lt;br /&gt;
Detach our input thread from the target window.&lt;br /&gt;
Returns true on success, false on failure.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== is32bit ==&lt;br /&gt;
'''boolean process.is32bit(handle proc)'''&lt;br /&gt;
&lt;br /&gt;
Returns true if the target process is 32-bit.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== is64bit ==&lt;br /&gt;
'''boolean process.is64bit(handle proc)'''&lt;br /&gt;
&lt;br /&gt;
Returns true if the target process is 64-bit.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== terminate ==&lt;br /&gt;
'''boolean process.terminate(handle proc)'''&lt;br /&gt;
&lt;br /&gt;
'''boolean process.terminate(handle proc, number exitCode = 0)'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Attempts to terminate the target process. Returns true on success, or false on failure. 'exitCode' is an optional identifier you can use to specify the reason it is being terminated.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== getWindows ==&lt;br /&gt;
'''table process.getWindows(number procId)'''&lt;br /&gt;
&lt;br /&gt;
Returns a list of tables containing the 'hwnd' (handle to window), 'name' (window title), and 'class' of each window that belongs to the process specified by the process ID. For more information on the return value, see [[Window_Module#findList|window.findList]]().&lt;/div&gt;</summary>
		<author><name>Elverion</name></author>	</entry>

	<entry>
		<id>https://solarstrike.net/wiki/index.php?title=Class_Module&amp;diff=1288</id>
		<title>Class Module</title>
		<link rel="alternate" type="text/html" href="https://solarstrike.net/wiki/index.php?title=Class_Module&amp;diff=1288"/>
				<updated>2018-06-06T20:33:16Z</updated>
		
		<summary type="html">&lt;p&gt;Elverion: /* is_a */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;See also: [[Classes]]&lt;br /&gt;
&lt;br /&gt;
== new ==&lt;br /&gt;
'''class class.new([class baseclass])'''&lt;br /&gt;
&lt;br /&gt;
Create a new class. If baseclass is given, creates a child of it, and set the 'parent' variable to its base.&lt;br /&gt;
&lt;br /&gt;
This will '''not''' call the constructor. That is what the __call operator on the returned class is for: to create an instance of the class.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== vector3d ==&lt;br /&gt;
'''vector3d class.vector3d([number x, number y, number z])'''&lt;br /&gt;
&lt;br /&gt;
Create a new table (class) of vector3d. If x, y and z are given, the new vector3d retains the given values.&lt;br /&gt;
&lt;br /&gt;
The vector3d class contains metamethods for operations such as vector scaling and dot product.&lt;br /&gt;
&lt;br /&gt;
See also: [[Vector3d Class]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== is_a ==&lt;br /&gt;
'''boolean class.is_a(class baseclass)'''&lt;br /&gt;
&lt;br /&gt;
Checks if this class is an instance of of child of the given base class. Returns true if so, otherwise false.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Dog should be a child of Animal&lt;br /&gt;
Animal = class.new();&lt;br /&gt;
Dog = Animal();&lt;br /&gt;
&lt;br /&gt;
-- Banana should be a child of fruit&lt;br /&gt;
Fruit = class.new();&lt;br /&gt;
Banana = Fruit();&lt;br /&gt;
&lt;br /&gt;
print(&amp;quot;Dog is an Animal?&amp;quot;, Dog:is_a(Animal)); -- Should be true&lt;br /&gt;
print(&amp;quot;Banana is a Fruit?&amp;quot;, Banana:is_a(Fruit)); -- Should be true&lt;br /&gt;
print(&amp;quot;Banana is an Animal?&amp;quot;, Banana:is_a(Animal)); -- Should be false&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Elverion</name></author>	</entry>

	<entry>
		<id>https://solarstrike.net/wiki/index.php?title=Class_Module&amp;diff=1287</id>
		<title>Class Module</title>
		<link rel="alternate" type="text/html" href="https://solarstrike.net/wiki/index.php?title=Class_Module&amp;diff=1287"/>
				<updated>2018-06-06T20:32:59Z</updated>
		
		<summary type="html">&lt;p&gt;Elverion: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;See also: [[Classes]]&lt;br /&gt;
&lt;br /&gt;
== new ==&lt;br /&gt;
'''class class.new([class baseclass])'''&lt;br /&gt;
&lt;br /&gt;
Create a new class. If baseclass is given, creates a child of it, and set the 'parent' variable to its base.&lt;br /&gt;
&lt;br /&gt;
This will '''not''' call the constructor. That is what the __call operator on the returned class is for: to create an instance of the class.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== vector3d ==&lt;br /&gt;
'''vector3d class.vector3d([number x, number y, number z])'''&lt;br /&gt;
&lt;br /&gt;
Create a new table (class) of vector3d. If x, y and z are given, the new vector3d retains the given values.&lt;br /&gt;
&lt;br /&gt;
The vector3d class contains metamethods for operations such as vector scaling and dot product.&lt;br /&gt;
&lt;br /&gt;
See also: [[Vector3d Class]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== is_a ==&lt;br /&gt;
'''boolean class.is_a(class baseclass)'''&lt;br /&gt;
&lt;br /&gt;
Checks if this class is an instance of of child of the given base class. Returns true if so, otherwise false.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''Example:''&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Dog should be a child of Animal&lt;br /&gt;
Animal = class.new();&lt;br /&gt;
Dog = Animal();&lt;br /&gt;
&lt;br /&gt;
-- Banana should be a child of fruit&lt;br /&gt;
Fruit = class.new();&lt;br /&gt;
Banana = Fruit();&lt;br /&gt;
&lt;br /&gt;
print(&amp;quot;Dog is an Animal?&amp;quot;, Dog:is_a(Animal)); -- Should be true&lt;br /&gt;
print(&amp;quot;Banana is a Fruit?&amp;quot;, Banana:is_a(Fruit)); -- Should be true&lt;br /&gt;
print(&amp;quot;Banana is an Animal?&amp;quot;, Banana:is_a(Animal)); -- Should be false&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Elverion</name></author>	</entry>

	<entry>
		<id>https://solarstrike.net/wiki/index.php?title=Clipper_Module&amp;diff=1286</id>
		<title>Clipper Module</title>
		<link rel="alternate" type="text/html" href="https://solarstrike.net/wiki/index.php?title=Clipper_Module&amp;diff=1286"/>
				<updated>2018-03-10T23:09:49Z</updated>
		
		<summary type="html">&lt;p&gt;Elverion: Created page with &amp;quot;The Clipper module makes use of the Clipper library[http://www.angusj.com/delphi/clipper.php]  = Path &amp;amp; Point definitions = Many Clipper functions will require or return a 'pa...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Clipper module makes use of the Clipper library[http://www.angusj.com/delphi/clipper.php]&lt;br /&gt;
&lt;br /&gt;
= Path &amp;amp; Point definitions =&lt;br /&gt;
Many Clipper functions will require or return a 'path.' In this context, a path will be a table of points. Each point (or vertex) of a path must be given in counter-clockwise fashion. A 'point' will be a table of x,y value pairs. Some functions will even use, or return, a table of paths. This may be a confusing explanation so a code example is given below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local point = {x = 5, y = 10}; -- This is a valid Clipper point&lt;br /&gt;
local path = { -- This path creates a triangle; remember, counter-clockwise&lt;br /&gt;
  {x = 8, y = 8},&lt;br /&gt;
  {x = 4, y = 4},&lt;br /&gt;
  {x = 12, y = 4},&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
-- Two more paths. Also known as... polygons.&lt;br /&gt;
local polygon1 = {&lt;br /&gt;
  {x = 4, y = 10},&lt;br /&gt;
  {x = 4, y = 4},&lt;br /&gt;
  {x = 5, y = 5},&lt;br /&gt;
  {x = 5, y = 10},&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
local polygon2 = {&lt;br /&gt;
  {x = 4, y = 7.5},&lt;br /&gt;
  {x = 6, y = 6},&lt;br /&gt;
  {x = 8, y = 12},&lt;br /&gt;
  {x = 1, y = 8},&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
local paths = {&lt;br /&gt;
  polygon1,&lt;br /&gt;
  polygon2,&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Module functions =&lt;br /&gt;
== getPointPrecision ==&lt;br /&gt;
'''number clipper.getPointPrecision()'''&lt;br /&gt;
&lt;br /&gt;
Returns the precision level used interally for scaling between floating-point numbers and integers (which the Clipper library uses for points).&lt;br /&gt;
By default, this is 16384.0.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== setPointPrecision ==&lt;br /&gt;
'''clipper.setPointPrecision(number newPrecision)'''&lt;br /&gt;
&lt;br /&gt;
Sets the precision for scaling points (as described in getPointPrecision). While any non-zero number should work, it is recommended that you stick to power-of-two values to prevent lossy conversions.&lt;br /&gt;
The underlying Clipper library uses integers to process points, however you probably will need floating-point numbers in your own project, and this number will aid in scaling between them.&lt;br /&gt;
&lt;br /&gt;
The default value should be fine enough for most cases so you will likely never need this function. If, however, you need finer (more decimal places) precision, try increasing this number. If you instead need larger but less precise points, you might try lowering this number.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== offset ==&lt;br /&gt;
'''table clipper.offset(table polygon, number offsetAmount)'''&lt;br /&gt;
&lt;br /&gt;
'''table clipper.offset(table polygon, number offsetAmount, string joinType)'''&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Offsets&amp;quot; (ie. scales/extrudes/shrinks/whatever) a polygon by some amount. If 'offsetAmount' is positive, the resulting polygon will be pushed outwards (become larger). If 'offsetAmount' is a negative number, the resulting polygon will instead be pushed inward (shrink).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By default, the 'joinType'[http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Types/JoinType.htm] is &amp;quot;miter&amp;quot;. You may specify either &amp;quot;miter&amp;quot;, &amp;quot;square&amp;quot; or &amp;quot;round&amp;quot; or determine how corners should be handled.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'polygon' should be a valid path. This function will return a table of paths, as self-intersection may occur, causing a polygon to be split into two separate polygons.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== merge ==&lt;br /&gt;
'''table clipper.merge(table polygons)'''&lt;br /&gt;
'''table clipper.merge(table polygons, string clipType)'''&lt;br /&gt;
&lt;br /&gt;
Performs a merge operation on a set of polygons. By default, clipType is assumed to be &amp;quot;union&amp;quot; (combine overlapping polygons into one). You may alternatively specify a clipType of &amp;quot;intersection&amp;quot; (solution will be a polygon of the area where input polygons were overlapping), &amp;quot;difference&amp;quot; (where the polygons are NOT overlapping), or &amp;quot;xor&amp;quot; (exclusive or, the area where one polygons or the other covers, but not both).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'polygons' will be, as you might expect, a table of paths you wish to apply the merge. This function will return a table of paths.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== clean ==&lt;br /&gt;
'''table clipper.clean(table polygon)'''&lt;br /&gt;
&lt;br /&gt;
'''table clipper.clean(table polygon, number distance)'''&lt;br /&gt;
&lt;br /&gt;
Cleans up a polygon by removing unnecessary vertices. As per the clipper docs, it will remove vertices that:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;column-count:1;-moz-column-count:1;-webkit-column-count:1&amp;quot;&amp;gt;&lt;br /&gt;
* that join co-linear edges, or join edges that are almost co-linear (such that if the vertex was moved no more than the specified distance the edges would be co-linear)&lt;br /&gt;
* that are within the specified distance of an adjacent vertex&lt;br /&gt;
* that are within the specified distance of a semi-adjacent vertex together with their out-lying vertices&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Simply put, it merges points that are too close together, removes dangling vertices, and simplifies vertices in a line into just one line.&lt;br /&gt;
&lt;br /&gt;
This function accepts 'polygon' as a path and returns a single path (not a table of paths).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
See the Clipper docs[http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Functions/CleanPolygon.htm] for more information.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== simplify ==&lt;br /&gt;
'''table clipper.simplify(table polygon)'''&lt;br /&gt;
&lt;br /&gt;
Simplifies a polygon. For example, a polygon that overlaps itself will instead be broken into two separate simple polygons.&lt;br /&gt;
&lt;br /&gt;
'polygon' should be a valid path. This function will return a table of paths.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
See the Clipper docs[http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Functions/SimplifyPolygon.htm] for more information.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== pointInPoly ==&lt;br /&gt;
'''inPoly, onPoly clipper.pointInPoly(table point, table polygon)'''&lt;br /&gt;
&lt;br /&gt;
Checks if a given point is inside (or on) a polygon. If the point is fully inside the given polygon, 'inPoly' will be true. If the point is on a segment between two vertices, 'onPoly' will also be true.&lt;br /&gt;
&lt;br /&gt;
'polygon' should be a valid path, and point should of course be a valid point. Both return values will be booleans.&lt;/div&gt;</summary>
		<author><name>Elverion</name></author>	</entry>

	<entry>
		<id>https://solarstrike.net/wiki/index.php?title=Manual&amp;diff=1285</id>
		<title>Manual</title>
		<link rel="alternate" type="text/html" href="https://solarstrike.net/wiki/index.php?title=Manual&amp;diff=1285"/>
				<updated>2018-03-10T21:41:39Z</updated>
		
		<summary type="html">&lt;p&gt;Elverion: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''MicroMacro 2.x Online Manual'''&lt;br /&gt;
&lt;br /&gt;
''The MicroMacro 2 branch is currently under development and is subject to change.''&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;padding: 8px;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;width: 150px;&amp;quot; | [[Basic Info]]&lt;br /&gt;
| How things work, configuration options, and other fun stuff.&lt;br /&gt;
|-&lt;br /&gt;
| [[Tutorials &amp;amp; Examples]]&lt;br /&gt;
| Everything you'll want to know to get started writing your own script.&lt;br /&gt;
|-&lt;br /&gt;
| [[Events]]&lt;br /&gt;
| The different events that can be triggered.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| [[Audio Module]]&lt;br /&gt;
| Load and play sounds with OpenAL.&lt;br /&gt;
|-&lt;br /&gt;
| [[Class Module]]&lt;br /&gt;
| Create classes with support for object inheritance.&lt;br /&gt;
|-&lt;br /&gt;
| [[Cli Module]]&lt;br /&gt;
| For interfacing with the console.&lt;br /&gt;
|-&lt;br /&gt;
| [[Clipper Module]]&lt;br /&gt;
| Polygon clipping, merging, simplifying, and more.&lt;br /&gt;
|-&lt;br /&gt;
| [[Filesystem Module]]&lt;br /&gt;
| Functions for dealing with files and directories.&lt;br /&gt;
|-&lt;br /&gt;
| [[Gamepad Module]]&lt;br /&gt;
| Read input from gamepads and joysticks.&lt;br /&gt;
|-&lt;br /&gt;
| [[Global Addon]]&lt;br /&gt;
| Misc functions in global scope.&lt;br /&gt;
|-&lt;br /&gt;
| [[ Hash Module]]&lt;br /&gt;
| Functions for 1-way hashing strings and files.&lt;br /&gt;
|-&lt;br /&gt;
| [[Key Module]]&lt;br /&gt;
| A table containing virtual key codes for use with keyboard and mouse related functions.&lt;br /&gt;
|-&lt;br /&gt;
| [[Keyboard Module]]&lt;br /&gt;
| Read keyboard input or send synthetic key presses.&lt;br /&gt;
|-&lt;br /&gt;
| [[Log Module]]&lt;br /&gt;
| Functions for interfacing with the global log file.&lt;br /&gt;
|-&lt;br /&gt;
| [[Macro Module]]&lt;br /&gt;
| The base module; controls the execution of your scripts.&lt;br /&gt;
|-&lt;br /&gt;
| [[Math Addon]]&lt;br /&gt;
| Additional math functions.&lt;br /&gt;
|-&lt;br /&gt;
| [[Mouse Module]]&lt;br /&gt;
| Read mouse input or send synthetic button presses &amp;amp; movement.&lt;br /&gt;
|-&lt;br /&gt;
| [[Ncurses Module]]&lt;br /&gt;
| Create Ncurses windows and display text in an advanced way.&lt;br /&gt;
|-&lt;br /&gt;
| [[Network Module]]&lt;br /&gt;
| Communicate with overs over standard network sockets&lt;br /&gt;
|-&lt;br /&gt;
| [[Process Module]]&lt;br /&gt;
| Interface with other processes &amp;amp; their allocated memory.&lt;br /&gt;
|-&lt;br /&gt;
| [[Serial Module]]&lt;br /&gt;
| Communicate over serial (COM) ports&lt;br /&gt;
|-&lt;br /&gt;
| [[SQL Module]]&lt;br /&gt;
| Query SQL relational databases.&lt;br /&gt;
|-&lt;br /&gt;
| [[String Addon]]&lt;br /&gt;
| Additional functions for working with text strings.&lt;br /&gt;
|-&lt;br /&gt;
| [[System Module]]&lt;br /&gt;
| Interfacing with the operating system.&lt;br /&gt;
|-&lt;br /&gt;
| [[Table Addon]]&lt;br /&gt;
| Additional functions for working with tables.&lt;br /&gt;
|-&lt;br /&gt;
| [[Time Module]]&lt;br /&gt;
| Anything dealing with timing &amp;amp; time values.&lt;br /&gt;
|-&lt;br /&gt;
| [[Window Module]]&lt;br /&gt;
| Interface with other windows.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| [[Cache Library]]&lt;br /&gt;
| For caching simple key/value pairs&lt;br /&gt;
|-&lt;br /&gt;
| [[HTTPD Library]]&lt;br /&gt;
| Run a mini-webserver and use your web browser to interface with your scripts&lt;br /&gt;
|-&lt;br /&gt;
| [[Neural Network Library]]&lt;br /&gt;
| Simple, open-ended machine learning&lt;br /&gt;
|-&lt;br /&gt;
| [[Timestamp Class]]&lt;br /&gt;
| A library to aid in dealing with time values&lt;br /&gt;
|-&lt;br /&gt;
| [[Timezone Class]]&lt;br /&gt;
| A library used to lookup timezone offsets&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''MicroMacro 1.x Online Manual'''&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;padding: 8px;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;width: 150px;&amp;quot; | [[Mouse Control]]&lt;br /&gt;
| Functions to control mouse movement and clicks&lt;br /&gt;
|-&lt;br /&gt;
| [[Keyboard Control]]&lt;br /&gt;
| Functions to control keyboard key presses and releases&lt;br /&gt;
|-&lt;br /&gt;
| [[Process Functions]]&lt;br /&gt;
| Functions to open, close, and find processes&lt;br /&gt;
|-&lt;br /&gt;
| [[Memory Functions]]&lt;br /&gt;
| Functions for reading and writing of memory&lt;br /&gt;
|-&lt;br /&gt;
| [[Network Functions]]&lt;br /&gt;
| Functions for sending and receiving data over TCP/IP&lt;br /&gt;
|-&lt;br /&gt;
| [[Filesystem Functions]]&lt;br /&gt;
| Functions for working with files and directories&lt;br /&gt;
|-&lt;br /&gt;
| [[Timer Functions]]&lt;br /&gt;
| Timer-related functions&lt;br /&gt;
|-&lt;br /&gt;
| [[Misc Functions|Misc. Functions]]&lt;br /&gt;
| Misc. functions&lt;br /&gt;
|-&lt;br /&gt;
| [[Sound Functions]]&lt;br /&gt;
| Functions for loading and playing sounds&lt;br /&gt;
|-&lt;br /&gt;
| [[Library]]&lt;br /&gt;
| Various library information &lt;br /&gt;
|-&lt;br /&gt;
| [[Modules]]&lt;br /&gt;
| Information about the standard modules, and how to create your own.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| [[Virtual Keys]]&lt;br /&gt;
| For use with keyboard related functions&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Additional Information==&lt;br /&gt;
*[[MicroMacro License]]&lt;br /&gt;
*[[Lua License]]&lt;/div&gt;</summary>
		<author><name>Elverion</name></author>	</entry>

	<entry>
		<id>https://solarstrike.net/wiki/index.php?title=Serial_Module&amp;diff=1284</id>
		<title>Serial Module</title>
		<link rel="alternate" type="text/html" href="https://solarstrike.net/wiki/index.php?title=Serial_Module&amp;diff=1284"/>
				<updated>2018-02-27T00:43:32Z</updated>
		
		<summary type="html">&lt;p&gt;Elverion: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;See also: [[Serial Port Class]]&lt;br /&gt;
&lt;br /&gt;
== open ==&lt;br /&gt;
'''serialPort serial.open(string portName)'''&lt;br /&gt;
'''serialPort serial.open(string portName, number baudRate)'''&lt;br /&gt;
&lt;br /&gt;
Opens a serial port by it's name. The portName should not contain the &amp;quot;\\.\&amp;quot; prefix as this is provided for you. You may optionally provide a baud rate, otherwise it will default to 9600.&lt;br /&gt;
&lt;br /&gt;
If this function succeeds, a new serial port object will be returned. If this function fails, it returns false plus an error message.&lt;br /&gt;
&lt;br /&gt;
See the documentation for the [[Serial Port Class]] to learn how to use this object.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local port = serial.open(&amp;quot;COM7&amp;quot;); -- Open COM7 with a default baud rate of 9600&lt;br /&gt;
local port2 = serial.open(&amp;quot;COM8&amp;quot;, 115200); -- Open COM8 with baud rate of 115200&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Elverion</name></author>	</entry>

	<entry>
		<id>https://solarstrike.net/wiki/index.php?title=Serial_Port_Class&amp;diff=1283</id>
		<title>Serial Port Class</title>
		<link rel="alternate" type="text/html" href="https://solarstrike.net/wiki/index.php?title=Serial_Port_Class&amp;diff=1283"/>
				<updated>2018-02-27T00:42:42Z</updated>
		
		<summary type="html">&lt;p&gt;Elverion: Created page with &amp;quot;== isConnected == '''boolean serialPort:isConnected'''  Returns a boolean describing whether or not the serial port is connected. Unless you've closed the port, this should pr...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== isConnected ==&lt;br /&gt;
'''boolean serialPort:isConnected'''&lt;br /&gt;
&lt;br /&gt;
Returns a boolean describing whether or not the serial port is connected. Unless you've closed the port, this should probably be true.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
if( not port:isConnected() ) then&lt;br /&gt;
	print(&amp;quot;The port has been closed.&amp;quot;);&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== read ==&lt;br /&gt;
'''string,boolean serialPort:read()'''&lt;br /&gt;
'''string,boolean serialPort:read(number length)'''&lt;br /&gt;
&lt;br /&gt;
Reads queued data out of a serial port. If 'length' is supplied, this function will only read up to that many bytes. If 'length' is not supplied, it will read up to the maximum buffer size (10240) in bytes.&lt;br /&gt;
&lt;br /&gt;
This function returns two variables: a string containing the data read and a boolean describing whether or not there is more data left in the queue. If this function fails, it should return nil.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local data,more = myPort:read(); -- Read as much as our buffer can hold (10240)&lt;br /&gt;
&lt;br /&gt;
-- or --&lt;br /&gt;
&lt;br /&gt;
repeat -- Keep reading until there's no more left in the queue&lt;br /&gt;
	data,more = myPort:read(4); -- Read 4 bytes at a time&lt;br /&gt;
until not more&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== write ==&lt;br /&gt;
'''boolean serialPort:write(string data)'''&lt;br /&gt;
&lt;br /&gt;
Writes data to a serial port. Returns true if the function succeeds, otherwise it returns false.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
if( not port:write(&amp;quot;Hello World&amp;quot;) ) then&lt;br /&gt;
	print(&amp;quot;Failed to write data&amp;quot;);&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== close ==&lt;br /&gt;
'''serialPort:close()'''&lt;br /&gt;
&lt;br /&gt;
Closes a serial port. Does not accept any parameters nor does it return anything. A serial port becomes useless after being closed and you must re-call [[Serial_Module#open|serial.open]]() if you wish to re-open it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
port:close();&lt;br /&gt;
port = nil; -- Set it to nil to delete the object so that it can be removed from memory&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Elverion</name></author>	</entry>

	<entry>
		<id>https://solarstrike.net/wiki/index.php?title=Serial_Module&amp;diff=1282</id>
		<title>Serial Module</title>
		<link rel="alternate" type="text/html" href="https://solarstrike.net/wiki/index.php?title=Serial_Module&amp;diff=1282"/>
				<updated>2018-02-27T00:27:28Z</updated>
		
		<summary type="html">&lt;p&gt;Elverion: Created page with &amp;quot;See also: Serial Port Class  == open == '''serialPort serial.open(string portName)''' '''serialPort serial.open(string portName, number baudRate)'''  Opens a serial port b...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;See also: [[Serial Port Class]]&lt;br /&gt;
&lt;br /&gt;
== open ==&lt;br /&gt;
'''serialPort serial.open(string portName)'''&lt;br /&gt;
'''serialPort serial.open(string portName, number baudRate)'''&lt;br /&gt;
&lt;br /&gt;
Opens a serial port by it's name. The portName should not contain the &amp;quot;\\.\&amp;quot; prefix as this is provided for you. You may optionally provide a baud rate, otherwise it will default to 9600.&lt;br /&gt;
&lt;br /&gt;
If this function succeeds, a new serial port object will be returned. If this function fails, it returns false plus an error message.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local port = serial.open(&amp;quot;COM7&amp;quot;); -- Open COM7 with a default baud rate of 9600&lt;br /&gt;
local port2 = serial.open(&amp;quot;COM8&amp;quot;, 115200); -- Open COM8 with baud rate of 115200&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Elverion</name></author>	</entry>

	<entry>
		<id>https://solarstrike.net/wiki/index.php?title=Manual&amp;diff=1281</id>
		<title>Manual</title>
		<link rel="alternate" type="text/html" href="https://solarstrike.net/wiki/index.php?title=Manual&amp;diff=1281"/>
				<updated>2018-02-27T00:20:35Z</updated>
		
		<summary type="html">&lt;p&gt;Elverion: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''MicroMacro 2.x Online Manual'''&lt;br /&gt;
&lt;br /&gt;
''The MicroMacro 2 branch is currently under development and is subject to change.''&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;padding: 8px;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;width: 150px;&amp;quot; | [[Basic Info]]&lt;br /&gt;
| How things work, configuration options, and other fun stuff.&lt;br /&gt;
|-&lt;br /&gt;
| [[Tutorials &amp;amp; Examples]]&lt;br /&gt;
| Everything you'll want to know to get started writing your own script.&lt;br /&gt;
|-&lt;br /&gt;
| [[Events]]&lt;br /&gt;
| The different events that can be triggered.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| [[Audio Module]]&lt;br /&gt;
| Load and play sounds with OpenAL.&lt;br /&gt;
|-&lt;br /&gt;
| [[Class Module]]&lt;br /&gt;
| Create classes with support for object inheritance.&lt;br /&gt;
|-&lt;br /&gt;
| [[Cli Module]]&lt;br /&gt;
| For interfacing with the console.&lt;br /&gt;
|-&lt;br /&gt;
| [[Filesystem Module]]&lt;br /&gt;
| Functions for dealing with files and directories.&lt;br /&gt;
|-&lt;br /&gt;
| [[Gamepad Module]]&lt;br /&gt;
| Read input from gamepads and joysticks.&lt;br /&gt;
|-&lt;br /&gt;
| [[Global Addon]]&lt;br /&gt;
| Misc functions in global scope.&lt;br /&gt;
|-&lt;br /&gt;
| [[ Hash Module]]&lt;br /&gt;
| Functions for 1-way hashing strings and files.&lt;br /&gt;
|-&lt;br /&gt;
| [[Key Module]]&lt;br /&gt;
| A table containing virtual key codes for use with keyboard and mouse related functions.&lt;br /&gt;
|-&lt;br /&gt;
| [[Keyboard Module]]&lt;br /&gt;
| Read keyboard input or send synthetic key presses.&lt;br /&gt;
|-&lt;br /&gt;
| [[Log Module]]&lt;br /&gt;
| Functions for interfacing with the global log file.&lt;br /&gt;
|-&lt;br /&gt;
| [[Macro Module]]&lt;br /&gt;
| The base module; controls the execution of your scripts.&lt;br /&gt;
|-&lt;br /&gt;
| [[Math Addon]]&lt;br /&gt;
| Additional math functions.&lt;br /&gt;
|-&lt;br /&gt;
| [[Mouse Module]]&lt;br /&gt;
| Read mouse input or send synthetic button presses &amp;amp; movement.&lt;br /&gt;
|-&lt;br /&gt;
| [[Ncurses Module]]&lt;br /&gt;
| Create Ncurses windows and display text in an advanced way.&lt;br /&gt;
|-&lt;br /&gt;
| [[Network Module]]&lt;br /&gt;
| Communicate with overs over standard network sockets&lt;br /&gt;
|-&lt;br /&gt;
| [[Process Module]]&lt;br /&gt;
| Interface with other processes &amp;amp; their allocated memory.&lt;br /&gt;
|-&lt;br /&gt;
| [[Serial Module]]&lt;br /&gt;
| Communicate over serial (COM) ports&lt;br /&gt;
|-&lt;br /&gt;
| [[SQL Module]]&lt;br /&gt;
| Query SQL relational databases.&lt;br /&gt;
|-&lt;br /&gt;
| [[String Addon]]&lt;br /&gt;
| Additional functions for working with text strings.&lt;br /&gt;
|-&lt;br /&gt;
| [[System Module]]&lt;br /&gt;
| Interfacing with the operating system.&lt;br /&gt;
|-&lt;br /&gt;
| [[Table Addon]]&lt;br /&gt;
| Additional functions for working with tables.&lt;br /&gt;
|-&lt;br /&gt;
| [[Time Module]]&lt;br /&gt;
| Anything dealing with timing &amp;amp; time values.&lt;br /&gt;
|-&lt;br /&gt;
| [[Window Module]]&lt;br /&gt;
| Interface with other windows.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| [[Cache Library]]&lt;br /&gt;
| For caching simple key/value pairs&lt;br /&gt;
|-&lt;br /&gt;
| [[HTTPD Library]]&lt;br /&gt;
| Run a mini-webserver and use your web browser to interface with your scripts&lt;br /&gt;
|-&lt;br /&gt;
| [[Neural Network Library]]&lt;br /&gt;
| Simple, open-ended machine learning&lt;br /&gt;
|-&lt;br /&gt;
| [[Timestamp Class]]&lt;br /&gt;
| A library to aid in dealing with time values&lt;br /&gt;
|-&lt;br /&gt;
| [[Timezone Class]]&lt;br /&gt;
| A library used to lookup timezone offsets&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''MicroMacro 1.x Online Manual'''&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;padding: 8px;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;width: 150px;&amp;quot; | [[Mouse Control]]&lt;br /&gt;
| Functions to control mouse movement and clicks&lt;br /&gt;
|-&lt;br /&gt;
| [[Keyboard Control]]&lt;br /&gt;
| Functions to control keyboard key presses and releases&lt;br /&gt;
|-&lt;br /&gt;
| [[Process Functions]]&lt;br /&gt;
| Functions to open, close, and find processes&lt;br /&gt;
|-&lt;br /&gt;
| [[Memory Functions]]&lt;br /&gt;
| Functions for reading and writing of memory&lt;br /&gt;
|-&lt;br /&gt;
| [[Network Functions]]&lt;br /&gt;
| Functions for sending and receiving data over TCP/IP&lt;br /&gt;
|-&lt;br /&gt;
| [[Filesystem Functions]]&lt;br /&gt;
| Functions for working with files and directories&lt;br /&gt;
|-&lt;br /&gt;
| [[Timer Functions]]&lt;br /&gt;
| Timer-related functions&lt;br /&gt;
|-&lt;br /&gt;
| [[Misc Functions|Misc. Functions]]&lt;br /&gt;
| Misc. functions&lt;br /&gt;
|-&lt;br /&gt;
| [[Sound Functions]]&lt;br /&gt;
| Functions for loading and playing sounds&lt;br /&gt;
|-&lt;br /&gt;
| [[Library]]&lt;br /&gt;
| Various library information &lt;br /&gt;
|-&lt;br /&gt;
| [[Modules]]&lt;br /&gt;
| Information about the standard modules, and how to create your own.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| [[Virtual Keys]]&lt;br /&gt;
| For use with keyboard related functions&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Additional Information==&lt;br /&gt;
*[[MicroMacro License]]&lt;br /&gt;
*[[Lua License]]&lt;/div&gt;</summary>
		<author><name>Elverion</name></author>	</entry>

	<entry>
		<id>https://solarstrike.net/wiki/index.php?title=Neural_Network_Library&amp;diff=1280</id>
		<title>Neural Network Library</title>
		<link rel="alternate" type="text/html" href="https://solarstrike.net/wiki/index.php?title=Neural_Network_Library&amp;diff=1280"/>
				<updated>2018-02-17T19:15:54Z</updated>
		
		<summary type="html">&lt;p&gt;Elverion: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= What Neural Networks Can Do =&lt;br /&gt;
&lt;br /&gt;
= How It Works =&lt;br /&gt;
&lt;br /&gt;
= Training =&lt;br /&gt;
&lt;br /&gt;
= Documentation =&lt;br /&gt;
==Including the library in your project==&lt;br /&gt;
&lt;br /&gt;
Before you can use the neural network library, you must tell your project to include the necessary files. To do so, you can simply use the ''require'' call, like so:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
require('neuralnet/net');&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is highly recommended to do this at the top of your main project file (probably main.lua).&lt;br /&gt;
&lt;br /&gt;
==Creating an instance of a neural network==&lt;br /&gt;
Before you can create an instance of a neural network, you will need to know what your network topology looks like. That is, how many inputs, how many outputs, how many hidden layers you would like, and how many neurons in each hidden layer. Hidden layers will generally have a number of neurons between the number of inputs and number of outputs. You generally only need one hidden layer for simple tasks and two for more complex tasks. For example, if you have 10 inputs and 2 outputs, you might consider one hidden layer of 4-6 neurons and may want to try experimenting to see which gives the best results.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''class NeuralNet(...)'''&lt;br /&gt;
&lt;br /&gt;
You may either pass a table of numbers or a variable number of number arguments to the constructor in order to create a network with that topology. The first argument (or table value) will be the number of inputs, the second argument will be the number of neurons in the first hidden layer, you may then provide additional data for extra hidden layers, and the final argument will be the number of outputs.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
net = NeuralNet(10, 6, 2); -- Create a neural network with 10 inputs, one hidden layer with 6 neurons, and 2 outputs.&lt;br /&gt;
net2 = NeuralNet(32, 24, 16, 8); -- 32 inputs, 24 neurons in hidden layer #1, 16 neurons in hidden layer #2, and 8 outputs.&lt;br /&gt;
&lt;br /&gt;
local topology = {6, 3, 1}; -- Alternatively we can pass the topology as a table&lt;br /&gt;
net3 = NeuralNet(topology);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==NeuralNet:feed()==&lt;br /&gt;
'''NeuralNet:feed(...)'''&lt;br /&gt;
&lt;br /&gt;
This function is used ''feed' data into the network's inputs and perform calculations on it. You will use this both while training and for getting results once training is complete. Again, this function accepts either a variable number of arguments or table of values.&lt;br /&gt;
&lt;br /&gt;
The number of values that you pass in '''must''' be exactly the same number of inputs for the network.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
net = NeuralNet(2, 2, 1);&lt;br /&gt;
net:feed(0.0, 1.0); -- Feed two values, 0.0 and 1.0, into the networks inputs.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==NeuralNet:backPropagation()==&lt;br /&gt;
&lt;br /&gt;
Back Propagation is one method of training neural networks. In this type of training, you will feed data to a network and then &amp;quot;back propagate&amp;quot; the known, expected result. With each back propagation, the neural network will continue to rearrange its hidden parts to understand what it is expected to do and, therefor, give better results. Note that back propagating once or twice will be meaningless; you will almost certainly need to provide thousands of training samples.&lt;br /&gt;
&lt;br /&gt;
You may pass values as a table or variable number of arguments, they must be numbers, and you must provide the exact number of values as are outputs for the network.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local a = 0.25;&lt;br /&gt;
local b = 0.75;&lt;br /&gt;
local expectedResult = a * b;&lt;br /&gt;
&lt;br /&gt;
net = NeuralNet(2, 2, 1); -- Our neural network is created, but is filled with randomness and won't provide any good results.&lt;br /&gt;
net:feed(a, b); -- Pass in our two inputs and process them, but since our network isn't trained the results are garbage&lt;br /&gt;
net:backPropagation(expectedResult); -- Slightly adjust network. It's at least a tiny bit smarter now!&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==NeuralNet:getRecentAverageError()==&lt;br /&gt;
==NeuralNet:getResults()==&lt;br /&gt;
'''table NeuralNet:getResults()'''&lt;br /&gt;
&lt;br /&gt;
Returns the results (values in the output layer) as a table. This is what you will use to get data out of a network after feeding data into the network.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
table.print(net:getResults());&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==NeuralNet:getExportTable()==&lt;br /&gt;
'''table NeuralNet:getExportTable()'''&lt;br /&gt;
&lt;br /&gt;
Returns a table containing neuron weights for the whole network. You almost certainly won't want to have to re-train your network every time you want to use it, so this function helps with saving all necessary data to restore the network to a trained state.&lt;br /&gt;
&lt;br /&gt;
You probably should just use NeuralNet:save() to save it directly to a file.&lt;br /&gt;
&lt;br /&gt;
==NeuralNet:save()==&lt;br /&gt;
'''NeuralNet::save(filename)'''&lt;br /&gt;
&lt;br /&gt;
Saves the neuron weights to a file. Use this after training so that you can re-load it later and not have to start over with training your network.&lt;br /&gt;
&lt;br /&gt;
==NeuralNet:load()==&lt;br /&gt;
'''NeuralNet:load(filename)'''&lt;br /&gt;
&lt;br /&gt;
Loads the neuron weights back into a network from a file that was saved with NeuralNet:save()&lt;br /&gt;
&lt;br /&gt;
= Examples =&lt;br /&gt;
==Calculating xor==&lt;br /&gt;
&lt;br /&gt;
In this example, we will create a neural network and train it to calculate for xor. Xor (eXclusive Or) simply means that input 1 OR input 2 must be true(1) but not both at the same time.&lt;br /&gt;
1 xor 0 is true(1)&lt;br /&gt;
0 xor 1 is true(1)&lt;br /&gt;
1 xor 1 is false(0)&lt;br /&gt;
0 xor 0 is false(0)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Since Lua already provides a way to do this, a neural network is way overkill and computationally expensive in comparison, however it should make a good example.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
require('neuralnet/net');&lt;br /&gt;
&lt;br /&gt;
function macro.init()&lt;br /&gt;
	net = NeuralNet(2, 2, 1);&lt;br /&gt;
&lt;br /&gt;
	for i = 1,1000 do&lt;br /&gt;
		local a = math.random(0, 1);&lt;br /&gt;
		local b = math.random(0, 1);&lt;br /&gt;
&lt;br /&gt;
		net:feed(a, b);&lt;br /&gt;
&lt;br /&gt;
		local result = a ~ b;		-- ~ is the bitwise 'xor' operation&lt;br /&gt;
		net:backPropagation(result);	-- Train on this data for the given input&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Our network should be trained well enough, so lets see if it works&lt;br /&gt;
	local a = math.random(0, 1);&lt;br /&gt;
	local b = math.random(0, 1);&lt;br /&gt;
	local expected = a ~ b;&lt;br /&gt;
&lt;br /&gt;
	net:feed(a, b);&lt;br /&gt;
	local results = net:getResults();&lt;br /&gt;
	local networkXor = math.floor(results[1] + 0.5); -- Since the network outputs a floating-point number, we round it&lt;br /&gt;
	printf(&amp;quot;Our neural network thinks %d XOR %d is %d. We expect to get %d\n&amp;quot;, a, b, networkXor, expected);&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Elverion</name></author>	</entry>

	<entry>
		<id>https://solarstrike.net/wiki/index.php?title=Neural_Network_Library&amp;diff=1279</id>
		<title>Neural Network Library</title>
		<link rel="alternate" type="text/html" href="https://solarstrike.net/wiki/index.php?title=Neural_Network_Library&amp;diff=1279"/>
				<updated>2018-02-17T19:15:21Z</updated>
		
		<summary type="html">&lt;p&gt;Elverion: /* Examples */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= What Neural Networks Can Do =&lt;br /&gt;
&lt;br /&gt;
= How It Works =&lt;br /&gt;
&lt;br /&gt;
= Documentation =&lt;br /&gt;
==Including the library in your project==&lt;br /&gt;
&lt;br /&gt;
Before you can use the neural network library, you must tell your project to include the necessary files. To do so, you can simply use the ''require'' call, like so:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
require('neuralnet/net');&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is highly recommended to do this at the top of your main project file (probably main.lua).&lt;br /&gt;
&lt;br /&gt;
==Creating an instance of a neural network==&lt;br /&gt;
Before you can create an instance of a neural network, you will need to know what your network topology looks like. That is, how many inputs, how many outputs, how many hidden layers you would like, and how many neurons in each hidden layer. Hidden layers will generally have a number of neurons between the number of inputs and number of outputs. You generally only need one hidden layer for simple tasks and two for more complex tasks. For example, if you have 10 inputs and 2 outputs, you might consider one hidden layer of 4-6 neurons and may want to try experimenting to see which gives the best results.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''class NeuralNet(...)'''&lt;br /&gt;
&lt;br /&gt;
You may either pass a table of numbers or a variable number of number arguments to the constructor in order to create a network with that topology. The first argument (or table value) will be the number of inputs, the second argument will be the number of neurons in the first hidden layer, you may then provide additional data for extra hidden layers, and the final argument will be the number of outputs.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
net = NeuralNet(10, 6, 2); -- Create a neural network with 10 inputs, one hidden layer with 6 neurons, and 2 outputs.&lt;br /&gt;
net2 = NeuralNet(32, 24, 16, 8); -- 32 inputs, 24 neurons in hidden layer #1, 16 neurons in hidden layer #2, and 8 outputs.&lt;br /&gt;
&lt;br /&gt;
local topology = {6, 3, 1}; -- Alternatively we can pass the topology as a table&lt;br /&gt;
net3 = NeuralNet(topology);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==NeuralNet:feed()==&lt;br /&gt;
'''NeuralNet:feed(...)'''&lt;br /&gt;
&lt;br /&gt;
This function is used ''feed' data into the network's inputs and perform calculations on it. You will use this both while training and for getting results once training is complete. Again, this function accepts either a variable number of arguments or table of values.&lt;br /&gt;
&lt;br /&gt;
The number of values that you pass in '''must''' be exactly the same number of inputs for the network.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
net = NeuralNet(2, 2, 1);&lt;br /&gt;
net:feed(0.0, 1.0); -- Feed two values, 0.0 and 1.0, into the networks inputs.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==NeuralNet:backPropagation()==&lt;br /&gt;
&lt;br /&gt;
Back Propagation is one method of training neural networks. In this type of training, you will feed data to a network and then &amp;quot;back propagate&amp;quot; the known, expected result. With each back propagation, the neural network will continue to rearrange its hidden parts to understand what it is expected to do and, therefor, give better results. Note that back propagating once or twice will be meaningless; you will almost certainly need to provide thousands of training samples.&lt;br /&gt;
&lt;br /&gt;
You may pass values as a table or variable number of arguments, they must be numbers, and you must provide the exact number of values as are outputs for the network.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local a = 0.25;&lt;br /&gt;
local b = 0.75;&lt;br /&gt;
local expectedResult = a * b;&lt;br /&gt;
&lt;br /&gt;
net = NeuralNet(2, 2, 1); -- Our neural network is created, but is filled with randomness and won't provide any good results.&lt;br /&gt;
net:feed(a, b); -- Pass in our two inputs and process them, but since our network isn't trained the results are garbage&lt;br /&gt;
net:backPropagation(expectedResult); -- Slightly adjust network. It's at least a tiny bit smarter now!&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==NeuralNet:getRecentAverageError()==&lt;br /&gt;
==NeuralNet:getResults()==&lt;br /&gt;
'''table NeuralNet:getResults()'''&lt;br /&gt;
&lt;br /&gt;
Returns the results (values in the output layer) as a table. This is what you will use to get data out of a network after feeding data into the network.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
table.print(net:getResults());&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==NeuralNet:getExportTable()==&lt;br /&gt;
'''table NeuralNet:getExportTable()'''&lt;br /&gt;
&lt;br /&gt;
Returns a table containing neuron weights for the whole network. You almost certainly won't want to have to re-train your network every time you want to use it, so this function helps with saving all necessary data to restore the network to a trained state.&lt;br /&gt;
&lt;br /&gt;
You probably should just use NeuralNet:save() to save it directly to a file.&lt;br /&gt;
&lt;br /&gt;
==NeuralNet:save()==&lt;br /&gt;
'''NeuralNet::save(filename)'''&lt;br /&gt;
&lt;br /&gt;
Saves the neuron weights to a file. Use this after training so that you can re-load it later and not have to start over with training your network.&lt;br /&gt;
&lt;br /&gt;
==NeuralNet:load()==&lt;br /&gt;
'''NeuralNet:load(filename)'''&lt;br /&gt;
&lt;br /&gt;
Loads the neuron weights back into a network from a file that was saved with NeuralNet:save()&lt;br /&gt;
&lt;br /&gt;
= Examples =&lt;br /&gt;
==Calculating xor==&lt;br /&gt;
&lt;br /&gt;
In this example, we will create a neural network and train it to calculate for xor. Xor (eXclusive Or) simply means that input 1 OR input 2 must be true(1) but not both at the same time.&lt;br /&gt;
1 xor 0 is true(1)&lt;br /&gt;
0 xor 1 is true(1)&lt;br /&gt;
1 xor 1 is false(0)&lt;br /&gt;
0 xor 0 is false(0)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Since Lua already provides a way to do this, a neural network is way overkill and computationally expensive in comparison, however it should make a good example.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
require('neuralnet/net');&lt;br /&gt;
&lt;br /&gt;
function macro.init()&lt;br /&gt;
	net = NeuralNet(2, 2, 1);&lt;br /&gt;
&lt;br /&gt;
	for i = 1,1000 do&lt;br /&gt;
		local a = math.random(0, 1);&lt;br /&gt;
		local b = math.random(0, 1);&lt;br /&gt;
&lt;br /&gt;
		net:feed(a, b);&lt;br /&gt;
&lt;br /&gt;
		local result = a ~ b;		-- ~ is the bitwise 'xor' operation&lt;br /&gt;
		net:backPropagation(result);	-- Train on this data for the given input&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Our network should be trained well enough, so lets see if it works&lt;br /&gt;
	local a = math.random(0, 1);&lt;br /&gt;
	local b = math.random(0, 1);&lt;br /&gt;
	local expected = a ~ b;&lt;br /&gt;
&lt;br /&gt;
	net:feed(a, b);&lt;br /&gt;
	local results = net:getResults();&lt;br /&gt;
	local networkXor = math.floor(results[1] + 0.5); -- Since the network outputs a floating-point number, we round it&lt;br /&gt;
	printf(&amp;quot;Our neural network thinks %d XOR %d is %d. We expect to get %d\n&amp;quot;, a, b, networkXor, expected);&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Elverion</name></author>	</entry>

	<entry>
		<id>https://solarstrike.net/wiki/index.php?title=Neural_Network_Library&amp;diff=1278</id>
		<title>Neural Network Library</title>
		<link rel="alternate" type="text/html" href="https://solarstrike.net/wiki/index.php?title=Neural_Network_Library&amp;diff=1278"/>
				<updated>2018-02-17T18:56:21Z</updated>
		
		<summary type="html">&lt;p&gt;Elverion: /* NeuralNet:load() */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= What Neural Networks Can Do =&lt;br /&gt;
&lt;br /&gt;
= How It Works =&lt;br /&gt;
&lt;br /&gt;
= Documentation =&lt;br /&gt;
==Including the library in your project==&lt;br /&gt;
&lt;br /&gt;
Before you can use the neural network library, you must tell your project to include the necessary files. To do so, you can simply use the ''require'' call, like so:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
require('neuralnet/net');&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is highly recommended to do this at the top of your main project file (probably main.lua).&lt;br /&gt;
&lt;br /&gt;
==Creating an instance of a neural network==&lt;br /&gt;
Before you can create an instance of a neural network, you will need to know what your network topology looks like. That is, how many inputs, how many outputs, how many hidden layers you would like, and how many neurons in each hidden layer. Hidden layers will generally have a number of neurons between the number of inputs and number of outputs. You generally only need one hidden layer for simple tasks and two for more complex tasks. For example, if you have 10 inputs and 2 outputs, you might consider one hidden layer of 4-6 neurons and may want to try experimenting to see which gives the best results.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''class NeuralNet(...)'''&lt;br /&gt;
&lt;br /&gt;
You may either pass a table of numbers or a variable number of number arguments to the constructor in order to create a network with that topology. The first argument (or table value) will be the number of inputs, the second argument will be the number of neurons in the first hidden layer, you may then provide additional data for extra hidden layers, and the final argument will be the number of outputs.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
net = NeuralNet(10, 6, 2); -- Create a neural network with 10 inputs, one hidden layer with 6 neurons, and 2 outputs.&lt;br /&gt;
net2 = NeuralNet(32, 24, 16, 8); -- 32 inputs, 24 neurons in hidden layer #1, 16 neurons in hidden layer #2, and 8 outputs.&lt;br /&gt;
&lt;br /&gt;
local topology = {6, 3, 1}; -- Alternatively we can pass the topology as a table&lt;br /&gt;
net3 = NeuralNet(topology);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==NeuralNet:feed()==&lt;br /&gt;
'''NeuralNet:feed(...)'''&lt;br /&gt;
&lt;br /&gt;
This function is used ''feed' data into the network's inputs and perform calculations on it. You will use this both while training and for getting results once training is complete. Again, this function accepts either a variable number of arguments or table of values.&lt;br /&gt;
&lt;br /&gt;
The number of values that you pass in '''must''' be exactly the same number of inputs for the network.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
net = NeuralNet(2, 2, 1);&lt;br /&gt;
net:feed(0.0, 1.0); -- Feed two values, 0.0 and 1.0, into the networks inputs.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==NeuralNet:backPropagation()==&lt;br /&gt;
&lt;br /&gt;
Back Propagation is one method of training neural networks. In this type of training, you will feed data to a network and then &amp;quot;back propagate&amp;quot; the known, expected result. With each back propagation, the neural network will continue to rearrange its hidden parts to understand what it is expected to do and, therefor, give better results. Note that back propagating once or twice will be meaningless; you will almost certainly need to provide thousands of training samples.&lt;br /&gt;
&lt;br /&gt;
You may pass values as a table or variable number of arguments, they must be numbers, and you must provide the exact number of values as are outputs for the network.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local a = 0.25;&lt;br /&gt;
local b = 0.75;&lt;br /&gt;
local expectedResult = a * b;&lt;br /&gt;
&lt;br /&gt;
net = NeuralNet(2, 2, 1); -- Our neural network is created, but is filled with randomness and won't provide any good results.&lt;br /&gt;
net:feed(a, b); -- Pass in our two inputs and process them, but since our network isn't trained the results are garbage&lt;br /&gt;
net:backPropagation(expectedResult); -- Slightly adjust network. It's at least a tiny bit smarter now!&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==NeuralNet:getRecentAverageError()==&lt;br /&gt;
==NeuralNet:getResults()==&lt;br /&gt;
'''table NeuralNet:getResults()'''&lt;br /&gt;
&lt;br /&gt;
Returns the results (values in the output layer) as a table. This is what you will use to get data out of a network after feeding data into the network.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
table.print(net:getResults());&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==NeuralNet:getExportTable()==&lt;br /&gt;
'''table NeuralNet:getExportTable()'''&lt;br /&gt;
&lt;br /&gt;
Returns a table containing neuron weights for the whole network. You almost certainly won't want to have to re-train your network every time you want to use it, so this function helps with saving all necessary data to restore the network to a trained state.&lt;br /&gt;
&lt;br /&gt;
You probably should just use NeuralNet:save() to save it directly to a file.&lt;br /&gt;
&lt;br /&gt;
==NeuralNet:save()==&lt;br /&gt;
'''NeuralNet::save(filename)'''&lt;br /&gt;
&lt;br /&gt;
Saves the neuron weights to a file. Use this after training so that you can re-load it later and not have to start over with training your network.&lt;br /&gt;
&lt;br /&gt;
==NeuralNet:load()==&lt;br /&gt;
'''NeuralNet:load(filename)'''&lt;br /&gt;
&lt;br /&gt;
Loads the neuron weights back into a network from a file that was saved with NeuralNet:save()&lt;br /&gt;
&lt;br /&gt;
= Examples =&lt;/div&gt;</summary>
		<author><name>Elverion</name></author>	</entry>

	<entry>
		<id>https://solarstrike.net/wiki/index.php?title=Neural_Network_Library&amp;diff=1277</id>
		<title>Neural Network Library</title>
		<link rel="alternate" type="text/html" href="https://solarstrike.net/wiki/index.php?title=Neural_Network_Library&amp;diff=1277"/>
				<updated>2018-02-17T18:55:05Z</updated>
		
		<summary type="html">&lt;p&gt;Elverion: /* NeuralNet:save() */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= What Neural Networks Can Do =&lt;br /&gt;
&lt;br /&gt;
= How It Works =&lt;br /&gt;
&lt;br /&gt;
= Documentation =&lt;br /&gt;
==Including the library in your project==&lt;br /&gt;
&lt;br /&gt;
Before you can use the neural network library, you must tell your project to include the necessary files. To do so, you can simply use the ''require'' call, like so:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
require('neuralnet/net');&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is highly recommended to do this at the top of your main project file (probably main.lua).&lt;br /&gt;
&lt;br /&gt;
==Creating an instance of a neural network==&lt;br /&gt;
Before you can create an instance of a neural network, you will need to know what your network topology looks like. That is, how many inputs, how many outputs, how many hidden layers you would like, and how many neurons in each hidden layer. Hidden layers will generally have a number of neurons between the number of inputs and number of outputs. You generally only need one hidden layer for simple tasks and two for more complex tasks. For example, if you have 10 inputs and 2 outputs, you might consider one hidden layer of 4-6 neurons and may want to try experimenting to see which gives the best results.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''class NeuralNet(...)'''&lt;br /&gt;
&lt;br /&gt;
You may either pass a table of numbers or a variable number of number arguments to the constructor in order to create a network with that topology. The first argument (or table value) will be the number of inputs, the second argument will be the number of neurons in the first hidden layer, you may then provide additional data for extra hidden layers, and the final argument will be the number of outputs.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
net = NeuralNet(10, 6, 2); -- Create a neural network with 10 inputs, one hidden layer with 6 neurons, and 2 outputs.&lt;br /&gt;
net2 = NeuralNet(32, 24, 16, 8); -- 32 inputs, 24 neurons in hidden layer #1, 16 neurons in hidden layer #2, and 8 outputs.&lt;br /&gt;
&lt;br /&gt;
local topology = {6, 3, 1}; -- Alternatively we can pass the topology as a table&lt;br /&gt;
net3 = NeuralNet(topology);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==NeuralNet:feed()==&lt;br /&gt;
'''NeuralNet:feed(...)'''&lt;br /&gt;
&lt;br /&gt;
This function is used ''feed' data into the network's inputs and perform calculations on it. You will use this both while training and for getting results once training is complete. Again, this function accepts either a variable number of arguments or table of values.&lt;br /&gt;
&lt;br /&gt;
The number of values that you pass in '''must''' be exactly the same number of inputs for the network.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
net = NeuralNet(2, 2, 1);&lt;br /&gt;
net:feed(0.0, 1.0); -- Feed two values, 0.0 and 1.0, into the networks inputs.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==NeuralNet:backPropagation()==&lt;br /&gt;
&lt;br /&gt;
Back Propagation is one method of training neural networks. In this type of training, you will feed data to a network and then &amp;quot;back propagate&amp;quot; the known, expected result. With each back propagation, the neural network will continue to rearrange its hidden parts to understand what it is expected to do and, therefor, give better results. Note that back propagating once or twice will be meaningless; you will almost certainly need to provide thousands of training samples.&lt;br /&gt;
&lt;br /&gt;
You may pass values as a table or variable number of arguments, they must be numbers, and you must provide the exact number of values as are outputs for the network.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local a = 0.25;&lt;br /&gt;
local b = 0.75;&lt;br /&gt;
local expectedResult = a * b;&lt;br /&gt;
&lt;br /&gt;
net = NeuralNet(2, 2, 1); -- Our neural network is created, but is filled with randomness and won't provide any good results.&lt;br /&gt;
net:feed(a, b); -- Pass in our two inputs and process them, but since our network isn't trained the results are garbage&lt;br /&gt;
net:backPropagation(expectedResult); -- Slightly adjust network. It's at least a tiny bit smarter now!&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==NeuralNet:getRecentAverageError()==&lt;br /&gt;
==NeuralNet:getResults()==&lt;br /&gt;
'''table NeuralNet:getResults()'''&lt;br /&gt;
&lt;br /&gt;
Returns the results (values in the output layer) as a table. This is what you will use to get data out of a network after feeding data into the network.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
table.print(net:getResults());&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==NeuralNet:getExportTable()==&lt;br /&gt;
'''table NeuralNet:getExportTable()'''&lt;br /&gt;
&lt;br /&gt;
Returns a table containing neuron weights for the whole network. You almost certainly won't want to have to re-train your network every time you want to use it, so this function helps with saving all necessary data to restore the network to a trained state.&lt;br /&gt;
&lt;br /&gt;
You probably should just use NeuralNet:save() to save it directly to a file.&lt;br /&gt;
&lt;br /&gt;
==NeuralNet:save()==&lt;br /&gt;
'''NeuralNet::save(filename)'''&lt;br /&gt;
&lt;br /&gt;
Saves the neuron weights to a file. Use this after training so that you can re-load it later and not have to start over with training your network.&lt;br /&gt;
&lt;br /&gt;
==NeuralNet:load()==&lt;br /&gt;
&lt;br /&gt;
= Examples =&lt;/div&gt;</summary>
		<author><name>Elverion</name></author>	</entry>

	<entry>
		<id>https://solarstrike.net/wiki/index.php?title=Neural_Network_Library&amp;diff=1276</id>
		<title>Neural Network Library</title>
		<link rel="alternate" type="text/html" href="https://solarstrike.net/wiki/index.php?title=Neural_Network_Library&amp;diff=1276"/>
				<updated>2018-02-17T18:54:13Z</updated>
		
		<summary type="html">&lt;p&gt;Elverion: /* NeuralNet:getExportTable() */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= What Neural Networks Can Do =&lt;br /&gt;
&lt;br /&gt;
= How It Works =&lt;br /&gt;
&lt;br /&gt;
= Documentation =&lt;br /&gt;
==Including the library in your project==&lt;br /&gt;
&lt;br /&gt;
Before you can use the neural network library, you must tell your project to include the necessary files. To do so, you can simply use the ''require'' call, like so:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
require('neuralnet/net');&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is highly recommended to do this at the top of your main project file (probably main.lua).&lt;br /&gt;
&lt;br /&gt;
==Creating an instance of a neural network==&lt;br /&gt;
Before you can create an instance of a neural network, you will need to know what your network topology looks like. That is, how many inputs, how many outputs, how many hidden layers you would like, and how many neurons in each hidden layer. Hidden layers will generally have a number of neurons between the number of inputs and number of outputs. You generally only need one hidden layer for simple tasks and two for more complex tasks. For example, if you have 10 inputs and 2 outputs, you might consider one hidden layer of 4-6 neurons and may want to try experimenting to see which gives the best results.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''class NeuralNet(...)'''&lt;br /&gt;
&lt;br /&gt;
You may either pass a table of numbers or a variable number of number arguments to the constructor in order to create a network with that topology. The first argument (or table value) will be the number of inputs, the second argument will be the number of neurons in the first hidden layer, you may then provide additional data for extra hidden layers, and the final argument will be the number of outputs.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
net = NeuralNet(10, 6, 2); -- Create a neural network with 10 inputs, one hidden layer with 6 neurons, and 2 outputs.&lt;br /&gt;
net2 = NeuralNet(32, 24, 16, 8); -- 32 inputs, 24 neurons in hidden layer #1, 16 neurons in hidden layer #2, and 8 outputs.&lt;br /&gt;
&lt;br /&gt;
local topology = {6, 3, 1}; -- Alternatively we can pass the topology as a table&lt;br /&gt;
net3 = NeuralNet(topology);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==NeuralNet:feed()==&lt;br /&gt;
'''NeuralNet:feed(...)'''&lt;br /&gt;
&lt;br /&gt;
This function is used ''feed' data into the network's inputs and perform calculations on it. You will use this both while training and for getting results once training is complete. Again, this function accepts either a variable number of arguments or table of values.&lt;br /&gt;
&lt;br /&gt;
The number of values that you pass in '''must''' be exactly the same number of inputs for the network.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
net = NeuralNet(2, 2, 1);&lt;br /&gt;
net:feed(0.0, 1.0); -- Feed two values, 0.0 and 1.0, into the networks inputs.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==NeuralNet:backPropagation()==&lt;br /&gt;
&lt;br /&gt;
Back Propagation is one method of training neural networks. In this type of training, you will feed data to a network and then &amp;quot;back propagate&amp;quot; the known, expected result. With each back propagation, the neural network will continue to rearrange its hidden parts to understand what it is expected to do and, therefor, give better results. Note that back propagating once or twice will be meaningless; you will almost certainly need to provide thousands of training samples.&lt;br /&gt;
&lt;br /&gt;
You may pass values as a table or variable number of arguments, they must be numbers, and you must provide the exact number of values as are outputs for the network.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local a = 0.25;&lt;br /&gt;
local b = 0.75;&lt;br /&gt;
local expectedResult = a * b;&lt;br /&gt;
&lt;br /&gt;
net = NeuralNet(2, 2, 1); -- Our neural network is created, but is filled with randomness and won't provide any good results.&lt;br /&gt;
net:feed(a, b); -- Pass in our two inputs and process them, but since our network isn't trained the results are garbage&lt;br /&gt;
net:backPropagation(expectedResult); -- Slightly adjust network. It's at least a tiny bit smarter now!&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==NeuralNet:getRecentAverageError()==&lt;br /&gt;
==NeuralNet:getResults()==&lt;br /&gt;
'''table NeuralNet:getResults()'''&lt;br /&gt;
&lt;br /&gt;
Returns the results (values in the output layer) as a table. This is what you will use to get data out of a network after feeding data into the network.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
table.print(net:getResults());&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==NeuralNet:getExportTable()==&lt;br /&gt;
'''table NeuralNet:getExportTable()'''&lt;br /&gt;
&lt;br /&gt;
Returns a table containing neuron weights for the whole network. You almost certainly won't want to have to re-train your network every time you want to use it, so this function helps with saving all necessary data to restore the network to a trained state.&lt;br /&gt;
&lt;br /&gt;
You probably should just use NeuralNet:save() to save it directly to a file.&lt;br /&gt;
&lt;br /&gt;
==NeuralNet:save()==&lt;br /&gt;
==NeuralNet:load()==&lt;br /&gt;
&lt;br /&gt;
= Examples =&lt;/div&gt;</summary>
		<author><name>Elverion</name></author>	</entry>

	<entry>
		<id>https://solarstrike.net/wiki/index.php?title=Neural_Network_Library&amp;diff=1275</id>
		<title>Neural Network Library</title>
		<link rel="alternate" type="text/html" href="https://solarstrike.net/wiki/index.php?title=Neural_Network_Library&amp;diff=1275"/>
				<updated>2018-02-17T18:54:00Z</updated>
		
		<summary type="html">&lt;p&gt;Elverion: /* NeuralNet:getExportTable() */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= What Neural Networks Can Do =&lt;br /&gt;
&lt;br /&gt;
= How It Works =&lt;br /&gt;
&lt;br /&gt;
= Documentation =&lt;br /&gt;
==Including the library in your project==&lt;br /&gt;
&lt;br /&gt;
Before you can use the neural network library, you must tell your project to include the necessary files. To do so, you can simply use the ''require'' call, like so:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
require('neuralnet/net');&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is highly recommended to do this at the top of your main project file (probably main.lua).&lt;br /&gt;
&lt;br /&gt;
==Creating an instance of a neural network==&lt;br /&gt;
Before you can create an instance of a neural network, you will need to know what your network topology looks like. That is, how many inputs, how many outputs, how many hidden layers you would like, and how many neurons in each hidden layer. Hidden layers will generally have a number of neurons between the number of inputs and number of outputs. You generally only need one hidden layer for simple tasks and two for more complex tasks. For example, if you have 10 inputs and 2 outputs, you might consider one hidden layer of 4-6 neurons and may want to try experimenting to see which gives the best results.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''class NeuralNet(...)'''&lt;br /&gt;
&lt;br /&gt;
You may either pass a table of numbers or a variable number of number arguments to the constructor in order to create a network with that topology. The first argument (or table value) will be the number of inputs, the second argument will be the number of neurons in the first hidden layer, you may then provide additional data for extra hidden layers, and the final argument will be the number of outputs.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
net = NeuralNet(10, 6, 2); -- Create a neural network with 10 inputs, one hidden layer with 6 neurons, and 2 outputs.&lt;br /&gt;
net2 = NeuralNet(32, 24, 16, 8); -- 32 inputs, 24 neurons in hidden layer #1, 16 neurons in hidden layer #2, and 8 outputs.&lt;br /&gt;
&lt;br /&gt;
local topology = {6, 3, 1}; -- Alternatively we can pass the topology as a table&lt;br /&gt;
net3 = NeuralNet(topology);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==NeuralNet:feed()==&lt;br /&gt;
'''NeuralNet:feed(...)'''&lt;br /&gt;
&lt;br /&gt;
This function is used ''feed' data into the network's inputs and perform calculations on it. You will use this both while training and for getting results once training is complete. Again, this function accepts either a variable number of arguments or table of values.&lt;br /&gt;
&lt;br /&gt;
The number of values that you pass in '''must''' be exactly the same number of inputs for the network.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
net = NeuralNet(2, 2, 1);&lt;br /&gt;
net:feed(0.0, 1.0); -- Feed two values, 0.0 and 1.0, into the networks inputs.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==NeuralNet:backPropagation()==&lt;br /&gt;
&lt;br /&gt;
Back Propagation is one method of training neural networks. In this type of training, you will feed data to a network and then &amp;quot;back propagate&amp;quot; the known, expected result. With each back propagation, the neural network will continue to rearrange its hidden parts to understand what it is expected to do and, therefor, give better results. Note that back propagating once or twice will be meaningless; you will almost certainly need to provide thousands of training samples.&lt;br /&gt;
&lt;br /&gt;
You may pass values as a table or variable number of arguments, they must be numbers, and you must provide the exact number of values as are outputs for the network.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local a = 0.25;&lt;br /&gt;
local b = 0.75;&lt;br /&gt;
local expectedResult = a * b;&lt;br /&gt;
&lt;br /&gt;
net = NeuralNet(2, 2, 1); -- Our neural network is created, but is filled with randomness and won't provide any good results.&lt;br /&gt;
net:feed(a, b); -- Pass in our two inputs and process them, but since our network isn't trained the results are garbage&lt;br /&gt;
net:backPropagation(expectedResult); -- Slightly adjust network. It's at least a tiny bit smarter now!&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==NeuralNet:getRecentAverageError()==&lt;br /&gt;
==NeuralNet:getResults()==&lt;br /&gt;
'''table NeuralNet:getResults()'''&lt;br /&gt;
&lt;br /&gt;
Returns the results (values in the output layer) as a table. This is what you will use to get data out of a network after feeding data into the network.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
table.print(net:getResults());&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==NeuralNet:getExportTable()==&lt;br /&gt;
'''table NeuralNet:getExportTable'''&lt;br /&gt;
&lt;br /&gt;
Returns a table containing neuron weights for the whole network. You almost certainly won't want to have to re-train your network every time you want to use it, so this function helps with saving all necessary data to restore the network to a trained state.&lt;br /&gt;
&lt;br /&gt;
You probably should just use NeuralNet:save() to save it directly to a file.&lt;br /&gt;
&lt;br /&gt;
==NeuralNet:save()==&lt;br /&gt;
==NeuralNet:load()==&lt;br /&gt;
&lt;br /&gt;
= Examples =&lt;/div&gt;</summary>
		<author><name>Elverion</name></author>	</entry>

	<entry>
		<id>https://solarstrike.net/wiki/index.php?title=Neural_Network_Library&amp;diff=1274</id>
		<title>Neural Network Library</title>
		<link rel="alternate" type="text/html" href="https://solarstrike.net/wiki/index.php?title=Neural_Network_Library&amp;diff=1274"/>
				<updated>2018-02-17T18:50:58Z</updated>
		
		<summary type="html">&lt;p&gt;Elverion: /* NeuralNet:getResults() */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= What Neural Networks Can Do =&lt;br /&gt;
&lt;br /&gt;
= How It Works =&lt;br /&gt;
&lt;br /&gt;
= Documentation =&lt;br /&gt;
==Including the library in your project==&lt;br /&gt;
&lt;br /&gt;
Before you can use the neural network library, you must tell your project to include the necessary files. To do so, you can simply use the ''require'' call, like so:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
require('neuralnet/net');&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is highly recommended to do this at the top of your main project file (probably main.lua).&lt;br /&gt;
&lt;br /&gt;
==Creating an instance of a neural network==&lt;br /&gt;
Before you can create an instance of a neural network, you will need to know what your network topology looks like. That is, how many inputs, how many outputs, how many hidden layers you would like, and how many neurons in each hidden layer. Hidden layers will generally have a number of neurons between the number of inputs and number of outputs. You generally only need one hidden layer for simple tasks and two for more complex tasks. For example, if you have 10 inputs and 2 outputs, you might consider one hidden layer of 4-6 neurons and may want to try experimenting to see which gives the best results.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''class NeuralNet(...)'''&lt;br /&gt;
&lt;br /&gt;
You may either pass a table of numbers or a variable number of number arguments to the constructor in order to create a network with that topology. The first argument (or table value) will be the number of inputs, the second argument will be the number of neurons in the first hidden layer, you may then provide additional data for extra hidden layers, and the final argument will be the number of outputs.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
net = NeuralNet(10, 6, 2); -- Create a neural network with 10 inputs, one hidden layer with 6 neurons, and 2 outputs.&lt;br /&gt;
net2 = NeuralNet(32, 24, 16, 8); -- 32 inputs, 24 neurons in hidden layer #1, 16 neurons in hidden layer #2, and 8 outputs.&lt;br /&gt;
&lt;br /&gt;
local topology = {6, 3, 1}; -- Alternatively we can pass the topology as a table&lt;br /&gt;
net3 = NeuralNet(topology);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==NeuralNet:feed()==&lt;br /&gt;
'''NeuralNet:feed(...)'''&lt;br /&gt;
&lt;br /&gt;
This function is used ''feed' data into the network's inputs and perform calculations on it. You will use this both while training and for getting results once training is complete. Again, this function accepts either a variable number of arguments or table of values.&lt;br /&gt;
&lt;br /&gt;
The number of values that you pass in '''must''' be exactly the same number of inputs for the network.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
net = NeuralNet(2, 2, 1);&lt;br /&gt;
net:feed(0.0, 1.0); -- Feed two values, 0.0 and 1.0, into the networks inputs.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==NeuralNet:backPropagation()==&lt;br /&gt;
&lt;br /&gt;
Back Propagation is one method of training neural networks. In this type of training, you will feed data to a network and then &amp;quot;back propagate&amp;quot; the known, expected result. With each back propagation, the neural network will continue to rearrange its hidden parts to understand what it is expected to do and, therefor, give better results. Note that back propagating once or twice will be meaningless; you will almost certainly need to provide thousands of training samples.&lt;br /&gt;
&lt;br /&gt;
You may pass values as a table or variable number of arguments, they must be numbers, and you must provide the exact number of values as are outputs for the network.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local a = 0.25;&lt;br /&gt;
local b = 0.75;&lt;br /&gt;
local expectedResult = a * b;&lt;br /&gt;
&lt;br /&gt;
net = NeuralNet(2, 2, 1); -- Our neural network is created, but is filled with randomness and won't provide any good results.&lt;br /&gt;
net:feed(a, b); -- Pass in our two inputs and process them, but since our network isn't trained the results are garbage&lt;br /&gt;
net:backPropagation(expectedResult); -- Slightly adjust network. It's at least a tiny bit smarter now!&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==NeuralNet:getRecentAverageError()==&lt;br /&gt;
==NeuralNet:getResults()==&lt;br /&gt;
'''table NeuralNet:getResults()'''&lt;br /&gt;
&lt;br /&gt;
Returns the results (values in the output layer) as a table. This is what you will use to get data out of a network after feeding data into the network.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
table.print(net:getResults());&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==NeuralNet:getExportTable()==&lt;br /&gt;
==NeuralNet:save()==&lt;br /&gt;
==NeuralNet:load()==&lt;br /&gt;
&lt;br /&gt;
= Examples =&lt;/div&gt;</summary>
		<author><name>Elverion</name></author>	</entry>

	<entry>
		<id>https://solarstrike.net/wiki/index.php?title=Neural_Network_Library&amp;diff=1273</id>
		<title>Neural Network Library</title>
		<link rel="alternate" type="text/html" href="https://solarstrike.net/wiki/index.php?title=Neural_Network_Library&amp;diff=1273"/>
				<updated>2018-02-17T18:49:11Z</updated>
		
		<summary type="html">&lt;p&gt;Elverion: /* NeuralNet:backPropagation() */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= What Neural Networks Can Do =&lt;br /&gt;
&lt;br /&gt;
= How It Works =&lt;br /&gt;
&lt;br /&gt;
= Documentation =&lt;br /&gt;
==Including the library in your project==&lt;br /&gt;
&lt;br /&gt;
Before you can use the neural network library, you must tell your project to include the necessary files. To do so, you can simply use the ''require'' call, like so:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
require('neuralnet/net');&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is highly recommended to do this at the top of your main project file (probably main.lua).&lt;br /&gt;
&lt;br /&gt;
==Creating an instance of a neural network==&lt;br /&gt;
Before you can create an instance of a neural network, you will need to know what your network topology looks like. That is, how many inputs, how many outputs, how many hidden layers you would like, and how many neurons in each hidden layer. Hidden layers will generally have a number of neurons between the number of inputs and number of outputs. You generally only need one hidden layer for simple tasks and two for more complex tasks. For example, if you have 10 inputs and 2 outputs, you might consider one hidden layer of 4-6 neurons and may want to try experimenting to see which gives the best results.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''class NeuralNet(...)'''&lt;br /&gt;
&lt;br /&gt;
You may either pass a table of numbers or a variable number of number arguments to the constructor in order to create a network with that topology. The first argument (or table value) will be the number of inputs, the second argument will be the number of neurons in the first hidden layer, you may then provide additional data for extra hidden layers, and the final argument will be the number of outputs.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
net = NeuralNet(10, 6, 2); -- Create a neural network with 10 inputs, one hidden layer with 6 neurons, and 2 outputs.&lt;br /&gt;
net2 = NeuralNet(32, 24, 16, 8); -- 32 inputs, 24 neurons in hidden layer #1, 16 neurons in hidden layer #2, and 8 outputs.&lt;br /&gt;
&lt;br /&gt;
local topology = {6, 3, 1}; -- Alternatively we can pass the topology as a table&lt;br /&gt;
net3 = NeuralNet(topology);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==NeuralNet:feed()==&lt;br /&gt;
'''NeuralNet:feed(...)'''&lt;br /&gt;
&lt;br /&gt;
This function is used ''feed' data into the network's inputs and perform calculations on it. You will use this both while training and for getting results once training is complete. Again, this function accepts either a variable number of arguments or table of values.&lt;br /&gt;
&lt;br /&gt;
The number of values that you pass in '''must''' be exactly the same number of inputs for the network.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
net = NeuralNet(2, 2, 1);&lt;br /&gt;
net:feed(0.0, 1.0); -- Feed two values, 0.0 and 1.0, into the networks inputs.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==NeuralNet:backPropagation()==&lt;br /&gt;
&lt;br /&gt;
Back Propagation is one method of training neural networks. In this type of training, you will feed data to a network and then &amp;quot;back propagate&amp;quot; the known, expected result. With each back propagation, the neural network will continue to rearrange its hidden parts to understand what it is expected to do and, therefor, give better results. Note that back propagating once or twice will be meaningless; you will almost certainly need to provide thousands of training samples.&lt;br /&gt;
&lt;br /&gt;
You may pass values as a table or variable number of arguments, they must be numbers, and you must provide the exact number of values as are outputs for the network.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local a = 0.25;&lt;br /&gt;
local b = 0.75;&lt;br /&gt;
local expectedResult = a * b;&lt;br /&gt;
&lt;br /&gt;
net = NeuralNet(2, 2, 1); -- Our neural network is created, but is filled with randomness and won't provide any good results.&lt;br /&gt;
net:feed(a, b); -- Pass in our two inputs and process them, but since our network isn't trained the results are garbage&lt;br /&gt;
net:backPropagation(expectedResult); -- Slightly adjust network. It's at least a tiny bit smarter now!&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==NeuralNet:getRecentAverageError()==&lt;br /&gt;
==NeuralNet:getResults()==&lt;br /&gt;
==NeuralNet:getExportTable()==&lt;br /&gt;
==NeuralNet:save()==&lt;br /&gt;
==NeuralNet:load()==&lt;br /&gt;
&lt;br /&gt;
= Examples =&lt;/div&gt;</summary>
		<author><name>Elverion</name></author>	</entry>

	<entry>
		<id>https://solarstrike.net/wiki/index.php?title=Neural_Network_Library&amp;diff=1272</id>
		<title>Neural Network Library</title>
		<link rel="alternate" type="text/html" href="https://solarstrike.net/wiki/index.php?title=Neural_Network_Library&amp;diff=1272"/>
				<updated>2018-02-17T18:40:36Z</updated>
		
		<summary type="html">&lt;p&gt;Elverion: /* NeuralNet:feed() */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= What Neural Networks Can Do =&lt;br /&gt;
&lt;br /&gt;
= How It Works =&lt;br /&gt;
&lt;br /&gt;
= Documentation =&lt;br /&gt;
==Including the library in your project==&lt;br /&gt;
&lt;br /&gt;
Before you can use the neural network library, you must tell your project to include the necessary files. To do so, you can simply use the ''require'' call, like so:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
require('neuralnet/net');&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is highly recommended to do this at the top of your main project file (probably main.lua).&lt;br /&gt;
&lt;br /&gt;
==Creating an instance of a neural network==&lt;br /&gt;
Before you can create an instance of a neural network, you will need to know what your network topology looks like. That is, how many inputs, how many outputs, how many hidden layers you would like, and how many neurons in each hidden layer. Hidden layers will generally have a number of neurons between the number of inputs and number of outputs. You generally only need one hidden layer for simple tasks and two for more complex tasks. For example, if you have 10 inputs and 2 outputs, you might consider one hidden layer of 4-6 neurons and may want to try experimenting to see which gives the best results.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''class NeuralNet(...)'''&lt;br /&gt;
&lt;br /&gt;
You may either pass a table of numbers or a variable number of number arguments to the constructor in order to create a network with that topology. The first argument (or table value) will be the number of inputs, the second argument will be the number of neurons in the first hidden layer, you may then provide additional data for extra hidden layers, and the final argument will be the number of outputs.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
net = NeuralNet(10, 6, 2); -- Create a neural network with 10 inputs, one hidden layer with 6 neurons, and 2 outputs.&lt;br /&gt;
net2 = NeuralNet(32, 24, 16, 8); -- 32 inputs, 24 neurons in hidden layer #1, 16 neurons in hidden layer #2, and 8 outputs.&lt;br /&gt;
&lt;br /&gt;
local topology = {6, 3, 1}; -- Alternatively we can pass the topology as a table&lt;br /&gt;
net3 = NeuralNet(topology);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==NeuralNet:feed()==&lt;br /&gt;
'''NeuralNet:feed(...)'''&lt;br /&gt;
&lt;br /&gt;
This function is used ''feed' data into the network's inputs and perform calculations on it. You will use this both while training and for getting results once training is complete. Again, this function accepts either a variable number of arguments or table of values.&lt;br /&gt;
&lt;br /&gt;
The number of values that you pass in '''must''' be exactly the same number of inputs for the network.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
net = NeuralNet(2, 2, 1);&lt;br /&gt;
net:feed(0.0, 1.0); -- Feed two values, 0.0 and 1.0, into the networks inputs.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==NeuralNet:backPropagation()==&lt;br /&gt;
==NeuralNet:getRecentAverageError()==&lt;br /&gt;
==NeuralNet:getResults()==&lt;br /&gt;
==NeuralNet:getExportTable()==&lt;br /&gt;
==NeuralNet:save()==&lt;br /&gt;
==NeuralNet:load()==&lt;br /&gt;
&lt;br /&gt;
= Examples =&lt;/div&gt;</summary>
		<author><name>Elverion</name></author>	</entry>

	<entry>
		<id>https://solarstrike.net/wiki/index.php?title=Neural_Network_Library&amp;diff=1271</id>
		<title>Neural Network Library</title>
		<link rel="alternate" type="text/html" href="https://solarstrike.net/wiki/index.php?title=Neural_Network_Library&amp;diff=1271"/>
				<updated>2018-02-17T18:31:03Z</updated>
		
		<summary type="html">&lt;p&gt;Elverion: /* Creating an instance of a neural network */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= What Neural Networks Can Do =&lt;br /&gt;
&lt;br /&gt;
= How It Works =&lt;br /&gt;
&lt;br /&gt;
= Documentation =&lt;br /&gt;
==Including the library in your project==&lt;br /&gt;
&lt;br /&gt;
Before you can use the neural network library, you must tell your project to include the necessary files. To do so, you can simply use the ''require'' call, like so:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
require('neuralnet/net');&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is highly recommended to do this at the top of your main project file (probably main.lua).&lt;br /&gt;
&lt;br /&gt;
==Creating an instance of a neural network==&lt;br /&gt;
Before you can create an instance of a neural network, you will need to know what your network topology looks like. That is, how many inputs, how many outputs, how many hidden layers you would like, and how many neurons in each hidden layer. Hidden layers will generally have a number of neurons between the number of inputs and number of outputs. You generally only need one hidden layer for simple tasks and two for more complex tasks. For example, if you have 10 inputs and 2 outputs, you might consider one hidden layer of 4-6 neurons and may want to try experimenting to see which gives the best results.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''class NeuralNet(...)'''&lt;br /&gt;
&lt;br /&gt;
You may either pass a table of numbers or a variable number of number arguments to the constructor in order to create a network with that topology. The first argument (or table value) will be the number of inputs, the second argument will be the number of neurons in the first hidden layer, you may then provide additional data for extra hidden layers, and the final argument will be the number of outputs.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
net = NeuralNet(10, 6, 2); -- Create a neural network with 10 inputs, one hidden layer with 6 neurons, and 2 outputs.&lt;br /&gt;
net2 = NeuralNet(32, 24, 16, 8); -- 32 inputs, 24 neurons in hidden layer #1, 16 neurons in hidden layer #2, and 8 outputs.&lt;br /&gt;
&lt;br /&gt;
local topology = {6, 3, 1}; -- Alternatively we can pass the topology as a table&lt;br /&gt;
net3 = NeuralNet(topology);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==NeuralNet:feed()==&lt;br /&gt;
==NeuralNet:backPropagation()==&lt;br /&gt;
==NeuralNet:getRecentAverageError()==&lt;br /&gt;
==NeuralNet:getResults()==&lt;br /&gt;
==NeuralNet:getExportTable()==&lt;br /&gt;
==NeuralNet:save()==&lt;br /&gt;
==NeuralNet:load()==&lt;br /&gt;
&lt;br /&gt;
= Examples =&lt;/div&gt;</summary>
		<author><name>Elverion</name></author>	</entry>

	<entry>
		<id>https://solarstrike.net/wiki/index.php?title=Neural_Network_Library&amp;diff=1270</id>
		<title>Neural Network Library</title>
		<link rel="alternate" type="text/html" href="https://solarstrike.net/wiki/index.php?title=Neural_Network_Library&amp;diff=1270"/>
				<updated>2018-02-17T18:29:21Z</updated>
		
		<summary type="html">&lt;p&gt;Elverion: /* Creating an instance of a neural network */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= What Neural Networks Can Do =&lt;br /&gt;
&lt;br /&gt;
= How It Works =&lt;br /&gt;
&lt;br /&gt;
= Documentation =&lt;br /&gt;
==Including the library in your project==&lt;br /&gt;
&lt;br /&gt;
Before you can use the neural network library, you must tell your project to include the necessary files. To do so, you can simply use the ''require'' call, like so:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
require('neuralnet/net');&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is highly recommended to do this at the top of your main project file (probably main.lua).&lt;br /&gt;
&lt;br /&gt;
==Creating an instance of a neural network==&lt;br /&gt;
Before you can create an instance of a neural network, you will need to know what your network topology looks like. That is, how many inputs, how many outputs, how many hidden layers you would like, and how many neurons in each hidden layer. Hidden layers will generally have a number of neurons between the number of inputs and number of outputs. You generally only need one hidden layer for simple tasks and two for more complex tasks. For example, if you have 10 inputs and 2 outputs, you might consider one hidden layer of 4-6 neurons and may want to try experimenting to see which gives the best results.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''class NeuralNet(...)'''&lt;br /&gt;
&lt;br /&gt;
You may either pass a table of numbers or a variable number of number arguments to the constructor in order to create a network with that topology. The first argument (or table value) will be the number of inputs, the second argument will be the number of neurons in the first hidden layer, you may then provide additional data for extra hidden layers, and the final argument will be the number of outputs.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
net = NeuralNet(10, 6, 2); -- Create a neural network with 10 inputs, one hidden layer with 6 neurons, and 2 outputs.&lt;br /&gt;
net2 = NeuralNet(32, 24, 16, 8); -- 32 inputs, 24 neurons in hidden layer #1, 16 neurons in hidden layer #2, and 8 outputs.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==NeuralNet:feed()==&lt;br /&gt;
==NeuralNet:backPropagation()==&lt;br /&gt;
==NeuralNet:getRecentAverageError()==&lt;br /&gt;
==NeuralNet:getResults()==&lt;br /&gt;
==NeuralNet:getExportTable()==&lt;br /&gt;
==NeuralNet:save()==&lt;br /&gt;
==NeuralNet:load()==&lt;br /&gt;
&lt;br /&gt;
= Examples =&lt;/div&gt;</summary>
		<author><name>Elverion</name></author>	</entry>

	<entry>
		<id>https://solarstrike.net/wiki/index.php?title=Neural_Network_Library&amp;diff=1269</id>
		<title>Neural Network Library</title>
		<link rel="alternate" type="text/html" href="https://solarstrike.net/wiki/index.php?title=Neural_Network_Library&amp;diff=1269"/>
				<updated>2018-02-17T18:13:18Z</updated>
		
		<summary type="html">&lt;p&gt;Elverion: /* Including the library in your project */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= What Neural Networks Can Do =&lt;br /&gt;
&lt;br /&gt;
= How It Works =&lt;br /&gt;
&lt;br /&gt;
= Documentation =&lt;br /&gt;
==Including the library in your project==&lt;br /&gt;
&lt;br /&gt;
Before you can use the neural network library, you must tell your project to include the necessary files. To do so, you can simply use the ''require'' call, like so:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
require('neuralnet/net');&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is highly recommended to do this at the top of your main project file (probably main.lua).&lt;br /&gt;
&lt;br /&gt;
==Creating an instance of a neural network==&lt;br /&gt;
==NeuralNet:feed()==&lt;br /&gt;
==NeuralNet:backPropagation()==&lt;br /&gt;
==NeuralNet:getRecentAverageError()==&lt;br /&gt;
==NeuralNet:getResults()==&lt;br /&gt;
==NeuralNet:getExportTable()==&lt;br /&gt;
==NeuralNet:save()==&lt;br /&gt;
==NeuralNet:load()==&lt;br /&gt;
&lt;br /&gt;
= Examples =&lt;/div&gt;</summary>
		<author><name>Elverion</name></author>	</entry>

	<entry>
		<id>https://solarstrike.net/wiki/index.php?title=Neural_Network_Library&amp;diff=1268</id>
		<title>Neural Network Library</title>
		<link rel="alternate" type="text/html" href="https://solarstrike.net/wiki/index.php?title=Neural_Network_Library&amp;diff=1268"/>
				<updated>2018-02-17T18:13:09Z</updated>
		
		<summary type="html">&lt;p&gt;Elverion: /* Including the library in your project */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= What Neural Networks Can Do =&lt;br /&gt;
&lt;br /&gt;
= How It Works =&lt;br /&gt;
&lt;br /&gt;
= Documentation =&lt;br /&gt;
==Including the library in your project==&lt;br /&gt;
&lt;br /&gt;
Before you can use the neural network library, you must tell your project to include the necessary files. To do so, you can simply use the ''require'' call, like so:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
require('neuralnet/net);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is highly recommended to do this at the top of your main project file (probably main.lua).&lt;br /&gt;
&lt;br /&gt;
==Creating an instance of a neural network==&lt;br /&gt;
==NeuralNet:feed()==&lt;br /&gt;
==NeuralNet:backPropagation()==&lt;br /&gt;
==NeuralNet:getRecentAverageError()==&lt;br /&gt;
==NeuralNet:getResults()==&lt;br /&gt;
==NeuralNet:getExportTable()==&lt;br /&gt;
==NeuralNet:save()==&lt;br /&gt;
==NeuralNet:load()==&lt;br /&gt;
&lt;br /&gt;
= Examples =&lt;/div&gt;</summary>
		<author><name>Elverion</name></author>	</entry>

	<entry>
		<id>https://solarstrike.net/wiki/index.php?title=Neural_Network_Library&amp;diff=1267</id>
		<title>Neural Network Library</title>
		<link rel="alternate" type="text/html" href="https://solarstrike.net/wiki/index.php?title=Neural_Network_Library&amp;diff=1267"/>
				<updated>2018-02-17T18:10:11Z</updated>
		
		<summary type="html">&lt;p&gt;Elverion: Created page with &amp;quot;= What Neural Networks Can Do =  = How It Works =  = Documentation = ==Including the library in your project== ==Creating an instance of a neural network== ==NeuralNet:feed()=...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= What Neural Networks Can Do =&lt;br /&gt;
&lt;br /&gt;
= How It Works =&lt;br /&gt;
&lt;br /&gt;
= Documentation =&lt;br /&gt;
==Including the library in your project==&lt;br /&gt;
==Creating an instance of a neural network==&lt;br /&gt;
==NeuralNet:feed()==&lt;br /&gt;
==NeuralNet:backPropagation()==&lt;br /&gt;
==NeuralNet:getRecentAverageError()==&lt;br /&gt;
==NeuralNet:getResults()==&lt;br /&gt;
==NeuralNet:getExportTable()==&lt;br /&gt;
==NeuralNet:save()==&lt;br /&gt;
==NeuralNet:load()==&lt;br /&gt;
&lt;br /&gt;
= Examples =&lt;/div&gt;</summary>
		<author><name>Elverion</name></author>	</entry>

	<entry>
		<id>https://solarstrike.net/wiki/index.php?title=Manual&amp;diff=1266</id>
		<title>Manual</title>
		<link rel="alternate" type="text/html" href="https://solarstrike.net/wiki/index.php?title=Manual&amp;diff=1266"/>
				<updated>2018-02-17T18:02:53Z</updated>
		
		<summary type="html">&lt;p&gt;Elverion: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''MicroMacro 2.x Online Manual'''&lt;br /&gt;
&lt;br /&gt;
''The MicroMacro 2 branch is currently under development and is subject to change.''&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;padding: 8px;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;width: 150px;&amp;quot; | [[Basic Info]]&lt;br /&gt;
| How things work, configuration options, and other fun stuff.&lt;br /&gt;
|-&lt;br /&gt;
| [[Tutorials &amp;amp; Examples]]&lt;br /&gt;
| Everything you'll want to know to get started writing your own script.&lt;br /&gt;
|-&lt;br /&gt;
| [[Events]]&lt;br /&gt;
| The different events that can be triggered.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| [[Audio Module]]&lt;br /&gt;
| Load and play sounds with OpenAL.&lt;br /&gt;
|-&lt;br /&gt;
| [[Class Module]]&lt;br /&gt;
| Create classes with support for object inheritance.&lt;br /&gt;
|-&lt;br /&gt;
| [[Cli Module]]&lt;br /&gt;
| For interfacing with the console.&lt;br /&gt;
|-&lt;br /&gt;
| [[Filesystem Module]]&lt;br /&gt;
| Functions for dealing with files and directories.&lt;br /&gt;
|-&lt;br /&gt;
| [[Gamepad Module]]&lt;br /&gt;
| Read input from gamepads and joysticks.&lt;br /&gt;
|-&lt;br /&gt;
| [[Global Addon]]&lt;br /&gt;
| Misc functions in global scope.&lt;br /&gt;
|-&lt;br /&gt;
| [[ Hash Module]]&lt;br /&gt;
| Functions for 1-way hashing strings and files.&lt;br /&gt;
|-&lt;br /&gt;
| [[Key Module]]&lt;br /&gt;
| A table containing virtual key codes for use with keyboard and mouse related functions.&lt;br /&gt;
|-&lt;br /&gt;
| [[Keyboard Module]]&lt;br /&gt;
| Read keyboard input or send synthetic key presses.&lt;br /&gt;
|-&lt;br /&gt;
| [[Log Module]]&lt;br /&gt;
| Functions for interfacing with the global log file.&lt;br /&gt;
|-&lt;br /&gt;
| [[Macro Module]]&lt;br /&gt;
| The base module; controls the execution of your scripts.&lt;br /&gt;
|-&lt;br /&gt;
| [[Math Addon]]&lt;br /&gt;
| Additional math functions.&lt;br /&gt;
|-&lt;br /&gt;
| [[Mouse Module]]&lt;br /&gt;
| Read mouse input or send synthetic button presses &amp;amp; movement.&lt;br /&gt;
|-&lt;br /&gt;
| [[Ncurses Module]]&lt;br /&gt;
| Create Ncurses windows and display text in an advanced way.&lt;br /&gt;
|-&lt;br /&gt;
| [[Network Module]]&lt;br /&gt;
| Communicate with overs over standard network sockets&lt;br /&gt;
|-&lt;br /&gt;
| [[Process Module]]&lt;br /&gt;
| Interface with other processes &amp;amp; their allocated memory.&lt;br /&gt;
|-&lt;br /&gt;
| [[SQL Module]]&lt;br /&gt;
| Query SQL relational databases.&lt;br /&gt;
|-&lt;br /&gt;
| [[String Addon]]&lt;br /&gt;
| Additional functions for working with text strings.&lt;br /&gt;
|-&lt;br /&gt;
| [[System Module]]&lt;br /&gt;
| Interfacing with the operating system.&lt;br /&gt;
|-&lt;br /&gt;
| [[Table Addon]]&lt;br /&gt;
| Additional functions for working with tables.&lt;br /&gt;
|-&lt;br /&gt;
| [[Time Module]]&lt;br /&gt;
| Anything dealing with timing &amp;amp; time values.&lt;br /&gt;
|-&lt;br /&gt;
| [[Window Module]]&lt;br /&gt;
| Interface with other windows.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| [[Cache Library]]&lt;br /&gt;
| For caching simple key/value pairs&lt;br /&gt;
|-&lt;br /&gt;
| [[HTTPD Library]]&lt;br /&gt;
| Run a mini-webserver and use your web browser to interface with your scripts&lt;br /&gt;
|-&lt;br /&gt;
| [[Neural Network Library]]&lt;br /&gt;
| Simple, open-ended machine learning&lt;br /&gt;
|-&lt;br /&gt;
| [[Timestamp Class]]&lt;br /&gt;
| A library to aid in dealing with time values&lt;br /&gt;
|-&lt;br /&gt;
| [[Timezone Class]]&lt;br /&gt;
| A library used to lookup timezone offsets&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''MicroMacro 1.x Online Manual'''&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;padding: 8px;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;width: 150px;&amp;quot; | [[Mouse Control]]&lt;br /&gt;
| Functions to control mouse movement and clicks&lt;br /&gt;
|-&lt;br /&gt;
| [[Keyboard Control]]&lt;br /&gt;
| Functions to control keyboard key presses and releases&lt;br /&gt;
|-&lt;br /&gt;
| [[Process Functions]]&lt;br /&gt;
| Functions to open, close, and find processes&lt;br /&gt;
|-&lt;br /&gt;
| [[Memory Functions]]&lt;br /&gt;
| Functions for reading and writing of memory&lt;br /&gt;
|-&lt;br /&gt;
| [[Network Functions]]&lt;br /&gt;
| Functions for sending and receiving data over TCP/IP&lt;br /&gt;
|-&lt;br /&gt;
| [[Filesystem Functions]]&lt;br /&gt;
| Functions for working with files and directories&lt;br /&gt;
|-&lt;br /&gt;
| [[Timer Functions]]&lt;br /&gt;
| Timer-related functions&lt;br /&gt;
|-&lt;br /&gt;
| [[Misc Functions|Misc. Functions]]&lt;br /&gt;
| Misc. functions&lt;br /&gt;
|-&lt;br /&gt;
| [[Sound Functions]]&lt;br /&gt;
| Functions for loading and playing sounds&lt;br /&gt;
|-&lt;br /&gt;
| [[Library]]&lt;br /&gt;
| Various library information &lt;br /&gt;
|-&lt;br /&gt;
| [[Modules]]&lt;br /&gt;
| Information about the standard modules, and how to create your own.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| [[Virtual Keys]]&lt;br /&gt;
| For use with keyboard related functions&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Additional Information==&lt;br /&gt;
*[[MicroMacro License]]&lt;br /&gt;
*[[Lua License]]&lt;/div&gt;</summary>
		<author><name>Elverion</name></author>	</entry>

	<entry>
		<id>https://solarstrike.net/wiki/index.php?title=Window_Module&amp;diff=1265</id>
		<title>Window Module</title>
		<link rel="alternate" type="text/html" href="https://solarstrike.net/wiki/index.php?title=Window_Module&amp;diff=1265"/>
				<updated>2017-12-08T06:01:18Z</updated>
		
		<summary type="html">&lt;p&gt;Elverion: /* getFocusHwnd */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== find ==&lt;br /&gt;
'''number window.find(string windowName[, string className])'''&lt;br /&gt;
&lt;br /&gt;
Finds a window's HWND based on its title (not case-sensitive), and (optionally) its classname (case-sensitive). 'title' and 'classname' can contain wildcards * and ?.&lt;br /&gt;
&lt;br /&gt;
Returns the first match found. If no match was found, returns nil.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== findList ==&lt;br /&gt;
'''table window.findList(string windowName[, string className])'''&lt;br /&gt;
&lt;br /&gt;
Finds a list of windows based on title (not case-sensitive), and (optionally) classname (case-sensitive). 'title' and 'classname' can contain wildcards * and ?.&lt;br /&gt;
&lt;br /&gt;
Returns a table of tables containing: 'hwnd' (number; handle to window), 'name' (string; window title), and 'class' (string; identifier used by its programmer). If no match was found, returns nil.&lt;br /&gt;
&lt;br /&gt;
For example, the return value might look like this:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
	{hwnd = 1234, name = &amp;quot;Window Name 1&amp;quot;, class = &amp;quot;Window Class 1&amp;quot;},&lt;br /&gt;
	{hwnd = 5678, name = &amp;quot;Window Name 2&amp;quot;, class = &amp;quot;Window Class 2&amp;quot;},&lt;br /&gt;
	{hwnd = 9012, name = &amp;quot;Window Name 3&amp;quot;, class = &amp;quot;Window Class 3&amp;quot;},&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== getParent ==&lt;br /&gt;
'''number window.getParent(number hwnd)'''&lt;br /&gt;
&lt;br /&gt;
Returns a window's parent, or nil on error.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== getTitle ==&lt;br /&gt;
'''string window.getTitle(number hwnd)'''&lt;br /&gt;
&lt;br /&gt;
Returns a window's title as a string.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== setTitle ==&lt;br /&gt;
'''window.setTitle(number hwnd, string title)'''&lt;br /&gt;
&lt;br /&gt;
Change a window's title.&lt;br /&gt;
&lt;br /&gt;
== getClassName ==&lt;br /&gt;
'''string window.getClassName(number hwnd)'''&lt;br /&gt;
&lt;br /&gt;
Returns a window's class name as a string.&lt;br /&gt;
&lt;br /&gt;
== valid ==&lt;br /&gt;
'''boolean window.valid(number hwnd)'''&lt;br /&gt;
&lt;br /&gt;
Returns true if 'hwnd' is a valid window handle, or false otherwise.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== getRect ==&lt;br /&gt;
'''number x, number y, number w, number h window.getRect(number hwnd)'''&lt;br /&gt;
&lt;br /&gt;
Returns the position (x,y) and size (w,h) of a window.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== setRect ==&lt;br /&gt;
'''window.setRect(number hwnd, number x, number y, number w, number h)'''&lt;br /&gt;
&lt;br /&gt;
Change the position and size of a window with handle 'hwnd'.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== getClientRect ==&lt;br /&gt;
'''number x, number y, number w, number h window.getClientRect(number hwnd)'''&lt;br /&gt;
&lt;br /&gt;
Returns the position and size of a window's client area.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== setClientRect ==&lt;br /&gt;
'''window.setClientRect(number hwnd, number x, number y, number w, number h)'''&lt;br /&gt;
&lt;br /&gt;
Change the position and size of a window's client area with handle 'hwnd'.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== show ==&lt;br /&gt;
'''window.show(number hwnd, number cmd)'''&lt;br /&gt;
&lt;br /&gt;
Show/hide/minimize/maximize/whatever with the window.&lt;br /&gt;
&lt;br /&gt;
For 'cmd', you should specify one of the following constants:&lt;br /&gt;
&lt;br /&gt;
SW_FORCEMINIMIZE&lt;br /&gt;
&lt;br /&gt;
SW_HIDE&lt;br /&gt;
&lt;br /&gt;
SW_MAXIMIZE&lt;br /&gt;
&lt;br /&gt;
SW_MINIMIZE&lt;br /&gt;
&lt;br /&gt;
SW_RESTORE&lt;br /&gt;
&lt;br /&gt;
SW_SHOW&lt;br /&gt;
&lt;br /&gt;
SW_SHOWDEFAULT&lt;br /&gt;
&lt;br /&gt;
SW_SHOWMAXIMIZED&lt;br /&gt;
&lt;br /&gt;
SW_SHOWMINIMIZED&lt;br /&gt;
&lt;br /&gt;
SW_SHOWMINNOACTIVATE&lt;br /&gt;
&lt;br /&gt;
SW_SHOWNA&lt;br /&gt;
&lt;br /&gt;
SW_SHOWNOACTIVATE&lt;br /&gt;
&lt;br /&gt;
SW_SHOWNORMAL&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== flash ==&lt;br /&gt;
'''window.flash(number hwnd, number flashCount)'''&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Flash&amp;quot; the window to attempt to grab the user's attention.&lt;br /&gt;
If 'flashCount' is &amp;lt; 0, stop flashing&lt;br /&gt;
If 'flashCount' is 0, flash until user focuses the window&lt;br /&gt;
If 'flashCount' is &amp;gt; 0, flash this many times&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== getPixel ==&lt;br /&gt;
'''number r, number g, number b window.getPixel(number hwnd, number x, number y)'''&lt;br /&gt;
&lt;br /&gt;
Get the color of a pixel at (x,y) inside window 'hwnd', and return the color split into red, green, and blue channels.&lt;br /&gt;
r, g, and b results will be between 0 and 255.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== pixelSearch ==&lt;br /&gt;
'''number x, number y window.pixelSearch(number hwnd, number r, number g, number b, number x1, number y1, number x2, number y2[, number accuracy[, number step]])'''&lt;br /&gt;
&lt;br /&gt;
Search the given window for a pixel that matches r,g,b within the rectangle outlined by (x1,y1) -&amp;gt; (x2,y2)&lt;br /&gt;
The rect may go from left-to-right, right-to-left, top-to-bottom, bottom-to-top, or any combination of those, depending on the orientation of the two points.&lt;br /&gt;
&lt;br /&gt;
'accuracy' is how many units each channel must be within the given color to generate a match. ie. with an accuracy of 20, the red, green, and blue channels must be within 20 of the target color to match. Default: 1&lt;br /&gt;
&lt;br /&gt;
'step' is the step size (distance between pixels to search). You generally have no need for this so long as you aren't scanning a large area, but you may experience faster scan times (with a chance of missing a match) with a higher step size. Default: 1&lt;br /&gt;
&lt;br /&gt;
If the pixel is not found, this function returns nil.&lt;br /&gt;
&lt;br /&gt;
== saveScreenshot ==&lt;br /&gt;
'''window.saveScreenshot(number hwnd, string filename)'''&lt;br /&gt;
&lt;br /&gt;
Save a screenshot of window 'hwnd' to 'filename'. If 'hwnd' is 0, this screenshots the whole desktop.&lt;br /&gt;
NOTE: You ''cannot'' take a screenshot of a minimized window. This is a limitation in Windows.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== getAppHwnd ==&lt;br /&gt;
'''number window.getAppHwnd()'''&lt;br /&gt;
&lt;br /&gt;
Returns the calling process' (MicroMacro) handle to window (HWND). This is what you may use to access or modify the console's properties where an hwnd is required.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== getFocusHwnd ==&lt;br /&gt;
'''number window.getFocusHwnd()'''&lt;br /&gt;
&lt;br /&gt;
Returns the hwnd of whichever window is top-most as of the the start of this logic cycle. This is polled once per frame and should be fairly accurate so long as your script executes each logic cycle quickly. Be aware that as windows are being minimized, maximized, or otherwise, the focused hwnd may temporarily switch to NULL (0).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== makeColor ==&lt;br /&gt;
'''number window.makeColor(number red, number green, number blue)'''&lt;br /&gt;
&lt;br /&gt;
This helper function converts red-green-blue components into a long integer color value for use in other functions. All input values (red, green, and blue) should be integers between 0 and 255. (0, 0, 0) would result in black, (255, 255, 255) would result in white and (0, 255, 0) would result in green.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== drawLine ==&lt;br /&gt;
'''boolean window.drawLine(number hwnd, number x1, number y1, number x2, number y2[, number color[, number thickness]])'''&lt;br /&gt;
&lt;br /&gt;
Draws a line in the client region of the window specied by hwnd (note: use 0 to draw directly to screen). It is possible to draw outside of the given window with this function. A line will be drawn starting from (x1,y1) to (x2,y2) with the given color and line thickness. By default, color will be black (0, 0, 0) and thickness (in pixels) will be 1.&lt;br /&gt;
&lt;br /&gt;
You should use [[Window_Module#makeColor|window.makeColor]]() to generate the number passed as the color value if you wish to specify a color by RGB. Alternatively, you can pass the value in by hex notation (ie, 0xFF00FF).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Draw a red line from (0,0) to (200, 200) that is 5 pixels thick on the window.&lt;br /&gt;
window.drawLine(hwnd, 0, 0, 200, 200, window.makeColor(255, 0, 0), 5);&lt;br /&gt;
&lt;br /&gt;
-- Draw a green line from (200, 200) to (400, 400) that is 1 pixels thick&lt;br /&gt;
window.drawLine(hwnd, 200, 200, 400, 400, 0x00FF00);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== drawRect ==&lt;br /&gt;
'''boolean window.drawRect(number hwnd, number x1, number y1, number x2, number y2[, number color[, number thickness]])'''&lt;br /&gt;
&lt;br /&gt;
This functions exactly like [[Window_Module#drawLine|window.drawLine]](), except that it draws a rectangle rather than a line.&lt;br /&gt;
&lt;br /&gt;
Draws a line in the client region of the window specied by hwnd (note: use 0 to draw directly to screen). It is possible to draw outside of the given window with this function. A rectangle will be drawn starting from (x1,y1) to (x2,y2) with the given color and line thickness. By default, color will be black (0, 0, 0) and border thickness (in pixels) will be 1.&lt;br /&gt;
&lt;br /&gt;
You should use [[Window_Module#makeColor|window.makeColor]]() to generate the number passed as the color value if you wish to specify a color by RGB. Alternatively, you can pass the value in by hex notation (ie, 0xFF00FF).&lt;/div&gt;</summary>
		<author><name>Elverion</name></author>	</entry>

	<entry>
		<id>https://solarstrike.net/wiki/index.php?title=Window_Module&amp;diff=1264</id>
		<title>Window Module</title>
		<link rel="alternate" type="text/html" href="https://solarstrike.net/wiki/index.php?title=Window_Module&amp;diff=1264"/>
				<updated>2017-12-07T19:54:24Z</updated>
		
		<summary type="html">&lt;p&gt;Elverion: /* pixelSearch */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== find ==&lt;br /&gt;
'''number window.find(string windowName[, string className])'''&lt;br /&gt;
&lt;br /&gt;
Finds a window's HWND based on its title (not case-sensitive), and (optionally) its classname (case-sensitive). 'title' and 'classname' can contain wildcards * and ?.&lt;br /&gt;
&lt;br /&gt;
Returns the first match found. If no match was found, returns nil.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== findList ==&lt;br /&gt;
'''table window.findList(string windowName[, string className])'''&lt;br /&gt;
&lt;br /&gt;
Finds a list of windows based on title (not case-sensitive), and (optionally) classname (case-sensitive). 'title' and 'classname' can contain wildcards * and ?.&lt;br /&gt;
&lt;br /&gt;
Returns a table of tables containing: 'hwnd' (number; handle to window), 'name' (string; window title), and 'class' (string; identifier used by its programmer). If no match was found, returns nil.&lt;br /&gt;
&lt;br /&gt;
For example, the return value might look like this:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
	{hwnd = 1234, name = &amp;quot;Window Name 1&amp;quot;, class = &amp;quot;Window Class 1&amp;quot;},&lt;br /&gt;
	{hwnd = 5678, name = &amp;quot;Window Name 2&amp;quot;, class = &amp;quot;Window Class 2&amp;quot;},&lt;br /&gt;
	{hwnd = 9012, name = &amp;quot;Window Name 3&amp;quot;, class = &amp;quot;Window Class 3&amp;quot;},&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== getParent ==&lt;br /&gt;
'''number window.getParent(number hwnd)'''&lt;br /&gt;
&lt;br /&gt;
Returns a window's parent, or nil on error.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== getTitle ==&lt;br /&gt;
'''string window.getTitle(number hwnd)'''&lt;br /&gt;
&lt;br /&gt;
Returns a window's title as a string.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== setTitle ==&lt;br /&gt;
'''window.setTitle(number hwnd, string title)'''&lt;br /&gt;
&lt;br /&gt;
Change a window's title.&lt;br /&gt;
&lt;br /&gt;
== getClassName ==&lt;br /&gt;
'''string window.getClassName(number hwnd)'''&lt;br /&gt;
&lt;br /&gt;
Returns a window's class name as a string.&lt;br /&gt;
&lt;br /&gt;
== valid ==&lt;br /&gt;
'''boolean window.valid(number hwnd)'''&lt;br /&gt;
&lt;br /&gt;
Returns true if 'hwnd' is a valid window handle, or false otherwise.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== getRect ==&lt;br /&gt;
'''number x, number y, number w, number h window.getRect(number hwnd)'''&lt;br /&gt;
&lt;br /&gt;
Returns the position (x,y) and size (w,h) of a window.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== setRect ==&lt;br /&gt;
'''window.setRect(number hwnd, number x, number y, number w, number h)'''&lt;br /&gt;
&lt;br /&gt;
Change the position and size of a window with handle 'hwnd'.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== getClientRect ==&lt;br /&gt;
'''number x, number y, number w, number h window.getClientRect(number hwnd)'''&lt;br /&gt;
&lt;br /&gt;
Returns the position and size of a window's client area.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== setClientRect ==&lt;br /&gt;
'''window.setClientRect(number hwnd, number x, number y, number w, number h)'''&lt;br /&gt;
&lt;br /&gt;
Change the position and size of a window's client area with handle 'hwnd'.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== show ==&lt;br /&gt;
'''window.show(number hwnd, number cmd)'''&lt;br /&gt;
&lt;br /&gt;
Show/hide/minimize/maximize/whatever with the window.&lt;br /&gt;
&lt;br /&gt;
For 'cmd', you should specify one of the following constants:&lt;br /&gt;
&lt;br /&gt;
SW_FORCEMINIMIZE&lt;br /&gt;
&lt;br /&gt;
SW_HIDE&lt;br /&gt;
&lt;br /&gt;
SW_MAXIMIZE&lt;br /&gt;
&lt;br /&gt;
SW_MINIMIZE&lt;br /&gt;
&lt;br /&gt;
SW_RESTORE&lt;br /&gt;
&lt;br /&gt;
SW_SHOW&lt;br /&gt;
&lt;br /&gt;
SW_SHOWDEFAULT&lt;br /&gt;
&lt;br /&gt;
SW_SHOWMAXIMIZED&lt;br /&gt;
&lt;br /&gt;
SW_SHOWMINIMIZED&lt;br /&gt;
&lt;br /&gt;
SW_SHOWMINNOACTIVATE&lt;br /&gt;
&lt;br /&gt;
SW_SHOWNA&lt;br /&gt;
&lt;br /&gt;
SW_SHOWNOACTIVATE&lt;br /&gt;
&lt;br /&gt;
SW_SHOWNORMAL&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== flash ==&lt;br /&gt;
'''window.flash(number hwnd, number flashCount)'''&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Flash&amp;quot; the window to attempt to grab the user's attention.&lt;br /&gt;
If 'flashCount' is &amp;lt; 0, stop flashing&lt;br /&gt;
If 'flashCount' is 0, flash until user focuses the window&lt;br /&gt;
If 'flashCount' is &amp;gt; 0, flash this many times&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== getPixel ==&lt;br /&gt;
'''number r, number g, number b window.getPixel(number hwnd, number x, number y)'''&lt;br /&gt;
&lt;br /&gt;
Get the color of a pixel at (x,y) inside window 'hwnd', and return the color split into red, green, and blue channels.&lt;br /&gt;
r, g, and b results will be between 0 and 255.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== pixelSearch ==&lt;br /&gt;
'''number x, number y window.pixelSearch(number hwnd, number r, number g, number b, number x1, number y1, number x2, number y2[, number accuracy[, number step]])'''&lt;br /&gt;
&lt;br /&gt;
Search the given window for a pixel that matches r,g,b within the rectangle outlined by (x1,y1) -&amp;gt; (x2,y2)&lt;br /&gt;
The rect may go from left-to-right, right-to-left, top-to-bottom, bottom-to-top, or any combination of those, depending on the orientation of the two points.&lt;br /&gt;
&lt;br /&gt;
'accuracy' is how many units each channel must be within the given color to generate a match. ie. with an accuracy of 20, the red, green, and blue channels must be within 20 of the target color to match. Default: 1&lt;br /&gt;
&lt;br /&gt;
'step' is the step size (distance between pixels to search). You generally have no need for this so long as you aren't scanning a large area, but you may experience faster scan times (with a chance of missing a match) with a higher step size. Default: 1&lt;br /&gt;
&lt;br /&gt;
If the pixel is not found, this function returns nil.&lt;br /&gt;
&lt;br /&gt;
== saveScreenshot ==&lt;br /&gt;
'''window.saveScreenshot(number hwnd, string filename)'''&lt;br /&gt;
&lt;br /&gt;
Save a screenshot of window 'hwnd' to 'filename'. If 'hwnd' is 0, this screenshots the whole desktop.&lt;br /&gt;
NOTE: You ''cannot'' take a screenshot of a minimized window. This is a limitation in Windows.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== getAppHwnd ==&lt;br /&gt;
'''number window.getAppHwnd()'''&lt;br /&gt;
&lt;br /&gt;
Returns the calling process' (MicroMacro) handle to window (HWND). This is what you may use to access or modify the console's properties where an hwnd is required.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== getFocusHwnd ==&lt;br /&gt;
'''number window.getFocusHwnd()'''&lt;br /&gt;
&lt;br /&gt;
Returns the hwnd of whichever window is top-most as of the the start of this logic cycle. This is polled once per frame and should be fairly accurate so long as your script executes each logic cycle quickly. Be aware that as windows are being minimized, maximized, or otherwise, the focused hwnd may temporarily switch to NULL (0).&lt;/div&gt;</summary>
		<author><name>Elverion</name></author>	</entry>

	<entry>
		<id>https://solarstrike.net/wiki/index.php?title=Events&amp;diff=1263</id>
		<title>Events</title>
		<link rel="alternate" type="text/html" href="https://solarstrike.net/wiki/index.php?title=Events&amp;diff=1263"/>
				<updated>2017-11-02T22:24:48Z</updated>
		
		<summary type="html">&lt;p&gt;Elverion: /* socketreceived */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;All events in MicroMacro will be passed to the [[Macro_Module#event|macro.event]]() function specified by the script.&lt;br /&gt;
The first argument given will be a string that identifies the type of event that was triggered. Any additional arguments depends on the type of event being handled.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function macro.event(e, data1, data2)&lt;br /&gt;
	if( e == &amp;quot;keypressed&amp;quot; ) then&lt;br /&gt;
		if( data1 == key.VK_SPACE ) then&lt;br /&gt;
			print(&amp;quot;Space bar was pressed.&amp;quot;);&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==focuschanged==&lt;br /&gt;
'''number hwnd'''&lt;br /&gt;
&lt;br /&gt;
Triggered whenever the active, focused window is changed (such as bringing a new window to the foreground).&lt;br /&gt;
Pushes one additional number: the handle to the window that is being changed to top.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==keypressed==&lt;br /&gt;
'''number vk, boolean toggle'''&lt;br /&gt;
&lt;br /&gt;
Triggered whenever a key is pressed (not held down).&lt;br /&gt;
Pushes two additional values: the virtual key being pushed and its toggle state. &lt;br /&gt;
&lt;br /&gt;
The toggle state refers to the state that the key is changing to. Ie. the capslock key will become activated when this returns true.&lt;br /&gt;
&lt;br /&gt;
See [[Keyboard_Module#getToggleState|getToggleState]]() and [[Keyboard_Module#pressed|pressed]]() for more information.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==keyreleased==&lt;br /&gt;
'''number vk, boolean toggle'''&lt;br /&gt;
&lt;br /&gt;
Triggered whenever a key is released.&lt;br /&gt;
Pushes two additional values: the virtual key being released and its toggle state.&lt;br /&gt;
&lt;br /&gt;
The toggle state refers to the state that the key has just changed to. Ie. the capslock key is activated when this returns false.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==mousepressed==&lt;br /&gt;
'''number vk, boolean toggle'''&lt;br /&gt;
&lt;br /&gt;
Triggered whenever a mouse button is pressed.&lt;br /&gt;
Even though mouse buttons do not typically have a toggle function, a second parameter is returned.&lt;br /&gt;
&lt;br /&gt;
See keypressed event for more information.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==mousereleased==&lt;br /&gt;
'''number vk, boolean toggle'''&lt;br /&gt;
&lt;br /&gt;
Triggered whenever a mouse button is released.&lt;br /&gt;
Even though mouse buttons do not typically have a toggle function, a second parameter is returned.&lt;br /&gt;
&lt;br /&gt;
See keyreleased event for more information.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==gamepadpressed==&lt;br /&gt;
'''number gamepadId, number buttonId'''&lt;br /&gt;
&lt;br /&gt;
Triggered whenever a button is pressed on any gamepad.&lt;br /&gt;
Returns two values: the ID of the gamepad (1-16), and the ID of the button being pressed (1-32).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==gamepadreleased==&lt;br /&gt;
'''number gamepadId, number buttonId'''&lt;br /&gt;
&lt;br /&gt;
Triggered whenever a button is released on any gamepad.&lt;br /&gt;
Returns two values: the ID of the gamepad (1-16), and the ID of the button being released (1-32).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==gamepadpovchanged==&lt;br /&gt;
'''number gamepadId, number pov'''&lt;br /&gt;
&lt;br /&gt;
Triggered whenever the direction of the POV-hat (aka D-pad) is changed.&lt;br /&gt;
Returns gamepad ID and new POV direction.&lt;br /&gt;
&lt;br /&gt;
See [[Gamepad_Module#getPOV|getPOV]]() for more information.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==gamepadaxischanged==&lt;br /&gt;
'''number gamepadId, number axisId, number axisValue'''&lt;br /&gt;
&lt;br /&gt;
Triggered whenever an axis of a gamepad is changed.&lt;br /&gt;
Pushes 3 values: ID of gamepad, ID of axis that was changed, and the actual new value of the axis.&lt;br /&gt;
&lt;br /&gt;
See [[Gamepad_Module#getAxis|getAxis]]() for more information.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==error==&lt;br /&gt;
'''string msg'''&lt;br /&gt;
&lt;br /&gt;
Triggered when an error occurs. Not all errors can be recovered from enough to push an error message.&lt;br /&gt;
Pushes 1 value: a string that describes the error that has occurred.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==warning==&lt;br /&gt;
'''string msg'''&lt;br /&gt;
&lt;br /&gt;
Exactly like the error event, except for non-critical errors or other warnings.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==consoleresized==&lt;br /&gt;
&lt;br /&gt;
Triggered when the MicroMacro console window is resized.&lt;br /&gt;
Does not push any additional information.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==socketconnected==&lt;br /&gt;
'''socket clientsock, number listenSockId'''&lt;br /&gt;
&lt;br /&gt;
Triggered whenever a new connection is received on a listening socket. Pushes a new [[Socket Class|socket object]] that you may use to communicate with this new client, and the socket '''ID''' of the listening socket that this client connected to.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==socketdisconnected==&lt;br /&gt;
'''number socketId'''&lt;br /&gt;
&lt;br /&gt;
Triggered whenever a connection is closed for any reason. The socket '''ID''' is pushed; not the socket object.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==socketreceived==&lt;br /&gt;
'''number socketId, string msg'''&lt;br /&gt;
'''userdata sockaddr, string msg'''&lt;br /&gt;
&lt;br /&gt;
Triggered whenever any socket receives some information.&lt;br /&gt;
&lt;br /&gt;
On a TCP connection, this pushes the socket '''ID''' and the content of the message as a string.&lt;br /&gt;
&lt;br /&gt;
On a UDP connection, this pushes the socket '''sockaddr''' and the content of the message as a string. You will use the sockaddr to respond to messages.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function macro.event(e, ...)&lt;br /&gt;
	if( e == &amp;quot;socketconnected&amp;quot; ) then&lt;br /&gt;
		-- Only a TCP server socket would receive this kind of event; UDP sockets are connectionless.&lt;br /&gt;
		local socket,listenSockId = ...; -- Pull the socket and listenSockId out of the event&lt;br /&gt;
		clients[socket:id()] = socket;&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	if( e == &amp;quot;socketreceived&amp;quot; ) then&lt;br /&gt;
		-- TCP&lt;br /&gt;
		local sockId,message = ...; -- Pull the sockId and message out of the event&lt;br /&gt;
		local client = clients[sockId]; -- We remember our client from their socketconnected event&lt;br /&gt;
		client:send(&amp;quot;Hello to you, too!&amp;quot;); -- Send a message back over their socket&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
		-- UDP&lt;br /&gt;
		local sockaddr,message = ...; -- Pull the sockaddr and message out of the event&lt;br /&gt;
		server:sendto(sockaddr, &amp;quot;Hello to you, too!&amp;quot;); -- Send a message back over the same sockaddr to reply to them&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==socketerror==&lt;br /&gt;
'''number socketId, number errorCode'''&lt;br /&gt;
&lt;br /&gt;
Triggered whenever an error is encountered on a socket. Pushes the socket '''ID''' and the Winsock error code [http://msdn.microsoft.com/en-us/library/windows/desktop/ms740668%28v=vs.85%29.aspx].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==quit==&lt;br /&gt;
&lt;br /&gt;
Triggered when the script is just about to terminate.&lt;br /&gt;
Does not push any additional information.&lt;/div&gt;</summary>
		<author><name>Elverion</name></author>	</entry>

	<entry>
		<id>https://solarstrike.net/wiki/index.php?title=Socket_Class&amp;diff=1262</id>
		<title>Socket Class</title>
		<link rel="alternate" type="text/html" href="https://solarstrike.net/wiki/index.php?title=Socket_Class&amp;diff=1262"/>
				<updated>2017-11-02T22:03:54Z</updated>
		
		<summary type="html">&lt;p&gt;Elverion: /* listen */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== connect ==&lt;br /&gt;
'''boolean socket:connect(string host, number port)'''&lt;br /&gt;
&lt;br /&gt;
Attempts to connect to a server specified by the host and port number. The 'host' can either be an IP address (ie. &amp;quot;127.0.0.1&amp;quot;) or a hostname (&amp;quot;www.example.com&amp;quot;). 'port' must be between 1 and 65535, but you should avoid commonly used ports (ie. 21, 80, etc.).&lt;br /&gt;
&lt;br /&gt;
If the connection succeeds, this function returns true. If it fails, it returns false plus an error string.&lt;br /&gt;
&lt;br /&gt;
NOTE: TCP only!&lt;br /&gt;
&lt;br /&gt;
== listen ==&lt;br /&gt;
'''boolean socket:listen(string host, number port)'''&lt;br /&gt;
&lt;br /&gt;
Attempts to set this socket into &amp;quot;listen&amp;quot; mode. That is, it will act like a server and wait for new connections. The 'host' should probably be an empty string (ie. &amp;quot;&amp;quot;) in order to accept connections from ''any'' incoming network, but you may also specify which network you would like (ie. &amp;quot;127.0.0.1&amp;quot; to only accept connections from localhost, &amp;quot;192.168.1.x&amp;quot; for LAN-only connections, etc.).&lt;br /&gt;
&lt;br /&gt;
If this function succeeds, it will return true. Otherwise, it will return false plus an error string.&lt;br /&gt;
&lt;br /&gt;
In UDP mode, make sure to call listen() *before* using sendto()! If you call sendto() first, the socket will be set to client-mode and not be able to properly bind to the given host/port.&lt;br /&gt;
&lt;br /&gt;
== send ==&lt;br /&gt;
'''boolean socket:send(string msg)'''&lt;br /&gt;
&lt;br /&gt;
Attempts to send information across an already-connected socket. If the message was successfully sent, this function returns true, otherwise it returns false. The message ('msg') is sent as a string but may contain binary and embedded zeroes.&lt;br /&gt;
&lt;br /&gt;
NOTE: TCP only!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== sendto ==&lt;br /&gt;
'''boolean socket:sendto(string ip, number port, string msg)'''&lt;br /&gt;
&lt;br /&gt;
'''boolean socket:sendto(userdata sockaddr, string msg)'''&lt;br /&gt;
&lt;br /&gt;
Attempts to send information across a UDP-connected socket. If the message was successfully sent, this function returns true, otherwise it returns false. The message ('msg') is sent as a string but may contain binary and embedded zeroes.&lt;br /&gt;
&lt;br /&gt;
You may either specify an IP/port to send the message to, or (when responding to received messages) supply the sockaddr (see: [[Events#socketreceived|Events:socketreceived]])&lt;br /&gt;
&lt;br /&gt;
NOTE: UDP only!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== recv ==&lt;br /&gt;
'''string socket:recv()'''&lt;br /&gt;
&lt;br /&gt;
If there are any messages in the input queue, returns the message on the top of the stack and pops it. Otherwise, returns nil.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== getRecvQueueSize ==&lt;br /&gt;
'''number socket:getRecvQueueSize()'''&lt;br /&gt;
&lt;br /&gt;
Returns the number of messages still in the receive queue.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== flushRecvQueue ==&lt;br /&gt;
'''socket:flushRecvQueue()'''&lt;br /&gt;
&lt;br /&gt;
Flushes all messages in the queue on this socket.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== close ==&lt;br /&gt;
'''socket:close()'''&lt;br /&gt;
&lt;br /&gt;
Closes a socket and shuts down related network threads. This will happen automatically as a socket object goes out of scope or is set to nil.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== id ==&lt;br /&gt;
'''number socket:id()'''&lt;br /&gt;
&lt;br /&gt;
Returns the socket's ID. You may use this to uniquely identify the socket, however you should be aware that socket IDs may be recycled.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== ip ==&lt;br /&gt;
'''string socket:ip()'''&lt;br /&gt;
&lt;br /&gt;
Returns the socket's IP. Generally only useful server-side to find out which IP you're listening on (clients will generally be 0.0.0.0 or &amp;quot;any&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
== port ==&lt;br /&gt;
'''number socket:port()'''&lt;br /&gt;
&lt;br /&gt;
Returns the socket's port. On the server, this will be the port you are 'listening' on, and on the client this will be assigned automatically.&lt;/div&gt;</summary>
		<author><name>Elverion</name></author>	</entry>

	<entry>
		<id>https://solarstrike.net/wiki/index.php?title=Socket_Class&amp;diff=1261</id>
		<title>Socket Class</title>
		<link rel="alternate" type="text/html" href="https://solarstrike.net/wiki/index.php?title=Socket_Class&amp;diff=1261"/>
				<updated>2017-11-02T22:02:16Z</updated>
		
		<summary type="html">&lt;p&gt;Elverion: /* connect */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== connect ==&lt;br /&gt;
'''boolean socket:connect(string host, number port)'''&lt;br /&gt;
&lt;br /&gt;
Attempts to connect to a server specified by the host and port number. The 'host' can either be an IP address (ie. &amp;quot;127.0.0.1&amp;quot;) or a hostname (&amp;quot;www.example.com&amp;quot;). 'port' must be between 1 and 65535, but you should avoid commonly used ports (ie. 21, 80, etc.).&lt;br /&gt;
&lt;br /&gt;
If the connection succeeds, this function returns true. If it fails, it returns false plus an error string.&lt;br /&gt;
&lt;br /&gt;
NOTE: TCP only!&lt;br /&gt;
&lt;br /&gt;
== listen ==&lt;br /&gt;
'''boolean socket:listen(string host, number port)'''&lt;br /&gt;
&lt;br /&gt;
Attempts to set this socket into &amp;quot;listen&amp;quot; mode. That is, it will act like a server and wait for new connections. The 'host' should probably be an empty string (ie. &amp;quot;&amp;quot;) in order to accept connections from ''any'' incoming network, but you may also specify which network you would like (ie. &amp;quot;127.0.0.1&amp;quot; to only accept connections from localhost, &amp;quot;192.168.1.x&amp;quot; for LAN-only connections, etc.).&lt;br /&gt;
&lt;br /&gt;
If this function succeeds, it will return true. Otherwise, it will return false plus an error string.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== send ==&lt;br /&gt;
'''boolean socket:send(string msg)'''&lt;br /&gt;
&lt;br /&gt;
Attempts to send information across an already-connected socket. If the message was successfully sent, this function returns true, otherwise it returns false. The message ('msg') is sent as a string but may contain binary and embedded zeroes.&lt;br /&gt;
&lt;br /&gt;
NOTE: TCP only!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== sendto ==&lt;br /&gt;
'''boolean socket:sendto(string ip, number port, string msg)'''&lt;br /&gt;
&lt;br /&gt;
'''boolean socket:sendto(userdata sockaddr, string msg)'''&lt;br /&gt;
&lt;br /&gt;
Attempts to send information across a UDP-connected socket. If the message was successfully sent, this function returns true, otherwise it returns false. The message ('msg') is sent as a string but may contain binary and embedded zeroes.&lt;br /&gt;
&lt;br /&gt;
You may either specify an IP/port to send the message to, or (when responding to received messages) supply the sockaddr (see: [[Events#socketreceived|Events:socketreceived]])&lt;br /&gt;
&lt;br /&gt;
NOTE: UDP only!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== recv ==&lt;br /&gt;
'''string socket:recv()'''&lt;br /&gt;
&lt;br /&gt;
If there are any messages in the input queue, returns the message on the top of the stack and pops it. Otherwise, returns nil.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== getRecvQueueSize ==&lt;br /&gt;
'''number socket:getRecvQueueSize()'''&lt;br /&gt;
&lt;br /&gt;
Returns the number of messages still in the receive queue.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== flushRecvQueue ==&lt;br /&gt;
'''socket:flushRecvQueue()'''&lt;br /&gt;
&lt;br /&gt;
Flushes all messages in the queue on this socket.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== close ==&lt;br /&gt;
'''socket:close()'''&lt;br /&gt;
&lt;br /&gt;
Closes a socket and shuts down related network threads. This will happen automatically as a socket object goes out of scope or is set to nil.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== id ==&lt;br /&gt;
'''number socket:id()'''&lt;br /&gt;
&lt;br /&gt;
Returns the socket's ID. You may use this to uniquely identify the socket, however you should be aware that socket IDs may be recycled.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== ip ==&lt;br /&gt;
'''string socket:ip()'''&lt;br /&gt;
&lt;br /&gt;
Returns the socket's IP. Generally only useful server-side to find out which IP you're listening on (clients will generally be 0.0.0.0 or &amp;quot;any&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
== port ==&lt;br /&gt;
'''number socket:port()'''&lt;br /&gt;
&lt;br /&gt;
Returns the socket's port. On the server, this will be the port you are 'listening' on, and on the client this will be assigned automatically.&lt;/div&gt;</summary>
		<author><name>Elverion</name></author>	</entry>

	<entry>
		<id>https://solarstrike.net/wiki/index.php?title=Socket_Class&amp;diff=1260</id>
		<title>Socket Class</title>
		<link rel="alternate" type="text/html" href="https://solarstrike.net/wiki/index.php?title=Socket_Class&amp;diff=1260"/>
				<updated>2017-11-02T22:01:56Z</updated>
		
		<summary type="html">&lt;p&gt;Elverion: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== connect ==&lt;br /&gt;
'''boolean socket:connect(string host, number port)'''&lt;br /&gt;
&lt;br /&gt;
Attempts to connect to a server specified by the host and port number. The 'host' can either be an IP address (ie. &amp;quot;127.0.0.1&amp;quot;) or a hostname (&amp;quot;www.example.com&amp;quot;). 'port' must be between 1 and 65535, but you should avoid commonly used ports (ie. 21, 80, etc.).&lt;br /&gt;
&lt;br /&gt;
If the connection succeeds, this function returns true. If it fails, it returns false plus an error string.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== listen ==&lt;br /&gt;
'''boolean socket:listen(string host, number port)'''&lt;br /&gt;
&lt;br /&gt;
Attempts to set this socket into &amp;quot;listen&amp;quot; mode. That is, it will act like a server and wait for new connections. The 'host' should probably be an empty string (ie. &amp;quot;&amp;quot;) in order to accept connections from ''any'' incoming network, but you may also specify which network you would like (ie. &amp;quot;127.0.0.1&amp;quot; to only accept connections from localhost, &amp;quot;192.168.1.x&amp;quot; for LAN-only connections, etc.).&lt;br /&gt;
&lt;br /&gt;
If this function succeeds, it will return true. Otherwise, it will return false plus an error string.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== send ==&lt;br /&gt;
'''boolean socket:send(string msg)'''&lt;br /&gt;
&lt;br /&gt;
Attempts to send information across an already-connected socket. If the message was successfully sent, this function returns true, otherwise it returns false. The message ('msg') is sent as a string but may contain binary and embedded zeroes.&lt;br /&gt;
&lt;br /&gt;
NOTE: TCP only!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== sendto ==&lt;br /&gt;
'''boolean socket:sendto(string ip, number port, string msg)'''&lt;br /&gt;
&lt;br /&gt;
'''boolean socket:sendto(userdata sockaddr, string msg)'''&lt;br /&gt;
&lt;br /&gt;
Attempts to send information across a UDP-connected socket. If the message was successfully sent, this function returns true, otherwise it returns false. The message ('msg') is sent as a string but may contain binary and embedded zeroes.&lt;br /&gt;
&lt;br /&gt;
You may either specify an IP/port to send the message to, or (when responding to received messages) supply the sockaddr (see: [[Events#socketreceived|Events:socketreceived]])&lt;br /&gt;
&lt;br /&gt;
NOTE: UDP only!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== recv ==&lt;br /&gt;
'''string socket:recv()'''&lt;br /&gt;
&lt;br /&gt;
If there are any messages in the input queue, returns the message on the top of the stack and pops it. Otherwise, returns nil.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== getRecvQueueSize ==&lt;br /&gt;
'''number socket:getRecvQueueSize()'''&lt;br /&gt;
&lt;br /&gt;
Returns the number of messages still in the receive queue.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== flushRecvQueue ==&lt;br /&gt;
'''socket:flushRecvQueue()'''&lt;br /&gt;
&lt;br /&gt;
Flushes all messages in the queue on this socket.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== close ==&lt;br /&gt;
'''socket:close()'''&lt;br /&gt;
&lt;br /&gt;
Closes a socket and shuts down related network threads. This will happen automatically as a socket object goes out of scope or is set to nil.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== id ==&lt;br /&gt;
'''number socket:id()'''&lt;br /&gt;
&lt;br /&gt;
Returns the socket's ID. You may use this to uniquely identify the socket, however you should be aware that socket IDs may be recycled.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== ip ==&lt;br /&gt;
'''string socket:ip()'''&lt;br /&gt;
&lt;br /&gt;
Returns the socket's IP. Generally only useful server-side to find out which IP you're listening on (clients will generally be 0.0.0.0 or &amp;quot;any&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
== port ==&lt;br /&gt;
'''number socket:port()'''&lt;br /&gt;
&lt;br /&gt;
Returns the socket's port. On the server, this will be the port you are 'listening' on, and on the client this will be assigned automatically.&lt;/div&gt;</summary>
		<author><name>Elverion</name></author>	</entry>

	<entry>
		<id>https://solarstrike.net/wiki/index.php?title=Mouse_Module&amp;diff=1259</id>
		<title>Mouse Module</title>
		<link rel="alternate" type="text/html" href="https://solarstrike.net/wiki/index.php?title=Mouse_Module&amp;diff=1259"/>
				<updated>2017-10-13T14:55:18Z</updated>
		
		<summary type="html">&lt;p&gt;Elverion: /* setHookCallback */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Most mouse functions will expect a virtual key code. Use the [[Key Module]] for getting the proper VK.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== pressed ==&lt;br /&gt;
'''boolean mouse.pressed(number vk)'''&lt;br /&gt;
&lt;br /&gt;
Returns true if the given mouse button was pressed in this logic cycle. It does not continually return true when a button is held down, only once when it is initially pressed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== released ==&lt;br /&gt;
'''boolean mouse.released(number vk)'''&lt;br /&gt;
&lt;br /&gt;
Returns true if the given mouse button was released in this logic cycle. It does not continually return true when a button not held down, only once when it is initially released.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== isDown ==&lt;br /&gt;
'''boolean mouse.isDown(number vk)'''&lt;br /&gt;
&lt;br /&gt;
Returns true if the given mouse button is held down. This ''will'' continue to return true as long as the button is held down.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== press ==&lt;br /&gt;
'''mouse.press(number vk[, bool async])'''&lt;br /&gt;
&lt;br /&gt;
Attempts to send a synthetic press for the given button.&lt;br /&gt;
If async is true (default), it is queued for automatic release. Otherwise, execution is blocked while waiting for release.&lt;br /&gt;
&lt;br /&gt;
This will send the input to whichever window has input focus at the time.&lt;br /&gt;
&lt;br /&gt;
== hold ==&lt;br /&gt;
'''mouse.hold(number vk)'''&lt;br /&gt;
&lt;br /&gt;
Attempts to send a synthetic hold for the given button.&lt;br /&gt;
As there is no automatically-paired release, the async flag is not accepted in this function.&lt;br /&gt;
&lt;br /&gt;
This will send the input to whichever window has input focus at the time.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== release ==&lt;br /&gt;
'''mouse.release(number vk)'''&lt;br /&gt;
&lt;br /&gt;
Attempts to send a synthetic release for the given button.&lt;br /&gt;
You should typically use mouse.hold() on the button first to give it something to release.&lt;br /&gt;
&lt;br /&gt;
This will send the input to whichever window has input focus at the time.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== move ==&lt;br /&gt;
'''mouse.move(number x, number y)'''&lt;br /&gt;
&lt;br /&gt;
Attempts to move (not set to a position) the physical mouse cursor. 'dx' and 'dy' are the amount to move in pixels in the x and y axis, respectively.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== wheelMove ==&lt;br /&gt;
'''mouse.wheelMove(number delta)'''&lt;br /&gt;
&lt;br /&gt;
Attempts to move the physical mouse wheel. 'delta' specified the amount to move; 120 = 1 wheel click. If 'delta' is positive, moves the wheel up (away from user). If 'delta' is negative, moves the wheel down (towards user).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== setPosition ==&lt;br /&gt;
'''mouse.setPosition(number x, number y)'''&lt;br /&gt;
&lt;br /&gt;
Attempts to set the physical mouse wheel to the given coordinates. 'x' and 'y' are specified in pixels.&lt;br /&gt;
&lt;br /&gt;
NOTE: Microsoft, in their infinite wisdom, decided to use some goofy, brain-dead system for this and we lose accuracy when normalizing the screen coordinates. As a result, the actual cursor may be 1 or 2 pixels off our target.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== getPosition ==&lt;br /&gt;
'''number x, number y mouse.getPosition()'''&lt;br /&gt;
&lt;br /&gt;
Returns the position of the physical mouse cursor, in pixels.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== getConsolePosition ==&lt;br /&gt;
'''number x, number y mouse.getConsolePosition()'''&lt;br /&gt;
&lt;br /&gt;
Returns the position of the physical mouse cursor in console characters.&lt;br /&gt;
&lt;br /&gt;
NOTE: This returns the position inside the window, not globally. Therefor, if the mouse is to the left or above the console window, you can receive negative numbers.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== virtualPress ==&lt;br /&gt;
'''mouse.virtualPress(number hwnd, number vk[, boolean async])'''&lt;br /&gt;
&lt;br /&gt;
Attempts to send a synthetic press for the given button, and sends that input directly to the given window.&lt;br /&gt;
If async is true (default), it is queued for automatic release. Otherwise, execution is blocked while waiting for release.&lt;br /&gt;
&lt;br /&gt;
The position that the mouse is &amp;quot;clicked&amp;quot; is wherever the virtual mouse is positioned to (use mouse.virtualMove()).&lt;br /&gt;
&lt;br /&gt;
As virtual functions send the input directly to the specified window's input queue, this can be used to control windows that are in the background without interrupting the user.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== virtualHold ==&lt;br /&gt;
'''mouse.virtualHold(number hwnd, number vk)'''&lt;br /&gt;
&lt;br /&gt;
Attempts to send a synthetic hold for the given button, and sends that input directly to the given window.&lt;br /&gt;
&lt;br /&gt;
The position that the button is held is wherever the virtual mouse is positioned to (use mouse.virtualMove() or mouse.setVirtualPosition()).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== virtualRelease ==&lt;br /&gt;
'''mouse.virtualRelease(number hwnd, number vk)'''&lt;br /&gt;
&lt;br /&gt;
Attempts to send a synthetic release for the given button, and sends that input directly to the given window.&lt;br /&gt;
&lt;br /&gt;
The position that the button is release is wherever the virtual mouse is positioned to (use mouse.virtualMove() or mouse.setVirtualPosition()).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== virtualMove ==&lt;br /&gt;
'''mouse.virtualMove(number hwnd, number dx, number dy)'''&lt;br /&gt;
&lt;br /&gt;
Moves the virtual mouse cursor by dx, dy. This does not affect the physical mouse cursor. See mouse.move() for more details.&lt;br /&gt;
&lt;br /&gt;
== virtualWheelMove ==&lt;br /&gt;
'''mouse.virtualWheelMove(number hwnd, number delta)'''&lt;br /&gt;
&lt;br /&gt;
Moves the virtual mouse wheel by 'delta'. See mouse.wheelMove() for more details.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== setVirtualPosition ==&lt;br /&gt;
'''mouse.setVirtualPosition(number hwnd, number x, number y)'''&lt;br /&gt;
&lt;br /&gt;
Sets the virtual mouse cursor to x, y. This does not affect the physical mouse cursor. See mouse.setPosition() for more details.&lt;br /&gt;
&lt;br /&gt;
== getVirtualPosition ==&lt;br /&gt;
'''number x, number y mouse.getVirtualPosition()'''&lt;br /&gt;
&lt;br /&gt;
Returns the position of the virtual mouse cursor. See mouse.getPosition() for more details.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== setHookCallback ==&lt;br /&gt;
'''boolean mouse.setHookCallback(nil|function callback)'''&lt;br /&gt;
&lt;br /&gt;
Install or uninstall a mouse hook callback. If 'callback' is a Lua function, this will be the callback function used when input is trapped. The callback should accept at minimum one parameter: the virtual key code of the event. Button presses will return the virtual key code (ie. key.VK_LMOUSE) as well as the string &amp;quot;up&amp;quot; or &amp;quot;down&amp;quot; to distinguish the action performed on that button. Moving the mouse will return the virtual key code (key.VK_MOUSEMOVE) and the position (x,y coordinates) of the mouse position. A mouse wheel movement event pushes the virtual key code (key.VK_MOUSEWHEEL) as well as the delta (change) in increments of 120; generally moving the wheel up will return '120' and down will return '-120'. Your callback should return a boolean: true if you want to drop/ignore the key, or false if you want to let it fall through to be processed.&lt;br /&gt;
&lt;br /&gt;
If 'callback' is nil, the mouse hook will be removed.&lt;br /&gt;
&lt;br /&gt;
Both your callback and main function (macro.main) should execute very quickly so '''do not''' use any rests or pauses. Slow-executing loops here can cause the system to delay input until these functions return. If your callback takes too long (5 seconds by default) to respond, Windows will consider it timed-out and remove the hook. When script execution is finished, the hook will also be removed automatically.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''Example''&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function mouse_hook(vk, ...)&lt;br /&gt;
	if( vk == key.VK_MOUSEWHEEL ) then&lt;br /&gt;
		local dist = ...;&lt;br /&gt;
		printf(&amp;quot;Mouse wheel moved %d\n&amp;quot;, dist);&lt;br /&gt;
	elseif( vk == key.VK_MOUSEMOVE ) then&lt;br /&gt;
		local x,y = ...;&lt;br /&gt;
		printf(&amp;quot;Mouse moved to: %d,%d\n&amp;quot;, x, y);&lt;br /&gt;
	elseif( vk == key.VK_LMOUSE ) then&lt;br /&gt;
		local state = ...;&lt;br /&gt;
		printf(&amp;quot;Mouse left %s\n&amp;quot;, state);&lt;br /&gt;
	elseif( vk == key.VK_MMOUSE ) then&lt;br /&gt;
		local state	=	...;&lt;br /&gt;
		printf(&amp;quot;Middle mouse %s\n&amp;quot;, state);&lt;br /&gt;
	elseif( vk == key.VK_RMOUSE ) then&lt;br /&gt;
		local state	=	...;&lt;br /&gt;
		printf(&amp;quot;Mouse right %s\n&amp;quot;, state);&lt;br /&gt;
	elseif( vk == key.VK_XMOUSE1 ) then&lt;br /&gt;
		local state	=	...;&lt;br /&gt;
		printf(&amp;quot;Extended mouse button 1 %s\n&amp;quot;, state);&lt;br /&gt;
	elseif( vk == key.VK_XMOUSE2 ) then&lt;br /&gt;
		local state	=	...;&lt;br /&gt;
		printf(&amp;quot;Extended mouse button 2 %s\n&amp;quot;, state);&lt;br /&gt;
		return true; -- Block this message from processing (ie. ignore this event)&lt;br /&gt;
	else&lt;br /&gt;
		printf(&amp;quot;Unhandled event: 0x%x\n&amp;quot;, vk);&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	return false;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function macro.init()&lt;br /&gt;
	-- Once the hook is installed, we will capture various mouse events as they are generated and block the X-mouse 2 from being pressed&lt;br /&gt;
	mouse.setHookCallback(mouse_hook);&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Elverion</name></author>	</entry>

	<entry>
		<id>https://solarstrike.net/wiki/index.php?title=Mouse_Module&amp;diff=1258</id>
		<title>Mouse Module</title>
		<link rel="alternate" type="text/html" href="https://solarstrike.net/wiki/index.php?title=Mouse_Module&amp;diff=1258"/>
				<updated>2017-10-01T19:38:17Z</updated>
		
		<summary type="html">&lt;p&gt;Elverion: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Most mouse functions will expect a virtual key code. Use the [[Key Module]] for getting the proper VK.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== pressed ==&lt;br /&gt;
'''boolean mouse.pressed(number vk)'''&lt;br /&gt;
&lt;br /&gt;
Returns true if the given mouse button was pressed in this logic cycle. It does not continually return true when a button is held down, only once when it is initially pressed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== released ==&lt;br /&gt;
'''boolean mouse.released(number vk)'''&lt;br /&gt;
&lt;br /&gt;
Returns true if the given mouse button was released in this logic cycle. It does not continually return true when a button not held down, only once when it is initially released.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== isDown ==&lt;br /&gt;
'''boolean mouse.isDown(number vk)'''&lt;br /&gt;
&lt;br /&gt;
Returns true if the given mouse button is held down. This ''will'' continue to return true as long as the button is held down.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== press ==&lt;br /&gt;
'''mouse.press(number vk[, bool async])'''&lt;br /&gt;
&lt;br /&gt;
Attempts to send a synthetic press for the given button.&lt;br /&gt;
If async is true (default), it is queued for automatic release. Otherwise, execution is blocked while waiting for release.&lt;br /&gt;
&lt;br /&gt;
This will send the input to whichever window has input focus at the time.&lt;br /&gt;
&lt;br /&gt;
== hold ==&lt;br /&gt;
'''mouse.hold(number vk)'''&lt;br /&gt;
&lt;br /&gt;
Attempts to send a synthetic hold for the given button.&lt;br /&gt;
As there is no automatically-paired release, the async flag is not accepted in this function.&lt;br /&gt;
&lt;br /&gt;
This will send the input to whichever window has input focus at the time.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== release ==&lt;br /&gt;
'''mouse.release(number vk)'''&lt;br /&gt;
&lt;br /&gt;
Attempts to send a synthetic release for the given button.&lt;br /&gt;
You should typically use mouse.hold() on the button first to give it something to release.&lt;br /&gt;
&lt;br /&gt;
This will send the input to whichever window has input focus at the time.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== move ==&lt;br /&gt;
'''mouse.move(number x, number y)'''&lt;br /&gt;
&lt;br /&gt;
Attempts to move (not set to a position) the physical mouse cursor. 'dx' and 'dy' are the amount to move in pixels in the x and y axis, respectively.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== wheelMove ==&lt;br /&gt;
'''mouse.wheelMove(number delta)'''&lt;br /&gt;
&lt;br /&gt;
Attempts to move the physical mouse wheel. 'delta' specified the amount to move; 120 = 1 wheel click. If 'delta' is positive, moves the wheel up (away from user). If 'delta' is negative, moves the wheel down (towards user).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== setPosition ==&lt;br /&gt;
'''mouse.setPosition(number x, number y)'''&lt;br /&gt;
&lt;br /&gt;
Attempts to set the physical mouse wheel to the given coordinates. 'x' and 'y' are specified in pixels.&lt;br /&gt;
&lt;br /&gt;
NOTE: Microsoft, in their infinite wisdom, decided to use some goofy, brain-dead system for this and we lose accuracy when normalizing the screen coordinates. As a result, the actual cursor may be 1 or 2 pixels off our target.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== getPosition ==&lt;br /&gt;
'''number x, number y mouse.getPosition()'''&lt;br /&gt;
&lt;br /&gt;
Returns the position of the physical mouse cursor, in pixels.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== getConsolePosition ==&lt;br /&gt;
'''number x, number y mouse.getConsolePosition()'''&lt;br /&gt;
&lt;br /&gt;
Returns the position of the physical mouse cursor in console characters.&lt;br /&gt;
&lt;br /&gt;
NOTE: This returns the position inside the window, not globally. Therefor, if the mouse is to the left or above the console window, you can receive negative numbers.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== virtualPress ==&lt;br /&gt;
'''mouse.virtualPress(number hwnd, number vk[, boolean async])'''&lt;br /&gt;
&lt;br /&gt;
Attempts to send a synthetic press for the given button, and sends that input directly to the given window.&lt;br /&gt;
If async is true (default), it is queued for automatic release. Otherwise, execution is blocked while waiting for release.&lt;br /&gt;
&lt;br /&gt;
The position that the mouse is &amp;quot;clicked&amp;quot; is wherever the virtual mouse is positioned to (use mouse.virtualMove()).&lt;br /&gt;
&lt;br /&gt;
As virtual functions send the input directly to the specified window's input queue, this can be used to control windows that are in the background without interrupting the user.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== virtualHold ==&lt;br /&gt;
'''mouse.virtualHold(number hwnd, number vk)'''&lt;br /&gt;
&lt;br /&gt;
Attempts to send a synthetic hold for the given button, and sends that input directly to the given window.&lt;br /&gt;
&lt;br /&gt;
The position that the button is held is wherever the virtual mouse is positioned to (use mouse.virtualMove() or mouse.setVirtualPosition()).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== virtualRelease ==&lt;br /&gt;
'''mouse.virtualRelease(number hwnd, number vk)'''&lt;br /&gt;
&lt;br /&gt;
Attempts to send a synthetic release for the given button, and sends that input directly to the given window.&lt;br /&gt;
&lt;br /&gt;
The position that the button is release is wherever the virtual mouse is positioned to (use mouse.virtualMove() or mouse.setVirtualPosition()).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== virtualMove ==&lt;br /&gt;
'''mouse.virtualMove(number hwnd, number dx, number dy)'''&lt;br /&gt;
&lt;br /&gt;
Moves the virtual mouse cursor by dx, dy. This does not affect the physical mouse cursor. See mouse.move() for more details.&lt;br /&gt;
&lt;br /&gt;
== virtualWheelMove ==&lt;br /&gt;
'''mouse.virtualWheelMove(number hwnd, number delta)'''&lt;br /&gt;
&lt;br /&gt;
Moves the virtual mouse wheel by 'delta'. See mouse.wheelMove() for more details.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== setVirtualPosition ==&lt;br /&gt;
'''mouse.setVirtualPosition(number hwnd, number x, number y)'''&lt;br /&gt;
&lt;br /&gt;
Sets the virtual mouse cursor to x, y. This does not affect the physical mouse cursor. See mouse.setPosition() for more details.&lt;br /&gt;
&lt;br /&gt;
== getVirtualPosition ==&lt;br /&gt;
'''number x, number y mouse.getVirtualPosition()'''&lt;br /&gt;
&lt;br /&gt;
Returns the position of the virtual mouse cursor. See mouse.getPosition() for more details.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== setHookCallback ==&lt;br /&gt;
'''boolean mouse.setHookCallback(nil|function callback)'''&lt;br /&gt;
&lt;br /&gt;
Install or uninstall a mouse hook callback. If 'callback' is a Lua function, this will be the callback function used when input is trapped. The callback should accept at minimum one parameter: the virtual key code of the event. Button presses will return the virtual key code (ie. key.VK_LMOUSE) as well as the string &amp;quot;up&amp;quot; or &amp;quot;down&amp;quot; to distinguish the action performed on that button. Moving the mouse will return the virtual key code (key.VK_MOUSEMOVE) and the position (x,y coordinates) of the mouse position. A mouse wheel movement event pushes the virtual key code (key.VK_MOUSEWHEEL) as well as the delta (change) in increments of 120; generally moving the wheel up will return '120' and down will return '-120'. Your callback should return a boolean: true if you want to drop/ignore the key, or false if you want to let it fall through to be processed.&lt;br /&gt;
&lt;br /&gt;
If 'callback' is nil, the mouse hook will be removed.&lt;br /&gt;
&lt;br /&gt;
Both your callback and main function (macro.main) should execute very quickly so '''do not''' use any rests or pauses. Slow-executing loops here can cause the system to delay input until these functions return. If your callback takes too long (5 seconds by default) to respond, Windows will consider it timed-out and remove the hook. When script execution is finished, the hook will also be removed automatically.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''Example''&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function mouse_hook(vk, ...)&lt;br /&gt;
	if( vk == key.VK_MOUSEWHEEL ) then&lt;br /&gt;
		local dist = ...;&lt;br /&gt;
		printf(&amp;quot;Mouse wheel moved %d\n&amp;quot;, dist);&lt;br /&gt;
	elseif( vk == key.VK_MOUSEMOVE ) then&lt;br /&gt;
		local x,y = ...;&lt;br /&gt;
		printf(&amp;quot;Mouse moved to: %d,%d\n&amp;quot;, x, y);&lt;br /&gt;
	elseif( vk == key.VK_LMOUSE ) then&lt;br /&gt;
		local state = ...;&lt;br /&gt;
		printf(&amp;quot;Mouse left %s\n&amp;quot;, state);&lt;br /&gt;
	elseif( vk == key.VK_MMOUSE ) then&lt;br /&gt;
		local state	=	...;&lt;br /&gt;
		printf(&amp;quot;Middle mouse %s\n&amp;quot;, state);&lt;br /&gt;
	elseif( vk == key.VK_RMOUSE ) then&lt;br /&gt;
		local state	=	...;&lt;br /&gt;
		printf(&amp;quot;Mouse right %s\n&amp;quot;, state);&lt;br /&gt;
	elseif( vk == key.VK_XMOUSE1 ) then&lt;br /&gt;
		local state	=	...;&lt;br /&gt;
		printf(&amp;quot;Extended mouse button 1 %s\n&amp;quot;, state);&lt;br /&gt;
	elseif( vk == key.VK_XMOUSE2 ) then&lt;br /&gt;
		local state	=	...;&lt;br /&gt;
		printf(&amp;quot;Extended mouse button 2 %s\n&amp;quot;, state);&lt;br /&gt;
		return true; -- Block this message from processing (ie. ignore this event)&lt;br /&gt;
	else&lt;br /&gt;
		printf(&amp;quot;Unhandled event: 0x%x\n&amp;quot;, vk);&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	return false;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function macro.init()&lt;br /&gt;
	-- Once the hook is installed, we will capture various mouse events as they are generated and block the X-mouse 2 from being pressed&lt;br /&gt;
	mouse.setHookCallback(hook);&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Elverion</name></author>	</entry>

	<entry>
		<id>https://solarstrike.net/wiki/index.php?title=Key_Module&amp;diff=1257</id>
		<title>Key Module</title>
		<link rel="alternate" type="text/html" href="https://solarstrike.net/wiki/index.php?title=Key_Module&amp;diff=1257"/>
				<updated>2017-10-01T19:24:29Z</updated>
		
		<summary type="html">&lt;p&gt;Elverion: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The key module is essentially just a table that holds key/value pairs that match virtual key names to virtual key codes. That is, key.VK_ENTER, a value of 13, represents the Enter key on your keyboard. These values are used in keyboard and mouse input.&lt;br /&gt;
&lt;br /&gt;
You may also dump the entire list of virtual key codes like this:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
for i,v in pairs(key) do&lt;br /&gt;
    print(i, v);&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For your reference, the below table contains all available virtual keys:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;padding: 8px;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| VK_LMOUSE&lt;br /&gt;
|-&lt;br /&gt;
| VK_RMOUSE&lt;br /&gt;
|-&lt;br /&gt;
| VK_CANCEL&lt;br /&gt;
|-&lt;br /&gt;
| VK_MMOUSE&lt;br /&gt;
|-&lt;br /&gt;
| VK_XMOUSE1&lt;br /&gt;
|-&lt;br /&gt;
| VK_XMOUSE2&lt;br /&gt;
|-&lt;br /&gt;
| VK_MOUSEMOVE&lt;br /&gt;
|-&lt;br /&gt;
| VK_MOUSEWHEEL&lt;br /&gt;
|-&lt;br /&gt;
| VK_BACKSPACE&lt;br /&gt;
|-&lt;br /&gt;
| VK_TAB&lt;br /&gt;
|-&lt;br /&gt;
| VK_RETURN&lt;br /&gt;
|-&lt;br /&gt;
| VK_ENTER&lt;br /&gt;
|-&lt;br /&gt;
| VK_SHIFT&lt;br /&gt;
|-&lt;br /&gt;
| VK_CONTROL&lt;br /&gt;
|-&lt;br /&gt;
| VK_ALT&lt;br /&gt;
|-&lt;br /&gt;
| VK_MENU&lt;br /&gt;
|-&lt;br /&gt;
| VK_PAUSE&lt;br /&gt;
|-&lt;br /&gt;
| VK_CAPITAL&lt;br /&gt;
|-&lt;br /&gt;
| VK_CAPSLOCK&lt;br /&gt;
|-&lt;br /&gt;
| VK_ESCAPE&lt;br /&gt;
|-&lt;br /&gt;
| VK_SPACE&lt;br /&gt;
|-&lt;br /&gt;
| VK_PRIOR&lt;br /&gt;
|-&lt;br /&gt;
| VK_PAGEUP&lt;br /&gt;
|-&lt;br /&gt;
| VK_NEXT&lt;br /&gt;
|-&lt;br /&gt;
| VK_PAGEDOWN&lt;br /&gt;
|-&lt;br /&gt;
| VK_END&lt;br /&gt;
|-&lt;br /&gt;
| VK_HOME&lt;br /&gt;
|-&lt;br /&gt;
| VK_LEFT&lt;br /&gt;
|-&lt;br /&gt;
| VK_UP&lt;br /&gt;
|-&lt;br /&gt;
| VK_RIGHT&lt;br /&gt;
|-&lt;br /&gt;
| VK_DOWN&lt;br /&gt;
|-&lt;br /&gt;
| VK_PRINT&lt;br /&gt;
|-&lt;br /&gt;
| VK_PRINTSCREEN&lt;br /&gt;
|-&lt;br /&gt;
| VK_SNAPSHOT&lt;br /&gt;
|-&lt;br /&gt;
| VK_INSERT&lt;br /&gt;
|-&lt;br /&gt;
| VK_DELETE&lt;br /&gt;
|-&lt;br /&gt;
| VK_HELP&lt;br /&gt;
|-&lt;br /&gt;
| VK_0&lt;br /&gt;
|-&lt;br /&gt;
| VK_1&lt;br /&gt;
|-&lt;br /&gt;
| VK_2&lt;br /&gt;
|-&lt;br /&gt;
| VK_3&lt;br /&gt;
|-&lt;br /&gt;
| VK_4&lt;br /&gt;
|-&lt;br /&gt;
| VK_5&lt;br /&gt;
|-&lt;br /&gt;
| VK_6&lt;br /&gt;
|-&lt;br /&gt;
| VK_7&lt;br /&gt;
|-&lt;br /&gt;
| VK_8&lt;br /&gt;
|-&lt;br /&gt;
| VK_9&lt;br /&gt;
|-&lt;br /&gt;
| VK_A&lt;br /&gt;
|-&lt;br /&gt;
| VK_B&lt;br /&gt;
|-&lt;br /&gt;
| VK_C&lt;br /&gt;
|-&lt;br /&gt;
| VK_D&lt;br /&gt;
|-&lt;br /&gt;
| VK_E&lt;br /&gt;
|-&lt;br /&gt;
| VK_F&lt;br /&gt;
|-&lt;br /&gt;
| VK_G&lt;br /&gt;
|-&lt;br /&gt;
| VK_H&lt;br /&gt;
|-&lt;br /&gt;
| VK_I&lt;br /&gt;
|-&lt;br /&gt;
| VK_J&lt;br /&gt;
|-&lt;br /&gt;
| VK_K&lt;br /&gt;
|-&lt;br /&gt;
| VK_L&lt;br /&gt;
|-&lt;br /&gt;
| VK_M&lt;br /&gt;
|-&lt;br /&gt;
| VK_N&lt;br /&gt;
|-&lt;br /&gt;
| VK_O&lt;br /&gt;
|-&lt;br /&gt;
| VK_P&lt;br /&gt;
|-&lt;br /&gt;
| VK_Q&lt;br /&gt;
|-&lt;br /&gt;
| VK_R&lt;br /&gt;
|-&lt;br /&gt;
| VK_S&lt;br /&gt;
|-&lt;br /&gt;
| VK_T&lt;br /&gt;
|-&lt;br /&gt;
| VK_U&lt;br /&gt;
|-&lt;br /&gt;
| VK_V&lt;br /&gt;
|-&lt;br /&gt;
| VK_W&lt;br /&gt;
|-&lt;br /&gt;
| VK_X&lt;br /&gt;
|-&lt;br /&gt;
| VK_Y&lt;br /&gt;
|-&lt;br /&gt;
| VK_Z&lt;br /&gt;
|-&lt;br /&gt;
| VK_LWINDOWS&lt;br /&gt;
|-&lt;br /&gt;
| VK_RWINDOWS&lt;br /&gt;
|-&lt;br /&gt;
| VK_APPS&lt;br /&gt;
|-&lt;br /&gt;
| VK_SLEEP&lt;br /&gt;
|-&lt;br /&gt;
| VK_NUMPAD0&lt;br /&gt;
|-&lt;br /&gt;
| VK_NUMPAD1&lt;br /&gt;
|-&lt;br /&gt;
| VK_NUMPAD2&lt;br /&gt;
|-&lt;br /&gt;
| VK_NUMPAD3&lt;br /&gt;
|-&lt;br /&gt;
| VK_NUMPAD4&lt;br /&gt;
|-&lt;br /&gt;
| VK_NUMPAD5&lt;br /&gt;
|-&lt;br /&gt;
| VK_NUMPAD6&lt;br /&gt;
|-&lt;br /&gt;
| VK_NUMPAD7&lt;br /&gt;
|-&lt;br /&gt;
| VK_NUMPAD8&lt;br /&gt;
|-&lt;br /&gt;
| VK_NUMPAD9&lt;br /&gt;
|-&lt;br /&gt;
| VK_MULTIPLY&lt;br /&gt;
|-&lt;br /&gt;
| VK_ADD&lt;br /&gt;
|-&lt;br /&gt;
| VK_SUBTRACT&lt;br /&gt;
|-&lt;br /&gt;
| VK_DECIMAL&lt;br /&gt;
|-&lt;br /&gt;
| VK_DIVIDE&lt;br /&gt;
|-&lt;br /&gt;
| VK_F1&lt;br /&gt;
|-&lt;br /&gt;
| VK_F2&lt;br /&gt;
|-&lt;br /&gt;
| VK_F3&lt;br /&gt;
|-&lt;br /&gt;
| VK_F4&lt;br /&gt;
|-&lt;br /&gt;
| VK_F5&lt;br /&gt;
|-&lt;br /&gt;
| VK_F6&lt;br /&gt;
|-&lt;br /&gt;
| VK_F7&lt;br /&gt;
|-&lt;br /&gt;
| VK_F8&lt;br /&gt;
|-&lt;br /&gt;
| VK_F9&lt;br /&gt;
|-&lt;br /&gt;
| VK_F10&lt;br /&gt;
|-&lt;br /&gt;
| VK_F11&lt;br /&gt;
|-&lt;br /&gt;
| VK_F12&lt;br /&gt;
|-&lt;br /&gt;
| VK_NUMLOCK&lt;br /&gt;
|-&lt;br /&gt;
| VK_SCROLL&lt;br /&gt;
|-&lt;br /&gt;
| VK_LSHIFT&lt;br /&gt;
|-&lt;br /&gt;
| VK_RSHIFT&lt;br /&gt;
|-&lt;br /&gt;
| VK_LCONTROL&lt;br /&gt;
|-&lt;br /&gt;
| VK_RCONTROL&lt;br /&gt;
|-&lt;br /&gt;
| VK_LMENU&lt;br /&gt;
|-&lt;br /&gt;
| VK_LALT&lt;br /&gt;
|-&lt;br /&gt;
| VK_RMENU&lt;br /&gt;
|-&lt;br /&gt;
| VK_RALT&lt;br /&gt;
|-&lt;br /&gt;
| VK_PLUS&lt;br /&gt;
|-&lt;br /&gt;
| VK_COMMA&lt;br /&gt;
|-&lt;br /&gt;
| VK_PERIOD&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Elverion</name></author>	</entry>

	<entry>
		<id>https://solarstrike.net/wiki/index.php?title=Macro_Module&amp;diff=1256</id>
		<title>Macro Module</title>
		<link rel="alternate" type="text/html" href="https://solarstrike.net/wiki/index.php?title=Macro_Module&amp;diff=1256"/>
				<updated>2017-03-08T03:49:56Z</updated>
		
		<summary type="html">&lt;p&gt;Elverion: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;See also: [[Basic_Info]] for information on how to use these functions.&lt;br /&gt;
&lt;br /&gt;
== init ==&lt;br /&gt;
'''macro.init(...)'''&lt;br /&gt;
&lt;br /&gt;
This is an empty function that will be called once at the start of your script's execution. You should replace this with your own function.&lt;br /&gt;
Any arguments passed to the script execution via command line will be also passed to this function.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== main ==&lt;br /&gt;
'''macro.main(number dt)'''&lt;br /&gt;
&lt;br /&gt;
This is an empty function that will be called once per logic cycle (~1,000 times a second). You should replace this with your own function. The only parameter received is the delta time; the amount of time (in seconds) that has passed since the last call to this function.&lt;br /&gt;
&lt;br /&gt;
You are expected to return 'true' to continue script execution, or 'false' to stop script execution. You do not need to insert any rests to reduce CPU usage; this is already handled for you.&lt;br /&gt;
&lt;br /&gt;
It is recommended that you do ''not'' use any long while loops; the main update function should execute quickly and constantly.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== event ==&lt;br /&gt;
'''macro.event(string eventType, ...)'''&lt;br /&gt;
&lt;br /&gt;
This is an empty function that will be called once for every event that is triggered. You should replace this with your own function.&lt;br /&gt;
&lt;br /&gt;
'eventType' is a string that identifies which event was triggered, and the number and types of extra parameters depends on the event type.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== fireEvent ==&lt;br /&gt;
'''macro.fireEvent(string eventType, ...)'''&lt;br /&gt;
&lt;br /&gt;
Pushes a custom, user-defined event onto the event queue, though there are limitations. Only very basic data types are currently supported (number and string for now). The first argument must be a string and will serve as the event's type/name. You may also pass up to 15 additional strings/numbers.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== getVersion ==&lt;br /&gt;
'''string macro.getVersion()'''&lt;br /&gt;
&lt;br /&gt;
Returns the version as a MAJOR.MINOR.BUILD string format (ie 2.1.4)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== is32bit ==&lt;br /&gt;
'''macro.is32bit()'''&lt;br /&gt;
&lt;br /&gt;
Returns whether or not the MicroMacro instance is 32-bit.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== is64bit ==&lt;br /&gt;
'''macro.is64bit()'''&lt;br /&gt;
&lt;br /&gt;
Returns whether or not the MicroMacro instance is 64-bit.&lt;/div&gt;</summary>
		<author><name>Elverion</name></author>	</entry>

	<entry>
		<id>https://solarstrike.net/wiki/index.php?title=HTTPD_Library&amp;diff=1255</id>
		<title>HTTPD Library</title>
		<link rel="alternate" type="text/html" href="https://solarstrike.net/wiki/index.php?title=HTTPD_Library&amp;diff=1255"/>
				<updated>2016-10-18T01:46:15Z</updated>
		
		<summary type="html">&lt;p&gt;Elverion: /* Creating a HTTPD instance */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;For a step-by-step guide of setting up a simple website using this library, see [https://solarstrike.net/phpBB3/viewtopic.php?f=6&amp;amp;t=6367 this forum post].&lt;br /&gt;
&lt;br /&gt;
= Creating a HTTPD instance =&lt;br /&gt;
'''object Httpd()'''&lt;br /&gt;
&lt;br /&gt;
'''object Httpd(table config)'''&lt;br /&gt;
&lt;br /&gt;
The HTTPD library is optional and the module must be required before use. Next, the Httpd class must be instantiated:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
require('httpd/httpd');&lt;br /&gt;
&lt;br /&gt;
httpd = Httpd();&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Optionally, you may provide config parameters:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
httpd = Httpd({&lt;br /&gt;
   ip            = '0.0.0.0',        -- The IP to bind to; use 0.0.0.0 to accept any connection; default 127.0.0.1&lt;br /&gt;
   port          = 80,               -- The port to bind to; default 8080&lt;br /&gt;
   controllerDir = './Controllers/',  -- Folder to look for controller objects; default /Controllers/&lt;br /&gt;
   viewDir       = './Views/',        -- Folder to look for view files &amp;amp; templates; default /Views/&lt;br /&gt;
   staticDir     = './Static/',       -- Folder to look for static files (images, css, javascript, etc.); default /Static/&lt;br /&gt;
)};&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Supported Methods=&lt;br /&gt;
==httpd:handleEvent()==&lt;br /&gt;
'''boolean httpd:handleEvent(string event, ...)'''&lt;br /&gt;
&lt;br /&gt;
Passes an event off to be handled by the Httpd. Returns true if the event was handled, otherwise false. You should place this in your macro.event() function and check its return result. For example:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function macro.event(e, ...)&lt;br /&gt;
	if( not httpd:handleEvent(e, ...) ) then&lt;br /&gt;
		-- Wasn't handled by the HTTPD, so we might need to handle it some other way&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Routes=&lt;br /&gt;
When initiated, the Httpd expects to be able to load a routes.lua file which is located in the same directory as your calling script(probably main.lua). This routes file should contain calls to the Route object; this object is instantiated for you automatically when you load the HTTPD library. In this file, you will tell the Route object to mount various controllers to URIs via the Route:controller() function. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Supported Methods==&lt;br /&gt;
'''Route:controller(string uriSegment, string controllerName)'''&lt;br /&gt;
&lt;br /&gt;
This function maps the first URI segment of a URL to a specific controller, which must be the exact name of the controller class.&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
Route:controller('/',    'HomeController');  -- This is a special URI; this is your base page, as if you accessed http://127.0.0.1:8080 (assuming default config)&lt;br /&gt;
Route:controller('home', 'HomeController');  -- Just like above, but the home controller is now accessible via / OR /home&lt;br /&gt;
Route:controller('test', 'TestController');  -- Just some other controller for an example&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Elverion</name></author>	</entry>

	<entry>
		<id>https://solarstrike.net/wiki/index.php?title=HTTPD_Library&amp;diff=1254</id>
		<title>HTTPD Library</title>
		<link rel="alternate" type="text/html" href="https://solarstrike.net/wiki/index.php?title=HTTPD_Library&amp;diff=1254"/>
				<updated>2016-09-09T04:35:04Z</updated>
		
		<summary type="html">&lt;p&gt;Elverion: /* Routes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;For a step-by-step guide of setting up a simple website using this library, see [https://solarstrike.net/phpBB3/viewtopic.php?f=6&amp;amp;t=6367 this forum post].&lt;br /&gt;
&lt;br /&gt;
= Creating a HTTPD instance =&lt;br /&gt;
'''object Httpd()'''&lt;br /&gt;
&lt;br /&gt;
'''object Httpd(table config)'''&lt;br /&gt;
&lt;br /&gt;
The HTTPD library is optional and the module must be required before use. Next, the Httpd class must be instantiated:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
require('httpd/httpd');&lt;br /&gt;
&lt;br /&gt;
httpd = Httpd();&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Optionally, you may provide config parameters:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
httpd = Httpd({&lt;br /&gt;
   ip            = '0.0.0.0',        -- The IP to bind to; use 0.0.0.0 to accept any connection; default 127.0.0.1&lt;br /&gt;
   port          = 80,               -- The port to bind to; default 8080&lt;br /&gt;
   controllerDir = '/Controllers/',  -- Folder to look for controller objects; default /Controllers/&lt;br /&gt;
   viewDir       = '/Views/',        -- Folder to look for view files &amp;amp; templates; default /Views/&lt;br /&gt;
   staticDir     = '/Static/',       -- Folder to look for static files (images, css, javascript, etc.); default /Static/&lt;br /&gt;
)};&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Supported Methods=&lt;br /&gt;
==httpd:handleEvent()==&lt;br /&gt;
'''boolean httpd:handleEvent(string event, ...)'''&lt;br /&gt;
&lt;br /&gt;
Passes an event off to be handled by the Httpd. Returns true if the event was handled, otherwise false. You should place this in your macro.event() function and check its return result. For example:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function macro.event(e, ...)&lt;br /&gt;
	if( not httpd:handleEvent(e, ...) ) then&lt;br /&gt;
		-- Wasn't handled by the HTTPD, so we might need to handle it some other way&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Routes=&lt;br /&gt;
When initiated, the Httpd expects to be able to load a routes.lua file which is located in the same directory as your calling script(probably main.lua). This routes file should contain calls to the Route object; this object is instantiated for you automatically when you load the HTTPD library. In this file, you will tell the Route object to mount various controllers to URIs via the Route:controller() function. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Supported Methods==&lt;br /&gt;
'''Route:controller(string uriSegment, string controllerName)'''&lt;br /&gt;
&lt;br /&gt;
This function maps the first URI segment of a URL to a specific controller, which must be the exact name of the controller class.&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
Route:controller('/',    'HomeController');  -- This is a special URI; this is your base page, as if you accessed http://127.0.0.1:8080 (assuming default config)&lt;br /&gt;
Route:controller('home', 'HomeController');  -- Just like above, but the home controller is now accessible via / OR /home&lt;br /&gt;
Route:controller('test', 'TestController');  -- Just some other controller for an example&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Elverion</name></author>	</entry>

	<entry>
		<id>https://solarstrike.net/wiki/index.php?title=HTTPD_Library&amp;diff=1253</id>
		<title>HTTPD Library</title>
		<link rel="alternate" type="text/html" href="https://solarstrike.net/wiki/index.php?title=HTTPD_Library&amp;diff=1253"/>
				<updated>2016-09-09T04:34:21Z</updated>
		
		<summary type="html">&lt;p&gt;Elverion: /* Supported Methods */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;For a step-by-step guide of setting up a simple website using this library, see [https://solarstrike.net/phpBB3/viewtopic.php?f=6&amp;amp;t=6367 this forum post].&lt;br /&gt;
&lt;br /&gt;
= Creating a HTTPD instance =&lt;br /&gt;
'''object Httpd()'''&lt;br /&gt;
&lt;br /&gt;
'''object Httpd(table config)'''&lt;br /&gt;
&lt;br /&gt;
The HTTPD library is optional and the module must be required before use. Next, the Httpd class must be instantiated:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
require('httpd/httpd');&lt;br /&gt;
&lt;br /&gt;
httpd = Httpd();&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Optionally, you may provide config parameters:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
httpd = Httpd({&lt;br /&gt;
   ip            = '0.0.0.0',        -- The IP to bind to; use 0.0.0.0 to accept any connection; default 127.0.0.1&lt;br /&gt;
   port          = 80,               -- The port to bind to; default 8080&lt;br /&gt;
   controllerDir = '/Controllers/',  -- Folder to look for controller objects; default /Controllers/&lt;br /&gt;
   viewDir       = '/Views/',        -- Folder to look for view files &amp;amp; templates; default /Views/&lt;br /&gt;
   staticDir     = '/Static/',       -- Folder to look for static files (images, css, javascript, etc.); default /Static/&lt;br /&gt;
)};&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Supported Methods=&lt;br /&gt;
==httpd:handleEvent()==&lt;br /&gt;
'''boolean httpd:handleEvent(string event, ...)'''&lt;br /&gt;
&lt;br /&gt;
Passes an event off to be handled by the Httpd. Returns true if the event was handled, otherwise false. You should place this in your macro.event() function and check its return result. For example:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function macro.event(e, ...)&lt;br /&gt;
	if( not httpd:handleEvent(e, ...) ) then&lt;br /&gt;
		-- Wasn't handled by the HTTPD, so we might need to handle it some other way&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Routes=&lt;br /&gt;
When initiated, the HTTPD expects to be able to load a routes.lua file which is located in the same directory as your calling script(probably main.lua). This routes file should contain calls to the Route object; this object is instantiated for you automatically when you load the HTTPD library. In this file, you will tell the Route object to mount various controllers to URIs via the Route:controller() function. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Supported Methods==&lt;br /&gt;
'''Route:controller(string uriSegment, string controllerName)'''&lt;br /&gt;
&lt;br /&gt;
This function maps the first URI segment of a URL to a specific controller, which must be the exact name of the controller class.&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
Route:controller('/',    'HomeController');  -- This is a special URI; this is your base page, as if you accessed http://127.0.0.1:8080 (assuming default config)&lt;br /&gt;
Route:controller('home', 'HomeController');  -- Just like above, but the home controller is now accessible via / OR /home&lt;br /&gt;
Route:controller('test', 'TestController');  -- Just some other controller for an example&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Elverion</name></author>	</entry>

	<entry>
		<id>https://solarstrike.net/wiki/index.php?title=HTTPD_Library&amp;diff=1252</id>
		<title>HTTPD Library</title>
		<link rel="alternate" type="text/html" href="https://solarstrike.net/wiki/index.php?title=HTTPD_Library&amp;diff=1252"/>
				<updated>2016-09-09T04:34:03Z</updated>
		
		<summary type="html">&lt;p&gt;Elverion: /* Routes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;For a step-by-step guide of setting up a simple website using this library, see [https://solarstrike.net/phpBB3/viewtopic.php?f=6&amp;amp;t=6367 this forum post].&lt;br /&gt;
&lt;br /&gt;
= Creating a HTTPD instance =&lt;br /&gt;
'''object Httpd()'''&lt;br /&gt;
&lt;br /&gt;
'''object Httpd(table config)'''&lt;br /&gt;
&lt;br /&gt;
The HTTPD library is optional and the module must be required before use. Next, the Httpd class must be instantiated:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
require('httpd/httpd');&lt;br /&gt;
&lt;br /&gt;
httpd = Httpd();&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Optionally, you may provide config parameters:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
httpd = Httpd({&lt;br /&gt;
   ip            = '0.0.0.0',        -- The IP to bind to; use 0.0.0.0 to accept any connection; default 127.0.0.1&lt;br /&gt;
   port          = 80,               -- The port to bind to; default 8080&lt;br /&gt;
   controllerDir = '/Controllers/',  -- Folder to look for controller objects; default /Controllers/&lt;br /&gt;
   viewDir       = '/Views/',        -- Folder to look for view files &amp;amp; templates; default /Views/&lt;br /&gt;
   staticDir     = '/Static/',       -- Folder to look for static files (images, css, javascript, etc.); default /Static/&lt;br /&gt;
)};&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Supported Methods=&lt;br /&gt;
==httpd:handleEvent()==&lt;br /&gt;
'''boolean httpd:handleEvent(string event, ...)'''&lt;br /&gt;
&lt;br /&gt;
Passes an event off to be handled by the Httpd. Returns true if the event was handled, otherwise false. You should place this in your macro.event() function and check its return result. For example:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function macro.event(e, ...)&lt;br /&gt;
	if( not httpd:handleEvent(e, ...) ) then&lt;br /&gt;
		-- Wasn't handled by the HTTPD, so we might need to handle it some other way&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Routes=&lt;br /&gt;
When initiated, the HTTPD expects to be able to load a routes.lua file which is located in the same directory as your calling script(probably main.lua). This routes file should contain calls to the Route object; this object is instantiated for you automatically when you load the HTTPD library. In this file, you will tell the Route object to mount various controllers to URIs via the Route:controller() function. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Supported Methods==&lt;br /&gt;
'''Route:controller(uriSegment, controllerName)'''&lt;br /&gt;
&lt;br /&gt;
This function maps the first URI segment of a URL to a specific controller, which must be the exact name of the controller class.&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
Route:controller('/',    'HomeController');  -- This is a special URI; this is your base page, as if you accessed http://127.0.0.1:8080 (assuming default config)&lt;br /&gt;
Route:controller('home', 'HomeController');  -- Just like above, but the home controller is now accessible via / OR /home&lt;br /&gt;
Route:controller('test', 'TestController');  -- Just some other controller for an example&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Elverion</name></author>	</entry>

	<entry>
		<id>https://solarstrike.net/wiki/index.php?title=HTTPD_Library&amp;diff=1251</id>
		<title>HTTPD Library</title>
		<link rel="alternate" type="text/html" href="https://solarstrike.net/wiki/index.php?title=HTTPD_Library&amp;diff=1251"/>
				<updated>2016-09-09T04:32:31Z</updated>
		
		<summary type="html">&lt;p&gt;Elverion: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;For a step-by-step guide of setting up a simple website using this library, see [https://solarstrike.net/phpBB3/viewtopic.php?f=6&amp;amp;t=6367 this forum post].&lt;br /&gt;
&lt;br /&gt;
= Creating a HTTPD instance =&lt;br /&gt;
'''object Httpd()'''&lt;br /&gt;
&lt;br /&gt;
'''object Httpd(table config)'''&lt;br /&gt;
&lt;br /&gt;
The HTTPD library is optional and the module must be required before use. Next, the Httpd class must be instantiated:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
require('httpd/httpd');&lt;br /&gt;
&lt;br /&gt;
httpd = Httpd();&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Optionally, you may provide config parameters:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
httpd = Httpd({&lt;br /&gt;
   ip            = '0.0.0.0',        -- The IP to bind to; use 0.0.0.0 to accept any connection; default 127.0.0.1&lt;br /&gt;
   port          = 80,               -- The port to bind to; default 8080&lt;br /&gt;
   controllerDir = '/Controllers/',  -- Folder to look for controller objects; default /Controllers/&lt;br /&gt;
   viewDir       = '/Views/',        -- Folder to look for view files &amp;amp; templates; default /Views/&lt;br /&gt;
   staticDir     = '/Static/',       -- Folder to look for static files (images, css, javascript, etc.); default /Static/&lt;br /&gt;
)};&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Supported Methods=&lt;br /&gt;
==httpd:handleEvent()==&lt;br /&gt;
'''boolean httpd:handleEvent(string event, ...)'''&lt;br /&gt;
&lt;br /&gt;
Passes an event off to be handled by the Httpd. Returns true if the event was handled, otherwise false. You should place this in your macro.event() function and check its return result. For example:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function macro.event(e, ...)&lt;br /&gt;
	if( not httpd:handleEvent(e, ...) ) then&lt;br /&gt;
		-- Wasn't handled by the HTTPD, so we might need to handle it some other way&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Routes=&lt;br /&gt;
When initiated, the HTTPD expects to be able to load a routes.lua file which is located in the same directory as your calling script(probably main.lua). This routes file should contain calls to the Route object; this object is instantiated for you automatically when you load the HTTPD library. In this file, you will tell the Route object to mount various controllers to URIs via the Route:controller() function. &lt;br /&gt;
&lt;br /&gt;
'''Route:controller(uriSegment, controllerName)'''&lt;br /&gt;
This function maps the first URI segment of a URL to a specific controller, which must be the exact name of the controller class.&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
Route:controller('/',    'HomeController');  -- This is a special URI; this is your base page, as if you accessed http://127.0.0.1:8080 (assuming default config)&lt;br /&gt;
Route:controller('home', 'HomeController');  -- Just like above, but the home controller is now accessible via / OR /home&lt;br /&gt;
Route:controller('test', 'TestController');  -- Just some other controller for an example&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Elverion</name></author>	</entry>

	<entry>
		<id>https://solarstrike.net/wiki/index.php?title=HTTPD_Library&amp;diff=1250</id>
		<title>HTTPD Library</title>
		<link rel="alternate" type="text/html" href="https://solarstrike.net/wiki/index.php?title=HTTPD_Library&amp;diff=1250"/>
				<updated>2016-09-08T17:10:53Z</updated>
		
		<summary type="html">&lt;p&gt;Elverion: Created page with &amp;quot;= Creating a cache instance = '''object Httpd()'''  '''object Httpd(table config)'''  The HTTPD library is optional and the module must be required before use. Next, the Httpd...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Creating a cache instance =&lt;br /&gt;
'''object Httpd()'''&lt;br /&gt;
&lt;br /&gt;
'''object Httpd(table config)'''&lt;br /&gt;
&lt;br /&gt;
The HTTPD library is optional and the module must be required before use. Next, the Httpd class must be instantiated:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
require('httpd/httpd');&lt;br /&gt;
&lt;br /&gt;
httpd = Httpd();&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Optionally, you may provide config parameters:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
httpd = Httpd({&lt;br /&gt;
   ip            = '0.0.0.0',        -- The IP to bind to; use 0.0.0.0 to accept any connection; default 127.0.0.1&lt;br /&gt;
   port          = 80,               -- The port to bind to; default 8080&lt;br /&gt;
   controllerDir = '/Controllers/',  -- Folder to look for controller objects; default /Controllers/&lt;br /&gt;
   viewDir       = '/Views/',        -- Folder to look for view files &amp;amp; templates; default /Views/&lt;br /&gt;
   staticDir     = '/Static/',       -- Folder to look for static files (images, css, javascript, etc.); default /Static/&lt;br /&gt;
)};&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Elverion</name></author>	</entry>

	<entry>
		<id>https://solarstrike.net/wiki/index.php?title=Cache_Library&amp;diff=1249</id>
		<title>Cache Library</title>
		<link rel="alternate" type="text/html" href="https://solarstrike.net/wiki/index.php?title=Cache_Library&amp;diff=1249"/>
				<updated>2016-09-08T16:42:49Z</updated>
		
		<summary type="html">&lt;p&gt;Elverion: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Creating a cache instance =&lt;br /&gt;
'''object Cache()'''&lt;br /&gt;
&lt;br /&gt;
'''object Cache(string driver)'''&lt;br /&gt;
&lt;br /&gt;
'''object Cache(string driver, table config)'''&lt;br /&gt;
&lt;br /&gt;
The cache library is optional and the module must be required before use. Next, the cache class must be instantiated:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
require('cache/cache');&lt;br /&gt;
&lt;br /&gt;
cache = Cache();&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You may optionally specify which driver you want to use and a table of configuration options (see driver details for more info).&lt;br /&gt;
&lt;br /&gt;
= Drivers =&lt;br /&gt;
Various drivers may be used which determine how cached data will be handled. Each driver may have its own set of pros and cons. For instance the 'memory' driver should give great speed, but may consume a lot of memory, will not be saved to disk (the data disappears once the script terminates), and will not share data between instances. By default, the DB driver is used.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== DB Driver ==&lt;br /&gt;
This will use SQLite internally to handle data. It should give good speed, but the primary benefit is that it will continually save to disk and all data will be shared across multiple instances. Using this driver will result in data being saved to 'cache.db' in the executing script's directory. You can explicitly create an instance of the DB driver by instantiating with the 'db' driver name:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
cache = Cache('db');&lt;br /&gt;
-- OR: --&lt;br /&gt;
local settings = {&lt;br /&gt;
  file = 'mycachefile.db',&lt;br /&gt;
  table = 'cachetable',&lt;br /&gt;
};&lt;br /&gt;
cache = Cache('db', settings);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Optional configurations:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;padding: 8px;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;width: 150px;&amp;quot; | file&lt;br /&gt;
| The filename (and optionally path) of the file to use for storing the database; by default this is 'cache.db'&lt;br /&gt;
|-&lt;br /&gt;
| table&lt;br /&gt;
| The name of the table to use for storing cache data; by default this is 'cache'&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Memory Driver ==&lt;br /&gt;
This will store cached data directly into the Lua engine's memory space. Speed should be great, but storing lots of cached data will require more memory. Cached information should be considered volatile; any cached data will be immediately lost as soon as the script terminates. Additionally, multiple instances of your script will not share data between them. You can explicitly create an instance of the memory driver by instantiating with the 'memory' driver name:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
cache = Cache('memory');&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Example usage =&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
require('cache/cache');&lt;br /&gt;
&lt;br /&gt;
function macro.init()&lt;br /&gt;
  cache = Cache(); -- Use the default cache driver&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function macro.main()&lt;br /&gt;
  -- Returns the existing value, or generates and returns a new one&lt;br /&gt;
  local value = cache:remember('testValue', 1, function() return string.random('alnum', 16) end);&lt;br /&gt;
&lt;br /&gt;
  print(&amp;quot;Cached value:&amp;quot;, value);&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Supported methods =&lt;br /&gt;
&lt;br /&gt;
== Cache:driverName ==&lt;br /&gt;
'''string Cache:driverName()'''&lt;br /&gt;
&lt;br /&gt;
Returns the 'name' of a driver for descriptive use only.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Cache:get ==&lt;br /&gt;
'''value Cache:get(string itemName, defaultValue)'''&lt;br /&gt;
&lt;br /&gt;
Returns a value from the cache if the item exists and is not expired, otherwise returns defaultValue or nil. In most cases you will probably want to either grab a cached value or set and return a new value, and so it is recommended to use [[Cache_Library#Cache:remember|Cache:remember()]] instead.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Cache:has ==&lt;br /&gt;
'''boolean Cache:has(string itemName)'''&lt;br /&gt;
&lt;br /&gt;
Returns true if an item exists and is not expired, otherwise returns false.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Cache:set ==&lt;br /&gt;
'''Cache:set(string itemName, value, minutes)'''&lt;br /&gt;
'''Cache:set(string itemName, value)'''&lt;br /&gt;
&lt;br /&gt;
Sets an item in the cache that will expire in the number of minutes denoted by 'minutes'. If 'minutes' is not given, a value of 1 is assumed. If the item should never expire, pass a negative number for 'minutes.'&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Cache:remember ==&lt;br /&gt;
'''value Cache:remember(string itemName, number minutes, function callback)'''&lt;br /&gt;
&lt;br /&gt;
If the item exists and is not expired, the cached value is returned. Otherwise, the callback function will be called (which should return the value you want to be set) and used as the item's new value which expires in 'minutes' from now; again a negative 'minutes' value indicates it should never expire (or use [[Cache_Library#Cache:rememberForever|Cache:rememberForever()]]). If the callback is used to generate a new value, that value is the one returned by this function.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Cache:rememberForever ==&lt;br /&gt;
'''value Cache:rememberForever(string itemName, function callback)'''&lt;br /&gt;
&lt;br /&gt;
Exactly like [[Cache_Library#Cache:remember|Cache:remember()]], only the item is set to never expire.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== cache:renew ==&lt;br /&gt;
'''Cache:renew(string itemName, number minutes)'''&lt;br /&gt;
&lt;br /&gt;
Updates the expires_at timestamp for an item so that it will expire in 'minutes' from now. If 'minutes' is nil, the item is set to never expire.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Cache:forget ==&lt;br /&gt;
'''Cache:forget(string itemName)'''&lt;br /&gt;
&lt;br /&gt;
Removes an item from the cache, regardless of whether it is still valid, expired, or set to never expire.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Cache:flush ==&lt;br /&gt;
'''Cache:flush()'''&lt;br /&gt;
&lt;br /&gt;
Removes all items from the cache.&lt;/div&gt;</summary>
		<author><name>Elverion</name></author>	</entry>

	<entry>
		<id>https://solarstrike.net/wiki/index.php?title=Manual&amp;diff=1248</id>
		<title>Manual</title>
		<link rel="alternate" type="text/html" href="https://solarstrike.net/wiki/index.php?title=Manual&amp;diff=1248"/>
				<updated>2016-09-08T16:36:20Z</updated>
		
		<summary type="html">&lt;p&gt;Elverion: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''MicroMacro 2.x Online Manual'''&lt;br /&gt;
&lt;br /&gt;
''The MicroMacro 2 branch is currently under development and is subject to change.''&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;padding: 8px;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;width: 150px;&amp;quot; | [[Basic Info]]&lt;br /&gt;
| How things work, configuration options, and other fun stuff.&lt;br /&gt;
|-&lt;br /&gt;
| [[Tutorials &amp;amp; Examples]]&lt;br /&gt;
| Everything you'll want to know to get started writing your own script.&lt;br /&gt;
|-&lt;br /&gt;
| [[Events]]&lt;br /&gt;
| The different events that can be triggered.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| [[Audio Module]]&lt;br /&gt;
| Load and play sounds with OpenAL.&lt;br /&gt;
|-&lt;br /&gt;
| [[Class Module]]&lt;br /&gt;
| Create classes with support for object inheritance.&lt;br /&gt;
|-&lt;br /&gt;
| [[Cli Module]]&lt;br /&gt;
| For interfacing with the console.&lt;br /&gt;
|-&lt;br /&gt;
| [[Filesystem Module]]&lt;br /&gt;
| Functions for dealing with files and directories.&lt;br /&gt;
|-&lt;br /&gt;
| [[Gamepad Module]]&lt;br /&gt;
| Read input from gamepads and joysticks.&lt;br /&gt;
|-&lt;br /&gt;
| [[Global Addon]]&lt;br /&gt;
| Misc functions in global scope.&lt;br /&gt;
|-&lt;br /&gt;
| [[ Hash Module]]&lt;br /&gt;
| Functions for 1-way hashing strings and files.&lt;br /&gt;
|-&lt;br /&gt;
| [[Key Module]]&lt;br /&gt;
| A table containing virtual key codes for use with keyboard and mouse related functions.&lt;br /&gt;
|-&lt;br /&gt;
| [[Keyboard Module]]&lt;br /&gt;
| Read keyboard input or send synthetic key presses.&lt;br /&gt;
|-&lt;br /&gt;
| [[Log Module]]&lt;br /&gt;
| Functions for interfacing with the global log file.&lt;br /&gt;
|-&lt;br /&gt;
| [[Macro Module]]&lt;br /&gt;
| The base module; controls the execution of your scripts.&lt;br /&gt;
|-&lt;br /&gt;
| [[Math Addon]]&lt;br /&gt;
| Additional math functions.&lt;br /&gt;
|-&lt;br /&gt;
| [[Mouse Module]]&lt;br /&gt;
| Read mouse input or send synthetic button presses &amp;amp; movement.&lt;br /&gt;
|-&lt;br /&gt;
| [[Ncurses Module]]&lt;br /&gt;
| Create Ncurses windows and display text in an advanced way.&lt;br /&gt;
|-&lt;br /&gt;
| [[Network Module]]&lt;br /&gt;
| Communicate with overs over standard network sockets&lt;br /&gt;
|-&lt;br /&gt;
| [[Process Module]]&lt;br /&gt;
| Interface with other processes &amp;amp; their allocated memory.&lt;br /&gt;
|-&lt;br /&gt;
| [[SQL Module]]&lt;br /&gt;
| Query SQL relational databases.&lt;br /&gt;
|-&lt;br /&gt;
| [[String Addon]]&lt;br /&gt;
| Additional functions for working with text strings.&lt;br /&gt;
|-&lt;br /&gt;
| [[System Module]]&lt;br /&gt;
| Interfacing with the operating system.&lt;br /&gt;
|-&lt;br /&gt;
| [[Table Addon]]&lt;br /&gt;
| Additional functions for working with tables.&lt;br /&gt;
|-&lt;br /&gt;
| [[Time Module]]&lt;br /&gt;
| Anything dealing with timing &amp;amp; time values.&lt;br /&gt;
|-&lt;br /&gt;
| [[Window Module]]&lt;br /&gt;
| Interface with other windows.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| [[Cache Library]]&lt;br /&gt;
| For caching simple key/value pairs&lt;br /&gt;
|-&lt;br /&gt;
| [[HTTPD Library]]&lt;br /&gt;
| Run a mini-webserver and use your web browser to interface with your scripts&lt;br /&gt;
|-&lt;br /&gt;
| [[Timestamp Class]]&lt;br /&gt;
| A library to aid in dealing with time values&lt;br /&gt;
|-&lt;br /&gt;
| [[Timezone Class]]&lt;br /&gt;
| A library used to lookup timezone offsets&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''MicroMacro 1.x Online Manual'''&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;padding: 8px;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;width: 150px;&amp;quot; | [[Mouse Control]]&lt;br /&gt;
| Functions to control mouse movement and clicks&lt;br /&gt;
|-&lt;br /&gt;
| [[Keyboard Control]]&lt;br /&gt;
| Functions to control keyboard key presses and releases&lt;br /&gt;
|-&lt;br /&gt;
| [[Process Functions]]&lt;br /&gt;
| Functions to open, close, and find processes&lt;br /&gt;
|-&lt;br /&gt;
| [[Memory Functions]]&lt;br /&gt;
| Functions for reading and writing of memory&lt;br /&gt;
|-&lt;br /&gt;
| [[Network Functions]]&lt;br /&gt;
| Functions for sending and receiving data over TCP/IP&lt;br /&gt;
|-&lt;br /&gt;
| [[Filesystem Functions]]&lt;br /&gt;
| Functions for working with files and directories&lt;br /&gt;
|-&lt;br /&gt;
| [[Timer Functions]]&lt;br /&gt;
| Timer-related functions&lt;br /&gt;
|-&lt;br /&gt;
| [[Misc Functions|Misc. Functions]]&lt;br /&gt;
| Misc. functions&lt;br /&gt;
|-&lt;br /&gt;
| [[Sound Functions]]&lt;br /&gt;
| Functions for loading and playing sounds&lt;br /&gt;
|-&lt;br /&gt;
| [[Library]]&lt;br /&gt;
| Various library information &lt;br /&gt;
|-&lt;br /&gt;
| [[Modules]]&lt;br /&gt;
| Information about the standard modules, and how to create your own.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| [[Virtual Keys]]&lt;br /&gt;
| For use with keyboard related functions&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Additional Information==&lt;br /&gt;
*[[MicroMacro License]]&lt;br /&gt;
*[[Lua License]]&lt;/div&gt;</summary>
		<author><name>Elverion</name></author>	</entry>

	<entry>
		<id>https://solarstrike.net/wiki/index.php?title=Cache_Library&amp;diff=1245</id>
		<title>Cache Library</title>
		<link rel="alternate" type="text/html" href="https://solarstrike.net/wiki/index.php?title=Cache_Library&amp;diff=1245"/>
				<updated>2016-08-23T21:28:13Z</updated>
		
		<summary type="html">&lt;p&gt;Elverion: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Creating a cache instance =&lt;br /&gt;
'''object Cache()'''&lt;br /&gt;
&lt;br /&gt;
'''object Cache(string driver)'''&lt;br /&gt;
&lt;br /&gt;
'''object Cache(string driver, table config)'''&lt;br /&gt;
&lt;br /&gt;
The cache library is optional and must be used by requiring the module. Next, the cache class must be instantiated:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
require('cache/cache');&lt;br /&gt;
&lt;br /&gt;
cache = Cache();&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You may optionally specify which driver you want to use and a table of configuration options (see driver details for more info).&lt;br /&gt;
&lt;br /&gt;
= Drivers =&lt;br /&gt;
Various drivers may be used which determine how cached data will be handled. Each driver may have its own set of pros and cons. For instance the 'memory' driver should give great speed, but may consume a lot of memory, will not be saved to disk (the data disappears once the script terminates), and will not share data between instances. By default, the DB driver is used.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== DB Driver ==&lt;br /&gt;
This will use SQLite internally to handle data. It should give good speed, but the primary benefit is that it will continually save to disk and all data will be shared across multiple instances. Using this driver will result in data being saved to 'cache.db' in the executing script's directory. You can explicitly create an instance of the DB driver by instantiating with the 'db' driver name:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
cache = Cache('db');&lt;br /&gt;
-- OR: --&lt;br /&gt;
local settings = {&lt;br /&gt;
  file = 'mycachefile.db',&lt;br /&gt;
  table = 'cachetable',&lt;br /&gt;
};&lt;br /&gt;
cache = Cache('db', settings);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Optional configurations:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;padding: 8px;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;width: 150px;&amp;quot; | file&lt;br /&gt;
| The filename (and optionally path) of the file to use for storing the database; by default this is 'cache.db'&lt;br /&gt;
|-&lt;br /&gt;
| table&lt;br /&gt;
| The name of the table to use for storing cache data; by default this is 'cache'&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Memory Driver ==&lt;br /&gt;
This will store cached data directly into the Lua engine's memory space. Speed should be great, but storing lots of cached data will require more memory. Cached information should be considered volatile; any cached data will be immediately lost as soon as the script terminates. Additionally, multiple instances of your script will not share data between them. You can explicitly create an instance of the memory driver by instantiating with the 'memory' driver name:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
cache = Cache('memory');&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Example usage =&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
require('cache/cache');&lt;br /&gt;
&lt;br /&gt;
function macro.init()&lt;br /&gt;
  cache = Cache(); -- Use the default cache driver&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function macro.main()&lt;br /&gt;
  -- Returns the existing value, or generates and returns a new one&lt;br /&gt;
  local value = cache:remember('testValue', 1, function() return string.random('alnum', 16) end);&lt;br /&gt;
&lt;br /&gt;
  print(&amp;quot;Cached value:&amp;quot;, value);&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Supported methods =&lt;br /&gt;
&lt;br /&gt;
== Cache:driverName ==&lt;br /&gt;
'''string Cache:driverName()'''&lt;br /&gt;
&lt;br /&gt;
Returns the 'name' of a driver for descriptive use only.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Cache:get ==&lt;br /&gt;
'''value Cache:get(string itemName, defaultValue)'''&lt;br /&gt;
&lt;br /&gt;
Returns a value from the cache if the item exists and is not expired, otherwise returns defaultValue or nil. In most cases you will probably want to either grab a cached value or set and return a new value, and so it is recommended to use [[Cache_Library#Cache:remember|Cache:remember()]] instead.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Cache:has ==&lt;br /&gt;
'''boolean Cache:has(string itemName)'''&lt;br /&gt;
&lt;br /&gt;
Returns true if an item exists and is not expired, otherwise returns false.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Cache:set ==&lt;br /&gt;
'''Cache:set(string itemName, value, minutes)'''&lt;br /&gt;
'''Cache:set(string itemName, value)'''&lt;br /&gt;
&lt;br /&gt;
Sets an item in the cache that will expire in the number of minutes denoted by 'minutes'. If 'minutes' is not given, a value of 1 is assumed. If the item should never expire, pass a negative number for 'minutes.'&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Cache:remember ==&lt;br /&gt;
'''value Cache:remember(string itemName, number minutes, function callback)'''&lt;br /&gt;
&lt;br /&gt;
If the item exists and is not expired, the cached value is returned. Otherwise, the callback function will be called (which should return the value you want to be set) and used as the item's new value which expires in 'minutes' from now; again a negative 'minutes' value indicates it should never expire (or use [[Cache_Library#Cache:rememberForever|Cache:rememberForever()]]). If the callback is used to generate a new value, that value is the one returned by this function.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Cache:rememberForever ==&lt;br /&gt;
'''value Cache:rememberForever(string itemName, function callback)'''&lt;br /&gt;
&lt;br /&gt;
Exactly like [[Cache_Library#Cache:remember|Cache:remember()]], only the item is set to never expire.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== cache:renew ==&lt;br /&gt;
'''Cache:renew(string itemName, number minutes)'''&lt;br /&gt;
&lt;br /&gt;
Updates the expires_at timestamp for an item so that it will expire in 'minutes' from now. If 'minutes' is nil, the item is set to never expire.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Cache:forget ==&lt;br /&gt;
'''Cache:forget(string itemName)'''&lt;br /&gt;
&lt;br /&gt;
Removes an item from the cache, regardless of whether it is still valid, expired, or set to never expire.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Cache:flush ==&lt;br /&gt;
'''Cache:flush()'''&lt;br /&gt;
&lt;br /&gt;
Removes all items from the cache.&lt;/div&gt;</summary>
		<author><name>Elverion</name></author>	</entry>

	<entry>
		<id>https://solarstrike.net/wiki/index.php?title=Cache_Library&amp;diff=1244</id>
		<title>Cache Library</title>
		<link rel="alternate" type="text/html" href="https://solarstrike.net/wiki/index.php?title=Cache_Library&amp;diff=1244"/>
				<updated>2016-08-23T20:21:49Z</updated>
		
		<summary type="html">&lt;p&gt;Elverion: /* DB Driver */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Creating a cache instance =&lt;br /&gt;
'''object Cache()'''&lt;br /&gt;
&lt;br /&gt;
'''object Cache(string driver)'''&lt;br /&gt;
&lt;br /&gt;
'''object Cache(string driver, table config)'''&lt;br /&gt;
&lt;br /&gt;
The cache library is optional and must be used by requiring the module. Next, the cache class must be instantiated:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
require('cache/cache');&lt;br /&gt;
&lt;br /&gt;
cache = Cache();&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You may optionally specify which driver you want to use and a table of configuration options (see driver details for more info).&lt;br /&gt;
&lt;br /&gt;
= Drivers =&lt;br /&gt;
Various drivers may be used which determine how cached data will be handled. Each driver may have its own set of pros and cons. For instance the 'memory' driver should give great speed, but may consume a lot of memory, will not be saved to disk (the data disappears once the script terminates), and will not share data between instances. By default, the DB driver is used.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== DB Driver ==&lt;br /&gt;
This will use SQLite internally to handle data. It should give good speed, but the primary benefit is that it will continually save to disk and all data will be shared across multiple instances. Using this driver will result in data being saved to 'cache.db' in the executing script's directory. You can explicitly create an instance of the DB driver by instantiating with the 'db' driver name:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
cache = Cache('db');&lt;br /&gt;
-- OR: --&lt;br /&gt;
local settings = {&lt;br /&gt;
  file = 'mycachefile.db',&lt;br /&gt;
  table = 'cachetable',&lt;br /&gt;
};&lt;br /&gt;
cache = Cache('db', settings);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Optional configurations:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;padding: 8px;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;width: 150px;&amp;quot; | file&lt;br /&gt;
| The filename (and optionally path) of the file to use for storing the database; by default this is 'cache.db'&lt;br /&gt;
|-&lt;br /&gt;
| table&lt;br /&gt;
| The name of the table to use for storing cache data; by default this is 'cache'&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Memory Driver ==&lt;br /&gt;
This will store cached data directly into the Lua engine's memory space. Speed should be great, but storing lots of cached data will require more memory. Cached information should be considered volatile; any cached data will be immediately lost as soon as the script terminates. Additionally, multiple instances of your script will not share data between them. You can explicitly create an instance of the memory driver by instantiating with the 'memory' driver name:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
cache = Cache('memory');&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Example usage =&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
require('cache/cache');&lt;br /&gt;
&lt;br /&gt;
function macro.init()&lt;br /&gt;
  cache = Cache(); -- Use the default cache driver&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function macro.main()&lt;br /&gt;
  -- Returns the existing value, or generates and returns a new one&lt;br /&gt;
  local value = cache:remember('testValue', 1, function() return string.random('alnum', 16) end);&lt;br /&gt;
&lt;br /&gt;
  print(&amp;quot;Cached value:&amp;quot;, value);&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Supported methods =&lt;br /&gt;
&lt;br /&gt;
== Cache:driverName ==&lt;br /&gt;
'''string Cache:driverName()'''&lt;br /&gt;
&lt;br /&gt;
Returns the 'name' of a driver for descriptive use only.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Cache:get ==&lt;br /&gt;
'''value Cache:get(string itemName, defaultValue)'''&lt;br /&gt;
&lt;br /&gt;
Returns a value from the cache if the item exists and is not expired, otherwise returns defaultValue or nil. In most cases you will probably want to either grab a cached value or set and return a new value, and so it is recommended to use [[Cache_Library#Cache:remember|Cache:remember()]] instead.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Cache:has ==&lt;br /&gt;
'''boolean Cache:has(string itemName)'''&lt;br /&gt;
&lt;br /&gt;
Returns true if an item exists and is not expired, otherwise returns false.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Cache:set ==&lt;br /&gt;
'''Cache:set(string itemName, value, minutes)'''&lt;br /&gt;
'''Cache:set(string itemName, value)'''&lt;br /&gt;
&lt;br /&gt;
Sets an item in the cache that will expire in the number of minutes denoted by 'minutes'. If 'minutes' is not given, a value of 1 is assumed. If the item should never expire, pass a negative number for 'minutes.'&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Cache:remember ==&lt;br /&gt;
'''value Cache:remember(string itemName, number minutes, function callback)'''&lt;br /&gt;
&lt;br /&gt;
If the item exists and is not expired, the cached value is returned. Otherwise, the callback function will be called (which should return the value you want to be set) and used as the item's new value which expires in 'minutes' from now; again a negative 'minutes' value indicates it should never expire (or use [[Cache_Library#Cache:rememberForever|Cache:rememberForever()]]). If the callback is used to generate a new value, that value is the one returned by this function.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Cache:rememberForever ==&lt;br /&gt;
'''value Cache:rememberForever(string itemName, function callback)'''&lt;br /&gt;
&lt;br /&gt;
Exactly like [[Cache_Library#Cache:remember|Cache:remember()]], only the item is set to never expire.&lt;br /&gt;
&lt;br /&gt;
== Cache:forget ==&lt;br /&gt;
'''Cache:forget(string itemName)'''&lt;br /&gt;
&lt;br /&gt;
Removes an item from the cache, regardless of whether it is still valid, expired, or set to never expire.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Cache:flush ==&lt;br /&gt;
'''Cache:flush()'''&lt;br /&gt;
&lt;br /&gt;
Removes all items from the cache.&lt;/div&gt;</summary>
		<author><name>Elverion</name></author>	</entry>

	<entry>
		<id>https://solarstrike.net/wiki/index.php?title=Cache_Library&amp;diff=1243</id>
		<title>Cache Library</title>
		<link rel="alternate" type="text/html" href="https://solarstrike.net/wiki/index.php?title=Cache_Library&amp;diff=1243"/>
				<updated>2016-08-23T20:18:05Z</updated>
		
		<summary type="html">&lt;p&gt;Elverion: /* Creating a cache instance */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Creating a cache instance =&lt;br /&gt;
'''object Cache()'''&lt;br /&gt;
&lt;br /&gt;
'''object Cache(string driver)'''&lt;br /&gt;
&lt;br /&gt;
'''object Cache(string driver, table config)'''&lt;br /&gt;
&lt;br /&gt;
The cache library is optional and must be used by requiring the module. Next, the cache class must be instantiated:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
require('cache/cache');&lt;br /&gt;
&lt;br /&gt;
cache = Cache();&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You may optionally specify which driver you want to use and a table of configuration options (see driver details for more info).&lt;br /&gt;
&lt;br /&gt;
= Drivers =&lt;br /&gt;
Various drivers may be used which determine how cached data will be handled. Each driver may have its own set of pros and cons. For instance the 'memory' driver should give great speed, but may consume a lot of memory, will not be saved to disk (the data disappears once the script terminates), and will not share data between instances. By default, the DB driver is used.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== DB Driver ==&lt;br /&gt;
This will use SQLite internally to handle data. It should give good speed, but the primary benefit is that it will continually save to disk and all data will be shared across multiple instances. Using this driver will result in data being saved to 'cache.db' in the executing script's directory. You can explicitly create an instance of the DB driver by instantiating with the 'db' driver name:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
cache = Cache('db');&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Optional configurations:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;padding: 8px;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;width: 150px;&amp;quot; | file&lt;br /&gt;
| The filename (and optionally path) of the file to use for storing the database; by default this is 'cache.db'&lt;br /&gt;
|-&lt;br /&gt;
| table&lt;br /&gt;
| The name of the table to use for storing cache data; by default this is 'cache'&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Memory Driver ==&lt;br /&gt;
This will store cached data directly into the Lua engine's memory space. Speed should be great, but storing lots of cached data will require more memory. Cached information should be considered volatile; any cached data will be immediately lost as soon as the script terminates. Additionally, multiple instances of your script will not share data between them. You can explicitly create an instance of the memory driver by instantiating with the 'memory' driver name:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
cache = Cache('memory');&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Example usage =&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
require('cache/cache');&lt;br /&gt;
&lt;br /&gt;
function macro.init()&lt;br /&gt;
  cache = Cache(); -- Use the default cache driver&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function macro.main()&lt;br /&gt;
  -- Returns the existing value, or generates and returns a new one&lt;br /&gt;
  local value = cache:remember('testValue', 1, function() return string.random('alnum', 16) end);&lt;br /&gt;
&lt;br /&gt;
  print(&amp;quot;Cached value:&amp;quot;, value);&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Supported methods =&lt;br /&gt;
&lt;br /&gt;
== Cache:driverName ==&lt;br /&gt;
'''string Cache:driverName()'''&lt;br /&gt;
&lt;br /&gt;
Returns the 'name' of a driver for descriptive use only.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Cache:get ==&lt;br /&gt;
'''value Cache:get(string itemName, defaultValue)'''&lt;br /&gt;
&lt;br /&gt;
Returns a value from the cache if the item exists and is not expired, otherwise returns defaultValue or nil. In most cases you will probably want to either grab a cached value or set and return a new value, and so it is recommended to use [[Cache_Library#Cache:remember|Cache:remember()]] instead.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Cache:has ==&lt;br /&gt;
'''boolean Cache:has(string itemName)'''&lt;br /&gt;
&lt;br /&gt;
Returns true if an item exists and is not expired, otherwise returns false.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Cache:set ==&lt;br /&gt;
'''Cache:set(string itemName, value, minutes)'''&lt;br /&gt;
'''Cache:set(string itemName, value)'''&lt;br /&gt;
&lt;br /&gt;
Sets an item in the cache that will expire in the number of minutes denoted by 'minutes'. If 'minutes' is not given, a value of 1 is assumed. If the item should never expire, pass a negative number for 'minutes.'&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Cache:remember ==&lt;br /&gt;
'''value Cache:remember(string itemName, number minutes, function callback)'''&lt;br /&gt;
&lt;br /&gt;
If the item exists and is not expired, the cached value is returned. Otherwise, the callback function will be called (which should return the value you want to be set) and used as the item's new value which expires in 'minutes' from now; again a negative 'minutes' value indicates it should never expire (or use [[Cache_Library#Cache:rememberForever|Cache:rememberForever()]]). If the callback is used to generate a new value, that value is the one returned by this function.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Cache:rememberForever ==&lt;br /&gt;
'''value Cache:rememberForever(string itemName, function callback)'''&lt;br /&gt;
&lt;br /&gt;
Exactly like [[Cache_Library#Cache:remember|Cache:remember()]], only the item is set to never expire.&lt;br /&gt;
&lt;br /&gt;
== Cache:forget ==&lt;br /&gt;
'''Cache:forget(string itemName)'''&lt;br /&gt;
&lt;br /&gt;
Removes an item from the cache, regardless of whether it is still valid, expired, or set to never expire.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Cache:flush ==&lt;br /&gt;
'''Cache:flush()'''&lt;br /&gt;
&lt;br /&gt;
Removes all items from the cache.&lt;/div&gt;</summary>
		<author><name>Elverion</name></author>	</entry>

	<entry>
		<id>https://solarstrike.net/wiki/index.php?title=Cache_Library&amp;diff=1242</id>
		<title>Cache Library</title>
		<link rel="alternate" type="text/html" href="https://solarstrike.net/wiki/index.php?title=Cache_Library&amp;diff=1242"/>
				<updated>2016-08-23T20:11:22Z</updated>
		
		<summary type="html">&lt;p&gt;Elverion: /* DB Driver */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Creating a cache instance =&lt;br /&gt;
The cache library is optional and must be used by requiring the module. Next, the cache class must be instantiated:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
require('cache/cache');&lt;br /&gt;
&lt;br /&gt;
cache = Cache();&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Drivers =&lt;br /&gt;
Various drivers may be used which determine how cached data will be handled. Each driver may have its own set of pros and cons. For instance the 'memory' driver should give great speed, but may consume a lot of memory, will not be saved to disk (the data disappears once the script terminates), and will not share data between instances. By default, the DB driver is used.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== DB Driver ==&lt;br /&gt;
This will use SQLite internally to handle data. It should give good speed, but the primary benefit is that it will continually save to disk and all data will be shared across multiple instances. Using this driver will result in data being saved to 'cache.db' in the executing script's directory. You can explicitly create an instance of the DB driver by instantiating with the 'db' driver name:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
cache = Cache('db');&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Optional configurations:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;padding: 8px;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;width: 150px;&amp;quot; | file&lt;br /&gt;
| The filename (and optionally path) of the file to use for storing the database; by default this is 'cache.db'&lt;br /&gt;
|-&lt;br /&gt;
| table&lt;br /&gt;
| The name of the table to use for storing cache data; by default this is 'cache'&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Memory Driver ==&lt;br /&gt;
This will store cached data directly into the Lua engine's memory space. Speed should be great, but storing lots of cached data will require more memory. Cached information should be considered volatile; any cached data will be immediately lost as soon as the script terminates. Additionally, multiple instances of your script will not share data between them. You can explicitly create an instance of the memory driver by instantiating with the 'memory' driver name:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
cache = Cache('memory');&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Example usage =&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
require('cache/cache');&lt;br /&gt;
&lt;br /&gt;
function macro.init()&lt;br /&gt;
  cache = Cache(); -- Use the default cache driver&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function macro.main()&lt;br /&gt;
  -- Returns the existing value, or generates and returns a new one&lt;br /&gt;
  local value = cache:remember('testValue', 1, function() return string.random('alnum', 16) end);&lt;br /&gt;
&lt;br /&gt;
  print(&amp;quot;Cached value:&amp;quot;, value);&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Supported methods =&lt;br /&gt;
&lt;br /&gt;
== Cache:driverName ==&lt;br /&gt;
'''string Cache:driverName()'''&lt;br /&gt;
&lt;br /&gt;
Returns the 'name' of a driver for descriptive use only.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Cache:get ==&lt;br /&gt;
'''value Cache:get(string itemName, defaultValue)'''&lt;br /&gt;
&lt;br /&gt;
Returns a value from the cache if the item exists and is not expired, otherwise returns defaultValue or nil. In most cases you will probably want to either grab a cached value or set and return a new value, and so it is recommended to use [[Cache_Library#Cache:remember|Cache:remember()]] instead.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Cache:has ==&lt;br /&gt;
'''boolean Cache:has(string itemName)'''&lt;br /&gt;
&lt;br /&gt;
Returns true if an item exists and is not expired, otherwise returns false.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Cache:set ==&lt;br /&gt;
'''Cache:set(string itemName, value, minutes)'''&lt;br /&gt;
'''Cache:set(string itemName, value)'''&lt;br /&gt;
&lt;br /&gt;
Sets an item in the cache that will expire in the number of minutes denoted by 'minutes'. If 'minutes' is not given, a value of 1 is assumed. If the item should never expire, pass a negative number for 'minutes.'&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Cache:remember ==&lt;br /&gt;
'''value Cache:remember(string itemName, number minutes, function callback)'''&lt;br /&gt;
&lt;br /&gt;
If the item exists and is not expired, the cached value is returned. Otherwise, the callback function will be called (which should return the value you want to be set) and used as the item's new value which expires in 'minutes' from now; again a negative 'minutes' value indicates it should never expire (or use [[Cache_Library#Cache:rememberForever|Cache:rememberForever()]]). If the callback is used to generate a new value, that value is the one returned by this function.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Cache:rememberForever ==&lt;br /&gt;
'''value Cache:rememberForever(string itemName, function callback)'''&lt;br /&gt;
&lt;br /&gt;
Exactly like [[Cache_Library#Cache:remember|Cache:remember()]], only the item is set to never expire.&lt;br /&gt;
&lt;br /&gt;
== Cache:forget ==&lt;br /&gt;
'''Cache:forget(string itemName)'''&lt;br /&gt;
&lt;br /&gt;
Removes an item from the cache, regardless of whether it is still valid, expired, or set to never expire.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Cache:flush ==&lt;br /&gt;
'''Cache:flush()'''&lt;br /&gt;
&lt;br /&gt;
Removes all items from the cache.&lt;/div&gt;</summary>
		<author><name>Elverion</name></author>	</entry>

	<entry>
		<id>https://solarstrike.net/wiki/index.php?title=Cache_Library&amp;diff=1241</id>
		<title>Cache Library</title>
		<link rel="alternate" type="text/html" href="https://solarstrike.net/wiki/index.php?title=Cache_Library&amp;diff=1241"/>
				<updated>2016-08-19T17:39:26Z</updated>
		
		<summary type="html">&lt;p&gt;Elverion: /* Cache:rememberForever */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Creating a cache instance =&lt;br /&gt;
The cache library is optional and must be used by requiring the module. Next, the cache class must be instantiated:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
require('cache/cache');&lt;br /&gt;
&lt;br /&gt;
cache = Cache();&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Drivers =&lt;br /&gt;
Various drivers may be used which determine how cached data will be handled. Each driver may have its own set of pros and cons. For instance the 'memory' driver should give great speed, but may consume a lot of memory, will not be saved to disk (the data disappears once the script terminates), and will not share data between instances. By default, the DB driver is used.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== DB Driver ==&lt;br /&gt;
This will use SQLite internally to handle data. It should give good speed, but the primary benefit is that it will continually save to disk and all data will be shared across multiple instances. Using this driver will result in data being saved to 'cache.db' in the executing script's directory. You can explicitly create an instance of the DB driver by instantiating with the 'db' driver name:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
cache = Cache('db');&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Memory Driver ==&lt;br /&gt;
This will store cached data directly into the Lua engine's memory space. Speed should be great, but storing lots of cached data will require more memory. Cached information should be considered volatile; any cached data will be immediately lost as soon as the script terminates. Additionally, multiple instances of your script will not share data between them. You can explicitly create an instance of the memory driver by instantiating with the 'memory' driver name:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
cache = Cache('memory');&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Example usage =&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
require('cache/cache');&lt;br /&gt;
&lt;br /&gt;
function macro.init()&lt;br /&gt;
  cache = Cache(); -- Use the default cache driver&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function macro.main()&lt;br /&gt;
  -- Returns the existing value, or generates and returns a new one&lt;br /&gt;
  local value = cache:remember('testValue', 1, function() return string.random('alnum', 16) end);&lt;br /&gt;
&lt;br /&gt;
  print(&amp;quot;Cached value:&amp;quot;, value);&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Supported methods =&lt;br /&gt;
&lt;br /&gt;
== Cache:driverName ==&lt;br /&gt;
'''string Cache:driverName()'''&lt;br /&gt;
&lt;br /&gt;
Returns the 'name' of a driver for descriptive use only.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Cache:get ==&lt;br /&gt;
'''value Cache:get(string itemName, defaultValue)'''&lt;br /&gt;
&lt;br /&gt;
Returns a value from the cache if the item exists and is not expired, otherwise returns defaultValue or nil. In most cases you will probably want to either grab a cached value or set and return a new value, and so it is recommended to use [[Cache_Library#Cache:remember|Cache:remember()]] instead.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Cache:has ==&lt;br /&gt;
'''boolean Cache:has(string itemName)'''&lt;br /&gt;
&lt;br /&gt;
Returns true if an item exists and is not expired, otherwise returns false.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Cache:set ==&lt;br /&gt;
'''Cache:set(string itemName, value, minutes)'''&lt;br /&gt;
'''Cache:set(string itemName, value)'''&lt;br /&gt;
&lt;br /&gt;
Sets an item in the cache that will expire in the number of minutes denoted by 'minutes'. If 'minutes' is not given, a value of 1 is assumed. If the item should never expire, pass a negative number for 'minutes.'&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Cache:remember ==&lt;br /&gt;
'''value Cache:remember(string itemName, number minutes, function callback)'''&lt;br /&gt;
&lt;br /&gt;
If the item exists and is not expired, the cached value is returned. Otherwise, the callback function will be called (which should return the value you want to be set) and used as the item's new value which expires in 'minutes' from now; again a negative 'minutes' value indicates it should never expire (or use [[Cache_Library#Cache:rememberForever|Cache:rememberForever()]]). If the callback is used to generate a new value, that value is the one returned by this function.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Cache:rememberForever ==&lt;br /&gt;
'''value Cache:rememberForever(string itemName, function callback)'''&lt;br /&gt;
&lt;br /&gt;
Exactly like [[Cache_Library#Cache:remember|Cache:remember()]], only the item is set to never expire.&lt;br /&gt;
&lt;br /&gt;
== Cache:forget ==&lt;br /&gt;
'''Cache:forget(string itemName)'''&lt;br /&gt;
&lt;br /&gt;
Removes an item from the cache, regardless of whether it is still valid, expired, or set to never expire.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Cache:flush ==&lt;br /&gt;
'''Cache:flush()'''&lt;br /&gt;
&lt;br /&gt;
Removes all items from the cache.&lt;/div&gt;</summary>
		<author><name>Elverion</name></author>	</entry>

	<entry>
		<id>https://solarstrike.net/wiki/index.php?title=Cache_Library&amp;diff=1240</id>
		<title>Cache Library</title>
		<link rel="alternate" type="text/html" href="https://solarstrike.net/wiki/index.php?title=Cache_Library&amp;diff=1240"/>
				<updated>2016-08-19T05:09:37Z</updated>
		
		<summary type="html">&lt;p&gt;Elverion: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Creating a cache instance =&lt;br /&gt;
The cache library is optional and must be used by requiring the module. Next, the cache class must be instantiated:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
require('cache/cache');&lt;br /&gt;
&lt;br /&gt;
cache = Cache();&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Drivers =&lt;br /&gt;
Various drivers may be used which determine how cached data will be handled. Each driver may have its own set of pros and cons. For instance the 'memory' driver should give great speed, but may consume a lot of memory, will not be saved to disk (the data disappears once the script terminates), and will not share data between instances. By default, the DB driver is used.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== DB Driver ==&lt;br /&gt;
This will use SQLite internally to handle data. It should give good speed, but the primary benefit is that it will continually save to disk and all data will be shared across multiple instances. Using this driver will result in data being saved to 'cache.db' in the executing script's directory. You can explicitly create an instance of the DB driver by instantiating with the 'db' driver name:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
cache = Cache('db');&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Memory Driver ==&lt;br /&gt;
This will store cached data directly into the Lua engine's memory space. Speed should be great, but storing lots of cached data will require more memory. Cached information should be considered volatile; any cached data will be immediately lost as soon as the script terminates. Additionally, multiple instances of your script will not share data between them. You can explicitly create an instance of the memory driver by instantiating with the 'memory' driver name:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
cache = Cache('memory');&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Example usage =&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
require('cache/cache');&lt;br /&gt;
&lt;br /&gt;
function macro.init()&lt;br /&gt;
  cache = Cache(); -- Use the default cache driver&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function macro.main()&lt;br /&gt;
  -- Returns the existing value, or generates and returns a new one&lt;br /&gt;
  local value = cache:remember('testValue', 1, function() return string.random('alnum', 16) end);&lt;br /&gt;
&lt;br /&gt;
  print(&amp;quot;Cached value:&amp;quot;, value);&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Supported methods =&lt;br /&gt;
&lt;br /&gt;
== Cache:driverName ==&lt;br /&gt;
'''string Cache:driverName()'''&lt;br /&gt;
&lt;br /&gt;
Returns the 'name' of a driver for descriptive use only.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Cache:get ==&lt;br /&gt;
'''value Cache:get(string itemName, defaultValue)'''&lt;br /&gt;
&lt;br /&gt;
Returns a value from the cache if the item exists and is not expired, otherwise returns defaultValue or nil. In most cases you will probably want to either grab a cached value or set and return a new value, and so it is recommended to use [[Cache_Library#Cache:remember|Cache:remember()]] instead.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Cache:has ==&lt;br /&gt;
'''boolean Cache:has(string itemName)'''&lt;br /&gt;
&lt;br /&gt;
Returns true if an item exists and is not expired, otherwise returns false.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Cache:set ==&lt;br /&gt;
'''Cache:set(string itemName, value, minutes)'''&lt;br /&gt;
'''Cache:set(string itemName, value)'''&lt;br /&gt;
&lt;br /&gt;
Sets an item in the cache that will expire in the number of minutes denoted by 'minutes'. If 'minutes' is not given, a value of 1 is assumed. If the item should never expire, pass a negative number for 'minutes.'&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Cache:remember ==&lt;br /&gt;
'''value Cache:remember(string itemName, number minutes, function callback)'''&lt;br /&gt;
&lt;br /&gt;
If the item exists and is not expired, the cached value is returned. Otherwise, the callback function will be called (which should return the value you want to be set) and used as the item's new value which expires in 'minutes' from now; again a negative 'minutes' value indicates it should never expire (or use [[Cache_Library#Cache:rememberForever|Cache:rememberForever()]]). If the callback is used to generate a new value, that value is the one returned by this function.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Cache:rememberForever ==&lt;br /&gt;
'''Cache:rememberForever(string itemName, function callback)'''&lt;br /&gt;
&lt;br /&gt;
Exactly like [[Cache_Library#Cache:remember|Cache:remember()]], only the item is set to never expire.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Cache:forget ==&lt;br /&gt;
'''Cache:forget(string itemName)'''&lt;br /&gt;
&lt;br /&gt;
Removes an item from the cache, regardless of whether it is still valid, expired, or set to never expire.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Cache:flush ==&lt;br /&gt;
'''Cache:flush()'''&lt;br /&gt;
&lt;br /&gt;
Removes all items from the cache.&lt;/div&gt;</summary>
		<author><name>Elverion</name></author>	</entry>

	<entry>
		<id>https://solarstrike.net/wiki/index.php?title=Cache_Library&amp;diff=1239</id>
		<title>Cache Library</title>
		<link rel="alternate" type="text/html" href="https://solarstrike.net/wiki/index.php?title=Cache_Library&amp;diff=1239"/>
				<updated>2016-08-19T05:07:45Z</updated>
		
		<summary type="html">&lt;p&gt;Elverion: /* Cache:rememberForever */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Creating a cache instance =&lt;br /&gt;
The cache library is optional and must be used by requiring the module. Next, the cache class must be instantiated:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
require('cache/cache');&lt;br /&gt;
&lt;br /&gt;
cache = Cache();&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Drivers =&lt;br /&gt;
Various drivers may be used which determine how cached data will be handled. Each driver may have its own set of pros and cons. For instance the 'memory' driver should give great speed, but may consume a lot of memory, will not be saved to disk (the data disappears once the script terminates), and will not share data between instances. By default, the DB driver is used.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== DB Driver ==&lt;br /&gt;
This will use SQLite internally to handle data. It should give good speed, but the primary benefit is that it will continually save to disk and all data will be shared across multiple instances. Using this driver will result in data being saved to 'cache.db' in the executing script's directory. You can explicitly create an instance of the DB driver by instantiating with the 'db' driver name:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
cache = Cache('db');&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Memory Driver ==&lt;br /&gt;
This will store cached data directly into the Lua engine's memory space. Speed should be great, but storing lots of cached data will require more memory. Cached information should be considered volatile; any cached data will be immediately lost as soon as the script terminates. Additionally, multiple instances of your script will not share data between them. You can explicitly create an instance of the memory driver by instantiating with the 'memory' driver name:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
cache = Cache('memory');&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Example usage =&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
require('cache/cache');&lt;br /&gt;
&lt;br /&gt;
function macro.init()&lt;br /&gt;
  cache = Cache(); -- Use the default cache driver&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function macro.main()&lt;br /&gt;
  -- Returns the existing value, or generates and returns a new one&lt;br /&gt;
  local value = cache:remember('testValue', 1, function() return string.random('alnum', 16) end);&lt;br /&gt;
&lt;br /&gt;
  print(&amp;quot;Cached value:&amp;quot;, value);&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Supported methods =&lt;br /&gt;
&lt;br /&gt;
== Cache:driverName ==&lt;br /&gt;
'''string Cache:driverName()'''&lt;br /&gt;
&lt;br /&gt;
Returns the 'name' of a driver for descriptive use only.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Cache:get ==&lt;br /&gt;
'''value Cache:get(string itemName, defaultValue)'''&lt;br /&gt;
&lt;br /&gt;
Returns a value from the cache if the item exists and is not expired, otherwise returns defaultValue or nil. In most cases you will probably want to either grab a cached value or set and return a new value, and so it is recommended to use [[Cache_Library#Cache:remember|Cache:remember()]] instead.&lt;br /&gt;
&lt;br /&gt;
== Cache:has ==&lt;br /&gt;
'''boolean Cache:has(string itemName)'''&lt;br /&gt;
&lt;br /&gt;
Returns true if an item exists and is not expired, otherwise returns false.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Cache:set ==&lt;br /&gt;
'''Cache:set(string itemName, value, minutes)'''&lt;br /&gt;
'''Cache:set(string itemName, value)'''&lt;br /&gt;
&lt;br /&gt;
Sets an item in the cache that will expire in the number of minutes denoted by 'minutes'. If 'minutes' is not given, a value of 1 is assumed. If the item should never expire, pass a negative number for 'minutes.'&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Cache:remember ==&lt;br /&gt;
'''value Cache:remember(string itemName, number minutes, function callback)'''&lt;br /&gt;
&lt;br /&gt;
If the item exists and is not expired, the cached value is returned. Otherwise, the callback function will be called (which should return the value you want to be set) and used as the item's new value which expires in 'minutes' from now; again a negative 'minutes' value indicates it should never expire (or use [[Cache_Library#Cache:rememberForever|Cache:rememberForever()]]). If the callback is used to generate a new value, that value is the one returned by this function.&lt;br /&gt;
&lt;br /&gt;
== Cache:rememberForever ==&lt;br /&gt;
'''Cache:rememberForever(string itemName, function callback)'''&lt;br /&gt;
&lt;br /&gt;
Exactly like [[Cache_Library#Cache:remember|Cache:remember()]], only the item is set to never expire.&lt;br /&gt;
&lt;br /&gt;
== Cache:forget ==&lt;br /&gt;
'''Cache:forget(string itemName)'''&lt;br /&gt;
&lt;br /&gt;
Removes an item from the cache, regardless of whether it is still valid, expired, or set to never expire.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Cache:flush ==&lt;br /&gt;
'''Cache:flush()'''&lt;br /&gt;
&lt;br /&gt;
Removes all items from the cache.&lt;/div&gt;</summary>
		<author><name>Elverion</name></author>	</entry>

	<entry>
		<id>https://solarstrike.net/wiki/index.php?title=Cache_Library&amp;diff=1238</id>
		<title>Cache Library</title>
		<link rel="alternate" type="text/html" href="https://solarstrike.net/wiki/index.php?title=Cache_Library&amp;diff=1238"/>
				<updated>2016-08-19T05:07:04Z</updated>
		
		<summary type="html">&lt;p&gt;Elverion: /* Cache:remember */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Creating a cache instance =&lt;br /&gt;
The cache library is optional and must be used by requiring the module. Next, the cache class must be instantiated:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
require('cache/cache');&lt;br /&gt;
&lt;br /&gt;
cache = Cache();&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Drivers =&lt;br /&gt;
Various drivers may be used which determine how cached data will be handled. Each driver may have its own set of pros and cons. For instance the 'memory' driver should give great speed, but may consume a lot of memory, will not be saved to disk (the data disappears once the script terminates), and will not share data between instances. By default, the DB driver is used.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== DB Driver ==&lt;br /&gt;
This will use SQLite internally to handle data. It should give good speed, but the primary benefit is that it will continually save to disk and all data will be shared across multiple instances. Using this driver will result in data being saved to 'cache.db' in the executing script's directory. You can explicitly create an instance of the DB driver by instantiating with the 'db' driver name:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
cache = Cache('db');&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Memory Driver ==&lt;br /&gt;
This will store cached data directly into the Lua engine's memory space. Speed should be great, but storing lots of cached data will require more memory. Cached information should be considered volatile; any cached data will be immediately lost as soon as the script terminates. Additionally, multiple instances of your script will not share data between them. You can explicitly create an instance of the memory driver by instantiating with the 'memory' driver name:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
cache = Cache('memory');&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Example usage =&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
require('cache/cache');&lt;br /&gt;
&lt;br /&gt;
function macro.init()&lt;br /&gt;
  cache = Cache(); -- Use the default cache driver&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function macro.main()&lt;br /&gt;
  -- Returns the existing value, or generates and returns a new one&lt;br /&gt;
  local value = cache:remember('testValue', 1, function() return string.random('alnum', 16) end);&lt;br /&gt;
&lt;br /&gt;
  print(&amp;quot;Cached value:&amp;quot;, value);&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Supported methods =&lt;br /&gt;
&lt;br /&gt;
== Cache:driverName ==&lt;br /&gt;
'''string Cache:driverName()'''&lt;br /&gt;
&lt;br /&gt;
Returns the 'name' of a driver for descriptive use only.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Cache:get ==&lt;br /&gt;
'''value Cache:get(string itemName, defaultValue)'''&lt;br /&gt;
&lt;br /&gt;
Returns a value from the cache if the item exists and is not expired, otherwise returns defaultValue or nil. In most cases you will probably want to either grab a cached value or set and return a new value, and so it is recommended to use [[Cache_Library#Cache:remember|Cache:remember()]] instead.&lt;br /&gt;
&lt;br /&gt;
== Cache:has ==&lt;br /&gt;
'''boolean Cache:has(string itemName)'''&lt;br /&gt;
&lt;br /&gt;
Returns true if an item exists and is not expired, otherwise returns false.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Cache:set ==&lt;br /&gt;
'''Cache:set(string itemName, value, minutes)'''&lt;br /&gt;
'''Cache:set(string itemName, value)'''&lt;br /&gt;
&lt;br /&gt;
Sets an item in the cache that will expire in the number of minutes denoted by 'minutes'. If 'minutes' is not given, a value of 1 is assumed. If the item should never expire, pass a negative number for 'minutes.'&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Cache:remember ==&lt;br /&gt;
'''value Cache:remember(string itemName, number minutes, function callback)'''&lt;br /&gt;
&lt;br /&gt;
If the item exists and is not expired, the cached value is returned. Otherwise, the callback function will be called (which should return the value you want to be set) and used as the item's new value which expires in 'minutes' from now; again a negative 'minutes' value indicates it should never expire (or use [[Cache_Library#Cache:rememberForever|Cache:rememberForever()]]). If the callback is used to generate a new value, that value is the one returned by this function.&lt;br /&gt;
&lt;br /&gt;
== Cache:rememberForever ==&lt;br /&gt;
'''Cache:rememberForever(string itemName, function callback)'''&lt;br /&gt;
&lt;br /&gt;
Exactly like Cache:remember(), only the item is set to never expire.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Cache:forget ==&lt;br /&gt;
'''Cache:forget(string itemName)'''&lt;br /&gt;
&lt;br /&gt;
Removes an item from the cache, regardless of whether it is still valid, expired, or set to never expire.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Cache:flush ==&lt;br /&gt;
'''Cache:flush()'''&lt;br /&gt;
&lt;br /&gt;
Removes all items from the cache.&lt;/div&gt;</summary>
		<author><name>Elverion</name></author>	</entry>

	</feed>