From 98f6266ad11821eb440f0266098a5bcf84605f71 Mon Sep 17 00:00:00 2001 From: Cooldude2606 Date: Wed, 29 May 2019 21:33:09 +0100 Subject: [PATCH] Removed outdated docs --- doc/index.html | 144 ---- doc/ldoc.css | 303 ------- doc/modules/ExpGamingCore.Commands.html | 401 --------- doc/modules/ExpGamingCore.Gui.Center.html | 337 -------- doc/modules/ExpGamingCore.Gui.Inputs.html | 498 ----------- doc/modules/ExpGamingCore.Gui.Left.html | 240 ------ doc/modules/ExpGamingCore.Gui.Popup.html | 185 ----- doc/modules/ExpGamingCore.Gui.Test.html | 144 ---- doc/modules/ExpGamingCore.Gui.Toolbar.html | 190 ----- doc/modules/ExpGamingCore.Gui.html | 366 -------- doc/modules/ExpGamingCore.Ranking.html | 883 -------------------- doc/modules/ExpGamingCore.Server.html | 848 ------------------- doc/modules/ExpGamingCore.Sync.html | 820 ------------------ doc/modules/ExpGamingLib.html | 672 --------------- doc/modules/FSM.html | 455 ---------- doc/modules/StdLib.Color.html | 561 ------------- doc/modules/StdLib.Game.html | 222 ----- doc/modules/StdLib.String.html | 302 ------- doc/modules/StdLib.Table.html | 922 --------------------- doc/modules/StdLib.Time.html | 139 ---- 20 files changed, 8632 deletions(-) delete mode 100644 doc/index.html delete mode 100644 doc/ldoc.css delete mode 100644 doc/modules/ExpGamingCore.Commands.html delete mode 100644 doc/modules/ExpGamingCore.Gui.Center.html delete mode 100644 doc/modules/ExpGamingCore.Gui.Inputs.html delete mode 100644 doc/modules/ExpGamingCore.Gui.Left.html delete mode 100644 doc/modules/ExpGamingCore.Gui.Popup.html delete mode 100644 doc/modules/ExpGamingCore.Gui.Test.html delete mode 100644 doc/modules/ExpGamingCore.Gui.Toolbar.html delete mode 100644 doc/modules/ExpGamingCore.Gui.html delete mode 100644 doc/modules/ExpGamingCore.Ranking.html delete mode 100644 doc/modules/ExpGamingCore.Server.html delete mode 100644 doc/modules/ExpGamingCore.Sync.html delete mode 100644 doc/modules/ExpGamingLib.html delete mode 100644 doc/modules/FSM.html delete mode 100644 doc/modules/StdLib.Color.html delete mode 100644 doc/modules/StdLib.Game.html delete mode 100644 doc/modules/StdLib.String.html delete mode 100644 doc/modules/StdLib.Table.html delete mode 100644 doc/modules/StdLib.Time.html diff --git a/doc/index.html b/doc/index.html deleted file mode 100644 index f5d24cda..00000000 --- a/doc/index.html +++ /dev/null @@ -1,144 +0,0 @@ - - - - - Reference - - - - -
- -
- -
-
-
- - -
- - - - - - -
- - - -

Modules

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FSMFactorio Softmod Manager
ExpGamingCore.CommandA full ranking system for factorio.
ExpGamingCore.GuiAdds a objective version to custom guis.
ExpGamingCore.Gui.CenterAdds a uniform preset for guis in the center of the screen which allow for different tabs to be opened
ExpGamingCore.Gui.InputsAdds a clean way of making new inputs for a gui allowing for sliders and text inputs to be hanndleded with custom events
ExpGamingCore.Gui.LeftAdds a organiser for left gui ellements which will automaticaly update there information and have open requirements
ExpGamingCore.Gui.PopupAdds a location for popups which can be dismissed by a player and created from other scripts
ExpGamingCore.Gui.TestUsed to test all gui elements and parts can be used in game via Gui.test()
ExpGamingCore.Gui.ToolbarAdds a toolbar to the top left of the screen
ExpGamingCore.RoleA full ranking system for factorio.
ExpGamingCore.ServerAdds a thread system and event listening and a admin bypass (recommend to disable /c and use optional /interface)
ExpGamingCore.SyncAllows syncing with an outside server and info panle.
ExpGamingLibAdds some common functions used though out all ExpGaming modules
StdLib.ColorA defines module for retrieving colors by name.
StdLib.GameThe game module.
StdLib.StringExtends Lua 5.2 string.
StdLib.TableExtends Lua 5.2 table.
StdLib.TimeA defines module for retrieving the number of ticks in 1 unit of time.
- -
-
-
-generated by LDoc 1.4.6 -Last updated 2018-06-07 12:58:23 -
-
- - diff --git a/doc/ldoc.css b/doc/ldoc.css deleted file mode 100644 index 52c4ad2b..00000000 --- a/doc/ldoc.css +++ /dev/null @@ -1,303 +0,0 @@ -/* BEGIN RESET - -Copyright (c) 2010, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.com/yui/license.html -version: 2.8.2r1 -*/ -html { - color: #000; - background: #FFF; -} -body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,button,textarea,p,blockquote,th,td { - margin: 0; - padding: 0; -} -table { - border-collapse: collapse; - border-spacing: 0; -} -fieldset,img { - border: 0; -} -address,caption,cite,code,dfn,em,strong,th,var,optgroup { - font-style: inherit; - font-weight: inherit; -} -del,ins { - text-decoration: none; -} -li { - margin-left: 20px; -} -caption,th { - text-align: left; -} -h1,h2,h3,h4,h5,h6 { - font-size: 100%; - font-weight: bold; -} -q:before,q:after { - content: ''; -} -abbr,acronym { - border: 0; - font-variant: normal; -} -sup { - vertical-align: baseline; -} -sub { - vertical-align: baseline; -} -legend { - color: #000; -} -input,button,textarea,select,optgroup,option { - font-family: inherit; - font-size: inherit; - font-style: inherit; - font-weight: inherit; -} -input,button,textarea,select {*font-size:100%; -} -/* END RESET */ - -body { - margin-left: 1em; - margin-right: 1em; - font-family: arial, helvetica, geneva, sans-serif; - background-color: #ffffff; margin: 0px; -} - -code, tt { font-family: monospace; font-size: 1.1em; } -span.parameter { font-family:monospace; } -span.parameter:after { content:":"; } -span.types:before { content:"("; } -span.types:after { content:")"; } -.type { font-weight: bold; font-style:italic } - -body, p, td, th { font-size: .95em; line-height: 1.2em;} - -p, ul { margin: 10px 0 0 0px;} - -strong { font-weight: bold;} - -em { font-style: italic;} - -h1 { - font-size: 1.5em; - margin: 20px 0 20px 0; -} -h2, h3, h4 { margin: 15px 0 10px 0; } -h2 { font-size: 1.25em; } -h3 { font-size: 1.15em; } -h4 { font-size: 1.06em; } - -a:link { font-weight: bold; color: #004080; text-decoration: none; } -a:visited { font-weight: bold; color: #006699; text-decoration: none; } -a:link:hover { text-decoration: underline; } - -hr { - color:#cccccc; - background: #00007f; - height: 1px; -} - -blockquote { margin-left: 3em; } - -ul { list-style-type: disc; } - -p.name { - font-family: "Andale Mono", monospace; - padding-top: 1em; -} - -pre { - background-color: rgb(245, 245, 245); - border: 1px solid #C0C0C0; /* silver */ - padding: 10px; - margin: 10px 0 10px 0; - overflow: auto; - font-family: "Andale Mono", monospace; -} - -pre.example { - font-size: .85em; -} - -table.index { border: 1px #00007f; } -table.index td { text-align: left; vertical-align: top; } - -#container { - margin-left: 1em; - margin-right: 1em; - background-color: #f0f0f0; -} - -#product { - text-align: center; - border-bottom: 1px solid #cccccc; - background-color: #ffffff; -} - -#product big { - font-size: 2em; -} - -#main { - background-color: #f0f0f0; - border-left: 2px solid #cccccc; -} - -#navigation { - float: left; - width: 14em; - vertical-align: top; - background-color: #f0f0f0; - overflow: visible; -} - -#navigation h2 { - background-color:#e7e7e7; - font-size:1.1em; - color:#000000; - text-align: left; - padding:0.2em; - border-top:1px solid #dddddd; - border-bottom:1px solid #dddddd; -} - -#navigation ul -{ - font-size:1em; - list-style-type: none; - margin: 1px 1px 10px 1px; -} - -#navigation li { - text-indent: -1em; - display: block; - margin: 3px 0px 0px 22px; -} - -#navigation li li a { - margin: 0px 3px 0px -1em; -} - -#content { - margin-left: 14em; - padding: 1em; - width: 700px; - border-left: 2px solid #cccccc; - border-right: 2px solid #cccccc; - background-color: #ffffff; -} - -#about { - clear: both; - padding: 5px; - border-top: 2px solid #cccccc; - background-color: #ffffff; -} - -@media print { - body { - font: 12pt "Times New Roman", "TimeNR", Times, serif; - } - a { font-weight: bold; color: #004080; text-decoration: underline; } - - #main { - background-color: #ffffff; - border-left: 0px; - } - - #container { - margin-left: 2%; - margin-right: 2%; - background-color: #ffffff; - } - - #content { - padding: 1em; - background-color: #ffffff; - } - - #navigation { - display: none; - } - pre.example { - font-family: "Andale Mono", monospace; - font-size: 10pt; - page-break-inside: avoid; - } -} - -table.module_list { - border-width: 1px; - border-style: solid; - border-color: #cccccc; - border-collapse: collapse; -} -table.module_list td { - border-width: 1px; - padding: 3px; - border-style: solid; - border-color: #cccccc; -} -table.module_list td.name { background-color: #f0f0f0; min-width: 200px; } -table.module_list td.summary { width: 100%; } - - -table.function_list { - border-width: 1px; - border-style: solid; - border-color: #cccccc; - border-collapse: collapse; -} -table.function_list td { - border-width: 1px; - padding: 3px; - border-style: solid; - border-color: #cccccc; -} -table.function_list td.name { background-color: #f0f0f0; min-width: 200px; } -table.function_list td.summary { width: 100%; } - -ul.nowrap { - overflow:auto; - white-space:nowrap; -} - -dl.table dt, dl.function dt {border-top: 1px solid #ccc; padding-top: 1em;} -dl.table dd, dl.function dd {padding-bottom: 1em; margin: 10px 0 0 20px;} -dl.table h3, dl.function h3 {font-size: .95em;} - -/* stop sublists from having initial vertical space */ -ul ul { margin-top: 0px; } -ol ul { margin-top: 0px; } -ol ol { margin-top: 0px; } -ul ol { margin-top: 0px; } - -/* make the target distinct; helps when we're navigating to a function */ -a:target + * { - background-color: #FF9; -} - - -/* styles for prettification of source */ -pre .comment { color: #558817; } -pre .constant { color: #a8660d; } -pre .escape { color: #844631; } -pre .keyword { color: #aa5050; font-weight: bold; } -pre .library { color: #0e7c6b; } -pre .marker { color: #512b1e; background: #fedc56; font-weight: bold; } -pre .string { color: #8080ff; } -pre .number { color: #f8660d; } -pre .operator { color: #2239a8; font-weight: bold; } -pre .preprocessor, pre .prepro { color: #a33243; } -pre .global { color: #800080; } -pre .user-keyword { color: #800080; } -pre .prompt { color: #558817; } -pre .url { color: #272fc2; text-decoration: underline; } - diff --git a/doc/modules/ExpGamingCore.Commands.html b/doc/modules/ExpGamingCore.Commands.html deleted file mode 100644 index 14672de7..00000000 --- a/doc/modules/ExpGamingCore.Commands.html +++ /dev/null @@ -1,401 +0,0 @@ - - - - - Reference - - - - -
- -
- -
-
-
- - -
- - - - - - -
- -

Module ExpGamingCore.Command

-

A full ranking system for factorio.

-

-

Info:

-
    -
  • License: https://github.com/explosivegaming/scenario/blob/master/LICENSE
  • -
  • Author: Cooldude2606
  • -
- - -

Functions

- - - - - - - - - - - - - - - - - -
format_inputs (command)Returns the inputs of this command as a formated string
validate_args (event)Used to validate the arguments of a command, will understand strings with "" as a single param else spaces divede the params
get_commands (player)Used to return all the commands a player can use
add_command (name[, description='No Description'][, inputs=an infite string], callback)Used to define commands
-

Tables

- - - - - -
validateCollection of funcations that can be used to validate inputs
-

Fields

- - - - - - - - - -
errorUsed as an error constant for validation
dataIndex of all command data
- -
-
- - -

Functions

- -
-
- - format_inputs (command) -
-
- Returns the inputs of this command as a formated string - - -

Parameters:

-
    -
  • command - string, table or event - the command to get the inputs of -
  • -
- -

Returns:

-
    - - string - the formated string for the inputs -
- - - -

Usage:

-
    -
    commands.format_inputs('interface') -- returns <code> (if you have ExpGamingCore.Server)
    -
- -
-
- - validate_args (event) -
-
- Used to validate the arguments of a command, will understand strings with "" as a single param else spaces divede the params - - -

Parameters:

-
    -
  • event - table - this is the event created by add_command not on_console_command -
  • -
- -

Returns:

-
    - - string - the error that happend while parsing the args -
-

Or

-
    - - table - the args for this command -
-

Or

-
    - - command.error -
- - - -

Usage:

-
    -
    commands.validate_args(event) -- returns args table
    -
- -
-
- - get_commands (player) -
-
- Used to return all the commands a player can use - - -

Parameters:

-
    -
  • player - index, name or player - the player to test as -
  • -
- -

Returns:

-
    - - table - a table containg all the commands the player can use -
- - - -

Usage:

-
    -
    get_commands(1) -- return table of command data for each command that the player can use
    -
- -
-
- - add_command (name[, description='No Description'][, inputs=an infite string], callback) -
-
- Used to define commands - - -

Parameters:

-
    -
  • name - string - the name of the command -
  • -
  • description - string - the description of the command - (default 'No Description') -
  • -
  • inputs - table - a table of the inputs to be used, last index being true makes the last parameter open ended (longer than one word) - (default an infite string) -
  • -
  • callback - function - the function to call on the event -
  • -
- - - - -

Usage:

-
    -
    --see examples in file
    -
- -
-
-

Tables

- -
-
- - validate -
-
- Collection of funcations that can be used to validate inputs - - -

Fields:

-
    -
  • __comment - replace _ with - the ldoc did not like me using - in the names -
  • -
  • string - basicly does nothing but a type filed is required -
  • -
  • string_inf - same as string but is infite in length, must be last arg -
  • -
  • string_len - same as string but can define a max lengh -
  • -
  • number - converts the input into a number -
  • -
  • number_int - conerts the input to a number and floors it -
  • -
  • number_range - allows a number in a range after it has been floored min < math.floor(X) <= max -
  • -
  • number_range - allows a number in a range after it has been floored min < math.floor(X) <= max -
  • -
  • player - converts the input into a valid player -
  • -
  • player_online - converts the input to a player if the player is online -
  • -
  • player_alive - converts the input to a player if the player is online and alive -
  • -
  • player_rank - -online converts the input to a player if the player is a lower rank than the user and online -
  • -
  • player_rank - -online converts the input to a player if the player is a lower rank than the user and online -
  • -
  • player_rank_alive - converts the input to a player if the player is a lower rank than the user and online and alive -
  • -
  • type - string - the type that the value should be -
  • -
  • value - the value that will be tested -
  • -
  • ... - any other data that can be passed to the function -
  • -
- - - - -

Usage:

-
    -
    commands.validate[type](value,event,...)
    -
- -
-
-

Fields

- -
-
- - error -
-
- Used as an error constant for validation - - - - - - -

Usage:

-
    -
  • return commands.error, 'err message'
  • -
  • return commands.error('err message')
  • -
- -
-
- - data -
-
- Index of all command data - - -
    -
  • key - string, table or event - the command that will be returned: string is the name, table is the command data, event is event from add_command -
  • -
- - - - -

Usage:

-
    -
  • commands.command_name -- returns command data
  • -
  • commands.data -- returns all data
  • -
- -
-
- - -
-
-
-generated by LDoc 1.4.6 -Last updated 2018-06-07 12:58:23 -
-
- - diff --git a/doc/modules/ExpGamingCore.Gui.Center.html b/doc/modules/ExpGamingCore.Gui.Center.html deleted file mode 100644 index b6b0f202..00000000 --- a/doc/modules/ExpGamingCore.Gui.Center.html +++ /dev/null @@ -1,337 +0,0 @@ - - - - - Reference - - - - -
- -
- -
-
-
- - -
- - - - - - -
- -

Module ExpGamingCore.Gui.Center

-

Adds a uniform preset for guis in the center of the screen which allow for different tabs to be opened

-

-

Info:

-
    -
  • License: https://github.com/explosivegaming/scenario/blob/master/LICENSE
  • -
  • Author: Cooldude2606
  • -
- - -

Functions

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
_comment ()This is a submodule of ExpGamingCore.Gui but for ldoc reasons it is under its own module
add (obj)Adds a new obj to the center gui
get_flow (player)Used to get the center frame of the player, used mainly in script
open (player, center)Used to open a center frame for a player
open_tab (player, center, tab)Used to open a center frame for a player
clear (player)Used to clear the center frame of the player, used mainly in script
center._center:add_tab (name, caption[, tooltip], callback)If deafult draw is used then you can add tabs to the gui with this function
- -
-
- - -

Functions

- -
-
- - _comment () -
-
- This is a submodule of ExpGamingCore.Gui but for ldoc reasons it is under its own module - - - - - - - -
-
- - add (obj) -
-
- Adds a new obj to the center gui - - -

Parameters:

-
    -
  • obj - contains the new object, needs name, fraw is opt and is function(root_frame) -
  • -
- -

Returns:

-
    - - the object made, used to add tabs -
- - - -

Usage:

-
    -
    Gui.center.add{name='foo',caption='Foo',tooltip='Testing',draw=function}
    -
- -
-
- - get_flow (player) -
-
- Used to get the center frame of the player, used mainly in script - - -

Parameters:

-
    -
  • player - a player indifier to get the flow for -
  • -
- -

Returns:

-
    - - table - the gui element flow -
- - - -

Usage:

-
    -
    Gui.center.get_flow(player) -- returns gui emelemt
    -
- -
-
- - open (player, center) -
-
- Used to open a center frame for a player - - -

Parameters:

-
    -
  • player - a player indifier to get the flow for -
  • -
  • center - string - the name of the center frame to open -
  • -
- -

Returns:

-
    - - boolean - based on if it successed or not -
- - - -

Usage:

-
    -
    Gui.center.open(player,'server-info') -- return true
    -
- -
-
- - open_tab (player, center, tab) -
-
- Used to open a center frame for a player - - -

Parameters:

-
    -
  • player - a player indifier to get the flow for -
  • -
  • center - string - the name of the center frame to open -
  • -
  • tab - string - the name of the tab to open -
  • -
- -

Returns:

-
    - - boolean - based on if it successed or not -
- - - -

Usage:

-
    -
    Gui.center.open_tab(player,'readme','rules') -- return true
    -
- -
-
- - clear (player) -
-
- Used to clear the center frame of the player, used mainly in script - - -

Parameters:

-
    -
  • player - a player indifier to get the flow for -
  • -
- - - - -

Usage:

-
    -
    Gui.center.clear(player)
    -
- -
-
- - center._center:add_tab (name, caption[, tooltip], callback) -
-
- If deafult draw is used then you can add tabs to the gui with this function - - -

Parameters:

-
    -
  • name - string - this is the name of the tab -
  • -
  • caption - string - this is the words that appear on the tab button -
  • -
  • tooltip - string - the tooltip that is on the button - (optional) -
  • -
  • callback - function - this is called when button is pressed with function(root_frame) -
  • -
- -

Returns:

-
    - - self to allow chaining of _center:add_tab -
- - - -

Usage:

-
    -
    _center:add_tab('foo','Foo','Just a tab',function)
    -
- -
-
- - -
-
-
-generated by LDoc 1.4.6 -Last updated 2018-06-07 12:58:23 -
-
- - diff --git a/doc/modules/ExpGamingCore.Gui.Inputs.html b/doc/modules/ExpGamingCore.Gui.Inputs.html deleted file mode 100644 index b96c8532..00000000 --- a/doc/modules/ExpGamingCore.Gui.Inputs.html +++ /dev/null @@ -1,498 +0,0 @@ - - - - - Reference - - - - -
- -
- -
-
-
- - -
- - - - - - -
- -

Module ExpGamingCore.Gui.Inputs

-

Adds a clean way of making new inputs for a gui allowing for sliders and text inputs to be hanndleded with custom events

-

-

Info:

-
    -
  • License: https://github.com/explosivegaming/scenario/blob/master/LICENSE
  • -
  • Author: Cooldude2606
  • -
- - -

Functions

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
_comment ()This is a submodule of ExpGamingCore.Gui but for ldoc reasons it is under its own module
inputs._input:on_event (event, callback)Sets the input to trigger on an certain event
inputs._input:draw (root)Draw the input into the root element
add (obj)Add a new input, this is the same as doing frame.add{} but returns a diffrent object
add_elem_button (name, elem_type, tooltip, callback)Used to define a choose-elem-button callback only on elem_changed
add_checkbox (name, radio, display, default, callback_true, callback_false)Used to define a checkbox callback only on state_changed
reset_radio (elements)Used to reset the state of radio buttons, recomened to be called on_state_change to reset any radio buttons it is ment to work with.
add_text (name, box, text, callback)Used to define a text callback only on text_changed
add_slider (name, orientation, min, max, start_callback, callback)Used to define a slider callback only on value_changed
add_drop_down (name, items, index, callback)Used to define a drop down callback only on value_changed
- -
-
- - -

Functions

- -
-
- - _comment () -
-
- This is a submodule of ExpGamingCore.Gui but for ldoc reasons it is under its own module - - - - - - - -
-
- - inputs._input:on_event (event, callback) -
-
- Sets the input to trigger on an certain event - - -

Parameters:

-
    -
  • event - the event to raise callback on | can be number of the event | can be a key of inputs.events -
  • -
  • callback - function - the function you want to run on the event -
  • -
- -

Returns:

-
    - - table - returns self so you can chain together -
- - - -

Usage:

-
    -
    button:on_event(defines.events.on_gui_click,player_return)
    -
- -
-
- - inputs._input:draw (root) -
-
- Draw the input into the root element - - -

Parameters:

-
    -
  • root - the element you want to add the input to -
  • -
- -

Returns:

-
    - - returns the element that was added -
- - - -

Usage:

-
    -
    button:draw(frame)
    -
- -
-
- - add (obj) -
-
- Add a new input, this is the same as doing frame.add{} but returns a diffrent object - - -

Parameters:

-
    -
  • obj - table - the new element to add if caption is a sprite path then sprite is used -
  • -
- -

Returns:

-
    - - table - the custom input object -
- - - -

Usage:

-
    -
    Gui.inputs.add{type='button',name='test',caption='Test'}
    -
- -
-
- - add_elem_button (name, elem_type, tooltip, callback) -
-
- Used to define a choose-elem-button callback only on elem_changed - - -

Parameters:

-
    -
  • name - string - the name of this button -
  • -
  • elem_type - string - the display for this button, either text or sprite path -
  • -
  • tooltip - string - the tooltip to show on the button -
  • -
  • callback - function - the callback to call on change function(player,element,elem) -
  • -
- -

Returns:

-
    - - table - the button object that was made, to allow a custom error event if wanted -
- - - -

Usage:

-
    -
    Gui.inputs.add_elem_button('test','Test','Just for testing',function)
    -
- -
-
- - add_checkbox (name, radio, display, default, callback_true, callback_false) -
-
- Used to define a checkbox callback only on state_changed - - -

Parameters:

-
    -
  • name - string - the name of this button -
  • -
  • radio - boolean - if this is a radio button -
  • -
  • display - string - the display for this button, either text or sprite path -
  • -
  • default - function - the callback which choses the default check state -
  • -
  • callback_true - function - the callback to call when changed to true -
  • -
  • callback_false - function - the callback to call when changed to false -
  • -
- -

Returns:

-
    - - table - the button object that was made, to allow a custom error event if wanted -
- - - -

Usage:

-
    -
    Gui.inputs.add_checkbox('test',false,'Just for testing',function,function,funvtion)
    -
- -
-
- - reset_radio (elements) -
-
- Used to reset the state of radio buttons, recomened to be called on_state_change to reset any radio buttons it is ment to work with. - - -

Parameters:

-
    -
  • elements - can be a list of elements or a single element -
  • -
- - - - -

Usage:

-
    -
    Gui.inputs.reset_radio{radio1,radio2,...}
    -
- -
-
- - add_text (name, box, text, callback) -
-
- Used to define a text callback only on text_changed - - -

Parameters:

-
    -
  • name - string - the name of this button -
  • -
  • box - boolean - is it a text box rather than a text field -
  • -
  • text - string - the starting text -
  • -
  • callback - function - the callback to call on change function(player,text,element) -
  • -
- -

Returns:

-
    - - table - the text object that was made, to allow a custom error event if wanted -
- - - -

Usage:

-
    -
    Gui.inputs.add_text('test',false,'Just for testing',function)
    -
- -
-
- - add_slider (name, orientation, min, max, start_callback, callback) -
-
- Used to define a slider callback only on value_changed - - -

Parameters:

-
    -
  • name - string - the name of this button -
  • -
  • orientation - string - direction of the slider -
  • -
  • min - number - the lowest number -
  • -
  • max - number - the highest number -
  • -
  • start_callback - function - either a number or a function to return a number -
  • -
  • callback - function - the function to be called on value_changed function(player,value,percent,element) -
  • -
- -

Returns:

-
    - - table - the slider object that was made, to allow a custom error event if wanted -
- - - -

Usage:

-
    -
    Gui.inputs.add_slider('test','horizontal',1,10,5,function)
    -
- -
-
- - add_drop_down (name, items, index, callback) -
-
- Used to define a drop down callback only on value_changed - - -

Parameters:

-
    -
  • name - string - name of the drop down -
  • -
  • items - either a list or a function which returns a list -
  • -
  • index - either a number or a function which returns a number -
  • -
  • callback - function - the callback which is called when a new index is selected function(player,selected,items,element) -
  • -
- -

Returns:

-
    - - table - the drop-down object that was made, to allow a custom error event if wanted -
- - - -

Usage:

-
    -
    Gui.inputs.add_drop_down('test',{1,2,3},1,function)
    -
- -
-
- - -
-
-
-generated by LDoc 1.4.6 -Last updated 2018-06-07 12:58:23 -
-
- - diff --git a/doc/modules/ExpGamingCore.Gui.Left.html b/doc/modules/ExpGamingCore.Gui.Left.html deleted file mode 100644 index b1fc3ddc..00000000 --- a/doc/modules/ExpGamingCore.Gui.Left.html +++ /dev/null @@ -1,240 +0,0 @@ - - - - - Reference - - - - -
- -
- -
-
-
- - -
- - - - - - -
- -

Module ExpGamingCore.Gui.Left

-

Adds a organiser for left gui ellements which will automaticaly update there information and have open requirements

-

-

Info:

-
    -
  • License: https://github.com/explosivegaming/scenario/blob/master/LICENSE
  • -
  • Author: Cooldude2606
  • -
- - -

Functions

- - - - - - - - - - - - - - - - - - - - - -
_comment ()This is a submodule of ExpGamingCore.Gui but for ldoc reasons it is under its own module
add (obj)Used to add a left gui frame
update ([frame[, players]])This is used to update all the guis of connected players, good idea to use our thread system as it as nested for loops
open (left_name)Used to open the left gui of every player
close (left_name)Used to close the left gui of every player
- -
-
- - -

Functions

- -
-
- - _comment () -
-
- This is a submodule of ExpGamingCore.Gui but for ldoc reasons it is under its own module - - - - - - - -
-
- - add (obj) -
-
- Used to add a left gui frame - - -

Parameters:

-
    -
  • obj - this is what will be made, needs a name and a draw function(root_frame), open_on_join can be used to set the deaful state true/false, can_open is a test to block it from opening but is not needed -
  • -
- -

Returns:

-
    - - the object that is made to... well idk but for the future -
- - - -

Usage:

-
    -
    Gui.left.add{name='foo',caption='Foo',tooltip='just testing',open_on_join=true,can_open=function,draw=function}
    -
- -
-
- - update ([frame[, players]]) -
-
- This is used to update all the guis of connected players, good idea to use our thread system as it as nested for loops - - -

Parameters:

-
    -
  • frame - string - this is the name of a frame if you only want to update one - (optional) -
  • -
  • players - the player to update for, if not given all players are updated, can be one player - (optional) -
  • -
- - - - -

Usage:

-
    -
    Gui.left.update()
    -
- -
-
- - open (left_name) -
-
- Used to open the left gui of every player - - -

Parameters:

-
    -
  • left_name - string - this is the gui that you want to open -
  • -
- - - - -

Usage:

-
    -
    Gui.left.open('foo')
    -
- -
-
- - close (left_name) -
-
- Used to close the left gui of every player - - -

Parameters:

-
    -
  • left_name - string - this is the gui that you want to close -
  • -
- - - - -

Usage:

-
    -
    Gui.left.close('foo')
    -
- -
-
- - -
-
-
-generated by LDoc 1.4.6 -Last updated 2018-06-07 12:58:23 -
-
- - diff --git a/doc/modules/ExpGamingCore.Gui.Popup.html b/doc/modules/ExpGamingCore.Gui.Popup.html deleted file mode 100644 index f1567b56..00000000 --- a/doc/modules/ExpGamingCore.Gui.Popup.html +++ /dev/null @@ -1,185 +0,0 @@ - - - - - Reference - - - - -
- -
- -
-
-
- - -
- - - - - - -
- -

Module ExpGamingCore.Gui.Popup

-

Adds a location for popups which can be dismissed by a player and created from other scripts

-

-

Info:

-
    -
  • License: https://github.com/explosivegaming/scenario/blob/master/LICENSE
  • -
  • Author: Cooldude2606
  • -
- - -

Functions

- - - - - - - - - - - - - -
_comment ()This is a submodule of ExpGamingCore.Gui but for ldoc reasons it is under its own module
add (obj)Used to add a popup gui style
open (style, data[, players=game.connected_players])Use to open a popup for these players
- -
-
- - -

Functions

- -
-
- - _comment () -
-
- This is a submodule of ExpGamingCore.Gui but for ldoc reasons it is under its own module - - - - - - - -
-
- - add (obj) -
-
- Used to add a popup gui style - - -

Parameters:

-
    -
  • obj - this is what will be made, needs a name and a draw function(root_frame,data) -
  • -
- -

Returns:

-
    - - the object that is made to... well idk but for the future -
- - - -

Usage:

-
    -
    Gui.left.add{name='foo',caption='Foo',draw=function}
    -
- -
-
- - open (style, data[, players=game.connected_players]) -
-
- Use to open a popup for these players - - -

Parameters:

-
    -
  • style - string - this is the name you gave to the popup when added -
  • -
  • data - this is the data that is sent to the draw function -
  • -
  • players - table - the players to open the popup for - (default game.connected_players) -
  • -
- - - - -

Usage:

-
    -
    Gui.popup.open('ban',nil,{player=1,reason='foo'})
    -
- -
-
- - -
-
-
-generated by LDoc 1.4.6 -Last updated 2018-06-07 12:58:23 -
-
- - diff --git a/doc/modules/ExpGamingCore.Gui.Test.html b/doc/modules/ExpGamingCore.Gui.Test.html deleted file mode 100644 index c5fc942d..00000000 --- a/doc/modules/ExpGamingCore.Gui.Test.html +++ /dev/null @@ -1,144 +0,0 @@ - - - - - Reference - - - - -
- -
- -
-
-
- - -
- - - - - - -
- -

Module ExpGamingCore.Gui.Test

-

Used to test all gui elements and parts can be used in game via Gui.test()

-

-

Info:

-
    -
  • License: https://github.com/explosivegaming/scenario/blob/master/LICENSE
  • -
  • Author: Cooldude2606
  • -
- - -

Functions

- - - - - - - - - -
_comment ()This is a submodule of ExpGamingCore.Gui but for ldoc reasons it is under its own module
Gui.test ([player=game.player])The funcation that is called when calling Gui.test
- -
-
- - -

Functions

- -
-
- - _comment () -
-
- This is a submodule of ExpGamingCore.Gui but for ldoc reasons it is under its own module - - - - - - - -
-
- - Gui.test ([player=game.player]) -
-
- The funcation that is called when calling Gui.test - - -

Parameters:

-
    -
  • player - a pointer to a player to draw the test gui for - (default game.player) -
  • -
- - - - -

Usage:

-
    -
    Gui.test() -- draws test gui
    -
- -
-
- - -
-
-
-generated by LDoc 1.4.6 -Last updated 2018-06-07 12:58:23 -
-
- - diff --git a/doc/modules/ExpGamingCore.Gui.Toolbar.html b/doc/modules/ExpGamingCore.Gui.Toolbar.html deleted file mode 100644 index 7abec4aa..00000000 --- a/doc/modules/ExpGamingCore.Gui.Toolbar.html +++ /dev/null @@ -1,190 +0,0 @@ - - - - - Reference - - - - -
- -
- -
-
-
- - -
- - - - - - -
- -

Module ExpGamingCore.Gui.Toolbar

-

Adds a toolbar to the top left of the screen

-

-

Info:

-
    -
  • License: https://github.com/explosivegaming/scenario/blob/master/LICENSE
  • -
  • Author: Cooldude2606
  • -
- - -

Functions

- - - - - - - - - - - - - -
_comment ()This is a submodule of ExpGamingCore.Gui but for ldoc reasons it is under its own module
add (name, caption, tooltip, callback)Add a button to the toolbar, ranks need to be allowed to use these buttons if ranks is preset
draw (player)Draws the toolbar for a certain player
- -
-
- - -

Functions

- -
-
- - _comment () -
-
- This is a submodule of ExpGamingCore.Gui but for ldoc reasons it is under its own module - - - - - - - -
-
- - add (name, caption, tooltip, callback) -
-
- Add a button to the toolbar, ranks need to be allowed to use these buttons if ranks is preset - - -

Parameters:

-
    -
  • name - string - the name of the button -
  • -
  • caption - string - can be a sprite path or text to show -
  • -
  • tooltip - string - the help to show for the button -
  • -
  • callback - function - the function which is called on_click -
  • -
- -

Returns:

-
    - - table - the button object that was made -
- - - -

Usage:

-
    -
    toolbar.add('foo','Foo','Test',function() game.print('test') end)
    -
- -
-
- - draw (player) -
-
- Draws the toolbar for a certain player - - -

Parameters:

-
    -
  • player - the player to draw the tool bar of -
  • -
- - - - -

Usage:

-
    -
    toolbar.draw(1)
    -
- -
-
- - -
-
-
-generated by LDoc 1.4.6 -Last updated 2018-06-07 12:58:23 -
-
- - diff --git a/doc/modules/ExpGamingCore.Gui.html b/doc/modules/ExpGamingCore.Gui.html deleted file mode 100644 index b5fea915..00000000 --- a/doc/modules/ExpGamingCore.Gui.html +++ /dev/null @@ -1,366 +0,0 @@ - - - - - Reference - - - - -
- -
- -
-
-
- - -
- - - - - - -
- -

Module ExpGamingCore.Gui

-

Adds a objective version to custom guis.

-

-

Info:

-
    -
  • License: https://github.com/explosivegaming/scenario/blob/master/LICENSE
  • -
  • Author: Cooldude2606
  • -
- - -

Functions

- - - - - - - - - - - - - -
bar (frame[, width=10])Add a white bar to any gui frame
set_dropdown_index (dropdown, _item)Used to set the index of a drop down to a certian item
cam_link (data)Adds a camera that updates every tick (or less depeading on how many are opening) it will move to follow an entity
-

Tables

- - - - - - - - - -
eventsStores all the on_player_joined_game event handlers for the guis
ParametersForCamLinkPrams for Gui.cam_link
-

Fields

- - - - - -
dataUsed to set and get data about different guis
-

modules.expgamingcore.gui.src.server Functions

- - - - - - - - - -
_comment ()This file will be loaded when ExpGamingCore.Command is present
__comment ()Adds a server thread that allows the camera follows to be toggled off and on
- -
-
- - -

Functions

- -
-
- - bar (frame[, width=10]) -
-
- Add a white bar to any gui frame - - -

Parameters:

-
    -
  • frame - the frame to draw the line to -
  • -
  • width - the width of the bar - (default 10) -
  • -
- -

Returns:

-
    - - the line that was made type is progressbar -
- - - -

Usage:

-
    -
    Gui.bar(frame,100)
    -
- -
-
- - set_dropdown_index (dropdown, _item) -
-
- Used to set the index of a drop down to a certian item - - -

Parameters:

-
    -
  • dropdown - the dropdown that is to be effected -
  • -
  • _item - this is the item to look for -
  • -
- -

Returns:

-
    - - returns the dropdown if it was successful -
- - - -

Usage:

-
    -
    Gui.set_dropdown_index(dropdown,player.name) -- will select the index with the players name as the value
    -
- -
-
- - cam_link (data) -
-
- Adds a camera that updates every tick (or less depeading on how many are opening) it will move to follow an entity - - -

Parameters:

-
    -
  • data - table - contains all other params given below -
  • -
- -

Returns:

-
    - - the camera that the function used be it made or given as a param -
- - - -

Usage:

-
    -
  • Gui.cam_link{entity=game.player.character,frame=frame,width=50,hight=50,zoom=1}
  • -
  • Gui.cam_link{entity=game.player.character,cam=frame.camera,surface=game.surfaces['testing']}
  • -
- -
-
-

Tables

- -
-
- - events -
-
- Stores all the on_player_joined_game event handlers for the guis - - - - - - - -
-
- - ParametersForCamLink -
-
- Prams for Gui.cam_link - - -

Fields:

-
    -
  • entity - this is the entity that the camera will follow -
  • -
  • cam - a camera that you already have in the gui -
  • -
  • frame - the frame to add the camera to, no effect if cam param is given -
  • -
  • zoom - the zoom to give the new camera -
  • -
  • width - the width to give the new camera -
  • -
  • height - the height to give the new camera -
  • -
  • surface - this will over ride the surface that the camera follows on, allowing for a 'ghost surface' while keeping same position -
  • -
  • respawn_open - if set to true then the camera will auto re link to the player after a respawn -
  • -
- - - - - -
-
-

Fields

- -
-
- - data -
-
- Used to set and get data about different guis - - -
    -
  • location - string - the location to get/set the data, center left etc... -
  • -
  • key - string - the name of the gui to set the value of - (optional) -
  • -
  • value - the data that will be set can be any value but table advised - (optional) -
  • -
- - - - -

Usage:

-
    -
  • Gui.data[location] -- returns the gui data for that gui location ex center
  • -
  • Gui.data(location,gui_name,gui_data) -- adds gui data for a gui at a location
  • -
- -
-
-

modules.expgamingcore.gui.src.server Functions

- -
-
- - _comment () -
-
- This file will be loaded when ExpGamingCore.Command is present - - - - - - - -
-
- - __comment () -
-
- Adds a server thread that allows the camera follows to be toggled off and on - - - - - - - -
-
- - -
-
-
-generated by LDoc 1.4.6 -Last updated 2018-06-07 12:58:23 -
-
- - diff --git a/doc/modules/ExpGamingCore.Ranking.html b/doc/modules/ExpGamingCore.Ranking.html deleted file mode 100644 index b63a6d37..00000000 --- a/doc/modules/ExpGamingCore.Ranking.html +++ /dev/null @@ -1,883 +0,0 @@ - - - - - Reference - - - - -
- -
- -
-
-
- - -
- - - - - - -
- -

Module ExpGamingCore.Role

-

A full ranking system for factorio.

-

-

Info:

-
    -
  • License: https://github.com/explosivegaming/scenario/blob/master/LICENSE
  • -
  • Author: Cooldude2606
  • -
- - -

Functions

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
output_ranks ([player=server])Outputs as a string all the ranks and the loaded order
_base_preset (ranks)Used to set the prset ranks that will be given to players
get_rank (mixed)Returns a rank object given a player or rank name
get_group (mixed)Returns the group object used to sort ranks given group name or rank
print (rank_base, rtn[, colour=defines.color.white[, below=false]])Prints to all rank of greater/lower power of the rank given
give_rank (player[, rank=default[, by_player='server'[, tick=game.tick]]])Gives a user a rank
revert (player[, by_player=nil])Revert the last change to a players rank
find_preset (player[, tick=nil])Given that the player has a rank in the preset table it is given; also will attempt to promote players if a time requirement is met
-

Tables

- - - - - - - - - - - - - - - - - -
globalGlobal Table
ranksContains the location of all the ranks, readonly during runtime
ranksContains the location of all the rank groups, readonly during runtime
metaContains some meta data about the ranks
-

Events

- - - - - -
on_rank_changeCalled when there is a rank change for a user
-

Class Rank

- - - - - - - - - - - - - - - - - -
Ranking._rank:allowed (action)Is this rank allowed to open this gui or use this command etc.
Ranking._rank:get_players ([online=false])Get all the players in this rank
Ranking._rank:print (rtn[, colour=defines.color.white[, show_default=false]])Print a message to all players of this rank
Ranking._rank:edit (key, value)Allows for a clean way to edit rank objects
-

Class Group

- - - - - - - - - - - - - -
Ranking._group:create (obj)Creates a new group
Ranking._group:add_rank (obj)Creats a new rank with this group as its group
Ranking._group:edit (key, value)Allows for a clean way to edit rank group objects
-

modules.expgamingcore.ranking.src.server Functions

- - - - - - - - - -
_comment ()This file will be loaded when ExpGamingCore.Server is present
Ranking._rank:print (rtn[, colour=defines.color.white[, show_default=false]])Print a message to all players of this rank
- -
-
- - -

Functions

- -
-
- - output_ranks ([player=server]) -
-
- Outputs as a string all the ranks and the loaded order - - -

Parameters:

-
    -
  • player - player_name, player_index or LuaPlayer - the player that the info will be printed to, nil will print to server - (default server) -
  • -
- - - - -

Usage:

-
    -
    Ranking.output_ranks(player) -- prints to player
    -
- -
-
- - _base_preset (ranks) -
-
- Used to set the prset ranks that will be given to players - - -

Parameters:

-
    -
  • ranks - table - table of player names with the player name as the key and rank name as the value -
  • -
- - - - -

Usage:

-
    -
    Ranking._base_preset{name=rank_name,nameTwo=rank_name_two} -- sets player name to have rank rank_name on join
    -
- -
-
- - get_rank (mixed) -
-
- Returns a rank object given a player or rank name - - -

Parameters:

-
    -
  • mixed - player, player_index, player_name, rank_name, Ranking._rank, 'server' or 'root' - what rank to get -
  • -
- -

Returns:

-
    - - table - the rank that is linked to mixed -
-

Or

-
    - - nil - there was no rank found -
- - - -

Usage:

-
    -
  • Ranking.get_rank(game.player) -- returns player's rank
  • -
  • Ranking.get_rank('admin') -- returns rank by the name of admin
  • -
- -
-
- - get_group (mixed) -
-
- Returns the group object used to sort ranks given group name or rank - - -

Parameters:

-
    -
  • mixed - player, player_index, player_name, rank_name, rank, 'server', 'root', group_name or group - what group to get -
  • -
- -

Returns:

-
    - - table - the group that is linked to mixed -
-

Or

-
    - - nil - there was no rank group found -
- - -

See also:

- - -

Usage:

-
    -
  • Ranking.get_group(game.player) -- returns player's rank group
  • -
  • Ranking.get_group('root') -- returns group by name of root
  • -
- -
-
- - print (rank_base, rtn[, colour=defines.color.white[, below=false]]) -
-
- Prints to all rank of greater/lower power of the rank given - - -

Parameters:

-
    -
  • rank_base - Ranking._rank or pointerToRank - the rank that acts as the cut off point (rank is always included) -
  • -
  • rtn - what do you want to return to the players -
  • -
  • colour - defines.color - the colour that will be used to print - (default defines.color.white) -
  • -
  • below - boolean - if true print to children rather than parents - (default false) -
  • -
- - - - -

Usage:

-
    -
    Ranking.print('admin','We got a grifer')
    -
- -
-
- - give_rank (player[, rank=default[, by_player='server'[, tick=game.tick]]]) -
-
- Gives a user a rank - - -

Parameters:

-
    -
  • player - LuaPlayer or pointerToPlayer - the player to give the rank to -
  • -
  • rank - Ranking._rank or pointerToRank - the rank to give to the player - (default default) -
  • -
  • by_player - LuaPlayer or pointerToPlayer - the player who is giving the rank - (default 'server') -
  • -
  • tick - number - the tick that the rank is being given on, used as pass though - (default game.tick) -
  • -
- - - - -

Usage:

-
    -
    Ranking.give_rank(1,'admin')
    -
- -
-
- - revert (player[, by_player=nil]) -
-
- Revert the last change to a players rank - - -

Parameters:

-
    -
  • player - LuaPlayer or pointerToPlayer - the player to revert the rank of -
  • -
  • by_player - the player who is doing the revert - (default nil) -
  • -
- - - - -

Usage:

-
    -
    Ranking.revert(1) -- reverts the rank of player with index 1
    -
- -
-
- - find_preset (player[, tick=nil]) -
-
- Given that the player has a rank in the preset table it is given; also will attempt to promote players if a time requirement is met - - -

Parameters:

-
    -
  • player - LuaPlayer or pointerToPlayer - the player to test for an auto rank -
  • -
  • tick - number - the tick it happens on - (default nil) -
  • -
- - - - -

Usage:

-
    -
    Ranking.find_preset(1) -- attemps to find the preset for player with index 1
    -
- -
-
-

Tables

- -
-
- - global -
-
- Global Table - - -

Fields:

-
    -
  • old - contains the previous rank a use had before a rank change -
  • -
  • preset - contains the preset ranks that users will recive apon joining -
  • -
  • last_change - contains the name of the player who last had there rank chagned -
  • -
- - - - - -
-
- - ranks -
-
- Contains the location of all the ranks, readonly during runtime - - - - - - - -
-
- - ranks -
-
- Contains the location of all the rank groups, readonly during runtime - - - - - - - -
-
- - meta -
-
- Contains some meta data about the ranks - - -

Fields:

-
    -
  • default - this is the name of the default rank -
  • -
  • root - this is the name of the root rank -
  • -
  • time_ranks - a list of all ranks which have a time requirement -
  • -
  • time_highest - the power of the highest rank that has a time requirement -
  • -
  • time_lowest - the lowest amount of time required for a time rank -
  • -
- - - - - -
-
-

Events

- -
-
- - on_rank_change -
-
- Called when there is a rank change for a user - - -

field:

-
    -
  • name - the rank id -
  • -
  • tick - the tick which the event was raised on -
  • -
  • player_index - the player whos rank was changed -
  • -
  • by_player_index - the player who changed the rank, 0 means server -
  • -
  • new_rank - the name of the rank that was given -
  • -
  • old_rank - the name of the rank the player had -
  • -
- - - - - -
-
-

Class Rank

- -
- The class for the ranks -
-
-
- - Ranking._rank:allowed (action) -
-
- Is this rank allowed to open this gui or use this command etc. - - -

Parameters:

-
    -
  • action - teh - to test for -
  • -
- -

Returns:

-
    - - boolean - is it allowed -
- - - -

Usage:

-
    -
    rank:allowed('interface') -- does the rank have permision for 'interface'
    -
- -
-
- - Ranking._rank:get_players ([online=false]) -
-
- Get all the players in this rank - - -

Parameters:

-
    -
  • online - boolean - get only online players - (default false) -
  • -
- -

Returns:

-
    - - table - a table of all players in this rank -
- - - -

Usage:

-
    -
    rank:get_players()
    -
- -
-
- - Ranking._rank:print (rtn[, colour=defines.color.white[, show_default=false]]) -
-
- Print a message to all players of this rank - - -

Parameters:

-
    -
  • rtn - any value you want to return -
  • -
  • colour - define.color - the colour that will be used to print - (default defines.color.white) -
  • -
  • show_default - boolean - weather to use the default rank name for the print, used as a pass though - (default false) -
  • -
- - - - -

Usage:

-
    -
    rank:print('foo') -- prints to all members of this rank
    -
- -
-
- - Ranking._rank:edit (key, value) -
-
- Allows for a clean way to edit rank objects - - -

Parameters:

-
    -
  • key - string - the key to edit, often allow or disallow -
  • -
  • value - the new value to be set -
  • -
- - - - -

Usage:

-
    -
    rank:edit('allow',{'interface'}) -- allows this rank to use 'interface'
    -
- -
-
-

Class Group

- -
- The class for the rank groups, the way to allow modules to idex a group that is always present, ranks will always look to there group as a parent -
-
-
- - Ranking._group:create (obj) -
-
- Creates a new group - - -

Parameters:

-
    -
  • obj - table - the fields for this object -
  • -
- -

Returns:

-
    - - Ranking._group - returns the object to allow chaining -
- - - -

Usage:

-
    -
    Ranking._group:create{name='root'} -- returns group with name root
    -
- -
-
- - Ranking._group:add_rank (obj) -
-
- Creats a new rank with this group as its group - - -

Parameters:

-
    -
  • obj - table - the fields for this object -
  • -
- -

Returns:

-
    - - Ranking._group - returns the object to allow chaining -
- - - -

Usage:

-
    -
    group:add_rank{name='root'} -- returns self
    -
- -
-
- - Ranking._group:edit (key, value) -
-
- Allows for a clean way to edit rank group objects - - -

Parameters:

-
    -
  • key - string - the key to edit, often allow or disallow -
  • -
  • value - the new value to be set -
  • -
- - - - -

Usage:

-
    -
    group:edit('allow',{'interface'}) -- allows this rank to use 'interface'
    -
- -
-
-

modules.expgamingcore.ranking.src.server Functions

- -
-
- - _comment () -
-
- This file will be loaded when ExpGamingCore.Server is present - - - - - - - -
-
- - Ranking._rank:print (rtn[, colour=defines.color.white[, show_default=false]]) -
-
- Print a message to all players of this rank - - -

Parameters:

-
    -
  • rtn - any value you want to return -
  • -
  • colour - define.color - the colour that will be used to print - (default defines.color.white) -
  • -
  • show_default - boolean - weather to use the default rank name for the print, used as a pass though - (default false) -
  • -
- - - - -

Usage:

-
    -
    rank:print('foo') -- prints to all members of this rank
    -
- -
-
- - -
-
-
-generated by LDoc 1.4.6 -Last updated 2018-06-07 12:58:23 -
-
- - diff --git a/doc/modules/ExpGamingCore.Server.html b/doc/modules/ExpGamingCore.Server.html deleted file mode 100644 index 5bd0827d..00000000 --- a/doc/modules/ExpGamingCore.Server.html +++ /dev/null @@ -1,848 +0,0 @@ - - - - - Reference - - - - -
- -
- -
-
-
- - -
- - - - - - -
- -

Module ExpGamingCore.Server

-

Adds a thread system and event listening and a admin bypass (recommend to disable /c and use optional /interface)

-

-

Info:

-
    -
  • License: https://github.com/explosivegaming/scenario/blob/master/LICENSE
  • -
  • Author: Cooldude2606
  • -
- - -

Functions

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
new_thread (obj)Generates a new thread object
get_thread (mixed)Used to get a thread via uuid or name (if one is assied)
queue_thread (thread_to_queue)Adds a thread into the resolve queue, can be used to lower lag
close_all_threads (with_force)Closes all active threads, can use force if it causes errors
run_tick_threads ()Runs all the theads which have opened with an on_tick event
check_timeouts ()Checks the timeout on all active timeout threads
_thread_debuger (player, event[, state=toggle])Used to print event info to a player
interface (callback[, use_thread[, env[, ...]]])Acts as a bypass for running functions, can accept a string
-

Tables

- - - - - -
globalGlobal Table
-

Fields

- - - - - - - - - -
uuidUsed to generate a new uuid for the thread system
threadsRedirect to the thread index
-

Class Thread

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Server._thread:create ([obj={}])Returns a new thread object
Server._thread:queue ()Opens and queses a thread
Server._thread:valid ([skip_location_check=false])Test if the thread has all requied parts
Server._thread:open ()Opens the thread; indexs this thread in the global index
Server._thread:close ()Inverse of thread:open() - Removes all indexs to this thread, most cases this will cause it to become inassible
Server._thread:resolve ([...])Trigger the on_resolve function and closes the thread - error and success called based on result of pcall (useful for async)
Server._thread:check_timeout ()Checks the timeout on a thread - if timed out then it calles on_timeout and closes
Server._thread:error (err)Used to check and raise the error handler of the thread, if not present it raises an error
Server._thread:on_event (event, callback)Set function to run then an event is triggered, none of them are 'needed' but you are advised to have atleast one
-

modules.expgamingcore.server.src.commands Functions

- - - - - - - - - -
_comment ()This file will be loaded when ExpGamingCore.Command is present
interfaceRuns the given input from the script
- -
-
- - -

Functions

- -
-
- - new_thread (obj) -
-
- Generates a new thread object - - -

Parameters:

-
    -
  • obj - table - the atributes to give to the thread -
  • -
- -

Returns:

-
    - - Server._thread - the new thread created -
- - - -

Usage:

-
    -
    Server.new_thread{name='foo',data={}}
    -
- -
-
- - get_thread (mixed) -
-
- Used to get a thread via uuid or name (if one is assied) - - -

Parameters:

-
    -
  • mixed - either a uuid or the name given to a thread -
  • -
- -

Returns:

-
    - - Server._thread - the thread by that name or uuid -
-

Or

-
    - - boolean - if false is returned then no thread existes -
- - - -

Usage:

-
    -
    Server.get_thread('decon') -- return thread
    -
- -
-
- - queue_thread (thread_to_queue) -
-
- Adds a thread into the resolve queue, can be used to lower lag - - -

Parameters:

-
    -
  • thread_to_queue - Server._thread - the thread to be added to the queue, must be open and have a on_resolve function -
  • -
- -

Returns:

-
    - - boolean - was it added successfuly -
- - - -

Usage:

-
    -
    Server.queue_thread(thread) -- return true/false
    -
- -
-
- - close_all_threads (with_force) -
-
- Closes all active threads, can use force if it causes errors - - -

Parameters:

-
    -
  • with_force - bolean - use force when closing -
  • -
- - - - -

Usage:

-
    -
  • Server.close_all_threads() -- asks all threads to close
  • -
  • Server.close_all_threads(true) -- forcefuly close all threads
  • -
- -
-
- - run_tick_threads () -
-
- Runs all the theads which have opened with an on_tick event - - - - - - -

Usage:

-
    -
    Server.run_tick_threads()
    -
- -
-
- - check_timeouts () -
-
- Checks the timeout on all active timeout threads - - - - - - -

Usage:

-
    -
    Server.check_timeouts()
    -
- -
-
- - _thread_debuger (player, event[, state=toggle]) -
-
- Used to print event info to a player - - -

Parameters:

-
    -
  • player - name, index or LuaPlayer - the player that the info will be returned to -
  • -
  • event - name or index - the event that info will be returned fo -
  • -
  • state - boolean - will info be returned, nil to toggle current state - (default toggle) -
  • -
- - - - -

Usage:

-
    -
    Server._thread_debuger('Cooldude2606','on_player_died',true) -- will output event info to 'Cooldude2606' for 'on_player_died'
    -
- -
-
- - interface (callback[, use_thread[, env[, ...]]]) -
-
- Acts as a bypass for running functions, can accept a string - - -

Parameters:

-
    -
  • callback - string or function - function to be ran -
  • -
  • use_thread - Server._thread or true - run the command on a premade thread or let it make its own - (optional) -
  • -
  • env - table - run the env to run the command in must have _env key as true to be - (optional) -
  • -
  • ... - any args you want to pass to the function - (optional) -
  • -
- -

Returns:

-
    -
  1. - boolean - if no thread then it will return a true for the success
  2. -
  3. - if no thread then it will return the value(s) returned by the callback
  4. -
-

Or

-
    -
  1. - boolean - if no thread then it will return a false for the success
  2. -
  3. - string - if no thread then it will return a an err value
  4. -
- - - -

Usage:

-
    -
  • Server.interface('local x = 1+1 print(x) return x') -- return 2
  • -
  • Server.interface('local x = 1+1 print(x)',true) -- will creat a thread to run as root (this is the bypass)
  • -
- -
-
-

Tables

- -
-
- - global -
-
- Global Table - - -

Fields:

-
    -
  • all - a list of every thread (indexed by uuid) -
  • -
  • queue - an index for threads which will be resolved (contains uuids) -
  • -
  • tick - an index for threads which will run every tick (contains uuids) -
  • -
  • timeout - an index for threads which will timeout (contains uuids) -
  • -
  • events - an index of threads based on event ids (contains uuids) -
  • -
  • paused - an index of pasued threads (contains uuids) -
  • -
  • named - a name index for thread uuids -
  • -
  • print_to - contains players that event details will be printed to -
  • -
  • uuid - contains the random number generator for the uuid system -
  • -
- - - - - -
-
-

Fields

- -
-
- - uuid -
-
- Used to generate a new uuid for the thread system - - - - - - -

Usage:

-
    -
    local uuid = tostring(Server.uuid) -- calling tostring locks the value
    -
- -
-
- - threads -
-
- Redirect to the thread index - - - - - - -

Usage:

-
    -
  • Server.threads -- return #global.all
  • -
  • Server.threads -- return global.all
  • -
- -
-
-

Class Thread

- -
- The class for the server threads, allows abbilty to run async function -
-
-
- - Server._thread:create ([obj={}]) -
-
- Returns a new thread object - - -

Parameters:

-
    -
  • obj - table - all values are opt {timeout=int,name=str,data=any} - (default {}) -
  • -
- -

Returns:

-
    - - Server._thread - the new thread object -
- - - -

Usage:

-
    -
    new_thread = thread:create()
    -
- -
-
- - Server._thread:queue () -
-
- Opens and queses a thread - - - -

Returns:

-
    - - boolean - was the thread queued successfuly -
- - -

See also:

- - -

Usage:

-
    -
    Server._thread:queue() -- returns true/false
    -
- -
-
- - Server._thread:valid ([skip_location_check=false]) -
-
- Test if the thread has all requied parts - - -

Parameters:

-
    -
  • skip_location_check - bolean - true to skip the location checking - (default false) -
  • -
- -

Returns:

-
    - - boolean - is the thread valid -
- - - -

Usage:

-
    -
    if thread:valid() then end -- basic test for valid
    -
- -
-
- - Server._thread:open () -
-
- Opens the thread; indexs this thread in the global index - - - -

Returns:

-
    - - bolean - if the thread was opened successfuly -
- - - -

Usage:

-
    -
    thread:open() -- return true
    -
- -
-
- - Server._thread:close () -
-
- Inverse of thread:open() - Removes all indexs to this thread, most cases this will cause it to become inassible - - - -

Returns:

-
    - - boolean - if the thread had a on_close function -
- - - -

Usage:

-
    -
    thread:close() -- return true
    -
- -
-
- - Server._thread:resolve ([...]) -
-
- Trigger the on_resolve function and closes the thread - error and success called based on result of pcall (useful for async) - - -

Parameters:

-
    -
  • ... - any arguments you want to pass to the resolve function - (optional) -
  • -
- -

Returns:

-
    - - bolean - true if the thread called on_success or on_error -
- - - -

Usage:

-
    -
    thread:resolve(x,y,z) -- return true
    -
- -
-
- - Server._thread:check_timeout () -
-
- Checks the timeout on a thread - if timed out then it calles on_timeout and closes - - - -

Returns:

-
    - - bolean - if the thread timed out -
- - - -

Usage:

-
    -
    thread:check_timeout() -- return true
    -
- -
-
- - Server._thread:error (err) -
-
- Used to check and raise the error handler of the thread, if not present it raises an error - - -

Parameters:

-
    -
  • err - string - the err to be rasied -
  • -
- -

Returns:

-
    - - boolean - did the thread have an error handler -
- - - -

Usage:

-
    -
    thread:error(err) -- return true
    -
- -
-
- - Server._thread:on_event (event, callback) -
-
- Set function to run then an event is triggered, none of them are 'needed' but you are advised to have atleast one - - -

Parameters:

-
    -
  • event - string or index - the name of the event that the function should be called on -
  • -
  • callback - function - the function which is called by the event trigger -
  • -
- -

Returns:

-
    - - table - returns self so that they can be chained together -
- - - -

Usage:

-
    -
  • thread:on_event('close',function) -- if event is not one below then a game event is used
  • -
  • thread_only_events = ['close','timeout','tick','resolve','success','error']
  • -
- -
-
-

modules.expgamingcore.server.src.commands Functions

- -
-
- - _comment () -
-
- This file will be loaded when ExpGamingCore.Command is present - - - - - - - -
-
- - interface -
-
- Runs the given input from the script - - -

param:

-
    -
  • code - The code that will be ran -
  • -
- - - - - -
-
- - -
-
-
-generated by LDoc 1.4.6 -Last updated 2018-06-07 12:58:23 -
-
- - diff --git a/doc/modules/ExpGamingCore.Sync.html b/doc/modules/ExpGamingCore.Sync.html deleted file mode 100644 index 291dd92b..00000000 --- a/doc/modules/ExpGamingCore.Sync.html +++ /dev/null @@ -1,820 +0,0 @@ - - - - - Reference - - - - -
- -
- -
-
-
- - -
- - - - - - -
- -

Module ExpGamingCore.Sync

-

Allows syncing with an outside server and info panle.

-

-

Info:

-
    -
  • License: https://github.com/explosivegaming/scenario/blob/master/LICENSE
  • -
  • Author: Cooldude2606
  • -
- - -

Functions

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
tick_format (tick)Used to standidise the tick format for any sync info
print (player_message, player_name[, player_tag[, player_colour[, prefix]]])Prints to chat as if it were a player
emit_embedded (args)Logs an embed to the json.data we use a js script to add things we cant here
count_admins ()Used to get the number of admins currently online
count_afk ([time=7200])Used to get the number of afk players defined by 2 min by default
count_ranks ()Used to get the number of players in each rank and currently online; if ExpGamingCore/Ranking is present then it will give more than admin and user
count_players (online)Used to get a list of every player name with the option to limit to only online players
count_player_times ()Used to get a list of every player name with the amount of time they have played for
update ()Called to update values inside of the info
add_update (key, callback)Adds a callback to be called when the info is updated
emit_data ()Outputs the curent server info into a file
-

Tables

- - - - - - - - - - - - - -
globalGlobal Table
global.playersPlayer sub-table
EmitEmbededParamatersOutline of the paramaters accepted by Sync.emit_embedded
-

Fields

- - - - - - - - - -
infoused to get the global list that has been defined, also used to set that list
timeUsed to return and set the current IRL time; not very good need a better way to do this
-

modules.expgamingcore.sync.src.gui Functions

- - - - - - - - - - - - - -
_comment ()This file will be loaded when ExpGamingCore.Gui is present
add_to_gui (element)Adds a emeltent to the sever info gui
server-infoCreates a center gui that will appear on join
-

modules.expgamingcore.sync.src.ranking Functions

- - - - - - - - - - - - - -
_comment ()This file will be loaded when ExpGamingCore.Role is present
set_ranks (...)Used as a redirect to Ranking._base_preset that will set the rank given to a player apon joining
count_ranks ()Used to get the number of players in each rank and currently online
- -
-
- - -

Functions

- -
-
- - tick_format (tick) -
-
- Used to standidise the tick format for any sync info - - -

Parameters:

-
    -
  • tick - -
  • -
- -

Returns:

-
    - - {number,string} - table containg both the raw number and clean version of a time -
- - - -

Usage:

-
    -
    Sync.tick_format(60) -- return {60,'1.00M'}
    -
- -
-
- - print (player_message, player_name[, player_tag[, player_colour[, prefix]]]) -
-
- Prints to chat as if it were a player - - -

Parameters:

-
    -
  • player_message - string - the message to be printed in chat -
  • -
  • player_name - string - the name of the player sending the message -
  • -
  • player_tag - string - the tag apllied to the player's name - (optional) -
  • -
  • player_colour - string - the colour of the message, either hex or named colour - (optional) -
  • -
  • prefix - string - add a prefix before the chat eg [IRC] - (optional) -
  • -
- - - - -

Usage:

-
    -
    Sync.print('Test','Cooldude2606')
    -
- -
-
- - emit_embedded (args) -
-
- Logs an embed to the json.data we use a js script to add things we cant here - - -

Parameters:

-
    -
  • args - table - a table which contains everything that the embedded will use -
  • -
- - - -

See also:

- - -

Usage:

-
    -
    Sync.emit_embedded{title='BAN',color='0x0',description='A player was banned' ... }
    -
- -
-
- - count_admins () -
-
- Used to get the number of admins currently online - - - -

Returns:

-
    - - number - the number of admins online -
- - - -

Usage:

-
    -
    Sync.count_admins() -- returns number
    -
- -
-
- - count_afk ([time=7200]) -
-
- Used to get the number of afk players defined by 2 min by default - - -

Parameters:

-
    -
  • time - int - in ticks that a player is called afk - (default 7200) -
  • -
- -

Returns:

-
    - - number - the number of afk players -
- - - -

Usage:

-
    -
    Sync.count_afk()
    -
- -
-
- - count_ranks () -
-
- Used to get the number of players in each rank and currently online; if ExpGamingCore/Ranking is present then it will give more than admin and user - - - -

Returns:

-
    - - table - contains the ranks and the players in that rank -
- - - -

Usage:

-
    -
    Sync.count_ranks()
    -
- -
-
- - count_players (online) -
-
- Used to get a list of every player name with the option to limit to only online players - - -

Parameters:

-
    -
  • online - boolean - true will get only the online players -
  • -
- -

Returns:

-
    - - table - table of player names -
- - - -

Usage:

-
    -
    Sync.count_players()
    -
- -
-
- - count_player_times () -
-
- Used to get a list of every player name with the amount of time they have played for - - - -

Returns:

-
    - - table - table indexed by player name, each value contains the raw tick and then the clean string -
- - - -

Usage:

-
    -
    Sync.count_player_times()
    -
- -
-
- - update () -
-
- Called to update values inside of the info - - - -

Returns:

-
    - - all of the new info -
- - - -

Usage:

-
    -
    Sync.update()
    -
- -
-
- - add_update (key, callback) -
-
- Adds a callback to be called when the info is updated - - -

Parameters:

-
    -
  • key - string - the key that the value will be stored in -
  • -
  • callback - function - the function which will return this value -
  • -
- - - - -

Usage:

-
    -
    Sync.add_update('players',function() return #game.players end)
    -
- -
-
- - emit_data () -
-
- Outputs the curent server info into a file - - - - - - -

Usage:

-
    -
    Sync.emit_data()
    -
- -
-
-

Tables

- -
-
- - global -
-
- Global Table - - -

Fields:

-
    -
  • server_name - the server name -
  • -
  • server_description - a short description of the server -
  • -
  • reset_time - the reset time of the server -
  • -
  • time - the last knowen irl time -
  • -
  • time_set - the last in game time that the time was set -
  • -
  • last_update - the last time that this info was updated -
  • -
  • time_period - how often this infomation is updated -
  • -
  • players - a list of different player related states -
  • -
  • ranks - a list of player ranks -
  • -
  • rockets - the number of rockets launched -
  • -
  • mods - the mods which are loaded -
  • -
- - - - - -
-
- - global.players -
-
- Player sub-table - - -

Fields:

-
    -
  • online - list of all players online -
  • -
  • n_online - the number of players online -
  • -
  • all - list of all player on or offline -
  • -
  • n_all - the number of players who have joined the server -
  • -
  • admins_online - the number of admins online -
  • -
  • afk_players - the number of afk players -
  • -
  • times - the play times of every player -
  • -
- - - - - -
-
- - EmitEmbededParamaters -
-
- Outline of the paramaters accepted by Sync.emit_embedded - - -

Fields:

-
    -
  • title - the tile of the embed -
  • -
  • color - the color given in hex you can use Color.to_hex{r=0,g=0,b=0} -
  • -
  • description - the description of the embed -
  • -
  • server_detail - sting to add onto the pre-set server detail -
  • -
  • fieldone - the filed to add to the embed (key is name) (value is text) (start value with <<inline>> to make inline) -
  • -
  • fieldtwo - the filed to add to the embed (key is name) (value is text) (start value with <<inline>> to make inline) -
  • -
- - - - - -
-
-

Fields

- -
-
- - info -
-
- used to get the global list that has been defined, also used to set that list - - -
    -
  • set - table - keys to be replaced in the server info - (default nil) -
  • -
- - - - -

Usage:

-
    -
  • Sync.info{server_name='Factorio Server 2'} -- returns true
  • -
  • Sync.info -- table of info
  • -
- -
-
- - time -
-
- Used to return and set the current IRL time; not very good need a better way to do this - - -
    -
  • set - string - the date time to be set - (default nil) -
  • -
- - - - -

Usage:

-
    -
  • Sync.time('Sun Apr  1 18:44:30 UTC 2018')
  • -
  • Sync.time -- string
  • -
- -
-
-

modules.expgamingcore.sync.src.gui Functions

- -
-
- - _comment () -
-
- This file will be loaded when ExpGamingCore.Gui is present - - - - - - - -
-
- - add_to_gui (element) -
-
- Adds a emeltent to the sever info gui - - -

Parameters:

-
    -
  • element - see examples before for what can be used, it can also be a return from Gui.inputs.add -
  • -
- -

Returns:

-
    - - bolean - based on weather it was successful or not -
- - - -

Usage:

-
    -
    Sync.add_to_gui('string') -- return true
    -
- -
-
- - server-info -
-
- Creates a center gui that will appear on join - - - - - - - -
-
-

modules.expgamingcore.sync.src.ranking Functions

- -
-
- - _comment () -
-
- This file will be loaded when ExpGamingCore.Role is present - - - - - - - -
-
- - set_ranks (...) -
-
- Used as a redirect to Ranking._base_preset that will set the rank given to a player apon joining - - -

Parameters:

-
    -
  • ... - -
  • -
- - - - -

Usage:

-
    -
    Sync.set_ranks{player_name=rank_name,...}
    -
- -
-
- - count_ranks () -
-
- Used to get the number of players in each rank and currently online - - - -

Returns:

-
    - - table - contains the ranks and the players in that rank -
- - - -

Usage:

-
    -
    Sync.count_ranks()
    -
- -
-
- - -
-
-
-generated by LDoc 1.4.6 -Last updated 2018-06-07 12:58:23 -
-
- - diff --git a/doc/modules/ExpGamingLib.html b/doc/modules/ExpGamingLib.html deleted file mode 100644 index 5cea1e8b..00000000 --- a/doc/modules/ExpGamingLib.html +++ /dev/null @@ -1,672 +0,0 @@ - - - - - Reference - - - - -
- -
- -
-
-
- - -
- - - - - - -
- -

Module ExpGamingLib

-

Adds some common functions used though out all ExpGaming modules

-

-

Info:

-
    -
  • License: https://github.com/explosivegaming/scenario/blob/master/LICENSE
  • -
  • Author: Cooldude2606
  • -
- - -

Functions

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
unpack_to_G (tbl)Loads a table into _G even when sandboxed; will not overwrite values or append to tables; will not work during runtime to avoid desyncs
get_env ()Used to get the current ENV with all _G keys removed; useful when saving function to global
add_metatable (tbl[, callback=tostring[, string=table.tostring]])Creats a table that will act like a string and a function
is_type (v[, test_type=nil])Compear types faster for faster valadation of prams
player_return (rtn[, colour=defines.colour.white[, player=game.player]])Will return a value of any type to the player/server console, allows colour for in-game players
tick_to_hour (tick)Convert ticks to hours
tick_to_min (tick)Convert ticks to minutes
tick_to_display_format (tick)Converts a tick into a clean format for end user
gui_tree (root)Used as a way to view the structure of a gui, used for debuging
-

Class table

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
table.val_to_str (v)Returns a value in a form able to be read as a value, any value to string
table.key_to_str (k)Returns a value in a form able to be read as a key, any key to string
table.tostring (tbl)Returns a table in a form able to be read as a table
table.json (lua_table)Simmilar to table.tostring but converts a lua table to a json one
table.autokey (tbl, str)Returns the closest match to a key
table.alphanumsort (tbl)Returns the list is a sorted way that would be expected by people (this is by key)
table.keysort (tbl)Returns the list is a sorted way that would be expected by people (this is by key) (faster alterative than above)
- -
-
- - -

Functions

- -
-
- - unpack_to_G (tbl) -
-
- Loads a table into _G even when sandboxed; will not overwrite values or append to tables; will not work during runtime to avoid desyncs - - -

Parameters:

-
    -
  • tbl - table - table to be unpacked -
  • -
- - - - -

Usage:

-
    -
    unpack_to_G{key1='foo',key2='bar'}
    -
- -
-
- - get_env () -
-
- Used to get the current ENV with all _G keys removed; useful when saving function to global - - - -

Returns:

-
    - - table - the env table with _G keys removed -
- - - -

Usage:

-
    -
    get_env() returns current ENV with _G keys removed
    -
- -
-
- - add_metatable (tbl[, callback=tostring[, string=table.tostring]]) -
-
- Creats a table that will act like a string and a function - - -

Parameters:

-
    -
  • tbl - table - the table that will have its metatable set -
  • -
  • callback - function - the function that will be used for the call - (default tostring) -
  • -
  • string - function or string - a function that resolves to a string or a string - (default table.tostring) -
  • -
- -

Returns:

-
    - - table - the new table with its metatable set -
- - - -

Usage:

-
    -
    add_metatable({},function) -- returns table
    -
- -
-
- - is_type (v[, test_type=nil]) -
-
- Compear types faster for faster valadation of prams - - -

Parameters:

-
    -
  • v - the value to be tested -
  • -
  • test_type - string - the type to test for if not given then it tests for nil - (default nil) -
  • -
- -

Returns:

-
    - - bolean - is v of type test_type -
- - - -

Usage:

-
    -
  • is_type('foo','string') -- return true
  • -
  • is_type('foo') -- return false
  • -
- -
-
- - player_return (rtn[, colour=defines.colour.white[, player=game.player]]) -
-
- Will return a value of any type to the player/server console, allows colour for in-game players - - -

Parameters:

-
    -
  • rtn - any value of any type that will be returned to the player or console -
  • -
  • colour - defines.color or string - the colour of the text for the player, ingroned when printing to console - (default defines.colour.white) -
  • -
  • player - LuaPlayer - the player that return will go to, if no game.player then returns to server - (default game.player) -
  • -
- - - - -

Usage:

-
    -
  • player_return('Hello, World!') -- returns 'Hello, World!' to game.player or server console
  • -
  • player_return('Hello, World!','green') -- returns 'Hello, World!' to game.player with colour green or server console
  • -
  • player_return('Hello, World!',nil,player) -- returns 'Hello, World!' to the given player
  • -
- -
-
- - tick_to_hour (tick) -
-
- Convert ticks to hours - - -

Parameters:

-
    -
  • tick - number - tick to convert to hours -
  • -
- -

Returns:

-
    - - number - the number of whole hours from this tick -
- - - -

Usage:

-
    -
    tick_to_hour(216001) -- return 1
    -
- -
-
- - tick_to_min (tick) -
-
- Convert ticks to minutes - - -

Parameters:

-
    -
  • tick - number - tick to convert to minutes -
  • -
- -

Returns:

-
    - - number - the number of whole minutes from this tick -
- - - -

Usage:

-
    -
    tick_to_hour(3601) -- return 1
    -
- -
-
- - tick_to_display_format (tick) -
-
- Converts a tick into a clean format for end user - - -

Parameters:

-
    -
  • tick - number - the tick to convert -
  • -
- -

Returns:

-
    - - string - the formated string -
- - - -

Usage:

-
    -
  • tick_to_display_format(3600) -- return '1.00 M'
  • -
  • tick_to_display_format(234000) -- return '1 H 5 M'
  • -
- -
-
- - gui_tree (root) -
-
- Used as a way to view the structure of a gui, used for debuging - - -

Parameters:

-
    -
  • root - LuaGuiElement - the root to start the tree from -
  • -
- -

Returns:

-
    - - table - the table that describes the gui -
- - - -

Usage:

-
    -
    Gui_tree(root) returns all children of gui recusivly
    -
- -
-
-

Class table

- -
- Extents the table class -
-
-
- - table.val_to_str (v) -
-
- Returns a value in a form able to be read as a value, any value to string - - -

Parameters:

-
    -
  • v - value to convert -
  • -
- -

Returns:

-
    - - string - the converted value -
- - - -

Usage:

-
    -
    table.val_to_str{a='foo'} -- return '"foo"'
    -
- -
-
- - table.key_to_str (k) -
-
- Returns a value in a form able to be read as a key, any key to string - - -

Parameters:

-
    -
  • k - key to convert -
  • -
- -

Returns:

-
    - - string - the converted key -
- - - -

Usage:

-
    -
    table.val_to_str{a='foo'} -- return '["a"]'
    -
- -
-
- - table.tostring (tbl) -
-
- Returns a table in a form able to be read as a table - - -

Parameters:

-
    -
  • tbl - table - table to convert -
  • -
- -

Returns:

-
    - - string - the converted table -
- - - -

Usage:

-
    -
    table.tostring{k1='foo',k2='bar'} -- return '{["k1"]="foo",["k2"]="bar"}'
    -
- -
-
- - table.json (lua_table) -
-
- Simmilar to table.tostring but converts a lua table to a json one - - -

Parameters:

-
    -
  • lua_table - table - the table to convert -
  • -
- -

Returns:

-
    - - string - the table in a json format -
- - - -

Usage:

-
    -
    talbe.json{k1='foo',k2='bar'} -- return '{"k1":"foo","k2":"bar"}'
    -
- -
-
- - table.autokey (tbl, str) -
-
- Returns the closest match to a key - - -

Parameters:

-
    -
  • tbl - table - the table that will be searched -
  • -
  • str - string - the string that will be looked for in the keys -
  • -
- - - - -

Usage:

-
    -
    table.autokey({foo=1,bar=2},'f') -- return 1
    -
- -
-
- - table.alphanumsort (tbl) -
-
- Returns the list is a sorted way that would be expected by people (this is by key) - - -

Parameters:

-
    -
  • tbl - table - the table to be sorted -
  • -
- -

Returns:

-
    - - table - the sorted table -
- - - -

Usage:

-
    -
    tbl = table.alphanumsort(tbl)
    -
- -
-
- - table.keysort (tbl) -
-
- Returns the list is a sorted way that would be expected by people (this is by key) (faster alterative than above) - - -

Parameters:

-
    -
  • tbl - table - the table to be sorted -
  • -
- -

Returns:

-
    - - table - the sorted table -
- - - -

Usage:

-
    -
    tbl = table.alphanumsort(tbl)
    -
- -
-
- - -
-
-
-generated by LDoc 1.4.6 -Last updated 2018-06-07 12:58:23 -
-
- - diff --git a/doc/modules/FSM.html b/doc/modules/FSM.html deleted file mode 100644 index ff5d0e35..00000000 --- a/doc/modules/FSM.html +++ /dev/null @@ -1,455 +0,0 @@ - - - - - Reference - - - - -
- -
- -
-
-
- - -
- - - - - - -
- -

Module FSM

-

Factorio Softmod Manager

-

-

Usage:

-
    -
    Manager = require("FactorioSoftmodManager")
    -
    -
-

Info:

-
    -
  • Author: Cooldude2606
  • -
- - -

Functions

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
_verbose (rtn)Default output for the verbose
verbose (rtn, action)Used to call the output of the verbose when the current state allows it
setVerbose (settings)Main logic for allowing verbose at different stages though out the script
sandbox (callback[, env])Creates a sand box envorment and runs a callback in that sand box; provents global pollution
loadModules ()Loads the modules that are present in the index list
error (err, callback)A more detailed replacement for the lua error function to allow for handlers to be added; repleaces default error so error can be used instead of Manager.error
event (event_name, callback)Event handler that modules can use, each module can register one function per event
-

Tables

- - - - - - - - - -
verboseSettingsDifferent verbose settings used for setVerbose
Manager.event.namesSub set to Manger.event and acts as a coverter between event_name and event_id
-

Fields

- - - - - -
globalUsed to avoid conflicts in the global table
- -
-
- - -

Functions

- -
-
- - _verbose (rtn) -
-
- Default output for the verbose - - -

Parameters:

-
    -
  • rtn - string - the value that will be returned though verbose output -
  • -
- - - - -

Usage:

-
    -
    Manager.verbose('Hello, World!')
    -
- -
-
- - verbose (rtn, action) -
-
- Used to call the output of the verbose when the current state allows it - - -

Parameters:

-
    -
  • rtn - string - the value that will be returned though verbose output -
  • -
  • action - string - is used to decide which verbose this is error || event etc -
  • -
- - - - -

Usage:

-
    -
    Manager.verbose('Hello, World!')
    -
- -
-
- - setVerbose (settings) -
-
- Main logic for allowing verbose at different stages though out the script - - -

Parameters:

-
    -
  • settings - newTbl - the table that will be searched for settings to be updated -
  • -
- - - - -

Usage:

-
    -
  • Manager.setVerbose{output=log}
  • -
  • Manager.setVerbose[setting] -- returns the value of that setting
  • -
  • tostring(Manager.setVerbose) -- returns a formated list of the current settings
  • -
- -
-
- - sandbox (callback[, env]) -
-
- Creates a sand box envorment and runs a callback in that sand box; provents global pollution - - -

Parameters:

-
    -
  • callback - function - the function that will be ran in the sandbox -
  • -
  • env - any other params that the function will use - (optional) -
  • -
- - - - -

Usage:

-
    -
  • Manager.sandbox(callback) -- return sandbox, success, other returns from callback
  • -
  • Manager.sandbox() -- returns and empty sandbox
  • -
  • Manager.sandbox[key] -- returns the sand box value in that key
  • -
- -
-
- - loadModules () -
-
- Loads the modules that are present in the index list - - - - - - -

Usage:

-
    -
  • Manager.loadModules() -- loads all moddules in the index list
  • -
  • #Manager.loadModules -- returns the number of modules loaded
  • -
  • tostring(Manager.loadModules) -- returns a formatted list of all modules loaded
  • -
  • pairs(Manager.loadModules) -- loops over the loaded modules moduleName, module
  • -
- -
-
- - error (err, callback) -
-
- A more detailed replacement for the lua error function to allow for handlers to be added; repleaces default error so error can be used instead of Manager.error - - -

Parameters:

-
    -
  • err - string or fucntion - the string to be passed to handlers; if a function it will register a handler -
  • -
  • callback - function - if given the err param will be used to given the handler a name -
  • -
- - - - -

Usage:

-
    -
  • Manager.error(err) -- calls all error handlers that are set or if none then prints to game and if that fails crashs game
  • -
  • Manager.error() -- returns an error constant that can be used to crash game
  • -
  • Manager.error(Manager.error()) -- crashs the game
  • -
  • Manager.error.addHandler(name,callback) -- adds a new handler if handler returns Manager.error() then game will crash
  • -
  • Manager.error[name] -- returns the handler of that name if present
  • -
  • #Manager.error -- returns the number of error handlers that are present
  • -
  • pairs(Manager.error) -- loops over only the error handlers handler_name,hander
  • -
- -
-
- - event (event_name, callback) -
-
- Event handler that modules can use, each module can register one function per event - - -

Parameters:

-
    -
  • event_name - int or string - that referes to an event -
  • -
  • callback - function - the function that will be set for that event -
  • -
- - - - -

Usage:

-
    -
  • Manager.event[event_name] = callback -- sets the callback for that event
  • -
  • Manager.event[event_name] = nil -- clears the callback for that event
  • -
  • Manager.event(event_name,callback) -- sets the callback for that event
  • -
  • Manager.event[event_name] -- returns the callback for that event or the event id if not registered
  • -
  • Manager.event(event_name) -- runs all the call backs for that event
  • -
  • Manager.event() -- returns the stop value for the event proccessor, if returned during an event will stop all other callbacks
  • -
  • #Manager.event -- returns the number of callbacks that are registered
  • -
  • pairs(Manager.events) -- returns event_id,table of callbacks
  • -
- -
-
-

Tables

- -
-
- - verboseSettings -
-
- Different verbose settings used for setVerbose - - -

Fields:

-
    -
  • selfInit - boolean - called while the manager is being set up -
  • -
  • moduleLoad - boolean - when a module is required by the manager -
  • -
  • moduleInit - boolean - when and within the initation of a module -
  • -
  • moduleEnv - boolean - during module runtime, this is a global option set within each module(module_verbose=true ln:1) for fine control -
  • -
  • eventRegistered - boolean - when a module registers its event handlers -
  • -
  • errorCaught - boolean - when an error is caught during runtime -
  • -
  • output - function - can be: print || log || or other function -
  • -
  • _output - a constant value that can used to store output data -
  • -
- - - - - -
-
- - Manager.event.names -
-
- Sub set to Manger.event and acts as a coverter between event_name and event_id - - - - - - -

Usage:

-
    -
    Manager.event[event_name]
    -
- -
-
-

Fields

- -
-
- - global -
-
- Used to avoid conflicts in the global table - - -
    -
  • if - table, string or true - table then the default for the global, if a string then the module to get the global of, if true then reset the global to default - (default {}) -
  • -
- - - - -

Usage:

-
    -
  • global[key] -- used like the normal global table
  • -
  • global{'foo','bar'} -- sets the default value
  • -
  • global(true) -- restores global to default
  • -
  • global(mopdule_name) -- returns that module's global
  • -
- -
-
- - -
-
-
-generated by LDoc 1.4.6 -Last updated 2018-06-07 12:58:23 -
-
- - diff --git a/doc/modules/StdLib.Color.html b/doc/modules/StdLib.Color.html deleted file mode 100644 index bec3d07b..00000000 --- a/doc/modules/StdLib.Color.html +++ /dev/null @@ -1,561 +0,0 @@ - - - - - Reference - - - - -
- -
- -
-
-
- - -
- - - - - - -
- -

Module StdLib.Color

-

A defines module for retrieving colors by name.

-

- Extends the Factorio defines table.

- - -

Functions

- - - - - - - - - - - - - - - - - - - - - - - - - -
set ([color=white[, alpha=1]])Set a value for the alpha channel in the given color table.
to_table (c_arr)Converts a color in the array format to a color in the table format.
from_rgb ([r=0[, g=0[, b=0[, a=255]]]])Converts a color in the rgb format to a color table
from_hex (hex[, alpha=1])Get a color table with a hexadecimal string.
to_rgb (color)Converts a color in the color table format to rgb
to_hex (color)Converts a color in the color table format to hex
-

Tables

- - - - - - - - - - - - - - - - - -
defines.colorA table of colors allowing retrieval by color name.
defines.anticolorReturns white for dark colors or black for lighter colors.
defines.lightcolorReturns a lighter color of a named color
defines.textcolorReturns a lighter color of a named color.
- -
-
- - -

Functions

- -
-
- - set ([color=white[, alpha=1]]) -
-
- Set a value for the alpha channel in the given color table. - `color.a` represents the alpha channel in the given color table. -
    -
  • If ***alpha*** is given, set `color.a` to it. -
  • If ***alpha*** is not given, and if the given color table does not have a value for `color.a`, set `color.a` to 1. -
  • If ***alpha*** is not given, and if the given color table already has a value for `color.a`, then leave `color.a` alone. -
- - -

Parameters:

-
    -
  • color - defines.color or Concepts.Color - the color to configure - (default white) -
  • -
  • alpha - float - the alpha value (*[0 - 1]*) to set for the given color - (default 1) -
  • -
- -

Returns:

-
    - - a - color table that has the specified value for the alpha channel -
- - - - -
-
- - to_table (c_arr) -
-
- Converts a color in the array format to a color in the table format. - - -

Parameters:

-
    -
  • c_arr - table - the color to convert -
  • -
- -

Returns:

-
    - - a - converted color — { r = c\_arr[1], g = c\_arr[2], b = c\_arr[3], a = c\_arr[4] } -
- - - - -
-
- - from_rgb ([r=0[, g=0[, b=0[, a=255]]]]) -
-
- Converts a color in the rgb format to a color table - - -

Parameters:

-
    -
  • r - int - 0-255 red - (default 0) -
  • -
  • g - int - 0-255 green - (default 0) -
  • -
  • b - int - 0-255 blue - (default 0) -
  • -
  • a - int - 0-255 alpha - (default 255) -
  • -
- -

Returns:

-
    - - Concepts.Color - -
- - - - -
-
- - from_hex (hex[, alpha=1]) -
-
- Get a color table with a hexadecimal string. - Optionally provide the value for the alpha channel. - - -

Parameters:

-
    -
  • hex - string - hexadecimal color string (#ffffff, not #fff) -
  • -
  • alpha - float - the alpha value to set; such that ***[ 0 ⋜ value ⋜ 1 ]*** - (default 1) -
  • -
- -

Returns:

-
    - - a - color table with RGB converted from Hex and with alpha -
- - - - -
-
- - to_rgb (color) -
-
- Converts a color in the color table format to rgb - - -

Parameters:

-
    -
  • color - table - the color to convert -
  • -
- -

Returns:

-
    - - table - the color as rgb -
- - - - -
-
- - to_hex (color) -
-
- Converts a color in the color table format to hex - - -

Parameters:

-
    -
  • color - table - the color to convert -
  • -
- -

Returns:

-
    - - string - the color as hex -
- - - - -
-
-

Tables

- -
-
- - defines.color -
-
- A table of colors allowing retrieval by color name. - - -

Fields:

-
    -
  • white - {r=1.00,g=1.00,b=1.00} -
  • -
  • black - {r=0.00,g=0.00,b=0.00} -
  • -
  • darkgrey - {r=0.25,g=0.25,b=0.25} -
  • -
  • grey - {r=0.50,g=0.50,b=0.50} -
  • -
  • lightgrey - {r=0.75,g=0.75,b=0.75} -
  • -
  • red - {r=1.00,g=0.00,b=0.00} -
  • -
  • darkred - {r=0.50,g=0.00,b=0.00} -
  • -
  • lightred - {r=1.00,g=0.50,b=0.50} -
  • -
  • green - {r=0.00,g=1.00,b=0.00} -
  • -
  • darkgreen - {r=0.00,g=0.50,b=0.00} -
  • -
  • lightgreen - {r=0.50,g=1.00,b=0.50} -
  • -
  • blue - {r=0.00,g=0.00,b=1.00} -
  • -
  • darkblue - {r=0.00,g=0.00,b=0.50} -
  • -
  • lightblue - {r=0.50,g=0.50,b=1.00} -
  • -
  • orange - {r=1.00,g=0.55,b=0.10} -
  • -
  • yellow - {r=1.00,g=1.00,b=0.00} -
  • -
  • pink - {r=1.00,g=0.00,b=1.00} -
  • -
  • purple - {r=0.60,g=0.10,b=0.60} -
  • -
  • brown - {r=0.60,g=0.40,b=0.10} -
  • -
- - - - - -
-
- - defines.anticolor -
-
- Returns white for dark colors or black for lighter colors. - - -

Fields:

-
    -
  • green - defines.color.black -
  • -
  • grey - defines.color.black -
  • -
  • lightblue - defines.color.black -
  • -
  • lightgreen - defines.color.black -
  • -
  • lightgrey - defines.color.black -
  • -
  • lightred - defines.color.black -
  • -
  • orange - defines.color.black -
  • -
  • white - defines.color.black -
  • -
  • yellow - defines.color.black -
  • -
  • black - defines.color.white -
  • -
  • blue - defines.color.white -
  • -
  • brown - defines.color.white -
  • -
  • darkblue - defines.color.white -
  • -
  • darkgreen - defines.color.white -
  • -
  • darkgrey - defines.color.white -
  • -
  • darkred - defines.color.white -
  • -
  • pink - defines.color.white -
  • -
  • purple - defines.color.white -
  • -
  • red - defines.color.white -
  • -
- - - - - -
-
- - defines.lightcolor -
-
- Returns a lighter color of a named color - - -

Fields:

-
    -
  • white - defines.color.lightgrey -
  • -
  • grey - defines.color.darkgrey -
  • -
  • lightgrey - defines.color.grey -
  • -
  • red - defines.color.lightred -
  • -
  • green - defines.color.lightgreen -
  • -
  • blue - defines.color.lightblue -
  • -
  • yellow - defines.color.orange -
  • -
  • pink - defines.color.purple -
  • -
- - - - - -
-
- - defines.textcolor -
-
- Returns a lighter color of a named color. - - -

Fields:

-
    -
  • info - {r=0.21,g=0.95,b=1.00} -
  • -
  • bg - {r=0.00,g=0.00,b=0.00} -
  • -
  • low - {r=0.18,g=0.77,b=0.18} -
  • -
  • med - {r=1.00,g=0.89,b=0.26} -
  • -
  • high - {r=1.00,g=0.33,b=0.00} -
  • -
  • crit - {r=1.00,g=0.00,b=0.00} -
  • -
- - - - - -
-
- - -
-
-
-generated by LDoc 1.4.6 -Last updated 2018-06-07 12:58:23 -
-
- - diff --git a/doc/modules/StdLib.Game.html b/doc/modules/StdLib.Game.html deleted file mode 100644 index 627c73ad..00000000 --- a/doc/modules/StdLib.Game.html +++ /dev/null @@ -1,222 +0,0 @@ - - - - - Reference - - - - -
- -
- -
-
-
- - -
- - - - - - -
- -

Module StdLib.Game

-

The game module.

-

- - -

Functions

- - - - - - - - - - - - - - - - - -
fail_if_missing (var[, msg="missing value"])Print msg if specified var evaluates to false.
get_player (mixed)Return a valid player object from event, index, string, or userdata
get_force (mixed)Return a valid force object from event, string, or userdata
print_all (msg[, condition])Messages all players currently connected to the game.
- -
-
- - -

Functions

- -
-
- - fail_if_missing (var[, msg="missing value"]) -
-
- Print msg if specified var evaluates to false. - - -

Parameters:

-
    -
  • var - Mixed - variable to evaluate -
  • -
  • msg - string - message - (default "missing value") -
  • -
- - - - - -
-
- - get_player (mixed) -
-
- Return a valid player object from event, index, string, or userdata - - -

Parameters:

-
    -
  • mixed - string, number, LuaPlayer or event - -
  • -
- -

Returns:

-
    - - LuaPlayer - a valid player or nil -
- - - - -
-
- - get_force (mixed) -
-
- Return a valid force object from event, string, or userdata - - -

Parameters:

-
    -
  • mixed - string, LuaForce or event - -
  • -
- -

Returns:

-
    - - LuaForce - a valid force or nil -
- - - - -
-
- - print_all (msg[, condition]) -
-
- Messages all players currently connected to the game. -> Offline players are not counted as having received the message. - If no players exist msg is stored in the `global._print_queue` table. - - -

Parameters:

-
    -
  • msg - string - the message to send to players -
  • -
  • condition - nil or boolean - the condition to be true for a player to be messaged - (optional) -
  • -
- -

Returns:

-
    - - uint - the number of players who received the message. -
- - - - -
-
- - -
-
-
-generated by LDoc 1.4.6 -Last updated 2018-06-07 12:58:23 -
-
- - diff --git a/doc/modules/StdLib.String.html b/doc/modules/StdLib.String.html deleted file mode 100644 index fe5de748..00000000 --- a/doc/modules/StdLib.String.html +++ /dev/null @@ -1,302 +0,0 @@ - - - - - Reference - - - - -
- -
- -
-
-
- - -
- - - - - - -
- -

Module StdLib.String

-

Extends Lua 5.2 string.

-

- - -

Functions

- - - - - - - - - - - - - - - - - - - - - - - - - -
trim (s)Returns a copy of the string with any leading or trailing whitespace from the string removed.
starts_with (s, start)Tests if a string starts with a given substring.
ends_with (s, ends)Tests if a string ends with a given substring.
contains (s, contains)Tests if a string contains a given substring.
is_empty (s)Tests whether a string is empty.
split (s[, sep="."[, pattern=false]])Splits a string into an array.
- -
-
- - -

Functions

- -
-
- - trim (s) -
-
- Returns a copy of the string with any leading or trailing whitespace from the string removed. - - -

Parameters:

-
    -
  • s - string - the string to remove leading or trailing whitespace from -
  • -
- -

Returns:

-
    - - string - a copy of the string without leading or trailing whitespace -
- - - - -
-
- - starts_with (s, start) -
-
- Tests if a string starts with a given substring. - - -

Parameters:

-
    -
  • s - string - the string to check for the start substring -
  • -
  • start - string - the substring to test for -
  • -
- -

Returns:

-
    - - boolean - true if the start substring was found in the string -
- - - - -
-
- - ends_with (s, ends) -
-
- Tests if a string ends with a given substring. - - -

Parameters:

-
    -
  • s - string - the string to check for the end substring -
  • -
  • ends - string - the substring to test for -
  • -
- -

Returns:

-
    - - boolean - true if the end substring was found in the string -
- - - - -
-
- - contains (s, contains) -
-
- Tests if a string contains a given substring. - - -

Parameters:

-
    -
  • s - string - the string to check for the substring -
  • -
  • contains - string - the substring to test for -
  • -
- -

Returns:

-
    - - boolean - true if the substring was found in the string -
- - - - -
-
- - is_empty (s) -
-
- Tests whether a string is empty. - - -

Parameters:

-
    -
  • s - string - the string to test -
  • -
- -

Returns:

-
    - - boolean - true if the string is empty -
- - - - -
-
- - split (s[, sep="."[, pattern=false]]) -
-
- Splits a string into an array. - *Note:* Empty split substrings are not included in the resulting table. -

For example, `string.split("foo.bar...", ".", false)` results in the table `{"foo", "bar"}`. - - -

Parameters:

-
    -
  • s - string - the string to split -
  • -
  • sep - string - the separator to use. - (default ".") -
  • -
  • pattern - boolean - whether to interpret the separator as a lua pattern or plaintext for the string split - (default false) -
  • -
- -

Returns:

-
    - - {string,...} - an array of strings -
- - - - -
-
- - -
-
-
-generated by LDoc 1.4.6 -Last updated 2018-06-07 12:58:23 -
-
- - diff --git a/doc/modules/StdLib.Table.html b/doc/modules/StdLib.Table.html deleted file mode 100644 index 4c3d30c6..00000000 --- a/doc/modules/StdLib.Table.html +++ /dev/null @@ -1,922 +0,0 @@ - - - - - Reference - - - - -
- -
- -
-
-
- - -
- - - - - - -
- -

Module StdLib.Table

-

Extends Lua 5.2 table.

-

- - -

Functions

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
map (tbl, func[, ...])Given a mapping function, creates a transformed copy of the table - by calling the function for each element in the table, and using - the result as the new value for the key.
filter (tbl, func[, ...])Given a filter function, creates a filtered copy of the table - by calling the function for each element in the table, and - filtering out any key-value pairs for non-true results.
find (tbl, func[, ...])Given a candidate search function, iterates over the table, calling the function - for each element in the table, and returns the first element the search function returned true.
any (tbl, func[, ...])Given a candidate search function, iterates over the table, calling the function - for each element in the table, and returns true if search function returned true.
each (tbl, func[, ...])Given a function, apply it to each element in the table.
flatten (tbl[, level])Returns a new array that is a one-dimensional recursive flattening of the given array.
first (tbl)Given an array, returns the first element or nil if no element exists.
last (tbl)Given an array, returns the last element or nil if no elements exist.
min (tbl)Given an array of only numeric values, returns the minimum or nil if no element exists.
max (tbl)Given an array of only numeric values, returns the maximum or nil if no element exists.
sum (tbl)Given an array of only numeric values, return the sum of all values, or 0 for empty arrays.
avg (tbl)Given an array of only numeric values, returns the average or nil if no element exists.
merge (tblA, tblB[, array_merge=false])Merges two tables — values from first get overwritten by the second.
deepcopy (object)Creates a deep copy of table without copying Factorio objects.
values (tbl[, sorted[, as_string]])Returns a copy of all of the values in the table.
keys (tbl[, sorted[, as_string]])Returns a copy of all of the keys in the table.
remove_keys (tbl, keys)Removes keys from a table by setting the values associated with the keys to nil.
count_keys (tbl[, func[, ...]])Returns the number of keys in a table, if func is passed only count keys when the function is true.
invert (tbl)Returns an inverted (***{[value] = key,...}***) copy of the given table.
size (table)Return the size of a table using built in table_size function
arr_to_bool (tbl)For all string or number values in an array map them to a key = true table
- -
-
- - -

Functions

- -
-
- - map (tbl, func[, ...]) -
-
- Given a mapping function, creates a transformed copy of the table - by calling the function for each element in the table, and using - the result as the new value for the key. Passes the index as second argument to the function. - - -

Parameters:

-
    -
  • tbl - table - the table to be mapped to the transform -
  • -
  • func - function - the function to transform values -
  • -
  • ... - additional arguments passed to the function - (optional) -
  • -
- -

Returns:

-
    - - table - a new table containing the keys and mapped values -
- - - -

Usage:

-
    -
  • a= { 1, 2, 3, 4, 5}
    -table.map(a, function(v) return v * 10 end) --produces: { 10, 20, 30, 40, 50 }
  • -
  • a = {1, 2, 3, 4, 5}
    -table.map(a, function(v, k, x) return v * k + x end, 100) --produces { 101, 104, 109, 116, 125}
  • -
- -
-
- - filter (tbl, func[, ...]) -
-
- Given a filter function, creates a filtered copy of the table - by calling the function for each element in the table, and - filtering out any key-value pairs for non-true results. Passes the index as second argument to the function. - - -

Parameters:

-
    -
  • tbl - table - the table to be filtered -
  • -
  • func - function - the function to filter values -
  • -
  • ... - additional arguments passed to the function - (optional) -
  • -
- -

Returns:

-
    - - table - a new table containing the filtered key-value pairs -
- - - -

Usage:

-
    -
  • a= { 1, 2, 3, 4, 5}
    -table.filter(a, function(v) return v % 2 == 0 end) --produces: { 2, 4 }
  • -
  • a = {1, 2, 3, 4, 5}
    -table.filter(a, function(v, k, x) return k % 2 == 1 end) --produces: { 1, 3, 5 }
  • -
- -
-
- - find (tbl, func[, ...]) -
-
- Given a candidate search function, iterates over the table, calling the function - for each element in the table, and returns the first element the search function returned true. - Passes the index as second argument to the function. - - -

Parameters:

-
    -
  • tbl - table - the table to be searched -
  • -
  • func - function - the function to use to search for any matching element -
  • -
  • ... - additional arguments passed to the function - (optional) -
  • -
- -

Returns:

-
    - - nil or Mixed - the first found value, or nil if none was found -
- - - -

Usage:

-
    -
  • a= { 1, 2, 3, 4, 5}
    -table.find(a, function(v) return v % 2 == 0 end) --produces: 2
  • -
  • a = {1, 2, 3, 4, 5}
    -table.find(a, function(v, k, x) return k % 2 == 1 end) --produces: 1
  • -
- -
-
- - any (tbl, func[, ...]) -
-
- Given a candidate search function, iterates over the table, calling the function - for each element in the table, and returns true if search function returned true. - Passes the index as second argument to the function. - - -

Parameters:

-
    -
  • tbl - table - the table to be searched -
  • -
  • func - function - the function to use to search for any matching element -
  • -
  • ... - additional arguments passed to the function - (optional) -
  • -
- -

Returns:

-
    - - boolean - true if an element was found, false if none was found -
- - - -

Usage:

-
    -
  • a= { 1, 2, 3, 4, 5} table.any(a, function(v) return v % 2 == 0 end) --produces: true
  • -
  • a = {1, 2, 3, 4, 5} table.any(a, function(v, k, x) return k % 2 == 1 end) --produces: true
  • -
- -
-
- - each (tbl, func[, ...]) -
-
- Given a function, apply it to each element in the table. - Passes the index as the second argument to the function. -

Iteration is aborted if the applied function returns true for any element during iteration. - - -

Parameters:

-
    -
  • tbl - table - the table to be iterated -
  • -
  • func - function - the function to apply to elements -
  • -
  • ... - additional arguments passed to the function - (optional) -
  • -
- -

Returns:

-
    - - table - the table where the given function has been applied to its elements -
- - - -

Usage:

-
    -
    a = {10, 20, 30, 40}
    -table.each(a, function(v) game.print(v) end) --prints 10, 20, 30, 40, 50
    -
- -
-
- - flatten (tbl[, level]) -
-
- Returns a new array that is a one-dimensional recursive flattening of the given array. - For every element that is an array, extract its elements into the new array. -

The optional level argument determines the level of recursion to flatten. -> This function flattens an integer-indexed array, but not an associative array. - - -

Parameters:

-
    -
  • tbl - array - the array to be flattened -
  • -
  • level - uint - recursive levels, or no limit to recursion if not supplied - (optional) -
  • -
- -

Returns:

-
    - - array - a new array that represents the flattened contents of the given array -
- - - - -
-
- - first (tbl) -
-
- Given an array, returns the first element or nil if no element exists. - - -

Parameters:

-
    -
  • tbl - array - the array -
  • -
- -

Returns:

-
    - - nil or Mixed - the first element -
- - - - -
-
- - last (tbl) -
-
- Given an array, returns the last element or nil if no elements exist. - - -

Parameters:

-
    -
  • tbl - array - the array -
  • -
- -

Returns:

-
    - - nil or Mixed - the last element or nil -
- - - - -
-
- - min (tbl) -
-
- Given an array of only numeric values, returns the minimum or nil if no element exists. - - -

Parameters:

-
    -
  • tbl - {number,...} - the array with only numeric values -
  • -
- -

Returns:

-
    - - nil or number - the minimum value -
- - - - -
-
- - max (tbl) -
-
- Given an array of only numeric values, returns the maximum or nil if no element exists. - - -

Parameters:

-
    -
  • tbl - {number,...} - the array with only numeric values -
  • -
- -

Returns:

-
    - - nil or number - the maximum value -
- - - - -
-
- - sum (tbl) -
-
- Given an array of only numeric values, return the sum of all values, or 0 for empty arrays. - - -

Parameters:

-
    -
  • tbl - {number,...} - the array with only numeric values -
  • -
- -

Returns:

-
    - - number - the sum of the numbers or zero if the given array was empty -
- - - - -
-
- - avg (tbl) -
-
- Given an array of only numeric values, returns the average or nil if no element exists. - - -

Parameters:

-
    -
  • tbl - {number,...} - the array with only numeric values -
  • -
- -

Returns:

-
    - - nil or number - the average value -
- - - - -
-
- - merge (tblA, tblB[, array_merge=false]) -
-
- Merges two tables — values from first get overwritten by the second. - - -

Parameters:

-
    -
  • tblA - table - first table -
  • -
  • tblB - table - second table -
  • -
  • array_merge - boolean - set to true to merge the tables as an array or false for an associative array - (default false) -
  • -
- -

Returns:

-
    - - array or table - an array or an associated array where tblA and tblB have been merged -
- - - -

Usage:

-
    -
    function some_func(x, y, args)
    -    args = table.merge({option1=false}, args)
    -    if opts.option1 == true then return x else return y end
    -end
    -some_func(1,2) -- returns 2
    -some_func(1,2,{option1=true}) -- returns 1
    -
- -
-
- - deepcopy (object) -
-
- Creates a deep copy of table without copying Factorio objects. - - -

Parameters:

-
    -
  • object - table - the table to copy -
  • -
- -

Returns:

-
    - - table - a copy of the table -
- - - -

Usage:

-
    -
    local copy = table.deepcopy[data.raw.["stone-furnace"]["stone-furnace"]] -- returns a copy of the stone furnace entity
    -
- -
-
- - values (tbl[, sorted[, as_string]]) -
-
- Returns a copy of all of the values in the table. - - -

Parameters:

-
    -
  • tbl - table - the table to copy the keys from, or an empty table if tbl is nil -
  • -
  • sorted - boolean - whether to sort the keys (slower) or keep the random order from pairs() - (optional) -
  • -
  • as_string - boolean - whether to try and parse the values as strings, or leave them as their existing type - (optional) -
  • -
- -

Returns:

-
    - - array - an array with a copy of all the values in the table -
- - - - -
-
- - keys (tbl[, sorted[, as_string]]) -
-
- Returns a copy of all of the keys in the table. - - -

Parameters:

-
    -
  • tbl - table - the table to copy the keys from, or an empty table if tbl is nil -
  • -
  • sorted - boolean - whether to sort the keys (slower) or keep the random order from pairs() - (optional) -
  • -
  • as_string - boolean - whether to try and parse the keys as strings, or leave them as their existing type - (optional) -
  • -
- -

Returns:

-
    - - array - an array with a copy of all the keys in the table -
- - - - -
-
- - remove_keys (tbl, keys) -
-
- Removes keys from a table by setting the values associated with the keys to nil. - - -

Parameters:

-
    -
  • tbl - table - the table to remove the keys from -
  • -
  • keys - {Mixed,...} - an array of keys that exist in the given table -
  • -
- -

Returns:

-
    - - table - tbl without the specified keys -
- - - -

Usage:

-
    -
  • local a = {1, 2, 3, 4}
    -table.remove_keys(a, {1,3}) --returns {nil, 2, nil, 4}
  • -
  • local b = {k1 = 1, k2 = 'foo', old_key = 'bar'}
    -table.remove_keys(b, {'old_key'}) --returns {k1 = 1, k2 = 'foo'}
  • -
- -
-
- - count_keys (tbl[, func[, ...]]) -
-
- Returns the number of keys in a table, if func is passed only count keys when the function is true. - - -

Parameters:

-
    -
  • tbl - table - to count keys -
  • -
  • func - function - to incremement counter - (optional) -
  • -
  • ... - additional arguments passed to the function - (optional) -
  • -
- -

Returns:

-
    -
  1. - number - The number of keys matching the function or the number of all keys if func isn't passed
  2. -
  3. - number - The total number of keys
  4. -
- - - -

Usage:

-
    -
  • local a = { 1, 2, 3, 4, 5}
    - table.count_keys(a) -- produces: 5, 5
  • -
  • local a = {1, 2, 3, 4, 5}
    - table.count_keys(a, function(v, k) return k % 2 == 1 end) -- produces: 3, 5
  • -
- -
-
- - invert (tbl) -
-
- Returns an inverted (***{[value] = key,...}***) copy of the given table. If the values are not unique, the assigned key depends on the order of pairs(). - - -

Parameters:

-
    -
  • tbl - table - the table to invert -
  • -
- -

Returns:

-
    - - table - a new table with inverted mapping -
- - - -

Usage:

-
    -
  • local a = {k1 = 'foo', k2 = 'bar'}
    -table.invert(a) --returns {'foo' = k1, 'bar' = k2}
  • -
  • local b = {k1 = 'foo', k2 = 'bar', k3 = 'bar'}
    -table.invert(b) --returns {'foo' = k1, 'bar' = ?}
  • -
- -
-
- - size (table) -
-
- Return the size of a table using built in table_size function - - -

Parameters:

-
    -
  • table - table - to use -
  • -
- -

Returns:

-
    - - int - size of the table -
- - - - -
-
- - arr_to_bool (tbl) -
-
- For all string or number values in an array map them to a key = true table - - -

Parameters:

-
    -
  • tbl - table - the table to convert -
  • -
- -

Returns:

-
    - - table - the converted table -
- - - -

Usage:

-
    -
    local a = {"v1", "v2"}
    - table.array_to_dict_bool(a) -- return {["v1"] = true, ["v2"]= true}
    -
- -
-
- - -
-
-
-generated by LDoc 1.4.6 -Last updated 2018-06-07 12:58:23 -
-
- - diff --git a/doc/modules/StdLib.Time.html b/doc/modules/StdLib.Time.html deleted file mode 100644 index 1730086b..00000000 --- a/doc/modules/StdLib.Time.html +++ /dev/null @@ -1,139 +0,0 @@ - - - - - Reference - - - - -
- -
- -
-
-
- - -
- - - - - - -
- -

Module StdLib.Time

-

A defines module for retrieving the number of ticks in 1 unit of time.

-

- Extends the Factorio defines table.

- - -

Tables

- - - - - -
defines.timeReturns the number of ticks in a second, minute, hour, day, week, month, or year.
- -
-
- - -

Tables

- -
-
- - defines.time -
-
- Returns the number of ticks in a second, minute, hour, day, week, month, or year. - - -

Fields:

-
    -
  • second - the number of Factorio ticks in a second -
  • -
  • minute - the number of Factorio ticks in a second -
  • -
  • hour - the number of Factorio ticks in an hour -
  • -
  • day - the number of Factorio ticks in an day -
  • -
  • week - the number of Factorio ticks in a week -
  • -
  • month - the number of Factorio ticks in a month (30 days) -
  • -
  • year - the number of Factorio ticks in a year (365 days) -
  • -
- - - - -

Usage:

-
    -
    local ten_seconds = defines.time.second * 10
    -
- -
-
- - -
-
-
-generated by LDoc 1.4.6 -Last updated 2018-06-07 12:58:23 -
-
- -