diff --git a/LICENSE b/LICENSE index 261eeb9..4a67574 100644 --- a/LICENSE +++ b/LICENSE @@ -199,3 +199,5 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. + + diff --git a/README.md b/README.md index 679cd86..b0a4288 100644 --- a/README.md +++ b/README.md @@ -1,74 +1,9 @@ # New Readme -This is a custom fork of the lotj-mudlet-ui that includes some patches, additions to fix mapping when moving between visible and non visible rooms, and a virtual ship map feature that will allow you to map a ship once and use that map across all ships with that model. +This is a custom fork of the lotj-mudlet-ui that includes some additional features as listed below. -# lotj-mudlet-ui - -This is an attempt to provide a richer UI for [Legends of the Jedi MUD](https://www.legendsofthejedi.com/) in Mudlet. - -![Image of UI with ground map](https://raw.githubusercontent.com/LotJ/lotj-mudlet-ui/main/images/ground-map.png) - - -## Features - -### Ground Map - -This package includes a script hooking into Mudlet's mapper so you can map by (mostly) just walking around an unexplored area. - -It works fairly well on all existing planets. It's based on room vnums, which means it will consider each ship to be fully unique rooms. - -### Local System Map - -![Image of UI with ground map](https://raw.githubusercontent.com/LotJ/lotj-mudlet-ui/main/images/system-map.png) - -When flying in a system, triggers capture radar output and draw a visual representation of the radar, including zooming in/out and updating proximity of each other entity as your position changes. - -### Galaxy Map - -![Image of UI with ground map](https://raw.githubusercontent.com/LotJ/lotj-mudlet-ui/main/images/galaxy-map.png) - -After initializing it by running various in-game commands, this map will show all publicly listed starsystems, including coloring each government's planets differently. It will also attempt to highlight your current system when known, although that only works while in space. - -### Chat windows - -Certain types of chat content are scraped from the main console and copied into tabbed chat windows for easier history browsing. - -### Live-updating Status Bar - -![Image of Status Bar](https://raw.githubusercontent.com/LotJ/lotj-mudlet-ui/main/images/stats-bar.png) - -Right above your input box, you'll see a bunch of useful information which updates live. This includes: - -- Your HP/Move/(Mana?) -- Opponent's name and percentage -- Current comlink channel and encryption code -- Ship speed, coordinates, hull, shield, energy -- Piloting and chaff indicators, and a countdown to the next space tick - - -## Installing - -After creating a Mudlet profile to connect to LOTJ, do the following to add the package: - -1. Download a release of this package (the `.mpackage` file) from the [releases page](https://github.com/LotJ/lotj-mudlet-ui/releases) -1. Open the **Package Manager** - 1. If present, uninstall the **generic-mapper** package. It conflicts with the one provided here. - 1. Select the `lotj-ui-.mpackage` file you downloaded before for installation -1. Restart Mudlet and reconnect. The UI should populate fully once you log into a character. - - -## Contributing - -The source for this package is structured to use [muddler](https://github.com/demonnic/muddler) to package it into a Mudlet package. Using version 0.1 is necessary at this time due to some errant behavior by later Muddler versions. - -You can, of course, just modify the triggers/aliases/scripts directly within Mudlet if you want to test local changes, but they'll be overwritten if you want to update to future versions of this package. - -To change the source for this package, modify the JSON files and associated Lua scripts inside the `src` directory, then run `muddler` to regenerate the package. The resulting `.mpackage` file will be inside the `build` directory. - -If you have Docker set up, it can be easiest to run a command like this to regenerate the package, from the root of the repository: - -``` -docker run --rm -it -u $(id -u):$(id -g) -v $PWD:/$PWD -w /$PWD demonnic/muddler:0.1 -``` - -If that's a pain, just make a pull request and someone else can generate the package with your changes to make sure they work. +* Virtual Ship Maps +* Integrated Autostudy +* TLC Automator +* Engineering Suite +* Skill Training Suite \ No newline at end of file diff --git a/mfile b/mfile index 25cfeae..14abf0a 100644 --- a/mfile +++ b/mfile @@ -1,4 +1,4 @@ { "package": "lotj-ui", - "version": "v2.3.3" + "version": "v2.4" } \ No newline at end of file diff --git a/src/aliases/autostudy/study.list.lua b/src/aliases/autostudy/study.list.lua index 261087e..2c3f52e 100644 --- a/src/aliases/autostudy/study.list.lua +++ b/src/aliases/autostudy/study.list.lua @@ -1,6 +1,6 @@ local TableMaker = require("lotj-ui.MDK.ftext").TableMaker -if not studyList then +if not studyList or #studyList == 0 then cecho("Studylist Empty.") else studyTable = TableMaker:new({ @@ -14,12 +14,12 @@ else studyTable:addColumn({ name = "Index", width = "5", - textColor = "" + textColor = "" }) studyTable:addColumn({ name = "Study Item", width = "25", - textColor = "<>"green + textColor = "" }) for index, value in ipairs(studyList) do diff --git a/src/aliases/autostudy/study.resume.lua b/src/aliases/autostudy/study.resume.lua index 4085a98..2796b64 100644 --- a/src/aliases/autostudy/study.resume.lua +++ b/src/aliases/autostudy/study.resume.lua @@ -1,4 +1,4 @@ -if studyList and studyIndex then +if #studyList > 0 and studyIndex then send("study " .. studyList[studyIndex]) else send("You need to add items to your study list first. See studyhelp for commands.") diff --git a/src/resources/MDK/Big.flf b/src/resources/MDK/Big.flf deleted file mode 100755 index b130c1b..0000000 --- a/src/resources/MDK/Big.flf +++ /dev/null @@ -1,2204 +0,0 @@ -flf2a$ 8 6 59 15 10 0 24463 -Big by Glenn Chappell 4/93 -- based on Standard -Includes ISO Latin-1 -Greek characters by Bruce Jakeway -figlet release 2.2 -- November 1996 -Permission is hereby given to modify this font, as long as the -modifier's name is placed on a comment line. - -Modified by Paul Burton 12/96 to include new parameter -supported by FIGlet and FIGWin. May also be slightly modified for better use -of new full-width/kern/smush alternatives, but default output is NOT changed. - $@ - $@ - $@ - $@ - $@ - $@ - $@ - $@@ - _ @ - | |@ - | |@ - | |@ - |_|@ - (_)@ - @ - @@ - _ _ @ - ( | )@ - V V @ - $ @ - $ @ - $ @ - @ - @@ - _ _ @ - _| || |_ @ - |_ __ _|@ - _| || |_ @ - |_ __ _|@ - |_||_| @ - @ - @@ - _ @ - | | @ - / __)@ - \__ \@ - ( /@ - |_| @ - @ - @@ - _ __@ - (_) / /@ - / / @ - / / @ - / / _ @ - /_/ (_)@ - @ - @@ - @ - ___ @ - ( _ ) @ - / _ \/\@ - | (_> <@ - \___/\/@ - @ - @@ - _ @ - ( )@ - |/ @ - $ @ - $ @ - $ @ - @ - @@ - __@ - / /@ - | | @ - | | @ - | | @ - | | @ - \_\@ - @@ - __ @ - \ \ @ - | |@ - | |@ - | |@ - | |@ - /_/ @ - @@ - _ @ - /\| |/\ @ - \ ` ' / @ - |_ _|@ - / , . \ @ - \/|_|\/ @ - @ - @@ - @ - _ @ - _| |_ @ - |_ _|@ - |_| @ - $ @ - @ - @@ - @ - @ - @ - @ - _ @ - ( )@ - |/ @ - @@ - @ - @ - ______ @ - |______|@ - $ @ - $ @ - @ - @@ - @ - @ - @ - @ - _ @ - (_)@ - @ - @@ - __@ - / /@ - / / @ - / / @ - / / @ - /_/ @ - @ - @@ - ___ @ - / _ \ @ - | | | |@ - | | | |@ - | |_| |@ - \___/ @ - @ - @@ - __ @ - /_ |@ - | |@ - | |@ - | |@ - |_|@ - @ - @@ - ___ @ - |__ \ @ - $) |@ - / / @ - / /_ @ - |____|@ - @ - @@ - ____ @ - |___ \ @ - __) |@ - |__ < @ - ___) |@ - |____/ @ - @ - @@ - _ _ @ - | || | @ - | || |_ @ - |__ _|@ - | | @ - |_| @ - @ - @@ - _____ @ - | ____|@ - | |__ @ - |___ \ @ - ___) |@ - |____/ @ - @ - @@ - __ @ - / / @ - / /_ @ - | '_ \ @ - | (_) |@ - \___/ @ - @ - @@ - ______ @ - |____ |@ - $/ / @ - / / @ - / / @ - /_/ @ - @ - @@ - ___ @ - / _ \ @ - | (_) |@ - > _ < @ - | (_) |@ - \___/ @ - @ - @@ - ___ @ - / _ \ @ - | (_) |@ - \__, |@ - / / @ - /_/ @ - @ - @@ - @ - _ @ - (_)@ - $ @ - _ @ - (_)@ - @ - @@ - @ - _ @ - (_)@ - $ @ - _ @ - ( )@ - |/ @ - @@ - __@ - / /@ - / / @ - < < @ - \ \ @ - \_\@ - @ - @@ - @ - ______ @ - |______|@ - ______ @ - |______|@ - @ - @ - @@ - __ @ - \ \ @ - \ \ @ - > >@ - / / @ - /_/ @ - @ - @@ - ___ @ - |__ \ @ - ) |@ - / / @ - |_| @ - (_) @ - @ - @@ - @ - ____ @ - / __ \ @ - / / _` |@ - | | (_| |@ - \ \__,_|@ - \____/ @ - @@ - @ - /\ @ - / \ @ - / /\ \ @ - / ____ \ @ - /_/ \_\@ - @ - @@ - ____ @ - | _ \ @ - | |_) |@ - | _ < @ - | |_) |@ - |____/ @ - @ - @@ - _____ @ - / ____|@ - | | $ @ - | | $ @ - | |____ @ - \_____|@ - @ - @@ - _____ @ - | __ \ @ - | | | |@ - | | | |@ - | |__| |@ - |_____/ @ - @ - @@ - ______ @ - | ____|@ - | |__ @ - | __| @ - | |____ @ - |______|@ - @ - @@ - ______ @ - | ____|@ - | |__ @ - | __| @ - | | @ - |_| @ - @ - @@ - _____ @ - / ____|@ - | | __ @ - | | |_ |@ - | |__| |@ - \_____|@ - @ - @@ - _ _ @ - | | | |@ - | |__| |@ - | __ |@ - | | | |@ - |_| |_|@ - @ - @@ - _____ @ - |_ _|@ - | | @ - | | @ - _| |_ @ - |_____|@ - @ - @@ - _ @ - | |@ - | |@ - _ | |@ - | |__| |@ - \____/ @ - @ - @@ - _ __@ - | |/ /@ - | ' / @ - | < @ - | . \ @ - |_|\_\@ - @ - @@ - _ @ - | | @ - | | @ - | | @ - | |____ @ - |______|@ - @ - @@ - __ __ @ - | \/ |@ - | \ / |@ - | |\/| |@ - | | | |@ - |_| |_|@ - @ - @@ - _ _ @ - | \ | |@ - | \| |@ - | . ` |@ - | |\ |@ - |_| \_|@ - @ - @@ - ____ @ - / __ \ @ - | | | |@ - | | | |@ - | |__| |@ - \____/ @ - @ - @@ - _____ @ - | __ \ @ - | |__) |@ - | ___/ @ - | | @ - |_| @ - @ - @@ - ____ @ - / __ \ @ - | | | |@ - | | | |@ - | |__| |@ - \___\_\@ - @ - @@ - _____ @ - | __ \ @ - | |__) |@ - | _ / @ - | | \ \ @ - |_| \_\@ - @ - @@ - _____ @ - / ____|@ - | (___ @ - \___ \ @ - ____) |@ - |_____/ @ - @ - @@ - _______ @ - |__ __|@ - | | @ - | | @ - | | @ - |_| @ - @ - @@ - _ _ @ - | | | |@ - | | | |@ - | | | |@ - | |__| |@ - \____/ @ - @ - @@ - __ __@ - \ \ / /@ - \ \ / / @ - \ \/ / @ - \ / @ - \/ @ - @ - @@ - __ __@ - \ \ / /@ - \ \ /\ / / @ - \ \/ \/ / @ - \ /\ / @ - \/ \/ @ - @ - @@ - __ __@ - \ \ / /@ - \ V / @ - > < @ - / . \ @ - /_/ \_\@ - @ - @@ - __ __@ - \ \ / /@ - \ \_/ / @ - \ / @ - | | @ - |_| @ - @ - @@ - ______@ - |___ /@ - $/ / @ - / / @ - / /__ @ - /_____|@ - @ - @@ - ___ @ - | _|@ - | | @ - | | @ - | | @ - | |_ @ - |___|@ - @@ - __ @ - \ \ @ - \ \ @ - \ \ @ - \ \ @ - \_\@ - @ - @@ - ___ @ - |_ |@ - | |@ - | |@ - | |@ - _| |@ - |___|@ - @@ - /\ @ - |/\|@ - $ @ - $ @ - $ @ - $ @ - @ - @@ - @ - @ - @ - @ - @ - $ @ - ______ @ - |______|@@ - _ @ - ( )@ - \|@ - $ @ - $ @ - $ @ - @ - @@ - @ - @ - __ _ @ - / _` |@ - | (_| |@ - \__,_|@ - @ - @@ - _ @ - | | @ - | |__ @ - | '_ \ @ - | |_) |@ - |_.__/ @ - @ - @@ - @ - @ - ___ @ - / __|@ - | (__ @ - \___|@ - @ - @@ - _ @ - | |@ - __| |@ - / _` |@ - | (_| |@ - \__,_|@ - @ - @@ - @ - @ - ___ @ - / _ \@ - | __/@ - \___|@ - @ - @@ - __ @ - / _|@ - | |_ @ - | _|@ - | | @ - |_| @ - @ - @@ - @ - @ - __ _ @ - / _` |@ - | (_| |@ - \__, |@ - __/ |@ - |___/ @@ - _ @ - | | @ - | |__ @ - | '_ \ @ - | | | |@ - |_| |_|@ - @ - @@ - _ @ - (_)@ - _ @ - | |@ - | |@ - |_|@ - @ - @@ - _ @ - (_)@ - _ @ - | |@ - | |@ - | |@ - _/ |@ - |__/ @@ - _ @ - | | @ - | | __@ - | |/ /@ - | < @ - |_|\_\@ - @ - @@ - _ @ - | |@ - | |@ - | |@ - | |@ - |_|@ - @ - @@ - @ - @ - _ __ ___ @ - | '_ ` _ \ @ - | | | | | |@ - |_| |_| |_|@ - @ - @@ - @ - @ - _ __ @ - | '_ \ @ - | | | |@ - |_| |_|@ - @ - @@ - @ - @ - ___ @ - / _ \ @ - | (_) |@ - \___/ @ - @ - @@ - @ - @ - _ __ @ - | '_ \ @ - | |_) |@ - | .__/ @ - | | @ - |_| @@ - @ - @ - __ _ @ - / _` |@ - | (_| |@ - \__, |@ - | |@ - |_|@@ - @ - @ - _ __ @ - | '__|@ - | | @ - |_| @ - @ - @@ - @ - @ - ___ @ - / __|@ - \__ \@ - |___/@ - @ - @@ - _ @ - | | @ - | |_ @ - | __|@ - | |_ @ - \__|@ - @ - @@ - @ - @ - _ _ @ - | | | |@ - | |_| |@ - \__,_|@ - @ - @@ - @ - @ - __ __@ - \ \ / /@ - \ V / @ - \_/ @ - @ - @@ - @ - @ - __ __@ - \ \ /\ / /@ - \ V V / @ - \_/\_/ @ - @ - @@ - @ - @ - __ __@ - \ \/ /@ - > < @ - /_/\_\@ - @ - @@ - @ - @ - _ _ @ - | | | |@ - | |_| |@ - \__, |@ - __/ |@ - |___/ @@ - @ - @ - ____@ - |_ /@ - / / @ - /___|@ - @ - @@ - __@ - / /@ - | | @ - / / @ - \ \ @ - | | @ - \_\@ - @@ - _ @ - | |@ - | |@ - | |@ - | |@ - | |@ - | |@ - |_|@@ - __ @ - \ \ @ - | | @ - \ \@ - / /@ - | | @ - /_/ @ - @@ - /\/|@ - |/\/ @ - $ @ - $ @ - $ @ - $ @ - @ - @@ - _ _ @ - (_)_(_) @ - / \ @ - / _ \ @ - / ___ \ @ - /_/ \_\@ - @ - @@ - _ _ @ - (_)_(_)@ - / _ \ @ - | | | |@ - | |_| |@ - \___/ @ - @ - @@ - _ _ @ - (_) (_)@ - | | | |@ - | | | |@ - | |_| |@ - \___/ @ - @ - @@ - _ _ @ - (_) (_)@ - __ _ @ - / _` |@ - | (_| |@ - \__,_|@ - @ - @@ - _ _ @ - (_) (_)@ - ___ @ - / _ \ @ - | (_) |@ - \___/ @ - @ - @@ - _ _ @ - (_) (_)@ - _ _ @ - | | | |@ - | |_| |@ - \__,_|@ - @ - @@ - ___ @ - / _ \ @ - | | ) |@ - | |< < @ - | | ) |@ - | ||_/ @ - |_| @ - @@ -160 NO-BREAK SPACE - $@ - $@ - $@ - $@ - $@ - $@ - $@ - $@@ -161 INVERTED EXCLAMATION MARK - _ @ - (_)@ - | |@ - | |@ - | |@ - |_|@ - @ - @@ -162 CENT SIGN - @ - _ @ - | | @ - / __)@ - | (__ @ - \ )@ - |_| @ - @@ -163 POUND SIGN - ___ @ - / ,_\ @ - _| |_ @ - |__ __| @ - | |____ @ - (_,_____|@ - @ - @@ -164 CURRENCY SIGN - @ - /\___/\@ - \ _ /@ - | (_) |@ - / ___ \@ - \/ \/@ - @ - @@ -165 YEN SIGN - __ __ @ - \ \ / / @ - _\ V /_ @ - |___ ___|@ - |___ ___|@ - |_| @ - @ - @@ -166 BROKEN BAR - _ @ - | |@ - | |@ - |_|@ - _ @ - | |@ - | |@ - |_|@@ -167 SECTION SIGN - __ @ - _/ _)@ - / \ \ @ - \ \\ \@ - \ \_/@ - (__/ @ - @ - @@ -168 DIAERESIS - _ _ @ - (_) (_)@ - $ $ @ - $ $ @ - $ $ @ - $ $ @ - @ - @@ -169 COPYRIGHT SIGN - ________ @ - / ____ \ @ - / / ___| \ @ - | | | |@ - | | |___ |@ - \ \____| / @ - \________/ @ - @@ -170 FEMININE ORDINAL INDICATOR - __ _ @ - / _` |@ - | (_| |@ - \__,_|@ - |_____|@ - $ @ - @ - @@ -171 LEFT-POINTING DOUBLE ANGLE QUOTATION MARK - ____@ - / / /@ - / / / @ - < < < @ - \ \ \ @ - \_\_\@ - @ - @@ -172 NOT SIGN - @ - @ - ______ @ - |____ |@ - |_|@ - $ @ - @ - @@ -173 SOFT HYPHEN - @ - @ - _____ @ - |_____|@ - $ @ - $ @ - @ - @@ -174 REGISTERED SIGN - ________ @ - / ____ \ @ - / | _ \ \ @ - | | |_) | |@ - | | _ < |@ - \ |_| \_\ / @ - \________/ @ - @@ -175 MACRON - ______ @ - |______|@ - $ @ - $ @ - $ @ - $ @ - @ - @@ -176 DEGREE SIGN - __ @ - / \ @ - | () |@ - \__/ @ - $ @ - $ @ - @ - @@ -177 PLUS-MINUS SIGN - _ @ - _| |_ @ - |_ _|@ - |_| @ - _____ @ - |_____|@ - @ - @@ -178 SUPERSCRIPT TWO - ___ @ - |_ )@ - / / @ - /___|@ - $ @ - $ @ - @ - @@ -179 SUPERSCRIPT THREE - ____@ - |__ /@ - |_ \@ - |___/@ - $ @ - $ @ - @ - @@ -180 ACUTE ACCENT - __@ - /_/@ - $ @ - $ @ - $ @ - $ @ - @ - @@ -181 MICRO SIGN - @ - @ - _ _ @ - | | | |@ - | |_| |@ - | ._,_|@ - | | @ - |_| @@ -182 PILCROW SIGN - ______ @ - / |@ - | (| || |@ - \__ || |@ - | || |@ - |_||_|@ - @ - @@ -183 MIDDLE DOT - @ - @ - _ @ - (_)@ - $ @ - $ @ - @ - @@ -184 CEDILLA - @ - @ - @ - @ - @ - _ @ - )_)@ - @@ -185 SUPERSCRIPT ONE - _ @ - / |@ - | |@ - |_|@ - $ @ - $ @ - @ - @@ -186 MASCULINE ORDINAL INDICATOR - ___ @ - / _ \ @ - | (_) |@ - \___/ @ - |_____|@ - $ @ - @ - @@ -187 RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK - ____ @ - \ \ \ @ - \ \ \ @ - > > >@ - / / / @ - /_/_/ @ - @ - @@ -188 VULGAR FRACTION ONE QUARTER - _ __ @ - / | / / @ - | |/ / _ @ - |_/ / | | @ - / /|_ _|@ - /_/ |_| @ - @ - @@ -189 VULGAR FRACTION ONE HALF - _ __ @ - / | / / @ - | |/ /__ @ - |_/ /_ )@ - / / / / @ - /_/ /___|@ - @ - @@ -190 VULGAR FRACTION THREE QUARTERS - ____ __ @ - |__ / / / @ - |_ \/ / _ @ - |___/ / | | @ - / /|_ _|@ - /_/ |_| @ - @ - @@ -191 INVERTED QUESTION MARK - _ @ - (_) @ - | | @ - / / @ - | (__ @ - \___|@ - @ - @@ -192 LATIN CAPITAL LETTER A WITH GRAVE - __ @ - \_\ @ - / \ @ - / _ \ @ - / ___ \ @ - /_/ \_\@ - @ - @@ -193 LATIN CAPITAL LETTER A WITH ACUTE - __ @ - /_/ @ - / \ @ - / _ \ @ - / ___ \ @ - /_/ \_\@ - @ - @@ -194 LATIN CAPITAL LETTER A WITH CIRCUMFLEX - //\ @ - |/_\| @ - / \ @ - / _ \ @ - / ___ \ @ - /_/ \_\@ - @ - @@ -195 LATIN CAPITAL LETTER A WITH TILDE - /\/| @ - |/\/ @ - / \ @ - / _ \ @ - / ___ \ @ - /_/ \_\@ - @ - @@ -196 LATIN CAPITAL LETTER A WITH DIAERESIS - _ _ @ - (_)_(_) @ - / \ @ - / _ \ @ - / ___ \ @ - /_/ \_\@ - @ - @@ -197 LATIN CAPITAL LETTER A WITH RING ABOVE - _ @ - (o) @ - / \ @ - / _ \ @ - / ___ \ @ - /_/ \_\@ - @ - @@ -198 LATIN CAPITAL LETTER AE - _______ @ - / ____|@ - / |__ @ - / /| __| @ - / ___ |____ @ - /_/ |______|@ - @ - @@ -199 LATIN CAPITAL LETTER C WITH CEDILLA - _____ @ - / ____|@ - | | $ @ - | | $ @ - | |____ @ - \_____|@ - )_) @ - @@ -200 LATIN CAPITAL LETTER E WITH GRAVE - __ @ - _\_\_ @ - | ____|@ - | _| @ - | |___ @ - |_____|@ - @ - @@ -201 LATIN CAPITAL LETTER E WITH ACUTE - __ @ - _/_/_ @ - | ____|@ - | _| @ - | |___ @ - |_____|@ - @ - @@ -202 LATIN CAPITAL LETTER E WITH CIRCUMFLEX - //\ @ - |/ \| @ - | ____|@ - | _| @ - | |___ @ - |_____|@ - @ - @@ -203 LATIN CAPITAL LETTER E WITH DIAERESIS - _ _ @ - (_) (_)@ - | ____|@ - | _| @ - | |___ @ - |_____|@ - @ - @@ -204 LATIN CAPITAL LETTER I WITH GRAVE - __ @ - \_\ @ - |_ _|@ - | | @ - | | @ - |___|@ - @ - @@ -205 LATIN CAPITAL LETTER I WITH ACUTE - __ @ - /_/ @ - |_ _|@ - | | @ - | | @ - |___|@ - @ - @@ -206 LATIN CAPITAL LETTER I WITH CIRCUMFLEX - //\ @ - |/_\|@ - |_ _|@ - | | @ - | | @ - |___|@ - @ - @@ -207 LATIN CAPITAL LETTER I WITH DIAERESIS - _ _ @ - (_)_(_)@ - |_ _| @ - | | @ - | | @ - |___| @ - @ - @@ -208 LATIN CAPITAL LETTER ETH - _____ @ - | __ \ @ - _| |_ | |@ - |__ __|| |@ - | |__| |@ - |_____/ @ - @ - @@ -209 LATIN CAPITAL LETTER N WITH TILDE - /\/| @ - |/\/_ @ - | \ | |@ - | \| |@ - | |\ |@ - |_| \_|@ - @ - @@ -210 LATIN CAPITAL LETTER O WITH GRAVE - __ @ - \_\ @ - / _ \ @ - | | | |@ - | |_| |@ - \___/ @ - @ - @@ -211 LATIN CAPITAL LETTER O WITH ACUTE - __ @ - /_/ @ - / _ \ @ - | | | |@ - | |_| |@ - \___/ @ - @ - @@ -212 LATIN CAPITAL LETTER O WITH CIRCUMFLEX - //\ @ - |/_\| @ - / _ \ @ - | | | |@ - | |_| |@ - \___/ @ - @ - @@ -213 LATIN CAPITAL LETTER O WITH TILDE - /\/| @ - |/\/ @ - / _ \ @ - | | | |@ - | |_| |@ - \___/ @ - @ - @@ -214 LATIN CAPITAL LETTER O WITH DIAERESIS - _ _ @ - (_)_(_)@ - / _ \ @ - | | | |@ - | |_| |@ - \___/ @ - @ - @@ -215 MULTIPLICATION SIGN - @ - @ - /\/\@ - > <@ - \/\/@ - $ @ - @ - @@ -216 LATIN CAPITAL LETTER O WITH STROKE - _____ @ - / __// @ - | | // |@ - | |//| |@ - | //_| |@ - //___/ @ - @ - @@ -217 LATIN CAPITAL LETTER U WITH GRAVE - __ @ - _\_\_ @ - | | | |@ - | | | |@ - | |_| |@ - \___/ @ - @ - @@ -218 LATIN CAPITAL LETTER U WITH ACUTE - __ @ - _/_/_ @ - | | | |@ - | | | |@ - | |_| |@ - \___/ @ - @ - @@ -219 LATIN CAPITAL LETTER U WITH CIRCUMFLEX - //\ @ - |/ \| @ - | | | |@ - | | | |@ - | |_| |@ - \___/ @ - @ - @@ -220 LATIN CAPITAL LETTER U WITH DIAERESIS - _ _ @ - (_) (_)@ - | | | |@ - | | | |@ - | |_| |@ - \___/ @ - @ - @@ -221 LATIN CAPITAL LETTER Y WITH ACUTE - __ @ - __/_/__@ - \ \ / /@ - \ V / @ - | | @ - |_| @ - @ - @@ -222 LATIN CAPITAL LETTER THORN - _ @ - | |___ @ - | __ \ @ - | |__) |@ - | ___/ @ - |_| @ - @ - @@ -223 LATIN SMALL LETTER SHARP S - ___ @ - / _ \ @ - | | ) |@ - | |< < @ - | | ) |@ - | ||_/ @ - |_| @ - @@ -224 LATIN SMALL LETTER A WITH GRAVE - __ @ - \_\ @ - __ _ @ - / _` |@ - | (_| |@ - \__,_|@ - @ - @@ -225 LATIN SMALL LETTER A WITH ACUTE - __ @ - /_/ @ - __ _ @ - / _` |@ - | (_| |@ - \__,_|@ - @ - @@ -226 LATIN SMALL LETTER A WITH CIRCUMFLEX - //\ @ - |/ \| @ - __ _ @ - / _` |@ - | (_| |@ - \__,_|@ - @ - @@ -227 LATIN SMALL LETTER A WITH TILDE - /\/| @ - |/\/ @ - __ _ @ - / _` |@ - | (_| |@ - \__,_|@ - @ - @@ -228 LATIN SMALL LETTER A WITH DIAERESIS - _ _ @ - (_) (_)@ - __ _ @ - / _` |@ - | (_| |@ - \__,_|@ - @ - @@ -229 LATIN SMALL LETTER A WITH RING ABOVE - __ @ - (()) @ - __ _ @ - / _` |@ - | (_| |@ - \__,_|@ - @ - @@ -230 LATIN SMALL LETTER AE - @ - @ - __ ____ @ - / _` _ \@ - | (_| __/@ - \__,____|@ - @ - @@ -231 LATIN SMALL LETTER C WITH CEDILLA - @ - @ - ___ @ - / __|@ - | (__ @ - \___|@ - )_) @ - @@ -232 LATIN SMALL LETTER E WITH GRAVE - __ @ - \_\ @ - ___ @ - / _ \@ - | __/@ - \___|@ - @ - @@ -233 LATIN SMALL LETTER E WITH ACUTE - __ @ - /_/ @ - ___ @ - / _ \@ - | __/@ - \___|@ - @ - @@ -234 LATIN SMALL LETTER E WITH CIRCUMFLEX - //\ @ - |/ \|@ - ___ @ - / _ \@ - | __/@ - \___|@ - @ - @@ -235 LATIN SMALL LETTER E WITH DIAERESIS - _ _ @ - (_) (_)@ - ___ @ - / _ \ @ - | __/ @ - \___| @ - @ - @@ -236 LATIN SMALL LETTER I WITH GRAVE - __ @ - \_\@ - _ @ - | |@ - | |@ - |_|@ - @ - @@ -237 LATIN SMALL LETTER I WITH ACUTE - __@ - /_/@ - _ @ - | |@ - | |@ - |_|@ - @ - @@ -238 LATIN SMALL LETTER I WITH CIRCUMFLEX - //\ @ - |/ \|@ - _ @ - | | @ - | | @ - |_| @ - @ - @@ -239 LATIN SMALL LETTER I WITH DIAERESIS - _ _ @ - (_) (_)@ - _ @ - | | @ - | | @ - |_| @ - @ - @@ -240 LATIN SMALL LETTER ETH - /\/\ @ - > < @ - \/\ \ @ - / _` |@ - | (_) |@ - \___/ @ - @ - @@ -241 LATIN SMALL LETTER N WITH TILDE - /\/| @ - |/\/ @ - _ __ @ - | '_ \ @ - | | | |@ - |_| |_|@ - @ - @@ -242 LATIN SMALL LETTER O WITH GRAVE - __ @ - \_\ @ - ___ @ - / _ \ @ - | (_) |@ - \___/ @ - @ - @@ -243 LATIN SMALL LETTER O WITH ACUTE - __ @ - /_/ @ - ___ @ - / _ \ @ - | (_) |@ - \___/ @ - @ - @@ -244 LATIN SMALL LETTER O WITH CIRCUMFLEX - //\ @ - |/ \| @ - ___ @ - / _ \ @ - | (_) |@ - \___/ @ - @ - @@ -245 LATIN SMALL LETTER O WITH TILDE - /\/| @ - |/\/ @ - ___ @ - / _ \ @ - | (_) |@ - \___/ @ - @ - @@ -246 LATIN SMALL LETTER O WITH DIAERESIS - _ _ @ - (_) (_)@ - ___ @ - / _ \ @ - | (_) |@ - \___/ @ - @ - @@ -247 DIVISION SIGN - _ @ - (_) @ - _______ @ - |_______|@ - _ @ - (_) @ - @ - @@ -248 LATIN SMALL LETTER O WITH STROKE - @ - @ - ____ @ - / _//\ @ - | (//) |@ - \//__/ @ - @ - @@ -249 LATIN SMALL LETTER U WITH GRAVE - __ @ - \_\ @ - _ _ @ - | | | |@ - | |_| |@ - \__,_|@ - @ - @@ -250 LATIN SMALL LETTER U WITH ACUTE - __ @ - /_/ @ - _ _ @ - | | | |@ - | |_| |@ - \__,_|@ - @ - @@ -251 LATIN SMALL LETTER U WITH CIRCUMFLEX - //\ @ - |/ \| @ - _ _ @ - | | | |@ - | |_| |@ - \__,_|@ - @ - @@ -252 LATIN SMALL LETTER U WITH DIAERESIS - _ _ @ - (_) (_)@ - _ _ @ - | | | |@ - | |_| |@ - \__,_|@ - @ - @@ -253 LATIN SMALL LETTER Y WITH ACUTE - __ @ - /_/ @ - _ _ @ - | | | |@ - | |_| |@ - \__, |@ - __/ |@ - |___/ @@ -254 LATIN SMALL LETTER THORN - _ @ - | | @ - | |__ @ - | '_ \ @ - | |_) |@ - | .__/ @ - | | @ - |_| @@ -255 LATIN SMALL LETTER Y WITH DIAERESIS - _ _ @ - (_) (_)@ - _ _ @ - | | | |@ - | |_| |@ - \__, |@ - __/ |@ - |___/ @@ -0x02BC MODIFIER LETTER APOSTROPHE - @ - @ - ))@ - @ - @ - @ - @ - @@ -0x02BD MODIFIER LETTER REVERSED COMMA - @ - @ - ((@ - @ - @ - @ - @ - @@ -0x037A GREEK YPOGEGRAMMENI - @ - @ - @ - @ - @ - @ - @ - ||@@ -0x0387 GREEK ANO TELEIA - @ - $ @ - _ @ - (_)@ - @ - $ @ - @ - @@ -0x0391 GREEK CAPITAL LETTER ALPHA - ___ @ - / _ \ @ - | |_| |@ - | _ |@ - | | | |@ - |_| |_|@ - @ - @@ -0x0392 GREEK CAPITAL LETTER BETA - ____ @ - | _ \ @ - | |_) )@ - | _ ( @ - | |_) )@ - |____/ @ - @ - @@ -0x0393 GREEK CAPITAL LETTER GAMMA - _____ @ - | ___)@ - | |$ @ - | |$ @ - | | @ - |_| @ - @ - @@ -0x0394 GREEK CAPITAL LETTER DELTA - @ - /\ @ - / \ @ - / /\ \ @ - / /__\ \ @ - /________\@ - @ - @@ -0x0395 GREEK CAPITAL LETTER EPSILON - _____ @ - | ___)@ - | |_ @ - | _) @ - | |___ @ - |_____)@ - @ - @@ -0x0396 GREEK CAPITAL LETTER ZETA - ______@ - (___ /@ - / / @ - / / @ - / /__ @ - /_____)@ - @ - @@ -0x0397 GREEK CAPITAL LETTER ETA - _ _ @ - | | | |@ - | |_| |@ - | _ |@ - | | | |@ - |_| |_|@ - @ - @@ -0x0398 GREEK CAPITAL LETTER THETA - ____ @ - / __ \ @ - | |__| |@ - | __ |@ - | |__| |@ - \____/ @ - @ - @@ -0x0399 GREEK CAPITAL LETTER IOTA - ___ @ - ( )@ - | | @ - | | @ - | | @ - (___)@ - @ - @@ -0x039A GREEK CAPITAL LETTER KAPPA - _ __@ - | | / /@ - | |/ / @ - | < @ - | |\ \ @ - |_| \_\@ - @ - @@ -0x039B GREEK CAPITAL LETTER LAMDA - @ - /\ @ - / \ @ - / /\ \ @ - / / \ \ @ - /_/ \_\@ - @ - @@ -0x039C GREEK CAPITAL LETTER MU - __ __ @ - | \ / |@ - | v |@ - | |\_/| |@ - | | | |@ - |_| |_|@ - @ - @@ -0x039D GREEK CAPITAL LETTER NU - _ _ @ - | \ | |@ - | \| |@ - | |@ - | |\ |@ - |_| \_|@ - @ - @@ -0x039E GREEK CAPITAL LETTER XI - _____ @ - (_____)@ - ___ @ - (___) @ - _____ @ - (_____)@ - @ - @@ -0x039F GREEK CAPITAL LETTER OMICRON - ___ @ - / _ \ @ - | | | |@ - | | | |@ - | |_| |@ - \___/ @ - @ - @@ -0x03A0 GREEK CAPITAL LETTER PI - _______ @ - ( _ )@ - | | | | @ - | | | | @ - | | | | @ - |_| |_| @ - @ - @@ -0x03A1 GREEK CAPITAL LETTER RHO - ____ @ - | _ \ @ - | |_) )@ - | __/ @ - | | @ - |_| @ - @ - @@ -0x03A3 GREEK CAPITAL LETTER SIGMA - ______ @ - \ ___)@ - \ \ @ - > > @ - / /__ @ - /_____)@ - @ - @@ -0x03A4 GREEK CAPITAL LETTER TAU - _____ @ - (_ _)@ - | | @ - | | @ - | | @ - |_| @ - @ - @@ -0x03A5 GREEK CAPITAL LETTER UPSILON - __ __ @ - (_ \ / _)@ - \ v / @ - | | @ - | | @ - |_| @ - @ - @@ -0x03A6 GREEK CAPITAL LETTER PHI - _ @ - _| |_ @ - / \ @ - ( (| |) )@ - \_ _/ @ - |_| @ - @ - @@ -0x03A7 GREEK CAPITAL LETTER CHI - __ __@ - \ \ / /@ - \ v / @ - > < @ - / ^ \ @ - /_/ \_\@ - @ - @@ -0x03A8 GREEK CAPITAL LETTER PSI - _ _ _ @ - | || || |@ - | \| |/ |@ - \_ _/ @ - | | @ - |_| @ - @ - @@ -0x03A9 GREEK CAPITAL LETTER OMEGA - ____ @ - / __ \ @ - | | | | @ - | | | | @ - _\ \/ /_ @ - (___||___)@ - @ - @@ -0x03B1 GREEK SMALL LETTER ALPHA - @ - @ - __ __@ - / \/ /@ - ( () < @ - \__/\_\@ - @ - @@ -0x03B2 GREEK SMALL LETTER BETA - ___ @ - / _ \ @ - | |_) )@ - | _ < @ - | |_) )@ - | __/ @ - | | @ - |_| @@ -0x03B3 GREEK SMALL LETTER GAMMA - @ - @ - _ _ @ - ( \ / )@ - \ v / @ - | | @ - | | @ - |_| @@ -0x03B4 GREEK SMALL LETTER DELTA - __ @ - / _) @ - \ \ @ - / _ \ @ - ( (_) )@ - \___/ @ - @ - @@ -0x03B5 GREEK SMALL LETTER EPSILON - @ - @ - ___ @ - / __)@ - > _) @ - \___)@ - @ - @@ -0x03B6 GREEK SMALL LETTER ZETA - _____ @ - \__ ) @ - / / @ - / / @ - | |__ @ - \__ \ @ - ) )@ - (_/ @@ -0x03B7 GREEK SMALL LETTER ETA - @ - @ - _ __ @ - | '_ \ @ - | | | |@ - |_| | |@ - | |@ - |_|@@ -0x03B8 GREEK SMALL LETTER THETA - ___ @ - / _ \ @ - | |_| |@ - | _ |@ - | |_| |@ - \___/ @ - @ - @@ -0x03B9 GREEK SMALL LETTER IOTA - @ - @ - _ @ - | | @ - | | @ - \_)@ - @ - @@ -0x03BA GREEK SMALL LETTER KAPPA - @ - @ - _ __@ - | |/ /@ - | < @ - |_|\_\@ - @ - @@ -0x03BB GREEK SMALL LETTER LAMDA - __ @ - \ \ @ - \ \ @ - > \ @ - / ^ \ @ - /_/ \_\@ - @ - @@ -0x03BC GREEK SMALL LETTER MU - @ - @ - _ _ @ - | | | |@ - | |_| |@ - | ._,_|@ - | | @ - |_| @@ -0x03BD GREEK SMALL LETTER NU - @ - @ - _ __@ - | |/ /@ - | / / @ - |__/ @ - @ - @@ -0x03BE GREEK SMALL LETTER XI - \=\__ @ - > __) @ - ( (_ @ - > _) @ - ( (__ @ - \__ \ @ - ) )@ - (_/ @@ -0x03BF GREEK SMALL LETTER OMICRON - @ - @ - ___ @ - / _ \ @ - ( (_) )@ - \___/ @ - @ - @@ -0x03C0 GREEK SMALL LETTER PI - @ - @ - ______ @ - ( __ )@ - | || | @ - |_||_| @ - @ - @@ -0x03C1 GREEK SMALL LETTER RHO - @ - @ - ___ @ - / _ \ @ - | |_) )@ - | __/ @ - | | @ - |_| @@ -0x03C2 GREEK SMALL LETTER FINAL SIGMA - @ - @ - ____ @ - / ___)@ - ( (__ @ - \__ \ @ - _) )@ - (__/ @@ -0x03C3 GREEK SMALL LETTER SIGMA - @ - @ - ____ @ - / ._)@ - ( () ) @ - \__/ @ - @ - @@ -0x03C4 GREEK SMALL LETTER TAU - @ - @ - ___ @ - ( )@ - | | @ - \_)@ - @ - @@ -0x03C5 GREEK SMALL LETTER UPSILON - @ - @ - _ _ @ - | | | |@ - | |_| |@ - \___/ @ - @ - @@ -0x03C6 GREEK SMALL LETTER PHI - _ @ - | | @ - _| |_ @ - / \ @ - ( (| |) )@ - \_ _/ @ - | | @ - |_| @@ -0x03C7 GREEK SMALL LETTER CHI - @ - @ - __ __@ - \ \ / /@ - \ v / @ - > < @ - / ^ \ @ - /_/ \_\@@ -0x03C8 GREEK SMALL LETTER PSI - @ - @ - _ _ _ @ - | || || |@ - | \| |/ |@ - \_ _/ @ - | | @ - |_| @@ -0x03C9 GREEK SMALL LETTER OMEGA - @ - @ - __ __ @ - / / _ \ \ @ - | |_/ \_| |@ - \___^___/ @ - @ - @@ -0x03D1 GREEK THETA SYMBOL - ___ @ - / _ \ @ - ( (_| |_ @ - _ \ _ _)@ - | |___| | @ - \_____/ @ - @ - @@ -0x03D5 GREEK PHI SYMBOL - @ - @ - _ __ @ - | | / \ @ - | || || )@ - \_ _/ @ - | | @ - |_| @@ -0x03D6 GREEK PI SYMBOL - @ - @ - _________ @ - ( _____ )@ - | |_/ \_| |@ - \___^___/ @ - @ - @@ --0x0005 -alpha = a, beta = b, gamma = g, delta = d, epsilon = e @ -zeta = z, eta = h, theta = q, iota = i, lamda = l, mu = m@ -nu = n, xi = x, omicron = o, pi = p, rho = r, sigma = s @ -phi = f, chi = c, psi = y, omega = w, final sigma = V @ - pi symbol = v, theta symbol = J, phi symbol = j @ - middle dot = :, ypogegrammeni = _ @ - rough breathing = (, smooth breathing = ) @ - acute accent = ', grave accent = `, dialytika = ^ @@ diff --git a/src/resources/MDK/doc/classes/Chyron.html b/src/resources/MDK/doc/classes/Chyron.html deleted file mode 100755 index 05cf776..0000000 --- a/src/resources/MDK/doc/classes/Chyron.html +++ /dev/null @@ -1,402 +0,0 @@ - - - - - Reference - - - - -
- -
- -
-
-
- - -
- - - - - - -
- -

Class Chyron

-

Creates a label with a scrolling text element.

-

It is highly recommended you use a monospace font for this label.

-

Info:

-
    -
  • Copyright: 2019,2020
  • -
  • Author: Delra,Damian Monogue
  • -
- - -

Methods

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
chyron:new(cons, container)Creates a new Chyron label
chyron:setDisplayWidth(displayWidth)Sets the numver of characters of the text to display at once
chyron:reset()Sets the Chyron from the first position, without changing enabled status
chyron:pause()Stops the Chyron with its current display
chyron:start()Start the Chyron back up from wherever it currently is
chyron:setUpdateTime(updateTime)Change the update time for the Chyron
chyron:enableAutoWidth()Enable autoWidth adjustment
chyron:disableAutoWidth()Disable autoWidth adjustment
chyron:stop()Stop the Chyron, and reset it to the original position
chyron:setMessage(message)Change the text being scrolled on the Chyron
chyron:setDelimiter(delimiter)Change the delimiter used to show the beginning and end of the message
- -
-
- - -

Methods

- -
-
- - chyron:new(cons, container) - line 80 -
-
- Creates a new Chyron label - - -

Parameters:

-
    -
  • cons - table - table of constraints which configures the EMCO. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    option namedescriptiondefault
    textThe text to scroll on the label""
    updateTimeMilliseconds between movements (one letter shift)200
    displayWidthHow many chars wide to display the text28
    delimiterThis character will be inserted with a space either side to mark the stop/start of the message"|"
    enabledShould the chyron scroll?true
    fontWhat font to use for the Chyron? Available in Geyser.Label but we define a default."Bitstream Vera Sans Mono"
    fontSizeWhat font size to use for the Chyron? Available in Geyser.Label but we define a default.9
    autoWidthShould the Chyron resize to just fit the text?true
    alignmentWhat alignment(left/right/center) to use for the Chyron text? Available in Geyser.Label but we define a default."center"
    -
  • -
  • container - GeyserObject - The container to use as the parent for the Chyron -
  • -
- - - - - -
-
- - chyron:setDisplayWidth(displayWidth) - line 99 -
-
- Sets the numver of characters of the text to display at once - - -

Parameters:

-
    -
  • displayWidth - number - number of characters to show at once -
  • -
- - - - - -
-
- - chyron:reset() - line 151 -
-
- Sets the Chyron from the first position, without changing enabled status - - - - - - - -
-
- - chyron:pause() - line 159 -
-
- Stops the Chyron with its current display - - - - - - - -
-
- - chyron:start() - line 167 -
-
- Start the Chyron back up from wherever it currently is - - - - - - - -
-
- - chyron:setUpdateTime(updateTime) - line 179 -
-
- Change the update time for the Chyron - - -

Parameters:

-
    -
  • updateTime - number new updateTime in milliseconds -
  • -
- - - - - -
-
- - chyron:enableAutoWidth() - line 190 -
-
- Enable autoWidth adjustment - - - - - - - -
-
- - chyron:disableAutoWidth() - line 196 -
-
- Disable autoWidth adjustment - - - - - - - -
-
- - chyron:stop() - line 201 -
-
- Stop the Chyron, and reset it to the original position - - - - - - - -
-
- - chyron:setMessage(message) - line 212 -
-
- Change the text being scrolled on the Chyron - - -

Parameters:

-
    -
  • message - string message the text you want to have scroll on the Chyron -
  • -
- - - - - -
-
- - chyron:setDelimiter(delimiter) - line 228 -
-
- Change the delimiter used to show the beginning and end of the message - - -

Parameters:

-
    -
  • delimiter - string the new delimiter to use. I recommend using one character. -
  • -
- - - - - -
-
- - -
-
-
-generated by LDoc 1.5.0 -Last updated 2023-05-29 18:41:27 -
-
- - diff --git a/src/resources/MDK/doc/classes/EMCO.html b/src/resources/MDK/doc/classes/EMCO.html deleted file mode 100755 index 621faa7..0000000 --- a/src/resources/MDK/doc/classes/EMCO.html +++ /dev/null @@ -1,3347 +0,0 @@ - - - - - Reference - - - - -
- -
- -
-
-
- - -
- - - - - - -
- -

Class EMCO

-

Embeddable Multi Console Object.

-

- This is essentially YATCO, but with some tweaks, updates, and it returns an object - similar to Geyser so that you can a.) have multiple of them and b.) easily embed it - into your existing UI as you would any other Geyser element.

-

Info:

-
    -
  • Copyright: 2020 Damian Monogue,2021 Damian Monogue
  • -
  • License: MIT, see LICENSE.lua
  • -
  • Author: Damian Monogue
  • -
- - -

Methods

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
emco:new(cons, container)Creates a new Embeddable Multi Console Object.
emco:miniConvertYATCO()Scans for the old YATCO configuration values and prints out a set of constraints to use.
emco:convertYATCO()Echos to the main console a script object you can add which will fully convert YATCO to EMCO.
emco:display(tabName, tabName, item[, any])Display the contents of one or more variables to an EMCO tab.
emco:removeTab(tabName)Remove a tab from the EMCO
emco:addTab(tabName[, position])Adds a tab to the EMCO object
emco:switchTab(tabName)Switches the active, visible tab of the EMCO to tabName
emco:cycleTab(reverse)Cycles between the tabs in order
emco:setBufferSize(bufferSize, deleteLines)Sets the buffer size and number of lines to delete for all managed miniconsoles.
emco:setBackgroundImage(tabName, imagePath, mode)Sets the background image for a tab's console.
emco:resetBackgroundImage(tabName)Resets the background image on a tab's console, returning it to the background color
emco:replay(tabName, numLines)Replays the last numLines lines from the log for tabName
emco:replayAll(numLines)Replays the last numLines in all miniconsoles
emco:processTemplate(str, tabName)Formats the string through EMCO's template.
emco:setPath(path)Sets the path for the EMCO for logging
emco:setFileName(fileName)Sets the fileName for the EMCO for logging
emco:setCmdLineStyleSheet(styleSheet)Sets the stylesheet for command lines in this EMCO
emco:enableCmdLine(tabName, template)Enables the commandLine on the specified tab.
emco:enableAllCmdLines()Enables all command lines, using whatever template they may currently have set
emco:disableAllCmdLines()Disables all commands line, but does not change their template
emco:disableCmdLine(tabName)Disables the command line for a particular tab
emco:setCmdAction(tabName, template)Sets the command action for a tab's command line.
emco:resetCmdAction(tabName)Resets the command action for tabName's miniconsole, which makes it work like the normal commandline
emco:getCmdLine(tabName)Gets the contents of tabName's cmdLine
emco:printCmd(tabName, txt)Prints to tabName's command line
emco:clearCmd(tabName)Clears tabName's command line
emco:appendCmd(tabName, txt)Appends text to tabName's command line
emco:reset()resets the object, redrawing everything
emco:fuzzyBoolean(bool)Expands boolean definitions to be more flexible.
emco:clear(tabName)clears a specific tab
emco:clearAll()clears all the tabs
emco:setTabFont(font)sets the font for all tabs
emco:setSingleTabFont(tabName, font)sets the font for a single tab.
emco:setFont(font)sets the font for all the miniconsoles
emco:setSingleWindowFont(tabName, font)sets the font for a specific miniconsole.
emco:setTabFontSize(fontSize)sets the font size for all tabs
emco:setTabAlignment(alignment)Sets the alignment for all the tabs
emco:enableTabUnderline()enables underline on all tabs
emco:disableTabUnderline()disables underline on all tabs
emco:enableTabItalics()enables italics on all tabs
emco:disableTabItalics()enables italics on all tabs
emco:enableTabBold()enables bold on all tabs
emco:disableTabBold()disables bold on all tabs
emco:enableCustomTimestampColor()enables custom colors for the timestamp, if displayed
emco:disableCustomTimestampColor()disables custom colors for the timestamp, if displayed
emco:enableTimestamp()enables the display of timestamps
emco:disableTimestamp()disables the display of timestamps
emco:setTimestampFormat(format)Sets the formatting for the timestamp, if enabled
emco:setTimestampBGColor(color)Sets the background color for the timestamp, if customTimestampColor is enabled.
emco:setTimestampFGColor(color)Sets the foreground color for the timestamp, if customTimestampColor is enabled.
emco:setAllTabName(allTabName)Sets the 'all' tab name.
emco:enableAllTab()Enables use of the 'all' tab
emco:disableAllTab()Disables use of the 'all' tab
emco:enableMapTab()Enables tying the Mudlet Mapper to one of the tabs.
emco:disableMapTab()disables binding the Mudlet Mapper to one of the tabs.
emco:setMapTabName(mapTabName)sets the name of the tab to bind the Mudlet Map.
emco:enableBlinkFromAll()Enables tab blinking even if you're on the 'all' tab
emco:disableBlinkFromAll()Disables tab blinking when you're on the 'all' tab
emco:enableGag()Enables gagging of the line passed in to :append(tabName)
emco:disableGag()Disables gagging of the line passed in to :append(tabName)
emco:enableBlink()Enables tab blinking when new information comes in to an inactive tab
emco:disableBlink()Disables tab blinking when new information comes in to an inactive tab
emco:enablePreserveBackground()Enables preserving the chat's background over the background of an incoming :append()
emco:disablePreserveBackground()Enables preserving the chat's background over the background of an incoming :append()
emco:setBlinkTime(blinkTime)Sets how long in seconds to wait between blinks
emco:setFontSize(fontSize)Sets the font size of the attached consoles
emco:setInactiveTabCSS(stylesheet)Sets the inactiveTabCSS
emco:setActiveTabCSS(stylesheet)Sets the activeTabCSS
emco:setActiveTabFGColor(color)Sets the FG color for the active tab
emco:setInactiveTabFGColor(color)Sets the FG color for the inactive tab
emco:setActiveTabBGColor(color)Sets the BG color for the active tab.
emco:setInactiveTabBGColor(color)Sets the BG color for the inactive tab.
emco:setConsoleColor(color)Sets the BG color for the consoles attached to this object
emco:setTabBoxCSS(css)Sets the CSS to use for the tab box which contains the tabs for the object
emco:setTabBoxColor(color)Sets the color to use for the tab box background
emco:setConsoleContainerColor(color)Sets the color for the container which holds the consoles attached to this object.
emco:setConsoleContainerCSS(css)Sets the CSS to use for the container which holds the consoles attached to this object
emco:setGap(gap)Sets the amount of space to use between the tabs and the consoles
emco:setTabHeight(tabHeight)Sets the height of the tabs in pixels
emco:enableAutoWrap()Enables autowrap for the object, and by extension all attached consoles.
emco:disableAutoWrap()Disables autowrap for the object, and by extension all attached consoles.
emco:setWrap(wrapAt)Sets the number of characters to wordwrap the attached consoles at.
emco:append(tabName, excludeAll)Appends the current line from the MUD to a tab.
emco:addNotifyTab(tabName)Adds a tab to the list of tabs to send OS toast/popup notifications for
emco:removeNotifyTab(tabName)Removes a tab from the list of tabs to send OS toast/popup notifications for
emco:addGag(pattern)Adds a pattern to the gag list for the EMCO
emco:removeGag(pattern)Removes a pattern from the gag list for the EMCO
emco:matchesGag(str)Checks if a string matches any of the EMCO's gag patterns
emco:enableNotifyWithFocus()Enables sending OS notifications even if Mudlet has focus
emco:disableNotifyWithFocus()Disables sending OS notifications if Mudlet has focus
emco:cecho(tabName, message, excludeAll)cecho to a tab, maintaining functionality
emco:decho(tabName, message, excludeAll)decho to a tab, maintaining functionality
emco:hecho(tabName, message, excludeAll)hecho to a tab, maintaining functionality
emco:echo(tabName, message, excludeAll)echo to a tab, maintaining functionality
emco:cechoLink(tabName, text, command, hint, excludeAll)cechoLink to a tab
emco:dechoLink(tabName, text, command, hint, excludeAll)dechoLink to a tab
emco:hechoLink(tabName, text, command, hint, excludeAll)hechoLink to a tab
emco:echoLink(tabName, text, command, hint, useCurrentFormat, excludeAll)echoLink to a tab
emco:cechoPopup(tabName, text, commands, hints, excludeAll)cechoPopup to a tab
emco:dechoPopup(tabName, text, commands, hints, excludeAll)dechoPopup to a tab
emco:hechoPopup(tabName, text, commands, hints, excludeAll)hechoPopup to a tab
emco:echoPopup(tabName, text, commands, hints, useCurrentFormat, excludeAll)echoPopup to a tab
emco:addAllTabExclusion(tabName)adds a tab to the exclusion list for echoing to the allTab
emco:removeAllTabExclusion(tabName)removess a tab from the exclusion list for echoing to the allTab
emco:enableBlankLine()Enable placing a blank line between all messages.
emco:disableBlankLine()Enable placing a blank line between all messages.
emco:enableScrollbars()Enable scrollbars for the miniconsoles
emco:disableScrollbars()Disable scrollbars for the miniconsoles
emco:save()Save an EMCO's configuration for reloading later.
emco:load()Load and apply a saved config for this EMCO
emco:enableTabLogging(tabName)Enables logging for tabName
emco:disableTabLogging(tabName)Disables logging for tabName
emco:enableAllLogging()Enables logging on all EMCO managed consoles
emco:disableAllLogging()Disables logging on all EMCO managed consoles
- -
-
- - -

Methods

- -
-
- - emco:new(cons, container) - line 367 -
-
- Creates a new Embeddable Multi Console Object. -
see https://github.com/demonnic/EMCO/wiki for information on valid constraints and defaults - - -

Parameters:

-
    -
  • cons - table - table of constraints which configures the EMCO. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    option namedescriptiondefault
    timestampdisplay timestamps on the miniconsoles?false
    blankLineput a blank line between appends/echos?false
    scrollbarsenable scrollbars for the miniconsoles?false
    customTimestampColorif showing timestamps, use a custom color?false
    mapTabshould we attach the Mudlet Mapper to this EMCO?false
    mapTabNameWhich tab should we attach the map to? -
    If mapTab is true and you do not set this, it will throw an error
    blinkFromAllshould tabs still blink, even if you're on the 'all' tab?false
    preserveBackgroundpreserve the miniconsole background color during append()?false
    gagwhen running :append(), should we also gag the line?false
    timestampFormatFormat string for the timestamp. Uses getTime()"HH:mm:ss"
    timestampBGColorCustom BG color to use for timestamps. Any valid Geyser.Color works."blue"
    timestampFGColorCustom FG color to use for timestamps. Any valid Geyser.Color works"red"
    allTabShould we send everything to an 'all' tab?false
    allTabNameAnd which tab should we use for the 'all' tab?"All"
    blinkShould we blink tabs that have been written to since you looked at them?false
    blinkTimeHow long to wait between blinks, in seconds?3
    fontSizeWhat font size to use for the miniconsoles?9
    fontWhat font to use for the miniconsoles?
    tabFontWhat font to use for the tabs?
    activeTabCssWhat css to use for the active tab?""
    inactiveTabCSSWhat css to use for the inactive tabs?""
    activeTabFGColorWhat color to use for the text on the active tab. Any Geyser.Color works."purple"
    inactiveTabFGColorWhat color to use for the text on the inactive tabs. Any Geyser.Color works."white"
    activeTabBGColorWhat BG color to use for the active tab? Any Geyser.Color works. Overriden by activeTabCSS"<0,180,0>"
    inactiveTabBGColorWhat BG color to use for the inactavie tabs? Any Geyser.Color works. Overridden by inactiveTabCSS"<60,60,60>"
    consoleColorDefault background color for the miniconsoles. Any Geyser.Color works"black"
    tabBoxCSStss for the entire tabBox (not individual tabs)""
    tabBoxColorWhat color to use for the tabBox? Any Geyser.Color works. Overridden by tabBoxCSS"black"
    consoleContainerCSSCSS to use for the container holding the miniconsoles""
    consoleContainerColorColor to use for the container holding the miniconsole. Any Geyser.Color works. Overridden by consoleContainerCSS"black"
    gapHow many pixels to place between the tabs and the miniconsoles?1
    consolesList of the tabs for this EMCO in table format{ "All" }
    allTabExclusionsList of the tabs which should never echo to the 'all' tab in table format{}
    tabHeightHow many pixels high should the tabs be?25
    autoWrapUse autoWrap for the miniconsoles?true
    wrapAtHow many characters to wrap it, if autoWrap is turned off?300
    leftMarginNumber of pixels to put between the left edge of the EMCO and the miniconsole?0
    rightMarginNumber of pixels to put between the right edge of the EMCO and the miniconsole?0
    bottomMarginNumber of pixels to put between the bottom edge of the EMCO and the miniconsole?0
    topMarginNumber of pixels to put between the top edge of the miniconsole container, and the miniconsole? This is in addition to gap0
    timestampExceptionsTable of tabnames which should not get timestamps even if timestamps are turned on{}
    tabFontSizeFont size for the tabs8
    tabBoldShould the tab text be bold? Boolean valuefalse
    tabItalicsShould the tab text be italicized?false
    tabUnderlineShould the tab text be underlined?false
    tabAlignmentValid alignments are 'c', 'center', 'l', 'left', 'r', 'right', or '' to not include the alignment as part of the echo (to allow the stylesheet to handle it)'c'
    commandLineShould we enable commandlines for the miniconsoles?false
    cmdActionsA table with console names as keys, and values which are templates for the command to send. see the setCustomCommandline function for more{}
    cmdLineStyleSheetWhat stylesheet to use for the command lines."QPlainTextEdit {\n border: 1px solid grey;\n }\n"
    backgroundImagesA table containing definitions for the background images. Each entry should have a key the same name as the tab it applies to, with entries "image" which is the path to the image file,
    and "mode" which determines how it is displayed. "border" stretches, "center" center, "tile" tiles, and "style". See Mudletwikilink for details.
    {}
    bufferSizeNumber of lines of scrollback to keep for the miniconsoles100000
    deleteLinesNumber of lines to delete if a console's buffer fills up.1000
    gagsA table of Lua patterns you wish to gag from being added to the EMCO. Useful for removing mob says and such example: {[[^A green leprechaun says, ".*"$]], "^Bob The Dark Lord of the Keep mutters darkly to himself.$"} see this tutorial on Lua patterns for more information.{}
    notifyTabsTables containing the names of all tabs you want to send notifications. IE {"Says", "Tells", "Org"}{}
    notifyWithFocusIf true, EMCO will send notifications even if Mudlet has focus. If false, it will only send them when Mudlet does NOT have focus.false
    -
  • -
  • container - GeyserObject - The container to use as the parent for the EMCO -
  • -
- -

Returns:

-
    - - the newly created EMCO -
- - - - -
-
- - emco:miniConvertYATCO() - line 554 -
-
- Scans for the old YATCO configuration values and prints out a set of constraints to use. - with EMCO to achieve the same effect. Is just the invocation - - - - - - - -
-
- - emco:convertYATCO() - line 565 -
-
- Echos to the main console a script object you can add which will fully convert YATCO to EMCO. - This replaces the demonnic.chat variable with a newly created EMCO object, so that the main - functions used to place information on the consoles (append(), cecho(), etc) should continue to - work in the user's triggers and events. - - - - - - - -
-
- - emco:display(tabName, tabName, item[, any]) - line 611 -
-
- Display the contents of one or more variables to an EMCO tab. like display() but targets the miniconsole - - -

Parameters:

-
    -
  • tabName - string the tab to displayu to -
  • -
  • tabName - string the tab to displayu to -
  • -
  • item - any The thing to display() -
  • -
  • any - item2 another thing to display() - (optional) -
  • -
- - - - - -
-
- - emco:removeTab(tabName) - line 621 -
-
- Remove a tab from the EMCO - - -

Parameters:

-
    -
  • tabName - string the name of the tab you want to remove from the EMCO -
  • -
- - - - - -
-
- - emco:addTab(tabName[, position]) - line 648 -
-
- Adds a tab to the EMCO object - - -

Parameters:

-
    -
  • tabName - string - the name of the tab to add -
  • -
  • position - number - position in the tab switcher to put this tab - (optional) -
  • -
- - - - - -
-
- - emco:switchTab(tabName) - line 669 -
-
- Switches the active, visible tab of the EMCO to tabName - - -

Parameters:

-
    -
  • tabName - string the name of the tab to show -
  • -
- - - - - -
-
- - emco:cycleTab(reverse) - line 697 -
-
- Cycles between the tabs in order - - -

Parameters:

-
    -
  • reverse - boolean - Defaults to false. When true, moves backward through the tab list rather than forward. -
  • -
- - - - - -
-
- - emco:setBufferSize(bufferSize, deleteLines) - line 778 -
-
- Sets the buffer size and number of lines to delete for all managed miniconsoles. - - -

Parameters:

-
    -
  • bufferSize - number - number of lines of scrollback to maintain in the miniconsoles. Uses current value if nil is passed -
  • -
  • deleteLines - number - number of line to delete if the buffer filles up. Uses current value if nil is passed -
  • -
- - - - - -
-
- - emco:setBackgroundImage(tabName, imagePath, mode) - line 795 -
-
- Sets the background image for a tab's console. use EMCO:resetBackgroundImage(tabName) to remove an image. - - -

Parameters:

-
    -
  • tabName - string - the tab to change the background image for. -
  • -
  • imagePath - string - the path to the image file to use. -
  • -
  • mode - string - the mode to use. Will default to "center" if not provided. -
  • -
- - - - - -
-
- - emco:resetBackgroundImage(tabName) - line 817 -
-
- Resets the background image on a tab's console, returning it to the background color - - -

Parameters:

-
    -
  • tabName - string - the tab to change the background image for. -
  • -
- - - - - -
-
- - emco:replay(tabName, numLines) - line 848 -
-
- Replays the last numLines lines from the log for tabName - - -

Parameters:

-
    -
  • tabName - the name of the tab to replay -
  • -
  • numLines - the number of lines to replay -
  • -
- - - - - -
-
- - emco:replayAll(numLines) - line 861 -
-
- Replays the last numLines in all miniconsoles - - -

Parameters:

-
    -
  • numLines - -
  • -
- - - - - -
-
- - emco:processTemplate(str, tabName) - line 874 -
-
- Formats the string through EMCO's template. |E is replaced with the EMCO's name. |N is replaced with the tab's name. - - -

Parameters:

-
    -
  • str - the string to replace tokens in -
  • -
  • tabName - optional, if included will be used for |N in the templated string. -
  • -
- - - - - -
-
- - emco:setPath(path) - line 884 -
-
- Sets the path for the EMCO for logging - - -

Parameters:

-
    -
  • path - the template for the path. @see EMCO:new() -
  • -
- - - - - -
-
- - emco:setFileName(fileName) - line 900 -
-
- Sets the fileName for the EMCO for logging - - -

Parameters:

-
    -
  • fileName - the template for the path. @see EMCO:new() -
  • -
- - - - - -
-
- - emco:setCmdLineStyleSheet(styleSheet) - line 916 -
-
- Sets the stylesheet for command lines in this EMCO - - -

Parameters:

-
    -
  • styleSheet - string - the stylesheet to use for the command line. See https://wiki.mudlet.org/w/Manual:Lua_Functions#setCmdLineStyleSheet for examples -
  • -
- - - - - -
-
- - emco:enableCmdLine(tabName, template) - line 929 -
-
- Enables the commandLine on the specified tab. - - -

Parameters:

-
    -
  • tabName - string - the name of the tab to turn the commandLine on for -
  • -
  • template - the template for the commandline to use, or the function to run when enter is hit. -
  • -
- - - - -

Usage:

-
    -
    myEMCO:enableCmdLine(tabName, template)
    -
- -
-
- - emco:enableAllCmdLines() - line 942 -
-
- Enables all command lines, using whatever template they may currently have set - - - - - - - -
-
- - emco:disableAllCmdLines() - line 949 -
-
- Disables all commands line, but does not change their template - - - - - - - -
-
- - emco:disableCmdLine(tabName) - line 957 -
-
- Disables the command line for a particular tab - - -

Parameters:

-
    -
  • tabName - string - the name of the tab to disable the command line of. -
  • -
- - - - - -
-
- - emco:setCmdAction(tabName, template) - line 970 -
-
- Sets the command action for a tab's command line. Can either be a template string to send where '|t' is replaced by the text sent, or a funnction which takes the text - - -

Parameters:

-
    -
  • tabName - string - the name of the tab to set the command action on -
  • -
  • template - the template for the commandline to use, or the function to run when enter is hit. -
  • -
- - - - -

Usage:

-
    -
  • myEMCO:setCmdAction("CT", "ct |t") -- will send everything in the CT tab's command line to CT by doing "ct Hi there!" if you type "Hi there!" in CT's command line
  • -
  • myEMCO:setCmdAction("CT", function(txt) send("ct " .. txt) end) -- functionally the same as the above
  • -
- -
-
- - emco:resetCmdAction(tabName) - line 997 -
-
- Resets the command action for tabName's miniconsole, which makes it work like the normal commandline - - -

Parameters:

-
    -
  • tabName - string - the name of the tab to reset the cmdAction for -
  • -
- - - - - -
-
- - emco:getCmdLine(tabName) - line 1004 -
-
- Gets the contents of tabName's cmdLine - - -

Parameters:

-
    -
  • tabName - the name of the tab to get the commandline of -
  • -
- - - - - -
-
- - emco:printCmd(tabName, txt) - line 1011 -
-
- Prints to tabName's command line - - -

Parameters:

-
    -
  • tabName - the tab whose command line you want to print to -
  • -
  • txt - the text to print to the command line -
  • -
- - - - - -
-
- - emco:clearCmd(tabName) - line 1017 -
-
- Clears tabName's command line - - -

Parameters:

-
    -
  • tabName - string - the tab whose command line you want to clear -
  • -
- - - - - -
-
- - emco:appendCmd(tabName, txt) - line 1024 -
-
- Appends text to tabName's command line - - -

Parameters:

-
    -
  • tabName - string - the tab whose command line you want to append to -
  • -
  • txt - string - the text to append to the command line -
  • -
- - - - - -
-
- - emco:reset() - line 1029 -
-
- resets the object, redrawing everything - - - - - - - -
-
- - emco:fuzzyBoolean(bool) - line 1071 -
-
- Expands boolean definitions to be more flexible. -
True values are "true", "yes", "0", 0, and true -
False values are "false", "no", "1", 1, false, and nil - - -

Parameters:

-
    -
  • bool - item to test for truthiness -
  • -
- - - - - -
-
- - emco:clear(tabName) - line 1092 -
-
- clears a specific tab - - -

Parameters:

-
    -
  • tabName - string - the name of the tab to clear -
  • -
- - - - - -
-
- - emco:clearAll() - line 1104 -
-
- clears all the tabs - - - - - - - -
-
- - emco:setTabFont(font) - line 1114 -
-
- sets the font for all tabs - - -

Parameters:

-
    -
  • font - string - the font to use. -
  • -
- - - - - -
-
- - emco:setSingleTabFont(tabName, font) - line 1124 -
-
- sets the font for a single tab. If you use setTabFont this will be overridden - - -

Parameters:

-
    -
  • tabName - string - the tab to change the font of -
  • -
  • font - string - the font to use for that tab -
  • -
- - - - - -
-
- - emco:setFont(font) - line 1134 -
-
- sets the font for all the miniconsoles - - -

Parameters:

-
    -
  • font - string - the name of the font to use -
  • -
- - - - - -
-
- - emco:setSingleWindowFont(tabName, font) - line 1153 -
-
- sets the font for a specific miniconsole. If setFont is called this will be overridden - - -

Parameters:

-
    -
  • tabName - string - the name of window to set the font for -
  • -
  • font - string - the name of the font to use -
  • -
- - - - - -
-
- - emco:setTabFontSize(fontSize) - line 1170 -
-
- sets the font size for all tabs - - -

Parameters:

-
    -
  • fontSize - number - the font size to use for the tabs -
  • -
- - - - - -
-
- - emco:setTabAlignment(alignment) - line 1179 -
-
- Sets the alignment for all the tabs - - -

Parameters:

-
    -
  • alignment - Valid alignments are 'c', 'center', 'l', 'left', 'r', 'right', or '' to not include the alignment as part of the echo -
  • -
- - - - - -
-
- - emco:enableTabUnderline() - line 1187 -
-
- enables underline on all tabs - - - - - - - -
-
- - emco:disableTabUnderline() - line 1195 -
-
- disables underline on all tabs - - - - - - - -
-
- - emco:enableTabItalics() - line 1203 -
-
- enables italics on all tabs - - - - - - - -
-
- - emco:disableTabItalics() - line 1211 -
-
- enables italics on all tabs - - - - - - - -
-
- - emco:enableTabBold() - line 1219 -
-
- enables bold on all tabs - - - - - - - -
-
- - emco:disableTabBold() - line 1227 -
-
- disables bold on all tabs - - - - - - - -
-
- - emco:enableCustomTimestampColor() - line 1235 -
-
- enables custom colors for the timestamp, if displayed - - - - - - - -
-
- - emco:disableCustomTimestampColor() - line 1240 -
-
- disables custom colors for the timestamp, if displayed - - - - - - - -
-
- - emco:enableTimestamp() - line 1245 -
-
- enables the display of timestamps - - - - - - - -
-
- - emco:disableTimestamp() - line 1250 -
-
- disables the display of timestamps - - - - - - - -
-
- - emco:setTimestampFormat(format) - line 1256 -
-
- Sets the formatting for the timestamp, if enabled - - -

Parameters:

-
    -
  • format - string - Format string which describes the display of the timestamp. See: https://wiki.mudlet.org/w/Manual:Lua_Functions#getTime -
  • -
- - - - - -
-
- - emco:setTimestampBGColor(color) - line 1269 -
-
- Sets the background color for the timestamp, if customTimestampColor is enabled. - - -

Parameters:

-
    -
  • color - Color string suitable for decho or hecho, or color name eg "purple", or table of colors {r,g,b} -
  • -
- - - - - -
-
- - emco:setTimestampFGColor(color) - line 1274 -
-
- Sets the foreground color for the timestamp, if customTimestampColor is enabled. - - -

Parameters:

-
    -
  • color - Color string suitable for decho or hecho, or color name eg "purple", or table of colors {r,g,b} -
  • -
- - - - - -
-
- - emco:setAllTabName(allTabName) - line 1281 -
-
- Sets the 'all' tab name. -
This is the name of the tab itself - - -

Parameters:

-
    -
  • allTabName - string - name of the tab to use as the all tab. Must be a tab which exists in the object. -
  • -
- - - - - -
-
- - emco:enableAllTab() - line 1294 -
-
- Enables use of the 'all' tab - - - - - - - -
-
- - emco:disableAllTab() - line 1299 -
-
- Disables use of the 'all' tab - - - - - - - -
-
- - emco:enableMapTab() - line 1305 -
-
- Enables tying the Mudlet Mapper to one of the tabs. -
mapTabName must be set, or this will error. Forces a redraw of the entire object - - - - - - - -
-
- - emco:disableMapTab() - line 1318 -
-
- disables binding the Mudlet Mapper to one of the tabs. -
CAUTION: this may have unexpected behaviour, as you can only open one Mapper console per profile - so you can't really unbind it. Binding of the Mudlet Mapper is best decided at instantiation. - - - - - - - -
-
- - emco:setMapTabName(mapTabName) - line 1327 -
-
- sets the name of the tab to bind the Mudlet Map. -
Forces a redraw of the object -
CAUTION: Mudlet only allows one Map object to be open at one time, so if you are going to attach the map to an object - you should probably do it at instantiation. - - -

Parameters:

-
    -
  • mapTabName - string - name of the tab to connect the Mudlet Map to. -
  • -
- - - - - -
-
- - emco:enableBlinkFromAll() - line 1340 -
-
- Enables tab blinking even if you're on the 'all' tab - - - - - - - -
-
- - emco:disableBlinkFromAll() - line 1345 -
-
- Disables tab blinking when you're on the 'all' tab - - - - - - - -
-
- - emco:enableGag() - line 1350 -
-
- Enables gagging of the line passed in to :append(tabName) - - - - - - - -
-
- - emco:disableGag() - line 1355 -
-
- Disables gagging of the line passed in to :append(tabName) - - - - - - - -
-
- - emco:enableBlink() - line 1360 -
-
- Enables tab blinking when new information comes in to an inactive tab - - - - - - - -
-
- - emco:disableBlink() - line 1370 -
-
- Disables tab blinking when new information comes in to an inactive tab - - - - - - - -
-
- - emco:enablePreserveBackground() - line 1379 -
-
- Enables preserving the chat's background over the background of an incoming :append() - - - - - - - -
-
- - emco:disablePreserveBackground() - line 1384 -
-
- Enables preserving the chat's background over the background of an incoming :append() - - - - - - - -
-
- - emco:setBlinkTime(blinkTime) - line 1390 -
-
- Sets how long in seconds to wait between blinks - - -

Parameters:

-
    -
  • blinkTime - number - time in seconds to wait between blinks -
  • -
- - - - - -
-
- - emco:setFontSize(fontSize) - line 1417 -
-
- Sets the font size of the attached consoles - - -

Parameters:

-
    -
  • fontSize - number - font size for attached consoles -
  • -
- - - - - -
-
- - emco:setInactiveTabCSS(stylesheet) - line 1475 -
-
- Sets the inactiveTabCSS - - -

Parameters:

-
    -
  • stylesheet - string - the stylesheet to use for inactive tabs. -
  • -
- - - - - -
-
- - emco:setActiveTabCSS(stylesheet) - line 1482 -
-
- Sets the activeTabCSS - - -

Parameters:

-
    -
  • stylesheet - string - the stylesheet to use for active tab. -
  • -
- - - - - -
-
- - emco:setActiveTabFGColor(color) - line 1489 -
-
- Sets the FG color for the active tab - - -

Parameters:

-
    -
  • color - Color string suitable for decho or hecho, or color name eg "purple", or table of colors {r,g,b} -
  • -
- - - - - -
-
- - emco:setInactiveTabFGColor(color) - line 1496 -
-
- Sets the FG color for the inactive tab - - -

Parameters:

-
    -
  • color - Color string suitable for decho or hecho, or color name eg "purple", or table of colors {r,g,b} -
  • -
- - - - - -
-
- - emco:setActiveTabBGColor(color) - line 1504 -
-
- Sets the BG color for the active tab. -
NOTE: If you set CSS for the active tab, it will override this setting. - - -

Parameters:

-
    -
  • color - Color string suitable for decho or hecho, or color name eg "purple", or table of colors {r,g,b} -
  • -
- - - - - -
-
- - emco:setInactiveTabBGColor(color) - line 1512 -
-
- Sets the BG color for the inactive tab. -
NOTE: If you set CSS for the inactive tab, it will override this setting. - - -

Parameters:

-
    -
  • color - Color string suitable for decho or hecho, or color name eg "purple", or table of colors {r,g,b} -
  • -
- - - - - -
-
- - emco:setConsoleColor(color) - line 1519 -
-
- Sets the BG color for the consoles attached to this object - - -

Parameters:

-
    -
  • color - Color string suitable for decho or hecho, or color name eg "purple", or table of colors {r,g,b} -
  • -
- - - - - -
-
- - emco:setTabBoxCSS(css) - line 1536 -
-
- Sets the CSS to use for the tab box which contains the tabs for the object - - -

Parameters:

-
    -
  • css - string - The css styling to use for the tab box -
  • -
- - - - - -
-
- - emco:setTabBoxColor(color) - line 1549 -
-
- Sets the color to use for the tab box background - - -

Parameters:

-
    -
  • color - Color string suitable for decho or hecho, or color name eg "purple", or table of colors {r,g,b} -
  • -
- - - - - -
-
- - emco:setConsoleContainerColor(color) - line 1561 -
-
- Sets the color for the container which holds the consoles attached to this object. - - -

Parameters:

-
    -
  • color - Color string suitable for decho or hecho, or color name eg "purple", or table of colors {r,g,b} -
  • -
- - - - - -
-
- - emco:setConsoleContainerCSS(css) - line 1568 -
-
- Sets the CSS to use for the container which holds the consoles attached to this object - - -

Parameters:

-
    -
  • css - string - CSS to use for the container -
  • -
- - - - - -
-
- - emco:setGap(gap) - line 1580 -
-
- Sets the amount of space to use between the tabs and the consoles - - -

Parameters:

-
    -
  • gap - number - Number of pixels to keep between the tabs and consoles -
  • -
- - - - - -
-
- - emco:setTabHeight(tabHeight) - line 1594 -
-
- Sets the height of the tabs in pixels - - -

Parameters:

-
    -
  • tabHeight - number - the height of the tabs for the object, in pixels -
  • -
- - - - - -
-
- - emco:enableAutoWrap() - line 1609 -
-
- Enables autowrap for the object, and by extension all attached consoles. -
To enable autoWrap for a specific miniconsole only, call myEMCO.windows[tabName]:enableAutoWrap() - but be warned if you do this it may be overwritten by future calls to EMCO:enableAutoWrap() or :disableAutoWrap() - - - - - - - -
-
- - emco:disableAutoWrap() - line 1623 -
-
- Disables autowrap for the object, and by extension all attached consoles. -
To disable autoWrap for a specific miniconsole only, call myEMCO.windows[tabName]:disableAutoWrap() - but be warned if you do this it may be overwritten by future calls to EMCO:enableAutoWrap() or :disableAutoWrap() - - - - - - - -
-
- - emco:setWrap(wrapAt) - line 1637 -
-
- Sets the number of characters to wordwrap the attached consoles at. -
it is generally recommended to make use of autoWrap unless you need - a specific width for some reason - - -

Parameters:

-
    -
  • wrapAt - -
  • -
- - - - - -
-
- - emco:append(tabName, excludeAll) - line 1660 -
-
- Appends the current line from the MUD to a tab. -
depending on this object's configuration, may gag the line -
depending on this object's configuration, may gag the next prompt - - -

Parameters:

-
    -
  • tabName - string - The name of the tab to append the line to -
  • -
  • excludeAll - boolean - if true, will exclude this from being mirrored to the allTab -
  • -
- - - - - -
-
- - emco:addNotifyTab(tabName) - line 1692 -
-
- Adds a tab to the list of tabs to send OS toast/popup notifications for - - -

Parameters:

-
    -
  • tabName - string - the name of a tab to enable notifications for -
  • -
- -

Returns:

-
    - - true if it was added, false if it was already included, nil if the tab does not exist. -
- - - - -
-
- - emco:removeNotifyTab(tabName) - line 1706 -
-
- Removes a tab from the list of tabs to send OS toast/popup notifications for - - -

Parameters:

-
    -
  • tabName - string - the name of a tab to disable notifications for -
  • -
- -

Returns:

-
    - - true if it was removed, false if it wasn't enabled to begin with, nil if the tab does not exist. -
- - - - -
-
- - emco:addGag(pattern) - line 1720 -
-
- Adds a pattern to the gag list for the EMCO - - -

Parameters:

-
    -
  • pattern - string - a Lua pattern to gag. http://lua-users.org/wiki/PatternsTutorial -
  • -
- -

Returns:

-
    - - true if it was added, false if it was already included. -
- - - - -
-
- - emco:removeGag(pattern) - line 1731 -
-
- Removes a pattern from the gag list for the EMCO - - -

Parameters:

-
    -
  • pattern - string - a Lua pattern to no longer gag. http://lua-users.org/wiki/PatternsTutorial -
  • -
- -

Returns:

-
    - - true if it was removed, false if it was not there to remove. -
- - - - -
-
- - emco:matchesGag(str) - line 1742 -
-
- Checks if a string matches any of the EMCO's gag patterns - - -

Parameters:

-
    -
  • str - string - The text you're testing against the gag patterns -
  • -
- -

Returns:

-
    - - false if it does not match any gag patterns. true and the matching pattern if it does match. -
- - - - -
-
- - emco:enableNotifyWithFocus() - line 1752 -
-
- Enables sending OS notifications even if Mudlet has focus - - - - - - - -
-
- - emco:disableNotifyWithFocus() - line 1757 -
-
- Disables sending OS notifications if Mudlet has focus - - - - - - - -
-
- - emco:cecho(tabName, message, excludeAll) - line 1875 -
-
- cecho to a tab, maintaining functionality - - -

Parameters:

-
    -
  • tabName - string - the name of the tab to cecho to -
  • -
  • message - string - the message to cecho to that tab's console -
  • -
  • excludeAll - boolean - if true, will exclude this from being mirrored to the allTab -
  • -
- - - - - -
-
- - emco:decho(tabName, message, excludeAll) - line 1885 -
-
- decho to a tab, maintaining functionality - - -

Parameters:

-
    -
  • tabName - string - the name of the tab to decho to -
  • -
  • message - string - the message to decho to that tab's console -
  • -
  • excludeAll - boolean - if true, will exclude this from being mirrored to the allTab -
  • -
- - - - - -
-
- - emco:hecho(tabName, message, excludeAll) - line 1895 -
-
- hecho to a tab, maintaining functionality - - -

Parameters:

-
    -
  • tabName - string - the name of the tab to hecho to -
  • -
  • message - string - the message to hecho to that tab's console -
  • -
  • excludeAll - boolean - if true, will exclude this from being mirrored to the allTab -
  • -
- - - - - -
-
- - emco:echo(tabName, message, excludeAll) - line 1905 -
-
- echo to a tab, maintaining functionality - - -

Parameters:

-
    -
  • tabName - string - the name of the tab to echo to -
  • -
  • message - string - the message to echo to that tab's console -
  • -
  • excludeAll - boolean - if true, will exclude this from being mirrored to the allTab -
  • -
- - - - - -
-
- - emco:cechoLink(tabName, text, command, hint, excludeAll) - line 1982 -
-
- cechoLink to a tab - - -

Parameters:

-
    -
  • tabName - string - the name of the tab to cechoLink to -
  • -
  • text - string - the text underlying the link -
  • -
  • command - string - the lua code to run in string format -
  • -
  • hint - string - the tooltip hint to use for the link -
  • -
  • excludeAll - boolean - if true, will exclude this from being mirrored to the allTab -
  • -
- - - - - -
-
- - emco:dechoLink(tabName, text, command, hint, excludeAll) - line 1994 -
-
- dechoLink to a tab - - -

Parameters:

-
    -
  • tabName - string - the name of the tab to dechoLink to -
  • -
  • text - string - the text underlying the link -
  • -
  • command - string - the lua code to run in string format -
  • -
  • hint - string - the tooltip hint to use for the link -
  • -
  • excludeAll - boolean - if true, will exclude this from being mirrored to the allTab -
  • -
- - - - - -
-
- - emco:hechoLink(tabName, text, command, hint, excludeAll) - line 2006 -
-
- hechoLink to a tab - - -

Parameters:

-
    -
  • tabName - string - the name of the tab to hechoLink to -
  • -
  • text - string - the text underlying the link -
  • -
  • command - string - the lua code to run in string format -
  • -
  • hint - string - the tooltip hint to use for the link -
  • -
  • excludeAll - boolean - if true, will exclude this from being mirrored to the allTab -
  • -
- - - - - -
-
- - emco:echoLink(tabName, text, command, hint, useCurrentFormat, excludeAll) - line 2019 -
-
- echoLink to a tab - - -

Parameters:

-
    -
  • tabName - string - the name of the tab to echoLink to -
  • -
  • text - string - the text underlying the link -
  • -
  • command - string - the lua code to run in string format -
  • -
  • hint - string - the tooltip hint to use for the link -
  • -
  • useCurrentFormat - boolean - use the format for the window or blue on black (hyperlink colors) -
  • -
  • excludeAll - boolean - if true, will exclude this from being mirrored to the allTab -
  • -
- - - - - -
-
- - emco:cechoPopup(tabName, text, commands, hints, excludeAll) - line 2031 -
-
- cechoPopup to a tab - - -

Parameters:

-
    -
  • tabName - string - the name of the tab to cechoPopup to -
  • -
  • text - string - the text underlying the link -
  • -
  • commands - table - the lua code to run in string format -
  • -
  • hints - table - the tooltip hint to use for the link -
  • -
  • excludeAll - boolean - if true, will exclude this from being mirrored to the allTab -
  • -
- - - - - -
-
- - emco:dechoPopup(tabName, text, commands, hints, excludeAll) - line 2043 -
-
- dechoPopup to a tab - - -

Parameters:

-
    -
  • tabName - string - the name of the tab to dechoPopup to -
  • -
  • text - string - the text underlying the link -
  • -
  • commands - table - the lua code to run in string format -
  • -
  • hints - table - the tooltip hint to use for the link -
  • -
  • excludeAll - boolean - if true, will exclude this from being mirrored to the allTab -
  • -
- - - - - -
-
- - emco:hechoPopup(tabName, text, commands, hints, excludeAll) - line 2055 -
-
- hechoPopup to a tab - - -

Parameters:

-
    -
  • tabName - string - the name of the tab to hechoPopup to -
  • -
  • text - string - the text underlying the link -
  • -
  • commands - table - the lua code to run in string format -
  • -
  • hints - table - the tooltip hint to use for the link -
  • -
  • excludeAll - boolean - if true, will exclude this from being mirrored to the allTab -
  • -
- - - - - -
-
- - emco:echoPopup(tabName, text, commands, hints, useCurrentFormat, excludeAll) - line 2068 -
-
- echoPopup to a tab - - -

Parameters:

-
    -
  • tabName - string - the name of the tab to echoPopup to -
  • -
  • text - string - the text underlying the link -
  • -
  • commands - table - the lua code to run in string format -
  • -
  • hints - table - the tooltip hint to use for the link -
  • -
  • useCurrentFormat - boolean - use the format for the window or blue on black (hyperlink colors) -
  • -
  • excludeAll - boolean - if true, will exclude this from being mirrored to the allTab -
  • -
- - - - - -
-
- - emco:addAllTabExclusion(tabName) - line 2076 -
-
- adds a tab to the exclusion list for echoing to the allTab - - -

Parameters:

-
    -
  • tabName - string - the name of the tab to add to the exclusion list -
  • -
- - - - - -
-
- - emco:removeAllTabExclusion(tabName) - line 2086 -
-
- removess a tab from the exclusion list for echoing to the allTab - - -

Parameters:

-
    -
  • tabName - string - the name of the tab to remove from the exclusion list -
  • -
- - - - - -
-
- - emco:enableBlankLine() - line 2124 -
-
- Enable placing a blank line between all messages. - - - - - - - -
-
- - emco:disableBlankLine() - line 2129 -
-
- Enable placing a blank line between all messages. - - - - - - - -
-
- - emco:enableScrollbars() - line 2134 -
-
- Enable scrollbars for the miniconsoles - - - - - - - -
-
- - emco:disableScrollbars() - line 2140 -
-
- Disable scrollbars for the miniconsoles - - - - - - - -
-
- - emco:save() - line 2160 -
-
- Save an EMCO's configuration for reloading later. Filename is based on the EMCO's name property. - - - - - - - -
-
- - emco:load() - line 2229 -
-
- Load and apply a saved config for this EMCO - - - - - - - -
-
- - emco:enableTabLogging(tabName) - line 2310 -
-
- Enables logging for tabName - - -

Parameters:

-
    -
  • tabName - string - the name of the tab you want to enable logging for -
  • -
- - - - - -
-
- - emco:disableTabLogging(tabName) - line 2323 -
-
- Disables logging for tabName - - -

Parameters:

-
    -
  • tabName - string - the name of the tab you want to disable logging for -
  • -
- - - - - -
-
- - emco:enableAllLogging() - line 2335 -
-
- Enables logging on all EMCO managed consoles - - - - - - - -
-
- - emco:disableAllLogging() - line 2343 -
-
- Disables logging on all EMCO managed consoles - - - - - - - -
-
- - -
-
-
-generated by LDoc 1.5.0 -Last updated 2023-05-29 18:41:27 -
-
- - diff --git a/src/resources/MDK/doc/classes/LoggingConsole.html b/src/resources/MDK/doc/classes/LoggingConsole.html deleted file mode 100755 index 2b4a3e3..0000000 --- a/src/resources/MDK/doc/classes/LoggingConsole.html +++ /dev/null @@ -1,813 +0,0 @@ - - - - - Reference - - - - -
- -
- -
-
-
- - -
- - - - - - -
- -

Class LoggingConsole

-

MiniConsole with logging capabilities

-

-

Info:

-
    -
  • Copyright: 2020 Damian Monogue
  • -
  • License: MIT, see LICENSE.lua
  • -
  • Author: Damian Monogue
  • -
- - -

Methods

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
loggingconsole:new(cons, container)Creates and returns a new LoggingConsole.
loggingconsole:getExtension()Returns the file extension of the logfile this console will log to
loggingconsole:getPath()Returns the path to the logfile for this console
loggingconsole:setPath(path)Sets the path to use for the log file.
loggingconsole:getFileName()Returns the filename for the logfile for this console
loggingconsole:setFileName(fileName)Sets the fileName to use for the log file.
loggingconsole:getFullFilename()Returns the pull path and filename for the logfile for this console
loggingconsole:enableLogging()Turns logging for this console on
loggingconsole:disableLogging()Turns logging for this console off
loggingconsole:cechoLink(text, command, hint, log)cechoLink for LoggingConsole
loggingconsole:dechoLink(text, command, hint, log)dechoLink for LoggingConsole
loggingconsole:hechoLink(text, command, hint, log)hechoLink for LoggingConsole
loggingconsole:echoLink(text, command, hint, useCurrentFormat, log)echoLink for LoggingConsole
loggingconsole:cechoPopup(text, commands, hints, log)cechoPopup for LoggingConsole
loggingconsole:dechoPopup(text, commands, hints, log)dechoPopup for LoggingConsole
loggingconsole:hechoPopup(text, commands, hints, log)hechoPopup for LoggingConsole
loggingconsole:echoPopup(text, commands, hints, useCurrentFormat, log)echoPopup for LoggingConsole
loggingconsole:appendBuffer(log)Append copy()ed text to the console
loggingconsole:append(log)Append copy()ed text to the console
loggingconsole:echo(str, log)echo's a string to the console.
loggingconsole:hecho(str, log)hecho's a string to the console.
loggingconsole:decho(str, log)decho's a string to the console.
loggingconsole:cecho(str, log)cecho's a string to the console.
loggingconsole:replay(numberOfLines)Replays the last X lines from the console's log file, if it exists
- -
-
- - -

Methods

- -
-
- - loggingconsole:new(cons, container) - line 56 -
-
- Creates and returns a new LoggingConsole. - - -

Parameters:

-
    -
  • cons - table of constraints. Includes all the valid Geyser.MiniConsole constraints, plus - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    option namedescriptiondefault
    logShould the miniconsole be logging?true
    logFormat"h" for html, "t" for plaintext, "l" for log (with ansi)h
    pathThe path the file lives in. It is templated.
    |h is replaced by the profile homedir.
    |y by 4 digit year.
    |m by 2 digit month
    |d by 2 digit day
    |n by the name constraint
    |e by the file extension (html for h logType, log for others)
    "|h/log/consoleLogs/|y/|m/|d/"
    fileNameThe name of the log file. It is templated, same as path above"|n.|e"
    -
  • -
  • container - the container for the console -
  • -
- - - - -

Usage:

-
    -
    local LoggingConsole = require("MDK.loggingconsole")
    -myLoggingConsole = LoggingConsole:new({
    -name = "my logging console",
    -  x = 0,
    -  y = 0,
    -  height = 200,
    -  width = 400,
    -}) -- just like making a miniconsole, really
    -
- -
-
- - loggingconsole:getExtension() - line 67 -
-
- Returns the file extension of the logfile this console will log to - - - - - - - -
-
- - loggingconsole:getPath() - line 95 -
-
- Returns the path to the logfile for this console - - - - - - - -
-
- - loggingconsole:setPath(path) - line 105 -
-
- Sets the path to use for the log file. - - -

Parameters:

-
    -
  • path - the path to put the log file in. It is templated.
    |h is replaced by the profile homedir.
    |y by 4 digit year.
    |m by 2 digit month
    |d by 2 digit day
    |n by the name constraint
    |e by the file extension (html for h logType, log for others) -
  • -
- - - - - -
-
- - loggingconsole:getFileName() - line 110 -
-
- Returns the filename for the logfile for this console - - - - - - - -
-
- - loggingconsole:setFileName(fileName) - line 118 -
-
- Sets the fileName to use for the log file. - - -

Parameters:

-
    -
  • fileName - the fileName to use for the logfile. It is templated.
    |h is replaced by the profile homedir.
    |y by 4 digit year.
    |m by 2 digit month
    |d by 2 digit day
    |n by the name constraint
    |e by the file extension (html for h logType, log for others) -
  • -
- - - - - -
-
- - loggingconsole:getFullFilename() - line 123 -
-
- Returns the pull path and filename for the logfile for this console - - - - - - - -
-
- - loggingconsole:enableLogging() - line 132 -
-
- Turns logging for this console on - - - - - - - -
-
- - loggingconsole:disableLogging() - line 137 -
-
- Turns logging for this console off - - - - - - - -
-
- - loggingconsole:cechoLink(text, command, hint, log) - line 309 -
-
- cechoLink for LoggingConsole - - -

Parameters:

-
    -
  • text - the text to use for the link -
  • -
  • command - the command to send when the link is clicked, as text. IE [[send("sleep")]] -
  • -
  • hint - A tooltip which is displayed when the mouse is over the link -
  • -
  • log - Should we log this line? Defaults to self.log if not passed. -
  • -
- - - - - -
-
- - loggingconsole:dechoLink(text, command, hint, log) - line 318 -
-
- dechoLink for LoggingConsole - - -

Parameters:

-
    -
  • text - the text to use for the link -
  • -
  • command - the command to send when the link is clicked, as text. IE [[send("sleep")]] -
  • -
  • hint - A tooltip which is displayed when the mouse is over the link -
  • -
  • log - Should we log this line? Defaults to self.log if not passed. -
  • -
- - - - - -
-
- - loggingconsole:hechoLink(text, command, hint, log) - line 327 -
-
- hechoLink for LoggingConsole - - -

Parameters:

-
    -
  • text - the text to use for the link -
  • -
  • command - the command to send when the link is clicked, as text. IE [[send("sleep")]] -
  • -
  • hint - A tooltip which is displayed when the mouse is over the link -
  • -
  • log - Should we log this line? Defaults to self.log if not passed. -
  • -
- - - - - -
-
- - loggingconsole:echoLink(text, command, hint, useCurrentFormat, log) - line 340 -
-
- echoLink for LoggingConsole - - -

Parameters:

-
    -
  • text - the text to use for the link -
  • -
  • command - the command to send when the link is clicked, as text. IE [[send("sleep")]] -
  • -
  • hint - A tooltip which is displayed when the mouse is over the link -
  • -
  • useCurrentFormat - If set to true, will look like the text around it. If false it will be blue and underline. -
  • -
  • log - Should we log this line? Defaults to self.log if not passed. If you want to pass this you must pass in useCurrentFormat -
  • -
- - - - -

Usage:

-
    -
  • myLoggingConsole:echoLink("This is a link!", [[send("sleep")]], "sleep") -- text "This is a link" will send("sleep") when clicked and be blue w/ underline. Defaut log behaviour (self.log)
  • -
  • myLoggingConsole:echoLink("This is a link!", [[send("sleep")]], "sleep", false, false) -- same as above, but forces it not to log regardless of self.log setting
  • -
  • myLoggingConsole:echoLink("This is a link!", [[send("sleep")]], "sleep", true, true) -- same as above, but forces it to log regardless of self.log setting and the text will look like anything else echoed to the console.
  • -
- -
-
- - loggingconsole:cechoPopup(text, commands, hints, log) - line 349 -
-
- cechoPopup for LoggingConsole - - -

Parameters:

-
    -
  • text - the text to use for the link -
  • -
  • commands - the commands to send when the popup is activated, as table. IE {[[send("sleep")]], [[send("stand")]]} -
  • -
  • hints - A tooltip which is displayed when the mouse is over the link. IE {{"sleep", "stand"}} -
  • -
  • log - Should we log this line? Defaults to self.log if not passed. -
  • -
- - - - - -
-
- - loggingconsole:dechoPopup(text, commands, hints, log) - line 358 -
-
- dechoPopup for LoggingConsole - - -

Parameters:

-
    -
  • text - the text to use for the link -
  • -
  • commands - the commands to send when the popup is activated, as table. IE {[[send("sleep")]], [[send("stand")]]} -
  • -
  • hints - A tooltip which is displayed when the mouse is over the link. IE {{"sleep", "stand"}} -
  • -
  • log - Should we log this line? Defaults to self.log if not passed. -
  • -
- - - - - -
-
- - loggingconsole:hechoPopup(text, commands, hints, log) - line 367 -
-
- hechoPopup for LoggingConsole - - -

Parameters:

-
    -
  • text - the text to use for the link -
  • -
  • commands - the commands to send when the popup is activated, as table. IE {[[send("sleep")]], [[send("stand")]]} -
  • -
  • hints - A tooltip which is displayed when the mouse is over the link. IE {{"sleep", "stand"}} -
  • -
  • log - Should we log this line? Defaults to self.log if not passed. -
  • -
- - - - - -
-
- - loggingconsole:echoPopup(text, commands, hints, useCurrentFormat, log) - line 380 -
-
- echoPopup for LoggingConsole - - -

Parameters:

-
    -
  • text - the text to use for the link -
  • -
  • commands - the commands to send when the popup is activated, as table. IE {[[send("sleep")]], [[send("stand")]]} -
  • -
  • hints - A tooltip which is displayed when the mouse is over the link. IE {{"sleep", "stand"}} -
  • -
  • useCurrentFormat - If set to true, will look like the text around it. If false it will be blue and underline. -
  • -
  • log - Should we log this line? Defaults to self.log if not passed. If you want to pass this you must pass in useCurrentFormat -
  • -
- - - - -

Usage:

-
    -
  • myLoggingConsole:echoPopup("This is a link!", {[[send("sleep")]], [[send("stand")]], {"sleep", "stand"}) -- text "This is a link" will send("sleep") when clicked and be blue w/ underline. Defaut log behaviour (self.log)
  • -
  • myLoggingConsole:echoPopup("This is a link!", {[[send("sleep")]], [[send("stand")]], {"sleep", "stand"}, false, false) -- same as above, but forces it not to log regardless of self.log setting
  • -
  • myLoggingConsole:echoPopup("This is a link!", {[[send("sleep")]], [[send("stand")]], {"sleep", "stand"}, true, true) -- same as above, but forces it to log regardless of self.log setting and the text will look like anything else echoed to the console.
  • -
- -
-
- - loggingconsole:appendBuffer(log) - line 386 -
-
- Append copy()ed text to the console - - -

Parameters:

-
    -
  • log - should we log this? -
  • -
- - - - - -
-
- - loggingconsole:append(log) - line 392 -
-
- Append copy()ed text to the console - - -

Parameters:

-
    -
  • log - should we log this? -
  • -
- - - - - -
-
- - loggingconsole:echo(str, log) - line 399 -
-
- echo's a string to the console. - - -

Parameters:

-
    -
  • str - the string to echo -
  • -
  • log - should this be logged? Used to override the .log constraint -
  • -
- - - - - -
-
- - loggingconsole:hecho(str, log) - line 406 -
-
- hecho's a string to the console. - - -

Parameters:

-
    -
  • str - the string to hecho -
  • -
  • log - should this be logged? Used to override the .log constraint -
  • -
- - - - - -
-
- - loggingconsole:decho(str, log) - line 413 -
-
- decho's a string to the console. - - -

Parameters:

-
    -
  • str - the string to decho -
  • -
  • log - should this be logged? Used to override the .log constraint -
  • -
- - - - - -
-
- - loggingconsole:cecho(str, log) - line 420 -
-
- cecho's a string to the console. - - -

Parameters:

-
    -
  • str - the string to cecho -
  • -
  • log - should this be logged? Used to override the .log constraint -
  • -
- - - - - -
-
- - loggingconsole:replay(numberOfLines) - line 426 -
-
- Replays the last X lines from the console's log file, if it exists - - -

Parameters:

-
    -
  • numberOfLines - The number of lines to replay from the end of the file -
  • -
- - - - - -
-
- - -
-
-
-generated by LDoc 1.5.0 -Last updated 2023-05-29 18:41:27 -
-
- - diff --git a/src/resources/MDK/doc/classes/Loginator.html b/src/resources/MDK/doc/classes/Loginator.html deleted file mode 100755 index 7174dae..0000000 --- a/src/resources/MDK/doc/classes/Loginator.html +++ /dev/null @@ -1,546 +0,0 @@ - - - - - Reference - - - - -
- -
- -
-
-
- - -
- - - - - - -
- -

Class Loginator

-

Loginator creates an object which allows you to log things to file at - various severity levels, with the ability to only log items above a specific - severity to file.

-

-

Info:

-
    -
  • Copyright: 2021 Damian Monogue
  • -
  • License: MIT, see LICENSE.lua
  • -
  • Author: Damian Monogue
  • -
- - -

Methods

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
loginator:new(options)Creates a new Loginator object
loginator:setColorForLevel(color, level)Set the color to associate with a logging level post-creation
loginator:getFullFilename()Returns the full path and filename to the logfile
loginator:error(msg)Write an error level message to the logfile.
loginator:warn(msg)Write a warn level message to the logfile.
loginator:info(msg)Write an info level message to the logfile.
loginator:debug(msg)Write a debug level message to the logfile.
loginator:log(msg, level)Write a message to the log file and optionally specify the level
loginator:open()Uses openUrl() to request your OS open the logfile in the appropriate application.
loginator:openDir()Uses openUrl() to request your OS open the directory the logfile resides in.
loginator:getPath(filename)Returns the path to the log file (directory in which the file resides) as a string
- -
-
- - -

Methods

- -
-
- - loginator:new(options) - line 214 -
-
- Creates a new Loginator object - - -

Parameters:

-
    -
  • options - table - table of options for the logger - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    option namedescriptiondefault
    formatWhat format to log in? "h" for html, "a" for ansi, anything else for plaintext."h"
    nameWhat is the name of the logger? Will replace |n in templateslogname
    levelWhat level should the logger operate at? This will control what level the log function defaults to, as well as what logs will actually be written
    - Only items of an equal or higher severity to this will be written to the log file.
    "info"
    bgColorWhat background color to use for html logs"black"
    fgColorWhat color to use for the main text in html logs"white"
    fontSizeWhat font size to use in html logs12
    levelColorsTable with the log level as the key, and the color which corresponds to it as the value{ error = "red", warn = "DarkOrange", info = "ForestGreen", debug = "ansi_yellow" }
    fileNameTemplateA template which will be transformed into the full filename, with path. See template options below for replacements"|p/log/Loginator/|y-|M-|d-|n.|e"
    entryTemplateThe template which controls the look of each log entry. See template options below for replacements"|y-|M-|d |h:|m:|s.|x [|c|l|r] |t"

    - Table of template options - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    template codewhat it is replaced withexample
    |ythe year in 4 digits2021
    |pgetMudletHomeDir()/home/demonnic/.config/mudlet/profiles/testprofile
    |MMonth as 2 digits05
    |dday, as 2 digits23
    |hhour in 24hr time format, 2 digits03
    |mminute as 2 digits42
    |sseconds as 2 digits34
    |xmilliseconds as 3 digits194
    |eFilename extension expected. "html" for html format, "log" for everything elsehtml
    |lThe logging level of the entry, in ALLCAPSWARN
    |cThe color which corresponds with the logging level. Set via the levelColors table in the options. Example not included.
    |rReset back to standard color. Used to close |c. Example not included
    |nThe name of the logger, set via the options when you have Loginator create it.CoolPackageLog
    -
  • -
- -

Returns:

-
    - - newly created logger object -
- - - - -
-
- - loginator:setColorForLevel(color, level) - line 288 -
-
- Set the color to associate with a logging level post-creation - - -

Parameters:

-
    -
  • color - The color to set for the level, as a string. Can be any valid color string for cecho, decho, or hecho. -
  • -
  • level - The level to set the color for. Must be one of 'error', 'warn', 'info', or 'debug' -
  • -
- -

Returns:

-
    - - true if the color is updated, or nil+error if it could not be updated for some reason. -
- - - - -
-
- - loginator:getFullFilename() - line 332 -
-
- Returns the full path and filename to the logfile - - - - - - - -
-
- - loginator:error(msg) - line 339 -
-
- Write an error level message to the logfile. Error level messages are always written. - - -

Parameters:

-
    -
  • msg - the message to log -
  • -
- -

Returns:

-
    - - true if msg written, nil+error if error -
- - - - -
-
- - loginator:warn(msg) - line 349 -
-
- Write a warn level message to the logfile. - Msg is only written if the logger level is <= warn - From most to least severe the levels are: - error > warn > info > debug - - -

Parameters:

-
    -
  • msg - the message to log -
  • -
- -

Returns:

-
    - - true if msg written, false if skipped due to level, nil+error if error -
- - - - -
-
- - loginator:info(msg) - line 359 -
-
- Write an info level message to the logfile. - Msg is only written if the logger level is <= info - From most to least severe the levels are: - error > warn > info > debug - - -

Parameters:

-
    -
  • msg - the message to log -
  • -
- -

Returns:

-
    - - true if msg written, false if skipped due to level, nil+error if error -
- - - - -
-
- - loginator:debug(msg) - line 369 -
-
- Write a debug level message to the logfile. - Msg is only written if the logger level is debug - From most to least severe the levels are: - error > warn > info > debug - - -

Parameters:

-
    -
  • msg - the message to log -
  • -
- -

Returns:

-
    - - true if msg written, false if skipped due to level, nil+error if error -
- - - - -
-
- - loginator:log(msg, level) - line 377 -
-
- Write a message to the log file and optionally specify the level - - -

Parameters:

-
    -
  • msg - the message to log -
  • -
  • level - the level to log the message at. Defaults to the level of the logger itself if not provided. -
  • -
- -

Returns:

-
    - - true if msg written, false if skipped due to level, nil+error if error -
- - - - -
-
- - loginator:open() - line 409 -
-
- Uses openUrl() to request your OS open the logfile in the appropriate application. Usually your web browser for html and text editor for all others. - - - - - - - -
-
- - loginator:openDir() - line 414 -
-
- Uses openUrl() to request your OS open the directory the logfile resides in. This allows for easier browsing if you have more than one file. - - - - - - - -
-
- - loginator:getPath(filename) - line 420 -
-
- Returns the path to the log file (directory in which the file resides) as a string - - -

Parameters:

-
    -
  • filename - optional filename to return the path of. If not supplied, with use the logger's current filename -
  • -
- - - - - -
-
- - -
-
-
-generated by LDoc 1.5.0 -Last updated 2023-05-29 18:41:27 -
-
- - diff --git a/src/resources/MDK/doc/classes/MasterMindSolver.html b/src/resources/MDK/doc/classes/MasterMindSolver.html deleted file mode 100755 index 7e5c34b..0000000 --- a/src/resources/MDK/doc/classes/MasterMindSolver.html +++ /dev/null @@ -1,277 +0,0 @@ - - - - - Reference - - - - -
- -
- -
-
-
- - -
- - - - - - -
- -

Class MasterMindSolver

-

Interactive object which helps you solve a Master Mind puzzle.

-

-

Info:

-
    -
  • Copyright: 2021 Damian Monogue,2008,2009 Konstantinos Asimakis for code used to turn an index number into a guess (indexToGuess method)
  • -
  • Author: Damian Monogue
  • -
- - -

Methods

- - - - - - - - - - - - - - - - - -
mastermindsolver:new(options)Creates a new Master Mind solver
mastermindsolver:reducePossible(guess, coloredPins, whitePins)Function used to reduce the remaining possible answers, given a guess and the answer to that guess.
mastermindsolver:checkLastSuggestion(coloredPins, whitePins)Function which assumes you used the last suggested guess from the solver, and reduces the number of possible correct solutions based on the answer given
mastermindsolver:getValidGuess(useActions)Used to get one of the remaining valid possible guesses
- -
-
- - -

Methods

- -
-
- - mastermindsolver:new(options) - line 81 -
-
- Creates a new Master Mind solver - - -

Parameters:

-
    -
  • options - table - table of configuration options for the solver - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    option namedescriptiondefault
    placesHow many spots in the code we're breaking?4
    itemsThe table of colors/gemstones/whatever which can be part of the code{"red", "orange", "yellow", "green", "blue", "purple"}
    templateThe string template to use for the guess. Within the template, |t is replaced by the item. Used as the command if autoSend is true"|t"
    autoSendShould we send the guess directly to the server?false
    allowDuplicatesCan the same item be used more than once in a code?true
    singleCommandIf true, combines the guess into a single command, with each one separated by the separatorfalse
    separatorIf sending the guess as a single command, what should we put between the guesses to separate them?" "
    -
  • -
- - - - - -
-
- - mastermindsolver:reducePossible(guess, coloredPins, whitePins) - line 178 -
-
- Function used to reduce the remaining possible answers, given a guess and the answer to that guess. This is not undoable. - - -

Parameters:

-
    -
  • guess - table - guess which the answer belongs to. Uses numbers, rather than item names. IE { 1, 1, 2, 2} rather than { "blue", "blue", "green", "green" } -
  • -
  • coloredPins - number - how many parts of the guess are both the right color and the right place -
  • -
  • whitePins - number - how many parts of the guess are the right color, but in the wrong place -
  • -
- -

Returns:

-
    - - true if you solved the puzzle (coloredPins == number of positions in the code), or false otherwise -
- - - - -
-
- - mastermindsolver:checkLastSuggestion(coloredPins, whitePins) - line 202 -
-
- Function which assumes you used the last suggested guess from the solver, and reduces the number of possible correct solutions based on the answer given - - -

Parameters:

-
    -
  • coloredPins - number - how many parts of the guess are both the right color and the right place -
  • -
  • whitePins - number - how many parts of the guess are the right color, but in the wrong place -
  • -
- -

Returns:

-
    - - true if you solved the puzzle (coloredPins == number of positions in the code), or false otherwise -
- - -

See also:

- - - -
-
- - mastermindsolver:getValidGuess(useActions) - line 208 -
-
- Used to get one of the remaining valid possible guesses - - -

Parameters:

-
    -
  • useActions - boolean - if true, will return the guess as the commands which would be sent, rather than the numbered items -
  • -
- - - - - -
-
- - -
-
-
-generated by LDoc 1.5.0 -Last updated 2023-05-29 18:41:27 -
-
- - diff --git a/src/resources/MDK/doc/classes/SUG.html b/src/resources/MDK/doc/classes/SUG.html deleted file mode 100755 index fad4257..0000000 --- a/src/resources/MDK/doc/classes/SUG.html +++ /dev/null @@ -1,407 +0,0 @@ - - - - - Reference - - - - -
- -
- -
-
-
- - -
- - - - - - -
- -

Class SUG

-

Self Updating Gauge, extends Geyser.Gauge

-

-

Info:

-
    -
  • Copyright: 2020 Damian Monogue
  • -
  • License: MIT, see LICENSE.lua
  • -
  • Author: Damian Monogue
  • -
- - -

Methods

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
sug:new(cons, container)Creates a new Self Updating Gauge.
sug:setUpdateTime(time)Set how often to update the gauge on a timer
sug:setUpdateEvent(event)Set the event to listen for to update the gauge
sug:setCurrentVariable(variableName)Set the name of the variable the Self Updating Gauge watches for the 'current' value of the gauge
sug:setMaxVariable(variableName)Set the name of the variable the Self Updating Gauge watches for the 'max' value of the gauge
sug:setTextTemplate(template)Set the template for the Self Updating Gauge to set the text with.
sug:setUpdateHook(func)Set the updateHook function which is run just prior to the gauge updating
sug:stop()Stops the Self Updating Gauge from updating
sug:start()Starts the Self Updating Gauge updating.
sug:update()Reads the values from currentVariable and maxVariable, and updates the gauge's value and text.
- -
-
- - -

Methods

- -
-
- - sug:new(cons, container) - line 91 -
-
- Creates a new Self Updating Gauge. - - -

Parameters:

-
    -
  • cons - table - table of options which control the Gauge's behaviour. In addition to all valid contraints for Geyser.Gauge, SUG adds: -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    namedescriptiondefault
    activeboolean, if true starts the timer updatingtrue
    updateTimeHow often should the gauge autoupdate? Milliseconds. 0 to disable the timer but still allow event updates333
    currentVariableWhat variable will hold the 'current' value of the gauge? Pass the name as a string, IE "currentHP" or "gmcp.Char.Vitals.hp"""
    maxVariableWhat variable will hold the 'current' value of the gauge? Pass the name as a string, IE "maxHP" or "gmcp.Char.Vitals.maxhp"""
    textTemplateTemplate to use for the text on the gauge. "|c" replaced with current value, "|m" replaced with max value, "|p" replaced with the % full the gauge should be" |c/|m |p%"
    defaultCurrentWhat value to use if the currentVariable points to nil or something which cannot be made a number?50
    defaultMaxWhat value to use if the maxVariable points to nil or something which cannot be made a number?100
    updateEventThe name of an event to listen for to perform an update. Can be run alongside or instead of the timer updates. Empty string to turn off""
    updateHookA function which is run each time the gauge updates. Should take 3 arguments, the gauge itself, current value, and max value. You can return new current and max values to be used, for example `return 34, 120` would cause the gauge to use 34 for current and 120 for max regardless of what the variables it reads say.
    -
  • -
  • container - The Geyser container for this gauge -
  • -
- - - - -

Usage:

-
    -
    local SUG = require("MDK.sug") --the following will watch "gmcp.Char.Vitals.hp" and "gmcp.Char.Vitals.maxhp" and update itself every 333 milliseconds
    -myGauge = SUG:new({
    -  name = "myGauge",
    -  currentVariable = "gmcp.Char.Vitals.hp", --if this is nil, it will use the defaultCurrent of 50
    -  maxVariable = "gmcp.Char.Vitals.maxhp",  --if this is nil, it will use the defaultMax of 100.
    -  height = 50,
    -})
    -
- -
-
- - sug:setUpdateTime(time) - line 115 -
-
- Set how often to update the gauge on a timer - - -

Parameters:

-
    -
  • time - number - time in milliseconds. 0 to disable the timer -
  • -
- - - - - -
-
- - sug:setUpdateEvent(event) - line 126 -
-
- Set the event to listen for to update the gauge - - -

Parameters:

-
    -
  • event - string - the name of the event to listen for, use "" to disable events without stopping any existing timers -
  • -
- - - - - -
-
- - sug:setCurrentVariable(variableName) - line 137 -
-
- Set the name of the variable the Self Updating Gauge watches for the 'current' value of the gauge - - -

Parameters:

-
    -
  • variableName - string - The name of the variable to get the current value for the gauge. For instance "currentHP", "gmcp.Char.Vitals.hp" etc -
  • -
- - - - - -
-
- - sug:setMaxVariable(variableName) - line 152 -
-
- Set the name of the variable the Self Updating Gauge watches for the 'max' value of the gauge - - -

Parameters:

-
    -
  • variableName - string - The name of the variable to get the max value for the gauge. For instance "maxHP", "gmcp.Char.Vitals.maxhp" etc. Set to "" to only check the current value -
  • -
- - - - - -
-
- - sug:setTextTemplate(template) - line 172 -
-
- Set the template for the Self Updating Gauge to set the text with. "|c" is replaced by the current value, "|m" is replaced by the max value, and "|p" is replaced by the percentage current/max - - -

Parameters:

-
    -
  • template - string - The template to use for the text on the gauge. If the max value is 200 and current is 68, then |c will be replace by 68, |m replaced by 200, and |p replaced by 34. -
  • -
- - - - - -
-
- - sug:setUpdateHook(func) - line 182 -
-
- Set the updateHook function which is run just prior to the gauge updating - - -

Parameters:

-
    -
  • func - function - The function which will be called when the gauge updates. It should take 3 arguments, the gauge itself, the current value, and the max value. If you wish to override the current or max values used for the gauge, you can return new current and max values, like `return newCurrent newMax` -
  • -
- - - - - -
-
- - sug:stop() - line 191 -
-
- Stops the Self Updating Gauge from updating - - - - - - - -
-
- - sug:start() - line 204 -
-
- Starts the Self Updating Gauge updating. If it is already updating, it will restart it. - - - - - - - -
-
- - sug:update() - line 218 -
-
- Reads the values from currentVariable and maxVariable, and updates the gauge's value and text. - - - - - - - -
-
- - -
-
-
-generated by LDoc 1.5.0 -Last updated 2023-05-29 18:41:27 -
-
- - diff --git a/src/resources/MDK/doc/classes/SortBox.html b/src/resources/MDK/doc/classes/SortBox.html deleted file mode 100755 index 5ce7b0c..0000000 --- a/src/resources/MDK/doc/classes/SortBox.html +++ /dev/null @@ -1,593 +0,0 @@ - - - - - Reference - - - - -
- -
- -
-
-
- - -
- - - - - - -
- -

Class SortBox

-

An H/VBox alternative which can be set to either vertical or horizontal, and will autosort the windows

-

-

Info:

-
    -
  • Copyright: 2020 Damian Monogue
  • -
  • License: MIT, see LICENSE.lua
  • -
  • Author: Damian Monogue
  • -
- - -

Tables

- - - - - -
sortbox.SortFunctionsSorting functions for spairs, should you wish
-

Methods

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
sortbox:new(options[, container])Creates a new SortBox
sortbox:organize()Calling this will cause the SortBox to reposition/resize everything
sortbox:enableElastic()Enables elasticity for the SortBox.
sortbox:disableElastic()Disables elasticity for the SortBox
sortbox:setElastic(enabled)Set elasticity specifically
sortbox:setMaxWidth(maxWidth)Set the max width of the SortBox if it's elastic
sortbox:setMaxHeight(maxHeight)Set the max height of the SortBox if it's elastic
sortbox:enableTimer()Starts the SortBox sorting and organizing itself on a timer
sortbox:disableTimer()Stops the SortBox from sorting and organizing itself on a timer
sortbox:setSortInterval(sortInterval)Sets the sortInterval, or amount of time in milliseconds between auto sorting on a timer if timerSort is true
sortbox:enableSort()Enables sorting when items are added/removed, or if timerSort is true, every sortInterval milliseconds
sortbox:disableSort()Disables sorting when items are added or removed
sortbox:setBoxType(boxType)Set whether the SortBox acts as a VBox or HBox.
sortbox:setSortFunction(functionName)Sets the type of sorting in use by this SortBox.
- -
-
- - -

Tables

- -
-
- - sortbox.SortFunctions - line 29 -
-
- Sorting functions for spairs, should you wish - - -

Fields:

-
    -
  • gaugeValue - sorts Geyser gauges by value, ascending -
  • -
  • reverseGaugeValue - sorts Geyser gauges by value, descending -
  • -
  • timeLeft - sorts TimerGauges by how much time is left, ascending -
  • -
  • reverseTimeLeft - sorts TimerGauges by how much time is left, descending. -
  • -
  • name - sorts Geyser objects by name, ascending -
  • -
  • reverseName - sorts Geyser objects by name, descending -
  • -
  • message - sorts Geyser labels and gauges by their echoed text, ascending -
  • -
  • reverseMessage - sorts Geyser labels and gauges by their echoed text, descending -
  • -
- - - - - -
-
-

Methods

- -
-
- - sortbox:new(options[, container]) - line 144 -
-
- Creates a new SortBox - - -

Parameters:

-
    -
  • options - table - the options to use for the SortBox. See table below for added options -
  • -
  • container - the container to add the SortBox into -

    Table of new options - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    option namedescriptiondefault
    autoSortshould the SortBox perform function based sorting? If false, will behave like a normal H/VBoxtrue
    timerSortshould the SortBox automatically perform sorting on a timer?true
    sortIntervalhow frequently should we sort on a timer if timerSort is true, in milliseconds500
    boxTypeShould we stack like an HBox or VBox? use 'h' for hbox and 'v' for vboxv
    sortFunctionhow should we sort the items in the SortBox? see setSortFunction for valid optionsgaugeValue
    elasticShould this container stretch to fit its contents? boxType v stretches in height, h stretches in width.false
    maxHeightIf elastic, what's the biggest a 'v' style box should grow in height? Use 0 for unlimited0
    maxWidthIf elastic, what's the biggest a 'h' style box should grow in width? Use 0 for unlimited0
    - (optional) -
  • -
- - - - -

Usage:

-
    -
    local SortBox = require("MDK.sortbox")
    -mySortBox = SortBox:new({
    -  name = "mySortBox",
    -  x = 400,
    -  y = 100,
    -  height = 150,
    -  width = 300,
    -  sortFunction = "timeLeft"
    -})
    -
- -
-
- - sortbox:organize() - line 196 -
-
- Calling this will cause the SortBox to reposition/resize everything - - - - - - - -
-
- - sortbox:enableElastic() - line 372 -
-
- Enables elasticity for the SortBox. - - - - - - - -
-
- - sortbox:disableElastic() - line 377 -
-
- Disables elasticity for the SortBox - - - - - - - -
-
- - sortbox:setElastic(enabled) - line 383 -
-
- Set elasticity specifically - - -

Parameters:

-
    -
  • enabled - boolean - if true, enable elasticity. If false, disable it. -
  • -
- - - - - -
-
- - sortbox:setMaxWidth(maxWidth) - line 389 -
-
- Set the max width of the SortBox if it's elastic - - -

Parameters:

-
    -
  • maxWidth - number - The maximum width in pixels to resize the SortBox to. Use 0 for unlimited. -
  • -
- - - - - -
-
- - sortbox:setMaxHeight(maxHeight) - line 398 -
-
- Set the max height of the SortBox if it's elastic - - -

Parameters:

-
    -
  • maxHeight - number - The maximum height in pixels to resize the SortBox to. Use 0 for unlimited. -
  • -
- - - - - -
-
- - sortbox:enableTimer() - line 406 -
-
- Starts the SortBox sorting and organizing itself on a timer - - - - - - - -
-
- - sortbox:disableTimer() - line 417 -
-
- Stops the SortBox from sorting and organizing itself on a timer - - - - - - - -
-
- - sortbox:setSortInterval(sortInterval) - line 425 -
-
- Sets the sortInterval, or amount of time in milliseconds between auto sorting on a timer if timerSort is true - - -

Parameters:

-
    -
  • sortInterval - number - time in milliseconds between auto sorting if timerSort is true -
  • -
- - - - - -
-
- - sortbox:enableSort() - line 436 -
-
- Enables sorting when items are added/removed, or if timerSort is true, every sortInterval milliseconds - - - - - - - -
-
- - sortbox:disableSort() - line 442 -
-
- Disables sorting when items are added or removed - - - - - - - -
-
- - sortbox:setBoxType(boxType) - line 451 -
-
- Set whether the SortBox acts as a VBox or HBox. - - -

Parameters:

-
    -
  • boxType - string - If you pass 'h' or 'horizontal' it will act like an HBox. Anything else it will act like a VBox. -
  • -
- - - - -

Usage:

-
    -
    mySortBox:setBoxType("v") -- behave like a VBox
    -mySortBox:setBoxType("h") -- behave like an HBox
    -mySortBox:setBoxType("beeblebrox") -- why?! Why would you do this? It'll behave like a VBox
    -
- -
-
- - sortbox:setSortFunction(functionName) - line 508 -
-
- Sets the type of sorting in use by this SortBox. -
If an item in the box does not have the appropriate property or function, then 999999999 is used for sorting except as otherwise noted. -
If an invalid option is given, then existing H/VBox behaviour is maintained, just like if autoSort is false. - - -

Parameters:

-
    -
  • functionName - string - what type of sorting should we use? See table below for valid options and their descriptions. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    sort typedescription
    gaugeValuesort gauges based on how full the gauge is, from less full to more
    reverseGaugeValuesort gauges based on how full the gauge is, from more full to less
    timeLeftsort TimerGauges based on the total time left in the gauge, from less time to more
    reverseTimeLeftsort TimerGauges based on the total time left in the gauge, from more time to less
    namesort any item (and mixed types) by name, alphabetically.
    reverseNamesort any item (and mixed types) by name, reverse alphabetically.
    messagesorts Labels based on their echoed message, alphabetically. If not a label, the empty string will be used
    reverseMessagesorts Labels based on their echoed message, reverse alphabetically. If not a label, the empty string will be used
    -
  • -
- - - - -

Usage:

-
    -
    mySortBox:setSortFunction("gaugeValue")
    -
- -
-
- - -
-
-
-generated by LDoc 1.5.0 -Last updated 2023-05-29 18:41:27 -
-
- - diff --git a/src/resources/MDK/doc/classes/TextGauge.html b/src/resources/MDK/doc/classes/TextGauge.html deleted file mode 100755 index da9ce37..0000000 --- a/src/resources/MDK/doc/classes/TextGauge.html +++ /dev/null @@ -1,622 +0,0 @@ - - - - - Reference - - - - -
- -
- -
-
-
- - -
- - - - - - -
- -

Class TextGauge

-

Creates a text based gauge, for use in miniconsoles and the like.

-

-

Info:

-
    -
  • Copyright: 2020 Damian Monogue,2021 Damian Monogue
  • -
  • License: MIT, see LICENSE.lua
  • -
  • Author: Damian Monogue
  • -
- - -

Methods

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
textgauge:new([options])Creates a new TextGauge.
textgauge:setWidth(width)Sets the width in characters of the gauge
textgauge:setFillCharacter(character)Sets the character to use for the 'full' part of the gauge
textgauge:setOverflowCharacter(character)Sets the character to use for the 'overflow' (>100%) part of the gauge
textgauge:setEmptyCharacter(character)Sets the character to use for the 'full' part of the gauge
textgauge:setFillColor(color)Sets the fill color for the gauge.
textgauge:setOverflowColor(color)Sets the overflow color for the gauge.
textgauge:setEmptyColor(color)Sets the empty color for the gauge.
textgauge:setPercentColor(color)Sets the fill color for the gauge.
textgauge:setPercentSymbolColor(color)Sets the fill color for the gauge.
textgauge:enableReverse()Enables reversing the fill direction (right to left instead of the usual left to right)
textgauge:disableReverse()Disables reversing the fill direction (go back to the usual left to right)
textgauge:enableShowPercent()Enables showing the percent value of the gauge
textgauge:disableShowPercent()Disables showing the percent value of the gauge
textgauge:enableShowPercentSymbol()Enables showing the percent symbol (appears after the value)
textgauge:disableShowPercentSymbol()Enables showing the percent symbol (appears after the value)
textgauge:setValue([current[, max]])Used to set the gauge's value and return the string representation of the gauge
textgauge:print(...)Synonym for setValue
- -
-
- - -

Methods

- -
-
- - textgauge:new([options]) - line 92 -
-
- Creates a new TextGauge. - - -

Parameters:

-
    -
  • options - table - The table of options you would like the TextGauge to start with. -

    Table of new options - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    option namedescriptiondefault
    widthHow many characters wide to make the gauge24
    fillCharacterWhat character to use for the 'full' part of the gauge:
    overflowCharacterWhat character to use for >100% part of the gaugeif not set, it uses whatever you set fillCharacter to
    emptyCharacterWhat character to use for the 'empty' part of the gauge-
    showPercentSymbolShould we show the % sign itself?true
    showPercentShould we show what % of the gauge is filled?true
    valueHow much of the gauge should be filled50
    formatWhat type of color formatting to use? 'c' for cecho, 'd' for decho, 'h' for hechoc
    fillColorWhat color to make the full part of the bar?"DarkOrange" or equivalent for your format type
    emptyColorwhat color to use for the empty part of the bar?"white" or format appropriate equivalent
    percentColorWhat color to print the percentage numvers in, if shown?"white" or fortmat appropriate equivalent
    percentSymbolColorWhat color to make the % if shown?If not set, uses what percentColor is set to.
    overflowColorWhat color to make the >100% portion of the bar?If not set, will use the same color as fillColor
    - (optional) -
  • -
- - - - -

Usage:

-
    -
    local TextGauge = require("MDK.textgauge")
    -myTextGauge = TextGauge:new()
    -gaugeText = myTextGauge:setValue(382, 830)
    -
- -
-
- - textgauge:setWidth(width) - line 105 -
-
- Sets the width in characters of the gauge - - -

Parameters:

-
    -
  • width - number - number of characters wide to make the gauge -
  • -
- - - - - -
-
- - textgauge:setFillCharacter(character) - line 118 -
-
- Sets the character to use for the 'full' part of the gauge - - -

Parameters:

-
    -
  • character - string - the character to use. -
  • -
- - - - - -
-
- - textgauge:setOverflowCharacter(character) - line 126 -
-
- Sets the character to use for the 'overflow' (>100%) part of the gauge - - -

Parameters:

-
    -
  • character - string - the character to use. -
  • -
- - - - - -
-
- - textgauge:setEmptyCharacter(character) - line 134 -
-
- Sets the character to use for the 'full' part of the gauge - - -

Parameters:

-
    -
  • character - string - the character to use. -
  • -
- - - - - -
-
- - textgauge:setFillColor(color) - line 142 -
-
- Sets the fill color for the gauge. - - -

Parameters:

-
    -
  • color - string - the color to use for the full portion of the gauge. Will be run through Geyser.Golor -
  • -
- - - - - -
-
- - textgauge:setOverflowColor(color) - line 149 -
-
- Sets the overflow color for the gauge. - - -

Parameters:

-
    -
  • color - string - the color to use for the full portion of the gauge. Will be run through Geyser.Golor -
  • -
- - - - - -
-
- - textgauge:setEmptyColor(color) - line 156 -
-
- Sets the empty color for the gauge. - - -

Parameters:

-
    -
  • color - string - the color to use for the empty portion of the gauge. Will be run through Geyser.Golor -
  • -
- - - - - -
-
- - textgauge:setPercentColor(color) - line 163 -
-
- Sets the fill color for the gauge. - - -

Parameters:

-
    -
  • color - string - the color to use for the numeric value. Will be run through Geyser.Golor -
  • -
- - - - - -
-
- - textgauge:setPercentSymbolColor(color) - line 169 -
-
- Sets the fill color for the gauge. - - -

Parameters:

-
    -
  • color - string - the color to use for the numeric value. Will be run through Geyser.Golor -
  • -
- - - - - -
-
- - textgauge:enableReverse() - line 175 -
-
- Enables reversing the fill direction (right to left instead of the usual left to right) - - - - - - - -
-
- - textgauge:disableReverse() - line 180 -
-
- Disables reversing the fill direction (go back to the usual left to right) - - - - - - - -
-
- - textgauge:enableShowPercent() - line 185 -
-
- Enables showing the percent value of the gauge - - - - - - - -
-
- - textgauge:disableShowPercent() - line 190 -
-
- Disables showing the percent value of the gauge - - - - - - - -
-
- - textgauge:enableShowPercentSymbol() - line 195 -
-
- Enables showing the percent symbol (appears after the value) - - - - - - - -
-
- - textgauge:disableShowPercentSymbol() - line 200 -
-
- Enables showing the percent symbol (appears after the value) - - - - - - - -
-
- - textgauge:setValue([current[, max]]) - line 270 -
-
- Used to set the gauge's value and return the string representation of the gauge - - -

Parameters:

-
    -
  • current - number - current value. If no value is passed it will use the stored value. Defaults to 50 to prevent errors. - (optional) -
  • -
  • max - number - maximum value. If not passed, the internally stored one will be used. Defaults to 100 so that it can be used with single values as a percent - (optional) -
  • -
- - - - -

Usage:

-
    -
  • myGauge:setValue(55) -- sets the gauge to 55% full
  • -
  • myGauge:setValue(2345, 2780) -- will figure out what the percentage fill is based on the given current/max values
  • -
- -
-
- - textgauge:print(...) - line 331 -
-
- Synonym for setValue - - -

Parameters:

-
    -
  • ... - -
  • -
- - - - - -
-
- - -
-
-
-generated by LDoc 1.5.0 -Last updated 2023-05-29 18:41:27 -
-
- - diff --git a/src/resources/MDK/doc/classes/TimerGauge.html b/src/resources/MDK/doc/classes/TimerGauge.html deleted file mode 100755 index 6410508..0000000 --- a/src/resources/MDK/doc/classes/TimerGauge.html +++ /dev/null @@ -1,631 +0,0 @@ - - - - - Reference - - - - -
- -
- -
-
-
- - -
- - - - - - -
- -

Class TimerGauge

-

Animated countdown timer, extends Geyser.Gauge

-

-

Info:

-
    -
  • Copyright: 2020 Damian Monogue
  • -
  • License: MIT, see LICENSE.lua
  • -
  • Author: Damian Monogue
  • -
- - -

Methods

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
timergauge:show2()Shows the TimerGauge.
timergauge:hide2()Hides the TimerGauge.
timergauge:start([show])Starts the timergauge.
timergauge:stop([hide])Stops the timergauge.
timergauge:pause([hide])Alias for stop.
timergauge:reset()Resets the time on the timergauge to its original value.
timergauge:restart([show])Resets and starts the timergauge.
timergauge:getTime(format)Get the amount of time remaining on the timer, in seconds
timergauge:finish([skipHook])Sets the timer's remaining time to 0, stops it, and executes the hook if one exists.
timergauge:setTime(time)Sets the amount of time the timer will run for.
timergauge:setUpdateTime(updateTime)Changes the time between gauge updates.
timergauge:new(cons, parent)Creates a new TimerGauge instance.
- -
-
- - -

Methods

- -
-
- - timergauge:show2() - line 40 -
-
- Shows the TimerGauge. If the manageContainer property is true, then will add it back to its container - - - - - - - -
-
- - timergauge:hide2() - line 49 -
-
- Hides the TimerGauge. If manageContainer property is true, then it will remove it from its container and if the container is an HBox or VBox it will initiate size/position management - - - - - - - -
-
- - timergauge:start([show]) - line 70 -
-
- Starts the timergauge. Works whether the timer is stopped or not. Does not start a timer which is already at 0 - - -

Parameters:

-
    -
  • show - boolean - override the autoShow property. True will always show, false will never show. - (optional) -
  • -
- - - - -

Usage:

-
    -
    myTimerGauge:start() --starts the timer, will show or not based on autoShow property
    -myTimerGauge:start(false) --starts the timer, will not change hidden status, regardless of autoShow property
    -myTimerGauge:start(true) --starts the timer, will show it regardless of autoShow property
    -
- -
-
- - timergauge:stop([hide]) - line 94 -
-
- Stops the timergauge. Works whether the timer is started or not. - - -

Parameters:

-
    -
  • hide - boolean - override the autoHide property. True will always hide, false will never hide. - (optional) -
  • -
- - - - -

Usage:

-
    -
    myTimerGauge:stop() --stops the timer, will hide or not based on autoHide property
    -myTimerGauge:stop(false) --stops the timer, will not change hidden status, regardless of autoHide property
    -myTimerGauge:stop(true) --stops the timer, will hide it regardless of autoHide property
    -
- -
-
- - timergauge:pause([hide]) - line 111 -
-
- Alias for stop. - - -

Parameters:

-
    -
  • hide - boolean - override the autoHide property. True will always hide, false will never hide. - (optional) -
  • -
- - - - - -
-
- - timergauge:reset() - line 116 -
-
- Resets the time on the timergauge to its original value. Does not alter the running state of the timer - - - - - - - -
-
- - timergauge:restart([show]) - line 127 -
-
- Resets and starts the timergauge. - - -

Parameters:

-
    -
  • show - boolean - override the autoShow property. true will always show, false will never show - (optional) -
  • -
- - - - -

Usage:

-
    -
    myTimerGauge:restart() --restarts the timer, will show or not based on autoShow property
    -myTimerGauge:restart(false) --restarts the timer, will not change hidden status, regardless of autoShow property
    -myTimerGauge:restart(true) --restarts the timer, will show it regardless of autoShow property
    -
- -
-
- - timergauge:getTime(format) - line 197 -
-
- Get the amount of time remaining on the timer, in seconds - - -

Parameters:

-
    -
  • format - string - Format string for how to return the time. If not provided defaults to self.timeFormat(which defaults to "S.t").
    - If "" is passed will return "" as the time. See below table for formatting codes
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    format codewhat it is replaced with
    STime left in seconds, unbroken down. Does not include milliseconds.
    - IE a timer with 2 minutes left it would replace S with 120 -
    ddDays, with 1 leading 0 (0, 01, 02-...)
    dDays, with no leading 0 (1,2,3-...)
    hhhours, with leading 0 (00-24)
    hhours, without leading 0 (0-24)
    MMminutes, with a leading 0 (00-59)
    Mminutes, no leading 0 (0-59)
    ssseconds, with leading 0 (00-59)
    sseconds, no leading 0 (0-59)
    ttenths of a second
    - timer with 12.345 seconds left, t would
    - br replaced by 3. -
    mmmilliseconds with leadings 0s (000-999)
    mmilliseconds with no leading 0s (0-999)

    -
  • -
- - - - -

Usage:

-
    -
    myTimerGauge:getTime() --returns the time using myTimerGauge.format
    -myTimerGauge:getTime("hh:MM:ss") --returns the time as hours, minutes, and seconds, with leading 0s (01:23:04)
    -myTimerGauge:getTime("S.mm") --returns the time as the total number of seconds, including milliseconds (114.004)
    -
- -
-
- - timergauge:finish([skipHook]) - line 263 -
-
- Sets the timer's remaining time to 0, stops it, and executes the hook if one exists. - - -

Parameters:

-
    -
  • skipHook - boolean - use true to have it set the timer to 0 and stop, but not execute the hook. - (optional) -
  • -
- - - - -

Usage:

-
    -
    myTimerGauge:finish() --executes the hook if it has one
    - myTimerGauge:finish(false) --will not execute the hook
    -
- -
-
- - timergauge:setTime(time) - line 294 -
-
- Sets the amount of time the timer will run for. Make sure to call :reset() or :restart() - if you want to cause the timer to run for that amount of time. If you set it to a time lower - than the time left on the timer currently, it will reset the current time, otherwise it is left alone - - -

Parameters:

-
    -
  • time - number - how long in seconds the timer should run for -
  • -
- - - - -

Usage:

-
    -
    myTimerGauge:setTime(50) -- sets myTimerGauge's max time to 50.
    -
- -
-
- - timergauge:setUpdateTime(updateTime) - line 318 -
-
- Changes the time between gauge updates. - - -

Parameters:

-
    -
  • updateTime - number - amount of time in milliseconds between gauge updates. Must be a positive number. -
  • -
- - - - - -
-
- - timergauge:new(cons, parent) - line 474 -
-
- Creates a new TimerGauge instance. - - -

Parameters:

-
    -
  • cons - table - a table of options (or constraints) for how the TimerGauge will behave. Valid options include: -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    namedescriptiondefault
    timehow long the timer should run for
    activewhether the timer should run or nottrue
    showTimeshould we show the time remaining on the gauge?true
    prefixtext you want shown before the time.""
    suffixtext you want shown after the time.""
    timerCaptionAlias for suffix. Deprecated and may be remove in the future -
    updateTimenumber of milliseconds between gauge updates.10
    autoHideshould the timer :hide() itself when it runs out/you stop it?true
    autoShowshould the timer :show() itself when you start it?true
    manageContainershould the timer remove itself from its container when you call
    :hide() and add itself back when you call :show()?
    false
    timeFormathow should the time be displayed/returned if you call :getTime()?
    See table below for more information
    "S.t"
    -
    Table of time format options - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    format codewhat it is replaced with
    STime left in seconds, unbroken down. Does not include milliseconds.
    - IE a timer with 2 minutes left it would replace S with 120 -
    ddDays, with 1 leading 0 (0, 01, 02-...)
    dDays, with no leading 0 (1,2,3-...)
    hhhours, with leading 0 (00-24)
    hhours, without leading 0 (0-24)
    MMminutes, with a leading 0 (00-59)
    Mminutes, no leading 0 (0-59)
    ssseconds, with leading 0 (00-59)
    sseconds, no leading 0 (0-59)
    ttenths of a second
    - timer with 12.345 seconds left, t would
    - br replaced by 3. -
    mmmilliseconds with leadings 0s (000-999)
    mmilliseconds with no leading 0s (0-999)

    -
  • -
  • parent - The Geyser parent for this TimerGauge -
  • -
- - - - -

Usage:

-
    -
    local TimerGauge = require("MDK.timergauge")
    -myTimerGauge = TimerGauge:new({
    -  name = "testGauge",
    -  x = 100,
    -  y = 100,
    -  height = 40,
    -  width = 200,
    -  time = 10
    -})
    -
- -
-
- - -
-
-
-generated by LDoc 1.5.0 -Last updated 2023-05-29 18:41:27 -
-
- - diff --git a/src/resources/MDK/doc/classes/aliasmgr.html b/src/resources/MDK/doc/classes/aliasmgr.html deleted file mode 100755 index adbad80..0000000 --- a/src/resources/MDK/doc/classes/aliasmgr.html +++ /dev/null @@ -1,415 +0,0 @@ - - - - - Reference - - - - -
- -
- -
-
-
- - -
- - - - - - -
- -

Class aliasmgr

-

Alias Manager

-

-

Info:

-
    -
  • Copyright: 2022 Damian Monogue
  • -
  • License: MIT, see LICENSE.lua
  • -
  • Author: Damian Monogue
  • -
- - -

Methods

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
aliasmgr:new()Creates a new alias manager
aliasmgr:register(name, regex, func)Registers an alias with the alias manager
aliasmgr:add(name, regex, func)Registers an alias with the alias manager.
aliasmgr:disable(name)Disables an alias, but does not delete it so it can be enabled later without being redefined
aliasmgr:disableAll()Disables all aliases registered with the manager
aliasmgr:enable(name)Enables an alias by name
aliasmgr:enableAll()Enables all aliases registered with the manager
aliasmgr:kill(name)Kill an alias, deleting it from the manager
aliasmgr:killAll()Kills all aliases registered with the manager, clearing it out
aliasmgr:delete(name)Kills an alias, deleting it from the manager
aliasmgr:deleteAll()Kills all aliases, deleting them from the manager
aliasmgr:getAliases()Returns the list of aliases and the information being tracked for them
- -
-
- - -

Methods

- -
-
- - aliasmgr:new() - line 10 -
-
- Creates a new alias manager - - - - - - - -
-
- - aliasmgr:register(name, regex, func) - line 27 -
-
- Registers an alias with the alias manager - - -

Parameters:

-
    -
  • name - the name for the alias -
  • -
  • regex - the regular expression the alias matches against -
  • -
  • func - The code to run when the alias matches. Can wrap code in [[ ]] or pass an actual function -
  • -
- - - - - -
-
- - aliasmgr:add(name, regex, func) - line 63 -
-
- Registers an alias with the alias manager. Alias for register - - -

Parameters:

-
    -
  • name - the name for the alias -
  • -
  • regex - the regular expression the alias matches against -
  • -
  • func - The code to run when the alias matches. Can wrap code in [[ ]] or pass an actual function -
  • -
- - - -

See also:

- - - -
-
- - aliasmgr:disable(name) - line 70 -
-
- Disables an alias, but does not delete it so it can be enabled later without being redefined - - -

Parameters:

-
    -
  • name - the name of the alias to disable -
  • -
- -

Returns:

-
    - - true if the alias exists and gets disabled, false if it does not exist or is already disabled -
- - - - -
-
- - aliasmgr:disableAll() - line 86 -
-
- Disables all aliases registered with the manager - - - - - - - -
-
- - aliasmgr:enable(name) - line 96 -
-
- Enables an alias by name - - -

Parameters:

-
    -
  • name - the name of the alias to enable -
  • -
- -

Returns:

-
    - - true if the alias exists and was enabled, false if it does not exist. -
- - - - -
-
- - aliasmgr:enableAll() - line 110 -
-
- Enables all aliases registered with the manager - - - - - - - -
-
- - aliasmgr:kill(name) - line 121 -
-
- Kill an alias, deleting it from the manager - - -

Parameters:

-
    -
  • name - the name of the alias to kill -
  • -
- -

Returns:

-
    - - true if the alias exists and gets deleted, false if the alias does not exist -
- - - - -
-
- - aliasmgr:killAll() - line 137 -
-
- Kills all aliases registered with the manager, clearing it out - - - - - - - -
-
- - aliasmgr:delete(name) - line 148 -
-
- Kills an alias, deleting it from the manager - - -

Parameters:

-
    -
  • name - the name of the alias to delete -
  • -
- -

Returns:

-
    - - true if the alias exists and gets deleted, false if the alias does not exist -
- - -

See also:

- - - -
-
- - aliasmgr:deleteAll() - line 154 -
-
- Kills all aliases, deleting them from the manager - - - - - -

See also:

- - - -
-
- - aliasmgr:getAliases() - line 160 -
-
- Returns the list of aliases and the information being tracked for them - - - -

Returns:

-
    - - the table of alias information, with names as keys and a table of information as the values. -
- - - - -
-
- - -
-
-
-generated by LDoc 1.5.0 -Last updated 2023-05-29 18:41:27 -
-
- - diff --git a/src/resources/MDK/doc/classes/revisionator.html b/src/resources/MDK/doc/classes/revisionator.html deleted file mode 100755 index b132fae..0000000 --- a/src/resources/MDK/doc/classes/revisionator.html +++ /dev/null @@ -1,252 +0,0 @@ - - - - - Reference - - - - -
- -
- -
-
-
- - -
- - - - - - -
- -

Class revisionator

-

The revisionator provides a standardized way of migrating configurations between revisions - for instance, it will track what the currently applied revision number is, and when you tell - tell it to migrate, it will apply every individual migration between the currently applied - revision and the latest/current revision.

-

This should allow for more seamlessly moving from - an older version of a package to a new one.

-

Info:

-
    -
  • Copyright: 2023
  • -
  • License: MIT, see https://raw.githubusercontent.com/demonnic/MDK/main/src/scripts/LICENSE.lua
  • -
  • Author: Damian Monogue
  • -
- - -

Methods

- - - - - - - - - - - - - - - - - -
revisionator:new(options)Creates a new revisionator
revisionator:getAppliedPatch()Get the currently applied revision from file
revisionator:migrate()go through all the patches in order and apply any which are still necessary
revisionator:addPatch(func[, position])add a patch to the table of patches
- -
-
- - -

Methods

- -
-
- - revisionator:new(options) - line 47 -
-
- Creates a new revisionator - - -

Parameters:

-
    -
  • options - table - the options to create the revisionator with. - - - - - - - - - - - - - - - - - - - - -
    option namedescriptiondefault
    nameThe name of the revisionator. This is absolutely required, as the name is used for tracking the currently applied patch levelraises an error if not provided
    patchesA table of patch functions. It is traversed using ipairs, so must be in the form of {function1, function2, function3} etc. If you do not provide it, you can add the patches by calling :addPatch for each patch in order.{}
    -
  • -
- - - - - -
-
- - revisionator:getAppliedPatch() - line 65 -
-
- Get the currently applied revision from file - - - -

Returns:

-
    - - number - the revision number currently applied, or 0 if it can't read a current version -
-

Or

-
    -
  1. - nil - nil
  2. -
  3. - string - error message
  4. -
- - - - -
-
- - revisionator:migrate() - line 86 -
-
- go through all the patches in order and apply any which are still necessary - - - -

Returns:

-
    - - boolean - true if it successfully applied patches, false if it was already at the latest patch level -
-

Or

-
    -
  1. - nil -
  2. -
  3. - string - error message
  4. -
- - - - -
-
- - revisionator:addPatch(func[, position]) - line 111 -
-
- add a patch to the table of patches - - -

Parameters:

-
    -
  • func - function - the function to run as the patch -
  • -
  • position - number - which patch to insert it as? If not supplied, inserts it as the last patch. Which is usually what you want. - (optional) -
  • -
- - - - - -
-
- - -
-
-
-generated by LDoc 1.5.0 -Last updated 2023-05-29 18:41:27 -
-
- - diff --git a/src/resources/MDK/doc/classes/spinbox.html b/src/resources/MDK/doc/classes/spinbox.html deleted file mode 100755 index 53623b5..0000000 --- a/src/resources/MDK/doc/classes/spinbox.html +++ /dev/null @@ -1,337 +0,0 @@ - - - - - Reference - - - - -
- -
- -
-
-
- - -
- - - - - - -
- -

Class spinbox

-

A Geyser object to create a spinbox for adjusting a number

-

-

Info:

-
    -
  • Copyright: 2023
  • -
  • License: MIT, see https://raw.githubusercontent.com/demonnic/MDK/main/src/scripts/LICENSE.lua
  • -
  • Author: Damian Monogue
  • -
- - -

Methods

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
spinbox:new(cons, container)Creates a new spinbox.
spinbox:setValue(value)Used to directly set the value of the spinbox.
spinbox:generateStyles()(Re)generates the stylesheets for the spinbox - Should not need to call but if you change something and it doesn't take effect - you can try calling this followed by applyStyles
spinbox:applyStyles()Applies updated stylesheets to the components of the spinbox - Should not need to call this directly
spinbox:setActiveButtonColor(color)sets the color for active buttons on the spinbox
spinbox:setInactiveButtonColor(color)sets the color for inactive buttons on the spinbox
spinbox:setCallBack(func)Set a callback function for the spinbox to call any time the value of the spinbox is changed - the function will be called as func(self.value, self.name)
- -
-
- - -

Methods

- -
-
- - spinbox:new(cons, container) - line 89 -
-
- Creates a new spinbox. - - -

Parameters:

-
    -
  • cons - table - a table containing the options for this spinbox. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    option namedescriptiondefault
    minThe minimum value for this spinbox0
    maxThe maximum value for this spinbox10
    activeButtonColorThe color the up/down buttons should be when they are active/able to be usedgray
    inactiveButtonColorThe color the up/down buttons should be when they are inactive/unable to be useddimgray
    integerBoolean value. When true, values must always be integers (no decimal place)true
    deltaThe amount to change the spinbox's value when the up or down button is pressed.1
    upArrowLocationThe location of the up arrow image. Either a web URL where it can be downloaded, or the location on disk to read it fromhttps://demonnic.github.io/image-assets/uparrow.png
    downArrowLocationThe location of the down arrow image. Either a web URL where it can be downloaded, or the location on disk to read it fromhttps://demonnic.github.io/image-assets/downarrow.png
    callBackThe function to run when the spinbox's value is updated. Is called with parameters (self.name, value, oldValue)nil
    -
  • -
  • container - The Geyser container for this spinbox -
  • -
- - - - - -
-
- - spinbox:setValue(value) - line 270 -
-
- Used to directly set the value of the spinbox. - - -

Parameters:

-
    -
  • value - The new value to set - Rounds the value to an integer if the spinbox is integer only. - Checks if the new value is within the min/max range and clamps it if not. - Updates the display label with the new value. - Applies any styles that depend on the value. -
  • -
- - - - - -
-
- - spinbox:generateStyles() - line 387 -
-
- (Re)generates the stylesheets for the spinbox - Should not need to call but if you change something and it doesn't take effect - you can try calling this followed by applyStyles - - - - - - - -
-
- - spinbox:applyStyles() - line 412 -
-
- Applies updated stylesheets to the components of the spinbox - Should not need to call this directly - - - - - - - -
-
- - spinbox:setActiveButtonColor(color) - line 430 -
-
- sets the color for active buttons on the spinbox - - -

Parameters:

-
    -
  • color - any valid color formatting string, such a "red" or "#880000" or "<128,0,0>" or a table of colors, like {128, 0,0}. See Geyser.Color.parse at https://www.mudlet.org/geyser/files/geyser/GeyserColor.html#Geyser.Color.parse -
  • -
- - - - - -
-
- - spinbox:setInactiveButtonColor(color) - line 445 -
-
- sets the color for inactive buttons on the spinbox - - -

Parameters:

-
    -
  • color - any valid color formatting string, such a "" or "red" or "<128,0,0>" or a table of colors, like {128, 0,0}. See Geyser.Color.parse at https://www.mudlet.org/geyser/files/geyser/GeyserColor.html#Geyser.Color.parse -
  • -
- - - - - -
-
- - spinbox:setCallBack(func) - line 472 -
-
- Set a callback function for the spinbox to call any time the value of the spinbox is changed - the function will be called as func(self.value, self.name) - - -

Parameters:

-
    -
  • func - -
  • -
- - - - - -
-
- - -
-
-
-generated by LDoc 1.5.0 -Last updated 2023-05-29 18:41:27 -
-
- - diff --git a/src/resources/MDK/doc/index.html b/src/resources/MDK/doc/index.html deleted file mode 100755 index a398531..0000000 --- a/src/resources/MDK/doc/index.html +++ /dev/null @@ -1,237 +0,0 @@ - - - - - Reference - - - - -
- -
- -
-
-
- - -
- - - - - - -
- - - -

Modules

- - - - - - - - - - - - - - - - - - - - - -
demontoolsCollection of miscellaneous functions and tools which don't necessarily warrant their own module/class
echofileset of functions for echoing files to things.
figletFiglet - A module to read figlet fonts and produce figlet ascii art from text
ftextftext - functions to format and print text, and the objects which use them
GradientMakerModule which provides for creating color gradients for your text.
-

Classes

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
aliasmgrAlias Manager
ChyronCreates a label with a scrolling text element.
EMCOEmbeddable Multi Console Object.
LoggingConsoleMiniConsole with logging capabilities
LoginatorLoginator creates an object which allows you to log things to file at - various severity levels, with the ability to only log items above a specific - severity to file.
MasterMindSolverInteractive object which helps you solve a Master Mind puzzle.
revisionatorThe revisionator provides a standardized way of migrating configurations between revisions - for instance, it will track what the currently applied revision number is, and when you tell - tell it to migrate, it will apply every individual migration between the currently applied - revision and the latest/current revision.
SortBoxAn H/VBox alternative which can be set to either vertical or horizontal, and will autosort the windows
spinboxA Geyser object to create a spinbox for adjusting a number
SUGSelf Updating Gauge, extends Geyser.Gauge
TextGaugeCreates a text based gauge, for use in miniconsoles and the like.
TimerGaugeAnimated countdown timer, extends Geyser.Gauge
-

Source

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
LICENSE.lua
aliasmgr.lua
chyron.lua
demontools.lua
echofile.lua
emco.lua
figlet.lua
ftext.lua
gradientmaker.lua
loggingconsole.lua
loginator.lua
mastermindsolver.lua
revisionator.lua
schema.lua
sortbox.lua
spinbox.lua
sug.lua
ftext_spec.lua
textgauge.lua
timergauge.lua
- -
-
-
-generated by LDoc 1.5.0 -Last updated 2023-05-29 18:41:27 -
-
- - diff --git a/src/resources/MDK/doc/ldoc.css b/src/resources/MDK/doc/ldoc.css deleted file mode 100755 index 74e9a46..0000000 --- a/src/resources/MDK/doc/ldoc.css +++ /dev/null @@ -1,315 +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: #ccc; - background: #222; -} -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: #222222; 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: #2266ee; text-decoration: none; } -a:visited { font-weight: bold; color: #0099bb; 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: #000000; - 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: #222222; -} - -#product { - text-align: center; - border-bottom: 1px solid #cccccc; - background-color: #222222; -} - -#product big { - font-size: 2em; -} - -#main { - background-color: #222222; - border-left: 2px solid #cccccc; -} - -#navigation { - float: left; - width: 14em; - vertical-align: top; - background-color: #222222; - overflow: visible; -} - -#navigation h1 { - color: #cccccc; - font-size: 1.5em; - margin: 20px 0 20px 0; -} - -#navigation h2 { - background-color:#333333; - font-size:1.1em; - color:#cccccc; - 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; - border-left: 2px solid #cccccc; - border-right: 2px solid #cccccc; - background-color: #222222; -} - -#about { - clear: both; - padding: 5px; - border-top: 2px solid #cccccc; - background-color: #222222; -} - -@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: #222222; 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: #222222; 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: #060; -} - - -/* 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; } - -.tg {border-collapse:collapse;border-color:#ccc;border-spacing:0;} -.tg td{background-color:#8b8b8b;border-color:#ccc;border-style:solid;border-width:1px;color:#000; - font-family:Arial, sans-serif;font-size:14px;overflow:hidden;padding:10px 5px;word-break:normal;} -.tg th{background-color:#000000;border-color:#ccc;border-style:solid;border-width:1px;color:#FFF; - font-family:Arial, sans-serif;font-size:14px;font-weight:normal;overflow:hidden;padding:10px 5px;word-break:normal;} -.tg .tg-2{background-color:#797979;border-color:inherit;text-align:left;vertical-align:top;color:#DDD} -.tg .tg-1{background-color:#8b8b8b;border-color:#ccc;border-style:solid;border-width:1px;color:#000;text-align:left;vertical-align:top} diff --git a/src/resources/MDK/doc/modules/GradientMaker.html b/src/resources/MDK/doc/modules/GradientMaker.html deleted file mode 100755 index 626c9a8..0000000 --- a/src/resources/MDK/doc/modules/GradientMaker.html +++ /dev/null @@ -1,422 +0,0 @@ - - - - - Reference - - - - -
- -
- -
-
-
- - -
- - - - - - -
- -

Module GradientMaker

-

Module which provides for creating color gradients for your text.

-

- Original functions found on the Lusternia Forums -
I added functions to work with hecho. -
I also made performance enhancements by storing already calculated gradients after first use for the session and only including the colorcode in the returned string if the color changed.

-

Info:

-
    -
  • Copyright: 2018 Sylphas,2020 Damian Monogue
  • -
  • Author: Sylphas on the Lusternia forums,Damian Monogue
  • -
- - -

Functions

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
color_name(r, g, b)Returns the closest color name to a given r,g,b color
dgradient(text, first_color, second_color, next_color)Returns the text, with the defined color gradients applied and formatted for us with decho.
cgradient(text, first_color, second_color, next_color)Returns the text, with the defined color gradients applied and formatted for us with cecho.
hgradient(text, first_color, second_color, next_color)Returns the text, with the defined color gradients applied and formatted for us with hecho.
cgradient_table(text, first_color, second_color, next_color)Returns a table, each element of which is a table, the first element of which is the color name to use and the character which should be that color
dgradient_table(text, first_color, second_color, next_color)Returns a table, each element of which is a table, the first element of which is the color({r,g,b} format) to use and the character which should be that color
hgradient_table(text, first_color, second_color, next_color)Returns a table, each element of which is a table, the first element of which is the color(in hex) to use and the second element of which is the character which should be that color
install_global()Creates global copies of the c/d/hgradient(_table) functions and color_name for use without accessing the module table
- -
-
- - -

Functions

- -
-
- - color_name(r, g, b) - line 228 -
-
- Returns the closest color name to a given r,g,b color - - -

Parameters:

-
    -
  • r - The red component. Can also pass the full color as a table, IE { 255, 0, 0 } -
  • -
  • g - The green component. If you pass the color as a table as noted above, this param should be empty -
  • -
  • b - the blue components. If you pass the color as a table as noted above, this param should be empty -
  • -
- - - - -

Usage:

-
    -
    closest_color = GradientMaker.color_name(128,200,30) -- returns "ansi_149"
    -closest_color = GradientMaker.color_name({128, 200, 30}) -- this is functionally equivalent to the first one
    -
- -
-
- - dgradient(text, first_color, second_color, next_color) - line 244 -
-
- Returns the text, with the defined color gradients applied and formatted for us with decho. Usage example below produces the following text -
dgradient example - - -

Parameters:

-
    -
  • text - string - The text you want to apply the color gradients to -
  • -
  • first_color - The color you want it to start at. Table of colors in { r, g, b } format -
  • -
  • second_color - The color you want the gradient to transition to first. Table of colors in { r, g, b } format -
  • -
  • next_color - Keep repeating if you want it to transition from the second color to a third, then a third to a fourth, etc -
  • -
- - - -

See also:

- - -

Usage:

-
    -
    decho(GradientMaker.dgradient("a luminescent butterly floats about lazily on brillant blue and lilac wings\n", {255,0,0}, {255,128,0}, {255,255,0}, {0,255,0}, {0,255,255}, {0,128,255}, {128,0,255}))
    -decho(GradientMaker.dgradient("a luminescent butterly floats about lazily on brillant blue and lilac wings\n", {255,0,0}, {0,0,255}))
    -decho(GradientMaker.dgradient("a luminescent butterly floats about lazily on brillant blue and lilac wings\n", {50,50,50}, {0,255,0}, {50,50,50}))
    -
- -
-
- - cgradient(text, first_color, second_color, next_color) - line 260 -
-
- Returns the text, with the defined color gradients applied and formatted for us with cecho. Usage example below produces the following text -
cgradient example - - -

Parameters:

-
    -
  • text - string - The text you want to apply the color gradients to -
  • -
  • first_color - The color you want it to start at. Table of colors in { r, g, b } format -
  • -
  • second_color - The color you want the gradient to transition to first. Table of colors in { r, g, b } format -
  • -
  • next_color - Keep repeating if you want it to transition from the second color to a third, then a third to a fourth, etc -
  • -
- - - -

See also:

- - -

Usage:

-
    -
    cecho(GradientMaker.cgradient("a luminescent butterly floats about lazily on brillant blue and lilac wings\n", {255,0,0}, {255,128,0}, {255,255,0}, {0,255,0}, {0,255,255}, {0,128,255}, {128,0,255}))
    -cecho(GradientMaker.cgradient("a luminescent butterly floats about lazily on brillant blue and lilac wings\n", {255,0,0}, {0,0,255}))
    -cecho(GradientMaker.cgradient("a luminescent butterly floats about lazily on brillant blue and lilac wings\n", {50,50,50}, {0,255,0}, {50,50,50}))
    -
- -
-
- - hgradient(text, first_color, second_color, next_color) - line 276 -
-
- Returns the text, with the defined color gradients applied and formatted for us with hecho. Usage example below produces the following text -
hgradient example - - -

Parameters:

-
    -
  • text - string - The text you want to apply the color gradients to -
  • -
  • first_color - The color you want it to start at. Table of colors in { r, g, b } format -
  • -
  • second_color - The color you want the gradient to transition to first. Table of colors in { r, g, b } format -
  • -
  • next_color - Keep repeating if you want it to transition from the second color to a third, then a third to a fourth, etc -
  • -
- - - -

See also:

- - -

Usage:

-
    -
    hecho(GradientMaker.hgradient("a luminescent butterly floats about lazily on brillant blue and lilac wings\n", {255,0,0}, {255,128,0}, {255,255,0}, {0,255,0}, {0,255,255}, {0,128,255}, {128,0,255}))
    -hecho(GradientMaker.hgradient("a luminescent butterly floats about lazily on brillant blue and lilac wings\n", {255,0,0}, {0,0,255}))
    -hecho(GradientMaker.hgradient("a luminescent butterly floats about lazily on brillant blue and lilac wings\n", {50,50,50}, {0,255,0}, {50,50,50}))
    -
- -
-
- - cgradient_table(text, first_color, second_color, next_color) - line 286 -
-
- Returns a table, each element of which is a table, the first element of which is the color name to use and the character which should be that color - - -

Parameters:

-
    -
  • text - string - The text you want to apply the color gradients to -
  • -
  • first_color - The color you want it to start at. Table of colors in { r, g, b } format -
  • -
  • second_color - The color you want the gradient to transition to first. Table of colors in { r, g, b } format -
  • -
  • next_color - Keep repeating if you want it to transition from the second color to a third, then a third to a fourth, etc -
  • -
- - - -

See also:

- - - -
-
- - dgradient_table(text, first_color, second_color, next_color) - line 296 -
-
- Returns a table, each element of which is a table, the first element of which is the color({r,g,b} format) to use and the character which should be that color - - -

Parameters:

-
    -
  • text - string - The text you want to apply the color gradients to -
  • -
  • first_color - The color you want it to start at. Table of colors in { r, g, b } format -
  • -
  • second_color - The color you want the gradient to transition to first. Table of colors in { r, g, b } format -
  • -
  • next_color - Keep repeating if you want it to transition from the second color to a third, then a third to a fourth, etc -
  • -
- - - -

See also:

- - - -
-
- - hgradient_table(text, first_color, second_color, next_color) - line 306 -
-
- Returns a table, each element of which is a table, the first element of which is the color(in hex) to use and the second element of which is the character which should be that color - - -

Parameters:

-
    -
  • text - string - The text you want to apply the color gradients to -
  • -
  • first_color - The color you want it to start at. Table of colors in { r, g, b } format -
  • -
  • second_color - The color you want the gradient to transition to first. Table of colors in { r, g, b } format -
  • -
  • next_color - Keep repeating if you want it to transition from the second color to a third, then a third to a fourth, etc -
  • -
- - - -

See also:

- - - -
-
- - install_global() - line 314 -
-
- Creates global copies of the c/d/hgradient(_table) functions and color_name for use without accessing the module table - - - - - - -

Usage:

-
    -
    GradientMaker.install_global()
    -cecho(cgradient(...)) -- use cgradient directly now
    -
- -
-
- - -
-
-
-generated by LDoc 1.5.0 -Last updated 2023-05-29 18:41:27 -
-
- - diff --git a/src/resources/MDK/doc/modules/demontools.html b/src/resources/MDK/doc/modules/demontools.html deleted file mode 100755 index dcb64f2..0000000 --- a/src/resources/MDK/doc/modules/demontools.html +++ /dev/null @@ -1,1330 +0,0 @@ - - - - - Reference - - - - -
- -
- -
-
-
- - -
- - - - - - -
- -

Module demontools

-

Collection of miscellaneous functions and tools which don't necessarily warrant their own module/class

-

-

Info:

-
    -
  • Copyright: 2020 Damian Monogue
  • -
  • License: MIT, see LICENSE.lua
  • -
  • Author: Damian Monogue
  • -
- - -

Functions

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
DemonTools.chunkify(tbl, num_chunks)Takes a list table and returns it as a table of 'chunks'.
DemonTools.ansi2cecho(text)Takes an ansi colored text string and returns a cecho colored one
DemonTools.ansi2decho(text)Takes an ansi colored text string and returns a decho colored one.
DemonTools.ansi2hecho(text)Takes an ansi colored text string and returns a hecho colored one
DemonTools.cecho2decho(text)Takes an cecho colored text string and returns a decho colored one
DemonTools.cecho2ansi(text)Takes an cecho colored text string and returns an ansi colored one
DemonTools.cecho2hecho(text)Takes an cecho colored text string and returns a hecho colored one
DemonTools.decho2cecho(text)Takes an decho colored text string and returns a cecho colored one
DemonTools.decho2ansi(text)Takes an decho colored text string and returns an ansi colored one
DemonTools.decho2hecho(text)Takes an decho colored text string and returns an hecho colored one
DemonTools.decho2html(text)Takes a decho colored text string and returns html.
DemonTools.cecho2html(text)Takes a cecho colored text string and returns html.
DemonTools.hecho2html(text)Takes a hecho colored text string and returns html.
DemonTools.ansi2html(text)Takes an ansi colored text string and returns html.
DemonTools.html2cecho(text)Takes an html colored string of the sort turned out by the DemonTools *2html functions and returns a cecho string
DemonTools.html2decho(text)Takes an html colored string of the sort turned out by the DemonTools *2html functions and returns a decho string
DemonTools.html2ansi(text)Takes an html colored string of the sort turned out by the DemonTools *2html functions and returns an ansi string
DemonTools.html2hecho(text)Takes an html colored string of the sort turned out by the DemonTools *2html functions and returns an hecho string
DemonTools.cecho2string(text)Takes a cecho string and returns it without the formatting
DemonTools.decho2string(text)Takes a decho string and returns it without the formatting
DemonTools.hecho2string(text)Takes a hecho string and returns it without the formatting
DemonTools.html2string(text)Takes an html colored string of the sort turned out by the DemonTools *2html functions and returns a clean string
DemonTools.hecho2ansi(text)Takes an hecho colored text string and returns a ansi colored one
DemonTools.hecho2cecho(text)Takes an hecho colored text string and returns a cecho colored one
DemonTools.hecho2decho(text)Takes an hecho colored text string and returns a decho colored one
DemonTools.append2decho()Takes the currently copy()ed item and returns it as a decho string
DemonTools.consoleToString(options)Dump the contents of a miniconsole, user window, or the main window in one of several formats, as determined by a table of options
DemonTools.displayColors(options)Alternative to Mudlet's showColors(), this one has additional options.
DemonTools.roundInt(number)Rounds a number to the nearest whole integer
DemonTools.scientific_round(number, sig_digits)Rounds a number to a specified number of significant digits
DemonTools.string2color(str)Returns a color table {r,g,b} derived from str.
DemonTools.colorMunge(strForColor, strToColor, format)Returns a colored string where strForColor is run through DemonTools.string2color and applied to strToColor based on format.
DemonTools.colorMungeEcho(strForColor, strToEcho, format, win)Like colorMunge but also echos the result to win.
DemonTools.milliToHuman(milliseconds, tbl)Converts milliseconds to hours:minutes:seconds:milliseconds
DemonTools.getValueAt(variableString)Takes the name of a variable as a string and returns the value.
DemonTools.exists(path)Returns if a file or directory exists on the filesystem
DemonTools.isDir(path)Returns if a path is a directory or not
DemonTools.isWindows()Returns true if running on windows, false otherwise
DemonTools.mkdir_p(path)Creates a directory, creating each directory as necessary along the way.
- -
-
- - -

Functions

- -
-
- - DemonTools.chunkify(tbl, num_chunks) - line 905 -
-
- Takes a list table and returns it as a table of 'chunks'. If the table has 12 items and you ask for 3 chunks, each chunk will have 4 items in it - - -

Parameters:

-
    -
  • tbl - table - The table you want to turn into chunks. Must be traversable using ipairs() -
  • -
  • num_chunks - number - The number of chunks to turn the table into -
  • -
- - - - -

Usage:

-
    -
    local dt = require("MDK.demontools")
    -testTable = { "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten" }
    -display(dt.chunkify(testTable, 3))
    ---displays the following
    -{
    -  {
    -    "one",
    -    "two",
    -    "three",
    -    "four"
    -  },
    -  {
    -    "five",
    -    "six",
    -    "seven"
    -  },
    -  {
    -    "eight",
    -    "nine",
    -    "ten"
    -  }
    -}
    -
- -
-
- - DemonTools.ansi2cecho(text) - line 913 -
-
- Takes an ansi colored text string and returns a cecho colored one - - -

Parameters:

-
    -
  • text - string - the text to convert -
  • -
- - - - -

Usage:

-
    -
    dt.ansi2cecho("Test")
    - --returns "<ansiRed>Test"
    -
- -
-
- - DemonTools.ansi2decho(text) - line 923 -
-
- Takes an ansi colored text string and returns a decho colored one. Handles 256 color SGR codes better than Mudlet's ansi2decho - - -

Parameters:

-
    -
  • text - string - the text to convert -
  • -
- - - - -

Usage:

-
    -
  • dt.ansi2decho("Test") --returns "<128,0,0>Test"
  • -
  • dt.ansi2decho("[38:2::127:0:0mTest") --returns "<127,0,0>Test"
  • -
  • ansi2decho("[38:2::127:0:0mTest") -- doesn't parse this format of colors and so returns "[38:2::127:0:0mTest"
  • -
- -
-
- - DemonTools.ansi2hecho(text) - line 931 -
-
- Takes an ansi colored text string and returns a hecho colored one - - -

Parameters:

-
    -
  • text - string - the text to convert -
  • -
- - - - -

Usage:

-
    -
    dt.ansi2hecho("Test")
    - --returns "#800000Test"
    -
- -
-
- - DemonTools.cecho2decho(text) - line 938 -
-
- Takes an cecho colored text string and returns a decho colored one - - -

Parameters:

-
    -
  • text - string - the text to convert -
  • -
- - - - -

Usage:

-
    -
    dt.cecho2decho("<green>Test") --returns "<0,255,0>Test"
    -
- -
-
- - DemonTools.cecho2ansi(text) - line 945 -
-
- Takes an cecho colored text string and returns an ansi colored one - - -

Parameters:

-
    -
  • text - string - the text to convert -
  • -
- - - - -

Usage:

-
    -
    dt.cecho2ansi("<green>Test") --returns "[38:2::0:255:0mTest"
    -
- -
-
- - DemonTools.cecho2hecho(text) - line 952 -
-
- Takes an cecho colored text string and returns a hecho colored one - - -

Parameters:

-
    -
  • text - string - the text to convert -
  • -
- - - - -

Usage:

-
    -
    dt.cecho2hecho("<green>Test") --returns "#00ff00Test"
    -
- -
-
- - DemonTools.decho2cecho(text) - line 959 -
-
- Takes an decho colored text string and returns a cecho colored one - - -

Parameters:

-
    -
  • text - string - the text to convert -
  • -
- - - - -

Usage:

-
    -
    dt.decho2cecho("<127,0,0:0,0,127>Test") --returns "<ansiRed:ansi_blue>Test"
    -
- -
-
- - DemonTools.decho2ansi(text) - line 966 -
-
- Takes an decho colored text string and returns an ansi colored one - - -

Parameters:

-
    -
  • text - string - the text to convert -
  • -
- - - - -

Usage:

-
    -
    dt.decho2ansi("<127,0,0:0,0,127>Test") --returns "[38:2::127:0:0m[48:2::0:0:127mTest"
    -
- -
-
- - DemonTools.decho2hecho(text) - line 973 -
-
- Takes an decho colored text string and returns an hecho colored one - - -

Parameters:

-
    -
  • text - string - the text to convert -
  • -
- - - - -

Usage:

-
    -
    dt.decho2hecho("<127,0,0:0,0,127>Test") --returns "#7f0000,00007fTest"
    -
- -
-
- - DemonTools.decho2html(text) - line 979 -
-
- Takes a decho colored text string and returns html. - - -

Parameters:

-
    -
  • text - string - the text to convert -
  • -
- - - - - -
-
- - DemonTools.cecho2html(text) - line 985 -
-
- Takes a cecho colored text string and returns html. - - -

Parameters:

-
    -
  • text - string - the text to convert -
  • -
- - - - - -
-
- - DemonTools.hecho2html(text) - line 991 -
-
- Takes a hecho colored text string and returns html. - - -

Parameters:

-
    -
  • text - string - the text to convert -
  • -
- - - - - -
-
- - DemonTools.ansi2html(text) - line 997 -
-
- Takes an ansi colored text string and returns html. - - -

Parameters:

-
    -
  • text - string - the text to convert -
  • -
- - - - - -
-
- - DemonTools.html2cecho(text) - line 1003 -
-
- Takes an html colored string of the sort turned out by the DemonTools *2html functions and returns a cecho string - - -

Parameters:

-
    -
  • text - string - the text to convert -
  • -
- - - - - -
-
- - DemonTools.html2decho(text) - line 1009 -
-
- Takes an html colored string of the sort turned out by the DemonTools *2html functions and returns a decho string - - -

Parameters:

-
    -
  • text - string - the text to convert -
  • -
- - - - - -
-
- - DemonTools.html2ansi(text) - line 1015 -
-
- Takes an html colored string of the sort turned out by the DemonTools *2html functions and returns an ansi string - - -

Parameters:

-
    -
  • text - string - the text to convert -
  • -
- - - - - -
-
- - DemonTools.html2hecho(text) - line 1021 -
-
- Takes an html colored string of the sort turned out by the DemonTools *2html functions and returns an hecho string - - -

Parameters:

-
    -
  • text - string - the text to convert -
  • -
- - - - - -
-
- - DemonTools.cecho2string(text) - line 1027 -
-
- Takes a cecho string and returns it without the formatting - - -

Parameters:

-
    -
  • text - the text to transform -
  • -
- - - - - -
-
- - DemonTools.decho2string(text) - line 1033 -
-
- Takes a decho string and returns it without the formatting - - -

Parameters:

-
    -
  • text - the text to transform -
  • -
- - - - - -
-
- - DemonTools.hecho2string(text) - line 1039 -
-
- Takes a hecho string and returns it without the formatting - - -

Parameters:

-
    -
  • text - the text to transform -
  • -
- - - - - -
-
- - DemonTools.html2string(text) - line 1044 -
-
- Takes an html colored string of the sort turned out by the DemonTools *2html functions and returns a clean string - - -

Parameters:

-
    -
  • text - -
  • -
- - - - - -
-
- - DemonTools.hecho2ansi(text) - line 1051 -
-
- Takes an hecho colored text string and returns a ansi colored one - - -

Parameters:

-
    -
  • text - string - the text to convert -
  • -
- - - - -

Usage:

-
    -
    dt.hecho2ansi("#7f0000,00007fTest") --returns "[38:2::127:0:0m[48:2::0:0:127mTest"
    -
- -
-
- - DemonTools.hecho2cecho(text) - line 1058 -
-
- Takes an hecho colored text string and returns a cecho colored one - - -

Parameters:

-
    -
  • text - string - the text to convert -
  • -
- - - - -

Usage:

-
    -
    dt.hecho2cecho("#7f0000,00007fTest") --returns "<ansiRed:ansi_blue>Test"
    -
- -
-
- - DemonTools.hecho2decho(text) - line 1065 -
-
- Takes an hecho colored text string and returns a decho colored one - - -

Parameters:

-
    -
  • text - string - the text to convert -
  • -
- - - - -

Usage:

-
    -
    dt.hecho2decho("#7f0000,00007fTest") --returns "<127,0,0:0,0,127>Test"
    -
- -
-
- - DemonTools.append2decho() - line 1070 -
-
- Takes the currently copy()ed item and returns it as a decho string - - - - - - - -
-
- - DemonTools.consoleToString(options) - line 1112 -
-
- Dump the contents of a miniconsole, user window, or the main window in one of several formats, as determined by a table of options - - -

Parameters:

-
    -
  • options - table - Table of options which controls which console and how it returns the data. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    option namedescriptiondefault
    formatWhat format to return the text as? 'h' for html, 'c' for cecho, 'a' for ansi, 'd' for decho, and 'x' for hecho"d"
    winwhat console/window to dump the buffer of?"main"
    start_lineWhat line to start dumping the buffer from?0
    end_lineWhat line to stop dumping the buffer on?Last line of the console
    includeHtmlWrapperIf the format is html, should it include the front and back portions required to make it a functioning html page?true
    -
  • -
- - - - - -
-
- - DemonTools.displayColors(options) - line 1174 -
-
- Alternative to Mudlet's showColors(), this one has additional options. - - -

Parameters:

-
    -
  • options - table - table of options which control the output of displayColors - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    option namedescriptiondefault
    colsNumber of columsn wide to display the colors in4
    searchIf not the empty string, will check colors against string.find using this property.
    IE if set to "blue" only colors which include the word 'blue' would be listed
    ""
    sortIf true, sorts alphabetically. Otherwise sorts based on the color valuefalse
    echoOnlyIf true, colors will not be clickable linksfalse
    windowWhat window/console to echo the colors out to."main"
    removeDupesIf true, will remove snake_case entries and 'gray' in favor of 'grey'true
    columnSortIf true, will print top-to-bottom, then left-to-right. false is like showColorstrue
    justTextIf true, will echo the text in the color and leave the background black.
    If false, the background will be the colour(like showColors).
    false
    color_tableTable of colors to display. If you provide your own table, it must be in the same format as Mudlet's own color_tablecolor_table
    -
  • -
- - - - - -
-
- - DemonTools.roundInt(number) - line 1182 -
-
- Rounds a number to the nearest whole integer - - -

Parameters:

-
    -
  • number - the number to round off -
  • -
- - - - -

Usage:

-
    -
  • dt.roundInt(8.3) -- returns 8
  • -
  • dt.roundInt(10.7) -- returns 11
  • -
- -
-
- - DemonTools.scientific_round(number, sig_digits) - line 1194 -
-
- Rounds a number to a specified number of significant digits - - -

Parameters:

-
    -
  • number - number - the number to round -
  • -
  • sig_digits - number - the number of significant digits to keep -
  • -
- - - - -

Usage:

-
    -
  • dt.scientific_round(1348290, 3) -- will return 1350000
  • -
  • dt.scientific_found(123.3452, 5) -- will return 123.34
  • -
- -
-
- - DemonTools.string2color(str) - line 1201 -
-
- Returns a color table {r,g,b} derived from str. Will return the same color every time for the same string. - - -

Parameters:

-
    -
  • str - string - the string to turn into a color. -
  • -
- - - - -

Usage:

-
    -
    dt.string2color("Demonnic") --returns { 131, 122, 209 }
    -
- -
-
- - DemonTools.colorMunge(strForColor, strToColor, format) - line 1210 -
-
- Returns a colored string where strForColor is run through DemonTools.string2color and applied to strToColor based on format. - - -

Parameters:

-
    -
  • strForColor - string - the string to turn into a color using DemonTools.string2color -
  • -
  • strToColor - string - the string you want to color based on strForColor -
  • -
  • format - What format to use for the color portion. "d" for decho, "c" for cecho, or "h" for hecho. Defaults to "d" -
  • -
- - - - -

Usage:

-
    -
    dt.colorMunge("Demonnic", "Test") --returns "<131,122,209>Test"
    -
- -
-
- - DemonTools.colorMungeEcho(strForColor, strToEcho, format, win) - line 1219 -
-
- Like colorMunge but also echos the result to win. - - -

Parameters:

-
    -
  • strForColor - string - the string to turn into a color using DemonTools.string2color -
  • -
  • strToEcho - string - the string you want to color and echo based on strForColor -
  • -
  • format - What format to use for the color portion. "d" for decho, "c" for cecho, or "h" for hecho. Defaults to "d" -
  • -
  • win - the window to echo to. You must provide the format if you want to change the window. Defaults to "main" -
  • -
- - - - - -
-
- - DemonTools.milliToHuman(milliseconds, tbl) - line 1235 -
-
- Converts milliseconds to hours:minutes:seconds:milliseconds - - -

Parameters:

-
    -
  • milliseconds - number - the number of milliseconds to convert -
  • -
  • tbl - boolean - if true, returns the time as a key/value table instead -
  • -
- - - - -

Usage:

-
    -
  • dt.milliToHuman(37194572) --returns "10:19:54:572"
  • -
  • display(dt.milliToHuman(37194572, true))
    -{
    -  minutes = 19,
    -  original = 37194572,
    -  hours = 10,
    -  milliseconds = 572,
    -  seconds = 54
    -}
  • -
- -
-
- - DemonTools.getValueAt(variableString) - line 1257 -
-
- Takes the name of a variable as a string and returns the value. "health" will return the value in varable health, "gmcp.Char.Vitals" will return the table at gmcp.Char.Vitals, etc - - -

Parameters:

-
    -
  • variableString - string - the string name of the variable you want the value of -
  • -
- - - - -

Usage:

-
    -
    currentHP = 50
    - dt.getValueAt("currentHP") -- returns 50
    -
- -
-
- - DemonTools.exists(path) - line 1263 -
-
- Returns if a file or directory exists on the filesystem - - -

Parameters:

-
    -
  • path - string - the path to the file or directory to check -
  • -
- - - - - -
-
- - DemonTools.isDir(path) - line 1269 -
-
- Returns if a path is a directory or not - - -

Parameters:

-
    -
  • path - string - the path to check -
  • -
- - - - - -
-
- - DemonTools.isWindows() - line 1274 -
-
- Returns true if running on windows, false otherwise - - - - - - - -
-
- - DemonTools.mkdir_p(path) - line 1280 -
-
- Creates a directory, creating each directory as necessary along the way. - - -

Parameters:

-
    -
  • path - string - the path to create -
  • -
- - - - - -
-
- - -
-
-
-generated by LDoc 1.5.0 -Last updated 2023-05-29 18:41:27 -
-
- - diff --git a/src/resources/MDK/doc/modules/echofile.html b/src/resources/MDK/doc/modules/echofile.html deleted file mode 100755 index 36c0add..0000000 --- a/src/resources/MDK/doc/modules/echofile.html +++ /dev/null @@ -1,552 +0,0 @@ - - - - - Reference - - - - -
- -
- -
-
-
- - -
- - - - - - -
- -

Module echofile

-

set of functions for echoing files to things.

-

Uses a slightly hacked up version of f-strings for interpolation/templating

-

Info:

-
    -
  • Copyright: 2021 Damian Monogue,2016 Hisham Muhammad (https://github.com/hishamhm/f-strings/blob/master/LICENSE)
  • -
  • License: MIT, see LICENSE.lua
  • -
  • Author: Damian Monogue
  • -
- - -

Functions

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
f(str)Takes a string and performs interpolation - Uses {} as the delimiter.
aechoFile(window, filename)reads the contents of a file, converts it to decho and then dechos it
aechoFilef(window, filename)reads the contents of a file and then cechos it
cechoFile(window, filename)reads the contents of a file and then cechos it
cechoFilef(window, filename)reads the contents of a file, interpolates it as per echofile.f and then cechos it
dechoFile(window, filename)reads the contents of a file and then dechos it
dechoFilef(window, filename)reads the contents of a file, interpolates it as per echofile.f and then dechos it
hechoFile(window, filename)reads the contents of a file and then hechos it
hechoFilef(window, filename)reads the contents of a file, interpolates it as per echofile.f and then hechos it
echoFile(window, filename)reads the contents of a file, interpolates it as per echofile.f and then echos it
echoFilef(window, filename)reads the contents of a file, interpolates it as per echofile.f and then echos it
patchGeyser()Adds c/d/h/echoFile functions to Geyser miniconsole and userwindow objects
installGlobal()Installs c/d/h/echoFile and f to the global namespace, and adds functions to Geyser
- -
-
- - -

Functions

- -
-
- - f(str) - line 109 -
-
- Takes a string and performs interpolation - Uses {} as the delimiter. Expressions will be evaluated - - -

Parameters:

-
    -
  • str - string: The string to interpolate -
  • -
- - - - -

Usage:

-
    -
    echofile = require("MDK.echofile")
    -echofile.f("{1+1}") -- returns "2"
    -local x = 4
    -echofile.f"4+3 = {x+3}" -- returns "4+3 = 7"
    -
- -
-
- - aechoFile(window, filename) - line 124 -
-
- reads the contents of a file, converts it to decho and then dechos it - - -

Parameters:

-
    -
  • window - string: Optional window to cecho to -
  • -
  • filename - string: Full path to file -
  • -
- - - -

See also:

- - -

Usage:

-
    -
    local ec = require("MDK.echofile")
    -local cechoFile,f = ec.cechoFile, ec.f
    -cechoFile("C:/path/to/file") -- windows1
    -cechoFile("C:\\path\\to\\file") -- windows2
    -cechoFile("/path/to/file") -- Linux/MacOS
    -cechoFile("aMiniConsole", f"{getMudletHomeDir()}/myPkgName/helpfile") -- cecho a file from your pkg to a miniconsole
    -
- -
-
- - aechoFilef(window, filename) - line 140 -
-
- reads the contents of a file and then cechos it - - -

Parameters:

-
    -
  • window - string: Optional window to cecho to -
  • -
  • filename - string: Full path to file -
  • -
- - - -

See also:

- - -

Usage:

-
    -
    local ec = require("MDK.echofile")
    -local cechoFile,f = ec.cechoFile, ec.f
    -cechoFile("C:/path/to/file") -- windows1
    -cechoFile("C:\\path\\to\\file") -- windows2
    -cechoFile("/path/to/file") -- Linux/MacOS
    -cechoFile("aMiniConsole", f"{getMudletHomeDir()}/myPkgName/helpfile") -- cecho a file from your pkg to a miniconsole
    -
- -
-
- - cechoFile(window, filename) - line 155 -
-
- reads the contents of a file and then cechos it - - -

Parameters:

-
    -
  • window - string: Optional window to cecho to -
  • -
  • filename - string: Full path to file -
  • -
- - - -

See also:

- - -

Usage:

-
    -
    local ec = require("MDK.echofile")
    -local cechoFile,f = ec.cechoFile, ec.f
    -cechoFile("C:/path/to/file") -- windows1
    -cechoFile("C:\\path\\to\\file") -- windows2
    -cechoFile("/path/to/file") -- Linux/MacOS
    -cechoFile("aMiniConsole", f"{getMudletHomeDir()}/myPkgName/helpfile") -- cecho a file from your pkg to a miniconsole
    -
- -
-
- - cechoFilef(window, filename) - line 170 -
-
- reads the contents of a file, interpolates it as per echofile.f and then cechos it - - -

Parameters:

-
    -
  • window - string: Optional window to cecho to -
  • -
  • filename - string: Full path to file -
  • -
- - - -

See also:

- - -

Usage:

-
    -
    local ec = require("MDK.echofile")
    -local cechoFile,f = ec.cechoFile, ec.f
    -cechoFile("C:/path/to/file") -- windows1
    -cechoFile("C:\\path\\to\\file") -- windows2
    -cechoFile("/path/to/file") -- Linux/MacOS
    -cechoFile("aMiniConsole", f"{getMudletHomeDir()}/myPkgName/helpfile") -- cecho a file from your pkg to a miniconsole
    -
- -
-
- - dechoFile(window, filename) - line 180 -
-
- reads the contents of a file and then dechos it - - -

Parameters:

-
    -
  • window - string: Optional window to decho to -
  • -
  • filename - string: Full path to file -
  • -
- - - -

See also:

- - - -
-
- - dechoFilef(window, filename) - line 190 -
-
- reads the contents of a file, interpolates it as per echofile.f and then dechos it - - -

Parameters:

-
    -
  • window - string: Optional window to decho to -
  • -
  • filename - string: Full path to file -
  • -
- - - -

See also:

- - - -
-
- - hechoFile(window, filename) - line 200 -
-
- reads the contents of a file and then hechos it - - -

Parameters:

-
    -
  • window - string: Optional window to hecho to -
  • -
  • filename - string: Full path to file -
  • -
- - - -

See also:

- - - -
-
- - hechoFilef(window, filename) - line 210 -
-
- reads the contents of a file, interpolates it as per echofile.f and then hechos it - - -

Parameters:

-
    -
  • window - string: Optional window to hecho to -
  • -
  • filename - string: Full path to file -
  • -
- - - -

See also:

- - - -
-
- - echoFile(window, filename) - line 220 -
-
- reads the contents of a file, interpolates it as per echofile.f and then echos it - - -

Parameters:

-
    -
  • window - string: Optional window to echo to -
  • -
  • filename - string: Full path to file -
  • -
- - - -

See also:

- - - -
-
- - echoFilef(window, filename) - line 230 -
-
- reads the contents of a file, interpolates it as per echofile.f and then echos it - - -

Parameters:

-
    -
  • window - string: Optional window to echo to -
  • -
  • filename - string: Full path to file -
  • -
- - - -

See also:

- - - -
-
- - patchGeyser() - line 239 -
-
- Adds c/d/h/echoFile functions to Geyser miniconsole and userwindow objects - - - - - - -

Usage:

-
    -
    require("MDK.echofile").patchGeyser()
    -myMC = Geyser.MiniConsole:new({name = "myMC"})
    -myMC:cechoFile(f"{getMudletHomeDir()}/helpfile")
    -
- -
-
- - installGlobal() - line 281 -
-
- Installs c/d/h/echoFile and f to the global namespace, and adds functions to Geyser - - - - - - -

Usage:

-
    -
    require("MDK.echofile").installGlobal()
    -f"{1+2}" -- returns "2"
    -dechoFile(f"{getMudletHomeDir()}/fileWithDechoLines.txt")
    --- reads contents of fileWithDechoLines.txt from profile directory
    --- and dechos them to the main console
    -
- -
-
- - -
-
-
-generated by LDoc 1.5.0 -Last updated 2023-05-29 18:41:27 -
-
- - diff --git a/src/resources/MDK/doc/modules/figlet.html b/src/resources/MDK/doc/modules/figlet.html deleted file mode 100755 index a798f9e..0000000 --- a/src/resources/MDK/doc/modules/figlet.html +++ /dev/null @@ -1,260 +0,0 @@ - - - - - Reference - - - - -
- -
- -
-
-
- - -
- - - - - - -
- -

Module figlet

-

Figlet - A module to read figlet fonts and produce figlet ascii art from text

-

-

Info:

-
    -
  • Copyright: 2010,2011 Nick Gammon,2022 Damian Monogue
  • -
- - -

Functions

- - - - - - - - - - - - - - - - - - - - - -
Figlet.readfont(filename)Reads a figlet font file (.flf) into memory and readies it for use by the next figlet - These files are cached in memory so that future calls to load a font just read from there.
Figlet.ascii_art(s, kern, smush)Returns a table of lines representing a string as figlet
Figlet.getString(str, kern, smush)Returns the figlet as a string, rather than a table
Figlet.getKern(str)Returns a figlet as a string, with kern set to true.
Figlet.getSmush(str)Returns a figlet as a string, with smush set to true.
- -
-
- - -

Functions

- -
-
- - Figlet.readfont(filename) - line 79 -
-
- Reads a figlet font file (.flf) into memory and readies it for use by the next figlet - These files are cached in memory so that future calls to load a font just read from there. - - -

Parameters:

-
    -
  • filename - the full path to the file to read the font from -
  • -
- - - - - -
-
- - Figlet.ascii_art(s, kern, smush) - line 214 -
-
- Returns a table of lines representing a string as figlet - - -

Parameters:

-
    -
  • s - string - the text to make into a figlet -
  • -
  • kern - boolean - should we reduce spacing -
  • -
  • smush - boolean - causes the letters to share edges, condensing it even further -
  • -
- - - - - -
-
- - Figlet.getString(str, kern, smush) - line 248 -
-
- Returns the figlet as a string, rather than a table - - -

Parameters:

-
    -
  • str - string - the string the make into a figlet -
  • -
  • kern - boolean - should we reduce the space between letters? -
  • -
  • smush - boolean - should the letters share edges, further condensing the output? -
  • -
- - - -

See also:

- - - -
-
- - Figlet.getKern(str) - line 256 -
-
- Returns a figlet as a string, with kern set to true. - - -

Parameters:

-
    -
  • str - string - The string to turn into a figlet -
  • -
- - - -

See also:

- - - -
-
- - Figlet.getSmush(str) - line 263 -
-
- Returns a figlet as a string, with smush set to true. - - -

Parameters:

-
    -
  • str - string - The string to turn into a figlet -
  • -
- - - -

See also:

- - - -
-
- - -
-
-
-generated by LDoc 1.5.0 -Last updated 2023-05-29 18:41:27 -
-
- - diff --git a/src/resources/MDK/doc/modules/ftext.html b/src/resources/MDK/doc/modules/ftext.html deleted file mode 100755 index 182f3ee..0000000 --- a/src/resources/MDK/doc/modules/ftext.html +++ /dev/null @@ -1,1780 +0,0 @@ - - - - - Reference - - - - -
- -
- -
-
-
- - -
- - - - - - -
- -

Module ftext

-

ftext - functions to format and print text, and the objects which use them

-

-

Info:

-
    -
  • Copyright: 2020 Damian Monogue,2021 Damian Monogue,2022 Damian Monogue
  • -
  • License: MIT, see LICENSE.lua
  • -
  • Author: Damian Monogue
  • -
- - -

Functions

- - - - - - - - - - - - - -
wordWrap(str, limit)Performs wordwrapping on a string, given a length limit.
xwrap(text, limit, type)Performs wordwrapping on a string, while ignoring color tags of a given type.
fText(str, opts)The main course, this function returns a formatted string, based on a table of options
-

Class ftext.TextFormatter

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TextFormatter:setType(typeToSet)Set's the formatting type whether it's for cecho, decho, or hecho
TextFormatter:setWrap(shouldWrap)Sets whether or not we should do word wrapping.
TextFormatter:setWidth(width)Sets the width we should format for
TextFormatter:setCap(cap)Sets the cap for the formatter
TextFormatter:setCapColor(capColor)Sets the color for the format cap
TextFormatter:setSpacerColor(spacerColor)Sets the color for spacing character
TextFormatter:setTextColor(textColor)Sets the color for formatted text
TextFormatter:setSpacer(spacer)Sets the spacing character to use.
TextFormatter:setAlignment(alignment)Set the alignment to format for
TextFormatter:setInside(spacerInside)Set whether the the spacer should go inside the the cap or outside of it
TextFormatter:setMirror(shouldMirror)Set whether we should mirror/reverse the caps.
TextFormatter:setNoGap(noGap)Set whether we should remove the gap spaces between the text and spacer characters.
TextFormatter:enableTruncate()Enables truncation (cutting to length).
TextFormatter:disableTruncate()Disables truncation (cutting to length).
TextFormatter:format(str)Format a string based on the stored options
TextFormatter:new(options)Creates and returns a new TextFormatter.
-

Class ftext.TableMaker

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TableMaker:getColumn(position)Get the TextFormatter which defines the format of a specific column
TableMaker:addColumn(options, position)Adds a column definition for the table.
TableMaker:deleteColumn(position)Deletes a column at the given position
TableMaker:replaceColumn(options, position)Replaces a column at a specific position with the newly provided formatting
TableMaker:getRow(position)Gets the row of output at a specific position
TableMaker:addRow(columnEntries, position)Adds a row of output to the table
TableMaker:deleteRow(position)Deletes the row at the given position
TableMaker:replaceRow(columnEntries, position)Replaces a row of output in the table
TableMaker:getCell(row, column)Get the contents and formatter for a specific cell
TableMaker:setCell(row, column, entry)Sets a specific cell's display information
TableMaker:setTitle(title)set the title of the table
TableMaker:setRowSeparator(char)set the rowSeparator for the table
TableMaker:setEdgeCharacter(char)set the edgeCharacter for the table
TableMaker:setFootCharacter(char)set the foot character for the table
TableMaker:setHeadCharacter(char)set the head character for the table
TableMaker:setSeparator(char)set the column separator character for the table
TableMaker:setTitleColor(color)set the title color for the table
TableMaker:setSeparatorColor(color)set the title color for the table
TableMaker:setFrameColor(color)set the title color for the table
TableMaker:enableForceHeaderSeparator()Force a separator between the header and first row, even if the row separator is disabled for the overall table
TableMaker:disableForceHeaderSeparator()Do not force a separator between the header and first row, even if the row separator is disabled for the overall table
TableMaker:enableHeaderTitle()Enable using the title separator for the column headers as well
TableMaker:disableHeaderTitle()Disable using the title separator for the column headers as well
TableMaker:enablePrintTitle()enable printing the title of the table
TableMaker:disablePrintTitle()disable printing the title of the table
TableMaker:enablePrintHeaders()enable printing of the column headers
TableMaker:disablePrintHeaders()disable printing of the column headers
TableMaker:enableRowSeparator()enable printing the separator line between rows
TableMaker:disableRowSeparator()enable printing the separator line between rows
TableMaker:enablePopups()enables making cells which incorporate insertLink/insertPopup
TableMaker:enableAutoEcho()enables autoEcho so that when assemble is called it echos automatically
TableMaker:disableAutoEcho()disables autoecho.
TableMaker:enableAutoClear()Enables automatically clearing the miniconsole we echo to
TableMaker:disableAutoClear()Disables automatically clearing the miniconsole we echo to
TableMaker:setAutoEchoConsole(console)Set the miniconsole to echo to
TableMaker:assemble()Assemble the table.
TableMaker:new(options)Creates and returns a new TableMaker.
- -
-
- - -

Functions

- -
-
- - wordWrap(str, limit) - line 17 -
-
- Performs wordwrapping on a string, given a length limit. Does not understand colour tags and will count them as characters in the string - - -

Parameters:

-
    -
  • str - string - the string to wordwrap -
  • -
  • limit - number - the line length to wrap at -
  • -
- - - - - -
-
- - xwrap(text, limit, type) - line 36 -
-
- Performs wordwrapping on a string, while ignoring color tags of a given type. - - -

Parameters:

-
    -
  • text - string - the string you are wordwrapping -
  • -
  • limit - number - the line length to wrap at -
  • -
  • type - string - What type of color codes to ignore. 'c' for cecho, 'd' for decho, 'h' for hecho, and anything else or nil to pass the string on to wordWrap -
  • -
- - - - - -
-
- - fText(str, opts) - line 203 -
-
- The main course, this function returns a formatted string, based on a table of options - - -

Parameters:

-
    -
  • str - string - the string to format -
  • -
  • opts - table - the table of options which control the formatting -

    Table of options - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    option namedescriptiondefault
    wrapShould it wordwrap to multiple lines?true
    formatTypeDetermines how it formats for color. 'c' for cecho, 'd' for decho, 'h' for hecho, and anything else for no colors""
    widthHow wide should we format the text?80
    capwhat characters to use for the endcap.""
    capColorwhat color to make the endcap?the correct 'white' for your formatType
    spacerWhat character to use for empty space. Must be a single character" "
    spacerColorwhat color should the spacer be?the correct 'white' for your formatType
    textColorwhat color should the text itself be?the correct 'white' for your formatType
    alignmentHow should the text be aligned within the width. "center", "left", or "right""center"
    nogapShould we put a literal space between the spacer character and the text?false
    insidePut the spacers inside the caps?false
    mirrorShould the endcap be reversed on the right? IE [[ becomes ]]true
    truncateCut the string to width. Is superceded by wrap being true.false
    -
  • -
- - - - - -
-
-

Class ftext.TextFormatter

- -
- Stand alone text formatter object. Remembers the options you set and can be adjusted as needed -
-
-
- - TextFormatter:setType(typeToSet) - line 512 -
-
- Set's the formatting type whether it's for cecho, decho, or hecho - - -

Parameters:

-
    -
  • typeToSet - string - What type of formatter is this? Valid options are { 'd', 'dec', 'decimal', 'h', 'hex', 'hexidecimal', 'c', 'color', 'colour', 'col', 'name'} -
  • -
- - - - - -
-
- - TextFormatter:setWrap(shouldWrap) - line 546 -
-
- Sets whether or not we should do word wrapping. - - -

Parameters:

-
    -
  • shouldWrap - boolean - should we do wordwrapping? -
  • -
- - - - - -
-
- - TextFormatter:setWidth(width) - line 558 -
-
- Sets the width we should format for - - -

Parameters:

-
    -
  • width - number - the width we should format for -
  • -
- - - - - -
-
- - TextFormatter:setCap(cap) - line 571 -
-
- Sets the cap for the formatter - - -

Parameters:

-
    -
  • cap - string - the string to use for capping the formatted string. -
  • -
- - - - - -
-
- - TextFormatter:setCapColor(capColor) - line 582 -
-
- Sets the color for the format cap - - -

Parameters:

-
    -
  • capColor - string - Color which can be formatted via Geyser.Color.parse() -
  • -
- - - - - -
-
- - TextFormatter:setSpacerColor(spacerColor) - line 593 -
-
- Sets the color for spacing character - - -

Parameters:

-
    -
  • spacerColor - string - Color which can be formatted via Geyser.Color.parse() -
  • -
- - - - - -
-
- - TextFormatter:setTextColor(textColor) - line 604 -
-
- Sets the color for formatted text - - -

Parameters:

-
    -
  • textColor - string - Color which can be formatted via Geyser.Color.parse() -
  • -
- - - - - -
-
- - TextFormatter:setSpacer(spacer) - line 615 -
-
- Sets the spacing character to use. Should be a single character - - -

Parameters:

-
    -
  • spacer - string - the character to use for spacing -
  • -
- - - - - -
-
- - TextFormatter:setAlignment(alignment) - line 626 -
-
- Set the alignment to format for - - -

Parameters:

-
    -
  • alignment - string - How to align the formatted string. Valid options are 'left', 'right', or 'center' -
  • -
- - - - - -
-
- - TextFormatter:setInside(spacerInside) - line 637 -
-
- Set whether the the spacer should go inside the the cap or outside of it - - -

Parameters:

-
    -
  • spacerInside - boolean - -
  • -
- - - - - -
-
- - TextFormatter:setMirror(shouldMirror) - line 648 -
-
- Set whether we should mirror/reverse the caps. IE << becomes >> if set to true - - -

Parameters:

-
    -
  • shouldMirror - boolean - -
  • -
- - - - - -
-
- - TextFormatter:setNoGap(noGap) - line 659 -
-
- Set whether we should remove the gap spaces between the text and spacer characters. "===some text===" if set to true, "== some text ==" if set to false - - -

Parameters:

-
    -
  • noGap - boolean - -
  • -
- - - - - -
-
- - TextFormatter:enableTruncate() - line 669 -
-
- Enables truncation (cutting to length). You still need to ensure wrap is disabled, as it supercedes. - - - - - - - -
-
- - TextFormatter:disableTruncate() - line 674 -
-
- Disables truncation (cutting to length). You still need to ensure wrap is enabled if you want it to wrap. - - - - - - - -
-
- - TextFormatter:format(str) - line 680 -
-
- Format a string based on the stored options - - -

Parameters:

-
    -
  • str - string - The string to format -
  • -
- - - - - -
-
- - TextFormatter:new(options) - line 773 -
-
- Creates and returns a new TextFormatter. - - -

Parameters:

-
    -
  • options - table - the options for the text formatter to use when running format() -

    Table of options - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    option namedescriptiondefault
    wrapShould it wordwrap to multiple lines?true
    formatTypeDetermines how it formats for color. 'c' for cecho, 'd' for decho, 'h' for hecho, and anything else for no colors"c"
    widthHow wide should we format the text?80
    capwhat characters to use for the endcap.""
    capColorwhat color to make the endcap?the correct 'white' for your formatType
    spacerWhat character to use for empty space. Must be a single character" "
    spacerColorwhat color should the spacer be?the correct 'white' for your formatType
    textColorwhat color should the text itself be?the correct 'white' for your formatType
    alignmentHow should the text be aligned within the width. "center", "left", or "right""center"
    nogapShould we put a literal space between the spacer character and the text?false
    insidePut the spacers inside the caps?false
    mirrorShould the endcap be reversed on the right? IE [[ becomes ]]true
    truncateCut the string to width. Is superceded by wrap being true.false
    -
  • -
- - - - -

Usage:

-
    -
    local TextFormatter = require("MDK.ftext").TextFormatter
    -myFormatter = TextFormatter:new( {
    -  width = 40,
    -  cap = "[CAP]",
    -  capColor = "<orange>",
    -  textColor = "<light_blue>"
    -})
    -myMessage = "This is a test of the emergency broadcasting system. This is only a test"
    -cecho(myFormatter:format(myMessage))
    -
- -
-
-

Class ftext.TableMaker

- -
- Easy formatting for text tables -
-
-
- - TableMaker:getColumn(position) - line 839 -
-
- Get the TextFormatter which defines the format of a specific column - - -

Parameters:

-
    -
  • position - number - The position of the column you're getting, counting from the left. If not provided will return the last column. -
  • -
- - - - - -
-
- - TableMaker:addColumn(options, position) - line 848 -
-
- Adds a column definition for the table. - - -

Parameters:

-
    -
  • options - table - Table of options suitable for a TextFormatter object. See https://github.com/demonnic/fText/wiki/fText -
  • -
  • position - number - The position of the column you're adding, counting from the left. If not provided will add it as the last column -
  • -
- - - - - -
-
- - TableMaker:deleteColumn(position) - line 865 -
-
- Deletes a column at the given position - - -

Parameters:

-
    -
  • position - number - the column you wish to delete -
  • -
- - - - - -
-
- - TableMaker:replaceColumn(options, position) - line 882 -
-
- Replaces a column at a specific position with the newly provided formatting - - -

Parameters:

-
    -
  • options - table - table of options suitable for a TextFormatter object. See https://github.com/demonnic/fText/wiki/fText -
  • -
  • position - number - which column you are replacing, counting from the left. -
  • -
- - - - - -
-
- - TableMaker:getRow(position) - line 904 -
-
- Gets the row of output at a specific position - - -

Parameters:

-
    -
  • position - number - The position of the row you want to get, coutning from the top down. If not provided defaults to the last row in the table -
  • -
- -

Returns:

-
    - - table of entries in the specified row -
- - - - -
-
- - TableMaker:addRow(columnEntries, position) - line 913 -
-
- Adds a row of output to the table - - -

Parameters:

-
    -
  • columnEntries - table - This indexed table contains an entry for each column in the table. Entries in the table must be strings, a table of options for insertPopup or insertLink, or a function which returns one of these things -
  • -
  • position - number - position for the row you want to add, counting from the top down. If not provided defaults to the last line in the table. -
  • -
- - - - - -
-
- - TableMaker:deleteRow(position) - line 936 -
-
- Deletes the row at the given position - - -

Parameters:

-
    -
  • position - number - the row to delete -
  • -
- - - - - -
-
- - TableMaker:replaceRow(columnEntries, position) - line 951 -
-
- Replaces a row of output in the table - - -

Parameters:

-
    -
  • columnEntries - table - This indexed table contains an entry for each column in the table. Entries in the table must be strings, a table of options for insertPopup or insertLink, or a function which returns one of these things -
  • -
  • position - number - position for the row you want to add, counting from the top down. -
  • -
- - - - - -
-
- - TableMaker:getCell(row, column) - line 1006 -
-
- Get the contents and formatter for a specific cell - - -

Parameters:

-
    -
  • row - number - the row number of the cell, counted top down. -
  • -
  • column - number - the column number of the cell, counted from the left. -
  • -
- -

Returns:

-
    - - the base text and TextFormatter for the cell at the specific row and column number -
- - - - -
-
- - TableMaker:setCell(row, column, entry) - line 1038 -
-
- Sets a specific cell's display information - - -

Parameters:

-
    -
  • row - number - the row number of the cell, counted from the top down -
  • -
  • column - number - the column number of the cell, counted from the left -
  • -
  • entry - What to set the entry to. Must be a string, or a table of options for insertLink/insertPopup if allowPopups is set. Or a function which returns one of these things -
  • -
- - - - - -
-
- - TableMaker:setTitle(title) - line 1282 -
-
- set the title of the table - - -

Parameters:

-
    -
  • title - string - The title of the table. -
  • -
- - - - - -
-
- - TableMaker:setRowSeparator(char) - line 1289 -
-
- set the rowSeparator for the table - - -

Parameters:

-
    -
  • char - string - The row separator to use -
  • -
- - - - - -
-
- - TableMaker:setEdgeCharacter(char) - line 1296 -
-
- set the edgeCharacter for the table - - -

Parameters:

-
    -
  • char - string - The edge character to use -
  • -
- - - - - -
-
- - TableMaker:setFootCharacter(char) - line 1303 -
-
- set the foot character for the table - - -

Parameters:

-
    -
  • char - string - The foot character to use -
  • -
- - - - - -
-
- - TableMaker:setHeadCharacter(char) - line 1310 -
-
- set the head character for the table - - -

Parameters:

-
    -
  • char - string - The head character to use -
  • -
- - - - - -
-
- - TableMaker:setSeparator(char) - line 1317 -
-
- set the column separator character for the table - - -

Parameters:

-
    -
  • char - string - The separator character to use -
  • -
- - - - - -
-
- - TableMaker:setTitleColor(color) - line 1324 -
-
- set the title color for the table - - -

Parameters:

-
    -
  • color - string - The title color to use. Should match the color type of the tablemaker (cecho by default) -
  • -
- - - - - -
-
- - TableMaker:setSeparatorColor(color) - line 1331 -
-
- set the title color for the table - - -

Parameters:

-
    -
  • color - string - The separator color to use. Should match the color type of the tablemaker (cecho by default) -
  • -
- - - - - -
-
- - TableMaker:setFrameColor(color) - line 1338 -
-
- set the title color for the table - - -

Parameters:

-
    -
  • color - string - The frame color to use. Should match the color type of the tablemaker (cecho by default) -
  • -
- - - - - -
-
- - TableMaker:enableForceHeaderSeparator() - line 1344 -
-
- Force a separator between the header and first row, even if the row separator is disabled for the overall table - - - - - - - -
-
- - TableMaker:disableForceHeaderSeparator() - line 1350 -
-
- Do not force a separator between the header and first row, even if the row separator is disabled for the overall table - - - - - - - -
-
- - TableMaker:enableHeaderTitle() - line 1356 -
-
- Enable using the title separator for the column headers as well - - - - - - - -
-
- - TableMaker:disableHeaderTitle() - line 1362 -
-
- Disable using the title separator for the column headers as well - - - - - - - -
-
- - TableMaker:enablePrintTitle() - line 1368 -
-
- enable printing the title of the table - - - - - - - -
-
- - TableMaker:disablePrintTitle() - line 1374 -
-
- disable printing the title of the table - - - - - - - -
-
- - TableMaker:enablePrintHeaders() - line 1380 -
-
- enable printing of the column headers - - - - - - - -
-
- - TableMaker:disablePrintHeaders() - line 1386 -
-
- disable printing of the column headers - - - - - - - -
-
- - TableMaker:enableRowSeparator() - line 1392 -
-
- enable printing the separator line between rows - - - - - - - -
-
- - TableMaker:disableRowSeparator() - line 1398 -
-
- enable printing the separator line between rows - - - - - - - -
-
- - TableMaker:enablePopups() - line 1404 -
-
- enables making cells which incorporate insertLink/insertPopup - - - - - - - -
-
- - TableMaker:enableAutoEcho() - line 1411 -
-
- enables autoEcho so that when assemble is called it echos automatically - - - - - - - -
-
- - TableMaker:disableAutoEcho() - line 1417 -
-
- disables autoecho. Cannot be used if allowPopups is set - - - - - - - -
-
- - TableMaker:enableAutoClear() - line 1426 -
-
- Enables automatically clearing the miniconsole we echo to - - - - - - - -
-
- - TableMaker:disableAutoClear() - line 1432 -
-
- Disables automatically clearing the miniconsole we echo to - - - - - - - -
-
- - TableMaker:setAutoEchoConsole(console) - line 1438 -
-
- Set the miniconsole to echo to - - -

Parameters:

-
    -
  • console - The miniconsole to autoecho to. Set to "main" or do not pass the parameter to autoecho to the main console. Can be a string name of the console, or a Geyser MiniConsole -
  • -
- - - - - -
-
- - TableMaker:assemble() - line 1455 -
-
- Assemble the table. If autoEcho is enabled/set to true, will automatically echo. Otherwise, returns the formatted string to echo the table - - - - - - - -
-
- - TableMaker:new(options) - line 1619 -
-
- Creates and returns a new TableMaker. - see https://github.com/demonnic/MDK/wiki/fText%3A-TableMaker%3A-Examples for usage - - -

Parameters:

-
    -
  • options - table - table of options for the TableMaker object -

    Table of new options - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    option namedescriptiondefault
    formatTypeDetermines how it formats for color. 'c' for cecho, 'd' for decho, 'h' for hecho, and anything else for no colorsc
    printHeadersprint top row as headertrue
    headCharacterThe character used to construct the very top of the table. A solid line of these characters is used"*"
    footCharacterThe character used to construct the very bottom of the table. A solid line of these characters is used"*"
    edgeCharacterthe character used to form the left and right edges of the table. There is one on either side of every line"*"
    frameColorThe color to use for the frame. The frame is the border around the outside edge of the table (headCharacter, footCharacter, and edgeCharacters will all be this color).the correct 'white' for your formatType
    rowSeparatorthe character used to form the lines between rows of text"-"
    separatorCharacter used between columns."|"
    separatorColorthe color used for the separators, the things which divide the rows and columns internally. (separator and rowSeparator will be this color)frameColor
    autoEchoecho the table automatically in addition to returning the string representation?false
    autoEchoConsoleMiniConsole to autoEcho to"main"
    autoClearIf autoEchoing, and not echoing to the main console, should we clear the console before outputting?false
    allowPopupssetting this to true allows you to make cells in the table clickable, as well as give them right-click menus.
    - Please see Clickable Tables HERE
    false
    separateRowsWhen false, will not print the separator line between rowstrue
    titleThe overall title of the table. Displayed at the top""
    titleColorWhat color to use for the title textformatColor
    printTitleShould we print the title of the table at the very tip-top?false
    headerTitleUse the same separator for the column headers as the title/top, rather than the row separatorformatColor
    forceHeaderSeparatorForce a separator between the column headers and the first row, even if rowSeparator is false.false
    -
  • -
- - - - - -
-
- - -
-
-
-generated by LDoc 1.5.0 -Last updated 2023-05-29 18:41:27 -
-
- - diff --git a/src/resources/MDK/doc/source/LICENSE.lua.html b/src/resources/MDK/doc/source/LICENSE.lua.html deleted file mode 100755 index 2f74e29..0000000 --- a/src/resources/MDK/doc/source/LICENSE.lua.html +++ /dev/null @@ -1,147 +0,0 @@ - - - - - Reference - - - - -
- -
- -
-
-
- - -
- - - - - - -
- -

LICENSE.lua

-
---[===[
-The MIT License (MIT)
-
-Copyright (c) 2020 Damian Monogue
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
---]===]
-
--- schema validation provided by schema.lua, license below
---[[
-The MIT License (MIT)
-
-Copyright (c) 2014 Sebastian Schoener
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
-]]
- - -
-
-
-generated by LDoc 1.5.0 -Last updated 2023-05-29 18:41:27 -
-
- - diff --git a/src/resources/MDK/doc/source/aliasmgr.lua.html b/src/resources/MDK/doc/source/aliasmgr.lua.html deleted file mode 100755 index 393acca..0000000 --- a/src/resources/MDK/doc/source/aliasmgr.lua.html +++ /dev/null @@ -1,263 +0,0 @@ - - - - - Reference - - - - -
- -
- -
-
-
- - -
- - - - - - -
- -

aliasmgr.lua

-
---- Alias Manager
--- @classmod aliasmgr
--- @author Damian Monogue <demonnic@gmail.com>
--- @copyright 2022 Damian Monogue
--- @license MIT, see LICENSE.lua
-local aliasmgr = {}
-aliasmgr.__index = aliasmgr
-
---- Creates a new alias manager
-function aliasmgr:new()
-  local mgr = {
-    aliases = {}
-  }
-  setmetatable(mgr, self)
-  return mgr
-end
-
-local function argError(funcName, argument, expected, actual)
-  local msg = string.format("%s: %s as %s expected, got %s", funcName, argument, expected, actual)
-  printError(msg, true, true)
-end
-
---- Registers an alias with the alias manager
--- @param name the name for the alias
--- @param regex the regular expression the alias matches against
--- @param func The code to run when the alias matches. Can wrap code in [[ ]] or pass an actual function
-function aliasmgr:register(name, regex, func)
-  local funcName = "aliasmgr:register(name, regex, func)"
-  if func == nil then
-    printError(f"{funcName} takes 3 arguments and you have provided less than that", true, true)
-  end
-  local nameType = type(name)
-  if nameType ~= "string" then
-    argError(funcName, "name", "string", nameType)
-  end
-  local regexType = type(regex)
-  if regexType ~= "string" then
-    argError(funcName, "regex", "string", regexType)
-  end
-  local funcType = type(func)
-  if funcType ~= "string" and funcType ~= "function" then
-    argError(funcName, "func", "string or function", funcType)
-  end
-  local object = {
-    regex = regex,
-    func = func
-  }
-  self:kill(name)
-  local ok, err = pcall(tempAlias, regex, func)
-  if not ok then
-    return nil, err
-  end
-  object.handlerID = err
-  self.aliases[name] = object
-  return true
-end
-
---- Registers an alias with the alias manager. Alias for register
--- @param name the name for the alias
--- @param regex the regular expression the alias matches against
--- @param func The code to run when the alias matches. Can wrap code in [[ ]] or pass an actual function
--- @see register
-function aliasmgr:add(name, regex, func)
-  self:register(name, regex, func)
-end
-
---- Disables an alias, but does not delete it so it can be enabled later without being redefined
--- @param name the name of the alias to disable
--- @return true if the alias exists and gets disabled, false if it does not exist or is already disabled
-function aliasmgr:disable(name)
-  local funcName = "aliasmgr:disable(name)"
-  local nameType = type(name)
-  if nameType ~= "string" then
-    argError(funcName, "name", "string", nameType)
-  end
-  local object = self.aliases[name]
-  if not object or object.handlerID == -1 then
-    return false
-  end
-  killAlias(object.handlerID)
-  object.handlerID = -1
-  return true
-end
-
---- Disables all aliases registered with the manager
-function aliasmgr:disableAll()
-  local aliases = self.aliases
-  for name, object in pairs(aliases) do
-    self:disable(name)
-  end
-end
-
---- Enables an alias by name
--- @param name the name of the alias to enable
--- @return true if the alias exists and was enabled, false if it does not exist.
-function aliasmgr:enable(name)
-  local funcName = "aliasmgr:enable(name)"
-  local nameType = type(name)
-  if nameType ~= "string" then
-    argError(funcName, "name", "string", nameType)
-  end
-  local object = self.aliases[name]
-  if not object then
-    return false
-  end
-  self:register(name, object.regex, object.func)
-end
-
---- Enables all aliases registered with the manager
-function aliasmgr:enableAll()
-  local aliases = self.aliases
-  for name,_ in pairs(aliases) do
-    self:enable(name)
-  end
-  return true
-end
-
---- Kill an alias, deleting it from the manager
--- @param name the name of the alias to kill
--- @return true if the alias exists and gets deleted, false if the alias does not exist
-function aliasmgr:kill(name)
-  local funcName = "aliasmgr:kill(name)"
-  local nameType = type(name)
-  if nameType ~= "string" then
-    argError(funcName, "name", "string", nameType)
-  end
-  local object = self.aliases[name]
-  if not object then
-    return false
-  end
-  self:disable(name)
-  self.aliases[name] = nil
-  return true
-end
-
---- Kills all aliases registered with the manager, clearing it out
-function aliasmgr:killAll()
-  local aliases = self.aliases
-  for name, _ in pairs(aliases) do
-    self:kill(name)
-  end
-end
-
---- Kills an alias, deleting it from the manager
--- @param name the name of the alias to delete
--- @return true if the alias exists and gets deleted, false if the alias does not exist
--- @see kill
-function aliasmgr:delete(name)
-  return self:kill(name)
-end
-
---- Kills all aliases, deleting them from the manager
--- @see killAll
-function aliasmgr:deleteAll()
-  return self:killAll()
-end
-
---- Returns the list of aliases and the information being tracked for them
--- @return the table of alias information, with names as keys and a table of information as the values.
-function aliasmgr:getAliases()
-  return self.aliases
-end
-
-return aliasmgr
- - -
-
-
-generated by LDoc 1.5.0 -Last updated 2023-05-29 18:41:27 -
-
- - diff --git a/src/resources/MDK/doc/source/chyron.lua.html b/src/resources/MDK/doc/source/chyron.lua.html deleted file mode 100755 index 03b74c9..0000000 --- a/src/resources/MDK/doc/source/chyron.lua.html +++ /dev/null @@ -1,334 +0,0 @@ - - - - - Reference - - - - -
- -
- -
-
-
- - -
- - - - - - -
- -

chyron.lua

-
---- Creates a label with a scrolling text element. It is highly recommended you use a monospace font for this label.
--- @classmod Chyron
--- @author Delra
--- @copyright 2019
--- @author Damian Monogue
--- @copyright 2020
-local Chyron = {
-  name = "ChyronClass",
-  text = "",
-  displayWidth = 28,
-  updateTime = 200,
-  font = "Bitstream Vera Sans Mono",
-  fontSize = "9",
-  autoWidth = true,
-  delimiter = "|",
-  pos = 1,
-  enabled = true,
-  alignment = "center",
-}
-
---- Creates a new Chyron label
--- @tparam table cons table of constraints which configures the EMCO.
--- <table class="tg">
--- <thead>
---   <tr>
---     <th>option name</th>
---     <th>description</th>
---     <th>default</th>
---   </tr>
--- </thead>
--- <tbody>
---   <tr>
---     <td class="tg-1">text</td>
---     <td class="tg-1">The text to scroll on the label</td>
---     <td class="tg-1">""</td>
---   </tr>
---   <tr>
---     <td class="tg-2">updateTime</td>
---     <td class="tg-2">Milliseconds between movements (one letter shift)</td>
---     <td class="tg-2">200</td>
---   </tr>
---   <tr>
---     <td class="tg-1">displayWidth</td>
---     <td class="tg-1">How many chars wide to display the text</td>
---     <td class="tg-1">28</td>
---   </tr>
---   <tr>
---     <td class="tg-2">delimiter</td>
---     <td class="tg-2">This character will be inserted with a space either side to mark the stop/start of the message</td>
---     <td class="tg-2">"|"</td>
---   </tr>
---   <tr>
---     <td class="tg-1">enabled</td>
---     <td class="tg-1">Should the chyron scroll?</td>
---     <td class="tg-1">true</td>
---   </tr>
---   <tr>
---     <td class="tg-2">font</td>
---     <td class="tg-2">What font to use for the Chyron? Available in Geyser.Label but we define a default.</td>
---     <td class="tg-2">"Bitstream Vera Sans Mono"</td>
---   </tr>
---   <tr>
---     <td class="tg-1">fontSize</td>
---     <td class="tg-1">What font size to use for the Chyron? Available in Geyser.Label but we define a default.</td>
---     <td class="tg-1">9</td>
---   </tr>
---   <tr>
---     <td class="tg-2">autoWidth</td>
---     <td class="tg-2">Should the Chyron resize to just fit the text?</td>
---     <td class="tg-2">true</td>
---   </tr>
---   <tr>
---     <td class="tg-1">alignment</td>
---     <td class="tg-1">What alignment(left/right/center) to use for the Chyron text? Available in Geyser.Label but we define a default.</td>
---     <td class="tg-1">"center"</td>
---   </tr>
--- </tbody>
--- </table>
--- @tparam GeyserObject container The container to use as the parent for the Chyron
-function Chyron:new(cons, container)
-  cons = cons or {}
-  cons.type = cons.type or "Chyron"
-  local me = self.parent:new(cons, container)
-  setmetatable(me, self)
-  self.__index = self
-  me.pos = 0
-  me:setDisplayWidth(me.displayWidth)
-  me:setMessage(me.text)
-  if me.enabled then
-    me:start()
-  else
-    me:stop()
-  end
-  return me
-end
-
---- Sets the numver of characters of the text to display at once
--- @tparam number displayWidth number of characters to show at once
-function Chyron:setDisplayWidth(displayWidth)
-  displayWidth = displayWidth or self.displayWidth
-  self.displayWidth = displayWidth
-  if self.autoWidth then
-    local width = calcFontSize(self.fontSize, self.font)
-    self:resize(width * (displayWidth + 2), self.height)
-  end
-  if not self.enabled then
-    self.pos = self.pos - 1
-    self:doScroll()
-  end
-end
-
---- Override setFontSize to call setDisplayWidth in order to resize if necessary
--- @local
-function Chyron:setFontSize(fontSize)
-  Geyser.Label.setFontSize(self, fontSize)
-  self:setDisplayWidth()
-end
-
---- Override setFont to call setDisplayWidth in order to resize if necessary
--- @local
-function Chyron:setFont(font)
-  Geyser.Label.setFont(self, font)
-  self:setDisplayWidth()
-end
-
---- Returns the proper section of text
--- @local
--- @param start number the character to start at
--- @param length number the length of the text you want to extract
-function Chyron:scrollText(start, length)
-  local t = self.textTable
-  local s = ''
-  local e = start + length
-  for i = start - 1, e - 2 do
-    local n = (i % #t) + 1
-    s = s .. t[n]
-  end
-  return s
-end
-
---- scroll the text
--- @local
-function Chyron:doScroll()
-  self.pos = self.pos + 1
-  local displayString = self:scrollText(self.pos, self.displayWidth)
-  self:echo('&lt;' .. displayString .. '&gt;')
-  self.message = self.text
-end
-
---- Sets the Chyron from the first position, without changing enabled status
-function Chyron:reset()
-  self.pos = 0
-  if not self.enabled then
-    self:doScroll()
-  end
-end
-
---- Stops the Chyron with its current display
-function Chyron:pause()
-  self.enabled = false
-  if self.timer then
-    killTimer(self.timer)
-  end
-end
-
---- Start the Chyron back up from wherever it currently is
-function Chyron:start()
-  self.enabled = true
-  if self.timer then
-    killTimer(self.timer)
-  end
-  self.timer = tempTimer(self.updateTime / 1000, function()
-    self:doScroll()
-  end, true)
-end
-
---- Change the update time for the Chyron
--- @param updateTime number new updateTime in milliseconds
-function Chyron:setUpdateTime(updateTime)
-  self.updateTime = updateTime or self.updateTime
-  if self.timer then
-    killTimer(self.timer)
-  end
-  if self.enabled then
-    self:start()
-  end
-end
-
---- Enable autoWidth adjustment
-function Chyron:enableAutoWidth()
-  self.autoWidth = true
-  self:setDisplayWidth()
-end
-
---- Disable autoWidth adjustment
-function Chyron:disableAutoWidth()
-  self.autoWidth = false
-end
-
---- Stop the Chyron, and reset it to the original position
-function Chyron:stop()
-  if self.timer then
-    killTimer(self.timer)
-  end
-  self.enabled = false
-  self.pos = 0
-  self:doScroll()
-end
-
---- Change the text being scrolled on the Chyron
--- @param message string message the text you want to have scroll on the Chyron
-function Chyron:setMessage(message)
-  self.text = message
-  self.pos = 0
-  message = string.format("%s %s ", message, self.delimiter)
-  local t = {}
-  for i = 1, #message do
-    t[i] = message:sub(i, i)
-  end
-  self.textTable = t
-  if not self.enabled then
-    self:doScroll()
-  end
-end
-
---- Change the delimiter used to show the beginning and end of the message
--- @param delimiter string the new delimiter to use. I recommend using one character.
-function Chyron:setDelimiter(delimiter)
-  self.delimiter = delimiter
-end
-
-Chyron.parent = Geyser.Label
-setmetatable(Chyron, Geyser.Label)
-
-return Chyron
- - -
-
-
-generated by LDoc 1.5.0 -Last updated 2023-05-29 18:41:27 -
-
- - diff --git a/src/resources/MDK/doc/source/demontools.lua.html b/src/resources/MDK/doc/source/demontools.lua.html deleted file mode 100755 index 47d8365..0000000 --- a/src/resources/MDK/doc/source/demontools.lua.html +++ /dev/null @@ -1,1585 +0,0 @@ - - - - - Reference - - - - -
- -
- -
-
-
- - -
- - - - - - -
- -

demontools.lua

-
---- Collection of miscellaneous functions and tools which don't necessarily warrant their own module/class
--- @module demontools
--- @author Damian Monogue <demonnic@gmail.com>
--- @copyright 2020 Damian Monogue
--- @license MIT, see LICENSE.lua
-local DemonTools = {}
-local cheatConsole = Geyser.MiniConsole:new({name = "DemonnicCheatConsole", width = 4000, wrapWidth = 10000, color = "black"})
-cheatConsole:hide()
-local function exists(path)
-  path = path:gsub([[\$]], "")
-  path = path:gsub([[/$]], "")
-  return io.exists(path)
-end
-
-local function isWindows()
-  return package.config:sub(1, 1) == [[\]]
-end
-
-local function isDir(path)
-  if not exists(path) then return false end
-    path = path:gsub([[\]], "/")
-  if path:ends("/") then
-    path = path:sub(1,-2)
-  end
-  local ok, err, code = lfs.attributes(path, "mode")
-  if ok then
-    if ok == "directory" then
-      return true
-    else
-      return false
-    end
-  end
-  return ok, err, code
-end
-
-local function mkdir_p(path)
-  path = path:gsub("\\", "/")
-  local pathTbl = path:split("/")
-  local cwd = "/"
-  if isWindows() then
-    cwd = ""
-  end
-  for index, dirName in ipairs(pathTbl) do
-    if index == 1 then
-      cwd = cwd .. dirName
-    else
-      cwd = cwd .. "/" .. dirName
-      cwd = cwd:gsub("//", "/")
-    end
-    if not table.contains({"/", "C:"}, cwd) and not exists(cwd) then
-      local ok, err = lfs.mkdir(cwd)
-      if not ok then
-        return ok, err
-      end
-    end
-  end
-  return true
-end
-
-local htmlHeader = [=[  <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-"http://www.w3.org/TR/html4/loose.dtd">
-<html>
-  <head>
-    <meta http-equiv="Content-Type" content="text/html;charset=utf-8" >
-    <link href='http://fonts.googleapis.com/css?family=Droid+Sans+Mono' rel='stylesheet' type='text/css'>
-    <style type="text/css">
-      body {
-        background-color: black;
-        font-family: 'Droid Sans Mono';
-        white-space: pre;
-        font-size: 12px;
-      }
-    </style>
-  </head>
-<body><span>
-]=]
-
-local htmlHeaderPattern = [=[  <!DOCTYPE HTML PUBLIC "%-//W3C//DTD HTML 4.01 Transitional//EN"
-"http://www.w3.org/TR/html4/loose.dtd">
-<html>
-  <head>
-    <meta http%-equiv="Content%-Type" content="text/html;charset=utf%-8" >
-    <link href='http://fonts.googleapis.com/css%?family=Droid%+Sans%+Mono' rel='stylesheet' type='text/css'>
-    <style type="text/css">
-      body {
-        background%-color: black;
-        font%-family: 'Droid Sans Mono';
-        white%-space: pre;
-        font%-size: 12px;
-      }
-    </style>
-  </head>
-<body><span>
-]=]
-
--- Internal function, used to turn a string variable name into a value
-local function getValueAt(accessString)
-  local ok, err = pcall(loadstring("return " .. tostring(accessString)))
-  if ok then return err end
-  return nil, err
-end
-
--- internal sorting function, sorts first by hue, then luminosity, then value
-local function sortColorsByHue(lhs, rhs)
-  local lh, ll, lv = unpack(lhs.sort)
-  local rh, rl, rv = unpack(rhs.sort)
-  if lh < rh then
-    return true
-  elseif lh > rh then
-    return false
-  elseif ll < rl then
-    return true
-  elseif ll > rl then
-    return false
-  else
-    return lv < rv
-  end
-end
-
--- internal sorting function, removes _ from snake_case and compares to camelCase
-local function sortColorsByName(a, b)
-  local aname = string.gsub(string.lower(a.name), "_", "")
-  local bname = string.gsub(string.lower(b.name), "_", "")
-  return aname < bname
-end
-
--- internal function used to turn sorted colors table into columns
-local function chunkify(tbl, num_chunks)
-  local pop = function(t)
-    return table.remove(t, 1)
-  end
-  tbl = table.deepcopy(tbl)
-  local tblsize = #tbl
-  local base_chunk_size = tblsize / num_chunks
-  local chunky_chunks = tblsize % num_chunks
-  local chunks = {}
-  for i = 1, num_chunks do
-    local chunk_size = base_chunk_size
-    if i <= chunky_chunks then
-      chunk_size = chunk_size + 1
-    end
-    local chunk = {}
-    for j = 1, chunk_size do
-      chunk[j] = pop(tbl)
-    end
-    chunks[i] = chunk
-  end
-  return chunks
-end
-
--- internal function, converts rgb to hsv
--- found at https://github.com/EmmanuelOga/columns/blob/master/utils/color.lua#L89
-local function rgbToHsv(r, g, b)
-  r, g, b = r / 255, g / 255, b / 255
-  local max, min = math.max(r, g, b), math.min(r, g, b)
-  local h, s, v
-  v = max
-  local d = max - min
-  if max == 0 then
-    s = 0
-  else
-    s = d / max
-  end
-  if max == min then
-    h = 0
-    -- achromatic
-  else
-    if max == r then
-      h = (g - b) / d
-      if g < b then
-        h = h + 6
-      end
-    elseif max == g then
-      h = (b - r) / d + 2
-    elseif max == b then
-      h = (r - g) / d + 4
-    end
-    h = h / 6
-  end
-  return h, s, v
-end
-
--- internal stepping function, removes some of the noise for a more pleasing sort
--- cribbed from the python on https://www.alanzucconi.com/2015/09/30/colour-sorting/
-local function step(r, g, b)
-  local lum = math.sqrt(.241 * r + .691 * g + .068 * b)
-  local reps = 8
-  local h, s, v = rgbToHsv(r, g, b)
-  local h2 = math.floor(h * reps)
-  local lum2 = math.floor(lum * reps)
-  local v2 = math.floor(v * reps)
-  if h2 % 2 == 1 then
-    v2 = reps - v2
-    lum2 = reps - lum2
-  end
-  return h2, lum2, v2
-end
-
-local function calc_luminosity(r, g, b)
-  r = r < 11 and r / (255 * 12.92) or ((0.055 + r / 255) / 1.055) ^ 2.4
-  g = g < 11 and g / (255 * 12.92) or ((0.055 + g / 255) / 1.055) ^ 2.4
-  b = b < 11 and b / (255 * 12.92) or ((0.055 + b / 255) / 1.055) ^ 2.4
-  return (0.2126 * r) + (0.7152 * g) + (0.0722 * b)
-end
-
-local function include(color, options)
-  if options.removeDupes and (string.find(color, "_") and not color:starts("ansi")) or string.find(color:lower(), 'gray') then
-    return false
-  end
-  if options.removeAnsi255 and string.find(color, "ansi_%d%d%d") then
-    return false
-  end
-end
-
-local function echoColor(color, options)
-  local rgb = color.rgb
-  local fgc = "white"
-  if calc_luminosity(unpack(rgb)) > 0.5 then
-    fgc = "black"
-  end
-  local colorString
-  if options.justText then
-    colorString = string.format('<%s:%s> %-23s<reset> ', color.name, 'black', color.name)
-  else
-    colorString = string.format('<%s:%s> %-23s<reset> ', fgc, color.name, color.name)
-  end
-  if options.window == "main" then
-    if options.echoOnly then
-      cecho(colorString)
-    else
-      cechoLink(colorString, [[appendCmdLine("]] .. color.name .. [[")]], table.concat(rgb, ", "), true)
-    end
-  else
-    if options.echoOnly then
-      cecho(options.window, colorString)
-    else
-      cechoLink(options.window, colorString, [[appendCmdLine("]] .. color.name .. [[")]], table.concat(rgb, ", "), true)
-    end
-  end
-end
-
-local cnames = {}
-
-local function _color_name(rgb)
-  if cnames[rgb] then
-    return cnames[rgb]
-  end
-  local least_distance = math.huge
-  local cname = ""
-  for name, color in pairs(color_table) do
-    local color_distance = math.sqrt((color[1] - rgb[1]) ^ 2 + (color[2] - rgb[2]) ^ 2 + (color[3] - rgb[3]) ^ 2)
-    if color_distance < least_distance then
-      least_distance = color_distance
-      cname = name
-    end
-  end
-  cnames[rgb] = cname
-  return cname
-end
-
--- converts decho color information to ansi escape sequences
-local function rgbToAnsi(rgb)
-  local result = ""
-  local cols = rgb:split(":")
-  local fore = cols[1]
-  local back = cols[2]
-  if fore ~= "" then
-    local components = fore:split(",")
-    result = string.format("%s\27[38:2::%s:%s:%sm", result, components[1] or "0", components[2] or "0", components[3] or "0")
-  end
-  if back then
-    local components = back:split(",")
-    result = string.format("%s\27[48:2::%s:%s:%sm", result, components[1] or "0", components[2] or "0", components[3] or "0")
-  end
-  return result
-end
-
--- converts a 6 digit hex color code to ansi escape sequence
-local function hexToAnsi(hexcode)
-  local result = ""
-  local cols = hexcode:split(",")
-  local fore = cols[1]
-  local back = cols[2]
-  if fore ~= "" then
-    local components = {tonumber(fore:sub(1, 2), 16), tonumber(fore:sub(3, 4), 16), tonumber(fore:sub(5, 6), 16)}
-    result = string.format("%s\27[38:2::%s:%s:%sm", result, components[1] or "0", components[2] or "0", components[3] or "0")
-  end
-  if back then
-    local components = {tonumber(back:sub(1, 2), 16), tonumber(back:sub(3, 4), 16), tonumber(back:sub(5, 6), 16)}
-    result = string.format("%s\27[48:2::%s:%s:%sm", result, components[1] or "0", components[2] or "0", components[3] or "0")
-  end
-  return result
-end
-
-local function hexToRgb(hexcode)
-  local result = "<"
-  local cols = hexcode:split(",")
-  local fore = cols[1]
-  local back = cols[2]
-  if fore ~= "" then
-    local r, g, b = Geyser.Color.parse("#" .. fore)
-    result = string.format("%s%s,%s,%s", result, r, g, b)
-  end
-  if back then
-    local r, g, b = Geyser.Color.parse("#" .. back)
-    result = string.format("%s:%s,%s,%s", result, r, g, b)
-  end
-  return string.format("%s>", result)
-end
-
-local function rgbToHex(rgb)
-  local result = "#"
-  local cols = rgb:split(":")
-  local fore = cols[1]
-  local back = cols[2]
-  if fore ~= "" then
-    local r, g, b = unpack(string.split(fore, ","))
-    result = string.format("%s%02x%02x%02x", result, r, g, b)
-  end
-  if back then
-    local r, g, b = unpack(string.split(back, ","))
-    result = string.format("%s,%02x%02x%02x", result, r, g, b)
-  end
-  return result
-end
-
-local function rgbToCname(rgb)
-  local result = "<"
-  local cols = rgb:split(":")
-  local fore = cols[1]
-  local back = cols[2]
-  if fore ~= "" then
-    result = string.format("%s%s", result, _color_name(fore:split(",")))
-  end
-  if back then
-    result = string.format("%s:%s", result, _color_name(back:split(",")))
-  end
-  return string.format("%s>", result)
-end
-
-local function cnameToRgb(cname)
-  local result = "<"
-  local cols = cname:split(":")
-  local fore = cols[1]
-  local back = cols[2]
-  if fore ~= "" then
-    local rgb = color_table[fore] or {0, 0, 0}
-    result = string.format("%s%s", result, table.concat(rgb, ","))
-  end
-  if back then
-    local rgb = color_table[back] or {0, 0, 0}
-    result = string.format("%s:%s", result, table.concat(rgb, ","))
-  end
-  return string.format("%s>", result)
-end
-
-local function toFromDecho(from, to, text)
-  local patterns = {d = _Echos.Patterns.Decimal[1], c = _Echos.Patterns.Color[1], h = _Echos.Patterns.Hex[1]}
-  local funcs = {d = {c = rgbToCname, h = rgbToHex, a = rgbToAnsi}, c = {d = cnameToRgb}, h = {d = hexToRgb}}
-  local resetCodes = {d = "<r>", h = "#r", c = "<reset>", a = "\27[39;49m"}
-
-  local colorPattern = patterns[from]
-  local func = funcs[from][to]
-  local reset = resetCodes[to]
-  local result = ""
-  for str, color, res in rex.split(text, colorPattern) do
-    result = result .. str
-    if color then
-      if color:sub(1, 1) == "|" then
-        color = color:gsub("|c", "#")
-      end
-      if from == "h" then
-        result = result .. func(color:sub(2, -1))
-      else
-        result = result .. func(color:match("<(.+)>"))
-      end
-    end
-    if res then
-      result = result .. reset
-    end
-  end
-  return result
-end
-
-local function decho2cecho(text)
-  return toFromDecho("d", "c", text)
-end
-
-local function cecho2decho(text)
-  return toFromDecho("c", "d", text)
-end
-
-local function decho2hecho(text)
-  return toFromDecho("d", "h", text)
-end
-
-local function hecho2decho(text)
-  return toFromDecho("h", "d", text)
-end
-
-local function cecho2ansi(text)
-  local dtext = cecho2decho(text)
-  return decho2ansi(dtext)
-end
-
-local function cecho2hecho(text)
-  local dtext = cecho2decho(text)
-  return decho2hecho(dtext)
-end
-
-local function hecho2cecho(text)
-  local dtext = hecho2decho(text)
-  return decho2cecho(dtext)
-end
-
-local function ansi2decho(tstring)
-  local cpattern = [=[\e\[([0-9;:]+)m]=]
-  local result = ""
-  local resets = {"39;49", "00", "0"}
-  local colours = {
-    [0] = color_table.ansiBlack,
-    [1] = color_table.ansiRed,
-    [2] = color_table.ansiGreen,
-    [3] = color_table.ansiYellow,
-    [4] = color_table.ansiBlue,
-    [5] = color_table.ansiMagenta,
-    [6] = color_table.ansiCyan,
-    [7] = color_table.ansiWhite,
-  }
-  local lightColours = {
-    [0] = color_table.ansiLightBlack,
-    [1] = color_table.ansiLightRed,
-    [2] = color_table.ansiLightGreen,
-    [3] = color_table.ansiLightYellow,
-    [4] = color_table.ansiLightBlue,
-    [5] = color_table.ansiLightMagenta,
-    [6] = color_table.ansiLightCyan,
-    [7] = color_table.ansiLightWhite,
-  }
-
-  local function colorCodeToRGB(color, parts)
-    local rgb
-    if color ~= 8 then
-      rgb = colours[color]
-    else
-      if parts[2] == "5" then
-        local color_number = tonumber(parts[3])
-        if color_number < 8 then
-          rgb = colours[color_number]
-        elseif color_number > 7 and color_number < 16 then
-          rgb = lightColours[color_number - 8]
-        else
-          rgb = color_table["ansi_" .. color_number]
-        end
-      elseif parts[2] == "2" then
-        local r = parts[4] or 0
-        local g = parts[5] or 0
-        local b = parts[6] or 0
-        if r == "" then
-          r = 0
-        end
-        if g == "" then
-          g = 0
-        end
-        if b == "" then
-          b = 0
-        end
-        rgb = {r, g, b}
-      end
-    end
-    return rgb
-  end
-
-  for str, color in rex.split(tstring, cpattern) do
-    result = result .. str
-    if color then
-      if table.contains(resets, color) then
-        result = result .. "<r>"
-      else
-        local parts
-        if color:find(";") then
-          parts = color:split(";")
-        else
-          parts = color:split(":")
-        end
-        local code = parts[1]
-        if code:starts("3") then
-          color = tonumber(code:sub(2, 2))
-          local rgb = colorCodeToRGB(color, parts)
-          result = string.format("%s<%s,%s,%s>", result, rgb[1], rgb[2], rgb[3])
-        elseif code:starts("4") then
-          color = tonumber(code:sub(2, 2))
-          local rgb = colorCodeToRGB(color, parts)
-          result = string.format("%s<:%s,%s,%s>", result, rgb[1], rgb[2], rgb[3])
-        elseif tonumber(code) >= 90 and tonumber(code) <= 97 then
-          local rgb = colours[tonumber(code) - 90]
-          result = string.format("%s<%s,%s,%s>", result, rgb[1], rgb[2], rgb[3])
-        elseif tonumber(code) >= 100 and tonumber(code) <= 107 then
-          local rgb = colours[tonumber(code) - 100]
-          result = string.format("%s<:%s,%s,%s>", result, rgb[1], rgb[2], rgb[3])
-        end
-      end
-    end
-  end
-  return result
-end
-
-local function decho2ansi(text)
-  local colorPattern = _Echos.Patterns.Decimal[1]
-  local result = ""
-  for str, color, res in rex.split(text, colorPattern) do
-    result = result .. str
-    if color then
-      result = result .. rgbToAnsi(color:match("<(.+)>"))
-    end
-    if res then
-      result = result .. "\27[39;49m"
-    end
-  end
-  return result
-end
-
-local function hecho2ansi(text)
-  local colorPattern = _Echos.Patterns.Hex[1]
-  local result = ""
-  for str, color, res in rex.split(text, colorPattern) do
-    result = result .. str
-    if color then
-      if color:sub(1, 1) == "|" then
-        color = color:gsub("|c", "#")
-      end
-      result = result .. hexToAnsi(color:sub(2, -1))
-    end
-    if res then
-      result = result .. "\27[39;49m"
-    end
-  end
-  return result
-end
-
-local function ansi2hecho(text)
-  local dtext = ansi2decho(text)
-  return decho2hecho(dtext)
-end
-
-local function displayColors(options)
-  options = options or {}
-  local optionsType = type(options)
-  assert(optionsType == "table", "displayColors(options) argument error: options as table expects, got " .. optionsType)
-  options.cols = options.cols or 4
-  options.search = options.search or ""
-  options.sort = options.sort or false
-  if options.removeDupes == nil then
-    options.removeDupes = true
-  end
-  if options.removeAnsi255 == nil then
-    options.removeAnsi255 = true
-  end
-  if options.columnSort == nil then
-    options.columnSort = true
-  end
-  if type(options.window) == "table" then
-    options.window = options.window.name
-  end
-  options.window = options.window or "main"
-  local color_table = options.color_table or color_table
-  local cols, search, sort = options.cols, options.search, options.sort
-  local colors = {}
-  for k, v in pairs(color_table) do
-    local color = {}
-    color.rgb = v
-    color.name = k
-    color.sort = {step(unpack(v))}
-    if include(k, options) and k:lower():find(search) then
-      table.insert(colors, color)
-    end
-  end
-  if sort then
-    table.sort(colors, sortColorsByName)
-  else
-    table.sort(colors, sortColorsByHue)
-  end
-  if options.columnSort then
-    local columns_table = chunkify(colors, cols)
-    local lines = #columns_table[1]
-    for i = 1, lines do
-      for j = 1, cols do
-        local color = columns_table[j][i]
-        if color then
-          echoColor(color, options)
-        end
-      end
-      echo(options.window, "\n")
-    end
-  else
-    local i = 1
-    for _, k in ipairs(colors) do
-      echoColor(k, options)
-      if i == cols then
-        echo(options.window, "\n")
-        i = 1
-      else
-        i = i + 1
-      end
-    end
-    if i ~= 1 then
-      echo(options.window, "\n")
-    end
-  end
-end
-
-local function cecho2string(text)
-  local pattern = _Echos.Patterns.Color[2]
-  local result = rex.gsub(text, pattern, "")
-  return result
-end
-
-local function decho2string(text)
-  local pattern = _Echos.Patterns.Decimal[2]
-  local result = rex.gsub(text, pattern, "")
-  return result
-end
-
-local function hecho2string(text)
-  local pattern = _Echos.Patterns.Hex[2]
-  local result = rex.gsub(text, pattern, "")
-  return result
-end
-
-local function append2decho()
-  cheatConsole:clear()
-  cheatConsole:appendBuffer()
-  local str = copy2decho(cheatConsole.name)
-  cheatConsole:clear()
-  return str
-end
-
-local function html2decho(text)
-  text = text:gsub(htmlHeaderPattern, "")
-  text = text:gsub("<span style='color: rgb%((%d+,%d+,%d+)%);background: rgb%((%d+,%d+,%d+)%);'>", "<%1:%2>")
-  text = text:gsub("<br>", "\n")
-  text = text:gsub("</span>", "")
-  return text
-end
-
-local function html2cecho(text)
-  local dtext = html2decho(text)
-  return decho2cecho(dtext)
-end
-
-local function html2hecho(text)
-  local dtext = html2decho(text)
-  return decho2hecho(dtext)
-end
-
-local function html2ansi(text)
-  local dtext = html2decho(text)
-  return decho2ansi(dtext)
-end
-
-local function html2string(text)
-  local dtext = html2decho(text)
-  return decho2string(text)
-end
-
-local function consoleToString(options)
-  options = options or {}
-  options.win = options.win or "main"
-  options.format = options.format or "d"
-  options.start_line = options.start_line or 0
-  if options.includeHtmlWrapper == nil then
-    options.includeHtmlWrapper = true
-  end
-  local console_line_count = options.win == "main" and getLineCount() or getLineCount(options.win)
-  if not options.end_line then
-    options.end_line = console_line_count
-  end
-  if options.end_line > console_line_count then
-    options.end_line = console_line_count
-  end
-  local start, finish, format = options.start_line, options.end_line, options.format
-  local current_x, current_y
-  if options.win == "main" then
-    current_x = getColumnNumber()
-    current_y = getLineNumber()
-  else
-    current_x = getColumnNumber(options.win)
-    current_y = getLineNumber(options.win)
-  end
-
-  local function move(x, y)
-    if options.win == "main" then
-      return moveCursor(x, y)
-    else
-      return moveCursor(options.win, x, y)
-    end
-  end
-  local function gcl()
-    local win, raw
-    if options.win ~= "main" then
-      win = options.win
-      raw = getCurrentLine(win)
-    else
-      win = nil
-      raw = getCurrentLine()
-    end
-    if raw == "" then
-      return ""
-    end
-    if format == "h" then
-      return copy2html(win)
-    elseif format == "d" then
-      return copy2decho(win)
-    elseif format == "a" then
-      return decho2ansi(copy2decho(win))
-    elseif format == "c" then
-      return decho2cecho(copy2decho(win))
-    elseif format == "x" then
-      return decho2hecho(copy2decho(win))
-    elseif format == "r" then
-      return raw
-    end
-  end
-  local lines = {}
-  if format == "h" and options.includeHtmlWrapper then
-    lines[#lines + 1] = htmlHeader
-  end
-  for line_number = start, finish do
-    move(0, line_number)
-    lines[#lines + 1] = gcl()
-  end
-  if format == "h" and options.includeHtmlWrapper then
-    lines[#lines + 1] = "</span></body></html>"
-  end
-  moveCursor(current_x, current_y)
-  return table.concat(lines, "\n")
-end
-
-local function decho2html(text)
-  cheatConsole:clear()
-  text = text:gsub("\n", "<br>")
-  cheatConsole:decho(text)
-  local html = copy2html(cheatConsole.name)
-  cheatConsole:clear()
-  return html
-end
-
-local function cecho2html(text)
-  local dtext = cecho2decho(text)
-  return decho2html(dtext)
-end
-
-local function hecho2html(text)
-  local dtext = hecho2decho(text)
-  return decho2html(dtext)
-end
-
-local function ansi2html(text)
-  local dtext = ansi2decho(text)
-  return decho2html(dtext)
-end
-
-local function scientific_round(number, sigDigits)
-  local decimalPlace = string.find(number, "%.")
-  if not decimalPlace or (sigDigits < decimalPlace) then
-    local numberTable = {}
-    local count = 1
-    for digit in string.gmatch(number, "%d") do
-      table.insert(numberTable, digit)
-    end
-    local endNumber = ""
-    for i, digit in ipairs(numberTable) do
-      if i < sigDigits then
-        endNumber = endNumber .. digit
-      end
-      if i == sigDigits then
-        if tonumber(numberTable[i + 1]) >= 5 then
-          endNumber = endNumber .. digit + 1
-        else
-          endNumber = endNumber .. digit
-        end
-      end
-      if i > sigDigits and (not decimalPlace or (i < decimalPlace)) then
-        endNumber = endNumber .. "0"
-      end
-    end
-    return tonumber(endNumber)
-  else
-    local decimalDigits = sigDigits - decimalPlace + 1
-    return tonumber(string.format("%" .. decimalPlace - 1 .. "." .. decimalDigits .. "f", number))
-  end
-end
-
-local function roundInt(number)
-  return math.floor(number + 0.5)
-end
-
-function string.tobyte(self)
-  return (self:gsub('.', function(c)
-    return string.byte(c)
-  end))
-end
-
-function string.tocolor(self)
-  -- This next bit takes the string and 'unshuffles' it, breaking it into odds and evens
-  -- reverses the evens, then adds the odds to the new even set. So demonnic becomes cnoedmni
-  -- this makes sure that names which are similar in the beginning don't color the same
-  -- especially since we have to cut the number for the random seed due to OSX using a default
-  -- randomseed if you feed it something too large, which made every name longer than 7 characters
-  -- always the same color, no matter what it was.
-  local strTable = {}
-  local part1 = {}
-  local part2 = {}
-  _ = self:gsub(".", function(c)
-    table.insert(strTable, c)
-  end)
-  for index, value in ipairs(strTable) do
-    if (index % 2 == 0) then
-      table.insert(part1, value)
-    else
-      table.insert(part2, value)
-    end
-  end
-  local newStr = string.reverse(table.concat(part1)) .. table.concat(part2)
-  -- end munging of the original string to get more uniqueness
-  math.randomseed(string.cut(newStr:tobyte(), 18))
-  local r = math.random(0, 255)
-  local g = math.random(0, 255)
-  local b = math.random(0, 255)
-  math.randomseed(os.time())
-  return {r, g, b}
-end
-
-local function colorMunge(strForColor, strToEcho, format)
-  format = format or 'd'
-  local rgb = strForColor:tocolor()
-  local color
-  if format == "d" then
-    color = string.format("<%s>", table.concat(rgb, ","))
-  elseif format == "c" then
-    color = string.format("<%s>", _color_name(rgb))
-  elseif format == "h" then
-    color = string.format("#%02x%02x%02x", rgb[1], rgb[2], rgb[3])
-  end
-  return color .. strToEcho
-end
-
-local function colorMungeEcho(strForColor, strToEcho, format, win)
-  format = format or "d"
-  win = win or "main"
-  local str = colorMunge(strForColor, strToEcho, format)
-  local func
-  if format == "d" then
-    func = decho
-  end
-  if format == "c" then
-    func = cecho
-  end
-  if format == "h" then
-    func = hecho
-  end
-  if win == "main" then
-    func(str)
-  else
-    func(win, str)
-  end
-end
-
-local function milliToHuman(milliseconds)
-  local totalseconds = math.floor(milliseconds / 1000)
-  milliseconds = milliseconds % 1000
-  local seconds = totalseconds % 60
-  local minutes = math.floor(totalseconds / 60)
-  local hours = math.floor(minutes / 60)
-  minutes = minutes % 60
-  return string.format("%02d:%02d:%02d:%03d", hours, minutes, seconds, milliseconds)
-end
-
---- Takes a list table and returns it as a table of 'chunks'. If the table has 12 items and you ask for 3 chunks, each chunk will have 4 items in it
--- @tparam table tbl The table you want to turn into chunks. Must be traversable using ipairs()
--- @tparam number num_chunks The number of chunks to turn the table into
--- @usage local dt = require("MDK.demontools")
--- testTable = { "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten" }
--- display(dt.chunkify(testTable, 3))
--- --displays the following
--- {
---   {
---     "one",
---     "two",
---     "three",
---     "four"
---   },
---   {
---     "five",
---     "six",
---     "seven"
---   },
---   {
---     "eight",
---     "nine",
---     "ten"
---   }
--- }
-
-function DemonTools.chunkify(tbl, num_chunks)
-  return chunkify(tbl, num_chunks)
-end
-
---- Takes an ansi colored text string and returns a cecho colored one
--- @tparam string text the text to convert
--- @usage   dt.ansi2cecho("Test")
--- --returns "<ansiRed>Test"
-function DemonTools.ansi2cecho(text)
-  local dtext = ansi2decho(text)
-  return decho2cecho(dtext)
-end
-
---- Takes an ansi colored text string and returns a decho colored one. Handles 256 color SGR codes better than Mudlet's ansi2decho
--- @tparam string text the text to convert
--- @usage   dt.ansi2decho("Test") --returns "<128,0,0>Test"
--- @usage dt.ansi2decho("[38:2::127:0:0mTest") --returns "<127,0,0>Test"
--- @usage ansi2decho("[38:2::127:0:0mTest") -- doesn't parse this format of colors and so returns "[38:2::127:0:0mTest"
-function DemonTools.ansi2decho(text)
-  return ansi2decho(text)
-end
-
---- Takes an ansi colored text string and returns a hecho colored one
--- @tparam string text the text to convert
--- @usage   dt.ansi2hecho("Test")
--- --returns "#800000Test"
-function DemonTools.ansi2hecho(text)
-  return ansi2hecho(text)
-end
-
---- Takes an cecho colored text string and returns a decho colored one
--- @tparam string text the text to convert
--- @usage  dt.cecho2decho("<green>Test") --returns "<0,255,0>Test"
-function DemonTools.cecho2decho(text)
-  return cecho2decho(text)
-end
-
---- Takes an cecho colored text string and returns an ansi colored one
--- @tparam string text the text to convert
--- @usage dt.cecho2ansi("<green>Test") --returns "[38:2::0:255:0mTest"
-function DemonTools.cecho2ansi(text)
-  return cecho2ansi(text)
-end
-
---- Takes an cecho colored text string and returns a hecho colored one
--- @tparam string text the text to convert
--- @usage dt.cecho2hecho("<green>Test") --returns "#00ff00Test"
-function DemonTools.cecho2hecho(text)
-  return cecho2hecho(text)
-end
-
---- Takes an decho colored text string and returns a cecho colored one
--- @tparam string text the text to convert
--- @usage   dt.decho2cecho("<127,0,0:0,0,127>Test") --returns "<ansiRed:ansi_blue>Test"
-function DemonTools.decho2cecho(text)
-  return decho2cecho(text)
-end
-
---- Takes an decho colored text string and returns an ansi colored one
--- @tparam string text the text to convert
--- @usage dt.decho2ansi("<127,0,0:0,0,127>Test") --returns "[38:2::127:0:0m[48:2::0:0:127mTest"
-function DemonTools.decho2ansi(text)
-  return decho2ansi(text)
-end
-
---- Takes an decho colored text string and returns an hecho colored one
--- @tparam string text the text to convert
--- @usage dt.decho2hecho("<127,0,0:0,0,127>Test") --returns "#7f0000,00007fTest"
-function DemonTools.decho2hecho(text)
-  return decho2hecho(text)
-end
-
---- Takes a decho colored text string and returns html.
--- @tparam string text the text to convert
-function DemonTools.decho2html(text)
-  return decho2html(text)
-end
-
---- Takes a cecho colored text string and returns html.
--- @tparam string text the text to convert
-function DemonTools.cecho2html(text)
-  return cecho2html(text)
-end
-
---- Takes a hecho colored text string and returns html.
--- @tparam string text the text to convert
-function DemonTools.hecho2html(text)
-  return hecho2html(text)
-end
-
---- Takes an ansi colored text string and returns html.
--- @tparam string text the text to convert
-function DemonTools.ansi2html(text)
-  return ansi2html(text)
-end
-
---- Takes an html colored string of the sort turned out by the DemonTools *2html functions and returns a cecho string
--- @tparam string text the text to convert
-function DemonTools.html2cecho(text)
-  return html2cecho(text)
-end
-
---- Takes an html colored string of the sort turned out by the DemonTools *2html functions and returns a decho string
--- @tparam string text the text to convert
-function DemonTools.html2decho(text)
-  return html2decho(text)
-end
-
---- Takes an html colored string of the sort turned out by the DemonTools *2html functions and returns an ansi string
--- @tparam string text the text to convert
-function DemonTools.html2ansi(text)
-  return html2ansi(text)
-end
-
---- Takes an html colored string of the sort turned out by the DemonTools *2html functions and returns an hecho string
--- @tparam string text the text to convert
-function DemonTools.html2hecho(text)
-  return html2hecho(text)
-end
-
---- Takes a cecho string and returns it without the formatting
--- @param text the text to transform
-function DemonTools.cecho2string(text)
-  return cecho2string(text)
-end
-
---- Takes a decho string and returns it without the formatting
--- @param text the text to transform
-function DemonTools.decho2string(text)
-  return decho2string(text)
-end
-
---- Takes a hecho string and returns it without the formatting
--- @param text the text to transform
-function DemonTools.hecho2string(text)
-  return hecho2string(text)
-end
-
---- Takes an html colored string of the sort turned out by the DemonTools *2html functions and returns a clean string
-function DemonTools.html2string(text)
-  return html2string(text)
-end
-
---- Takes an hecho colored text string and returns a ansi colored one
--- @tparam string text the text to convert
--- @usage dt.hecho2ansi("#7f0000,00007fTest") --returns "[38:2::127:0:0m[48:2::0:0:127mTest"
-function DemonTools.hecho2ansi(text)
-  return hecho2ansi(text)
-end
-
---- Takes an hecho colored text string and returns a cecho colored one
--- @tparam string text the text to convert
--- @usage   dt.hecho2cecho("#7f0000,00007fTest") --returns "<ansiRed:ansi_blue>Test"
-function DemonTools.hecho2cecho(text)
-  return hecho2cecho(text)
-end
-
---- Takes an hecho colored text string and returns a decho colored one
--- @tparam string text the text to convert
--- @usage   dt.hecho2decho("#7f0000,00007fTest") --returns "<127,0,0:0,0,127>Test"
-function DemonTools.hecho2decho(text)
-  return hecho2decho(text)
-end
-
---- Takes the currently copy()ed item and returns it as a decho string
-function DemonTools.append2decho()
-  return append2decho()
-end
-
---- Dump the contents of a miniconsole, user window, or the main window in one of several formats, as determined by a table of options
--- @tparam table options Table of options which controls which console and how it returns the data.
--- <table class="tg">
--- <thead>
---   <tr>
---     <th>option name</th>
---     <th>description</th>
---     <th>default</th>
---   </tr>
--- </thead>
--- <tbody>
---   <tr>
---     <td class="tg-1">format</td>
---     <td class="tg-1">What format to return the text as? 'h' for html, 'c' for cecho, 'a' for ansi, 'd' for decho, and 'x' for hecho</td>
---     <td class="tg-1">"d"</td>
---   </tr>
---   <tr>
---     <td class="tg-2">win</td>
---     <td class="tg-2">what console/window to dump the buffer of?</td>
---     <td class="tg-2">"main"</td>
---   </tr>
---   <tr>
---     <td class="tg-1">start_line</td>
---     <td class="tg-1">What line to start dumping the buffer from?</td>
---     <td class="tg-1">0</td>
---   </tr>
---   <tr>
---     <td class="tg-2">end_line</td>
---     <td class="tg-2">What line to stop dumping the buffer on?</td>
---     <td class="tg-2">Last line of the console</td>
---   </tr>
---   <tr>
---     <td class="tg-1">includeHtmlWrapper</td>
---     <td class="tg-1">If the format is html, should it include the front and back portions required to make it a functioning html page?</td>
---     <td class="tg-1">true</td>
---   </tr>
--- </tbody>
--- </table>
-function DemonTools.consoleToString(options)
-  return consoleToString(options)
-end
-
---- Alternative to Mudlet's showColors(), this one has additional options.
--- @tparam table options table of options which control the output of displayColors
--- <table class="tg">
--- <thead>
---   <tr>
---     <th>option name</th>
---     <th>description</th>
---     <th>default</th>
---   </tr>
--- </thead>
--- <tbody>
---   <tr>
---     <td class="tg-1">cols</td>
---     <td class="tg-1">Number of columsn wide to display the colors in</td>
---     <td class="tg-1">4</td>
---   </tr>
---   <tr>
---     <td class="tg-2">search</td>
---     <td class="tg-2">If not the empty string, will check colors against string.find using this property.<br>IE if set to "blue" only colors which include the word 'blue' would be listed</td>
---     <td class="tg-2">""</td>
---   </tr>
---   <tr>
---     <td class="tg-1">sort</td>
---     <td class="tg-1">If true, sorts alphabetically. Otherwise sorts based on the color value</td>
---     <td class="tg-1">false</td>
---   </tr>
---   <tr>
---     <td class="tg-2">echoOnly</td>
---     <td class="tg-2">If true, colors will not be clickable links</td>
---     <td class="tg-2">false</td>
---   </tr>
---   <tr>
---     <td class="tg-1">window</td>
---     <td class="tg-1">What window/console to echo the colors out to.</td>
---     <td class="tg-1">"main"</td>
---   </tr>
---   <tr>
---     <td class="tg-2">removeDupes</td>
---     <td class="tg-2">If true, will remove snake_case entries and 'gray' in favor of 'grey'</td>
---     <td class="tg-2">true</td>
---   </tr>
---   <tr>
---     <td class="tg-1">columnSort</td>
---     <td class="tg-1">If true, will print top-to-bottom, then left-to-right. false is like showColors</td>
---     <td class="tg-1">true</td>
---   </tr>
---   <tr>
---     <td class="tg-2">justText</td>
---     <td class="tg-2">If true, will echo the text in the color and leave the background black.<br>If false, the background will be the colour(like showColors).</td>
---     <td class="tg-2">false</td>
---   </tr>
---   <tr>
---     <td class="tg-1">color_table</td>
---     <td class="tg-1">Table of colors to display. If you provide your own table, it must be in the same format as Mudlet's own color_table</td>
---     <td class="tg-1">color_table</td>
---   </tr>
--- </tbody>
--- </table>
-function DemonTools.displayColors(options)
-  return displayColors(options)
-end
-
---- Rounds a number to the nearest whole integer
--- @param number the number to round off
--- @usage dt.roundInt(8.3) -- returns 8
--- @usage dt.roundInt(10.7) -- returns 11
-function DemonTools.roundInt(number)
-  local num = tonumber(number)
-  local numType = type(num)
-  assert(numType == "number", string.format("DemonTools.roundInt(number): number as number expected, got %s", type(number)))
-  return roundInt(num)
-end
-
---- Rounds a number to a specified number of significant digits
--- @tparam number number the number to round
--- @tparam number sig_digits the number of significant digits to keep
--- @usage dt.scientific_round(1348290, 3) -- will return 1350000
--- @usage dt.scientific_found(123.3452, 5) -- will return 123.34
-function DemonTools.scientific_round(number, sig_digits)
-  return scientific_round(number, sig_digits)
-end
-
---- Returns a color table {r,g,b} derived from str. Will return the same color every time for the same string.
--- @tparam string str the string to turn into a color.
--- @usage   dt.string2color("Demonnic") --returns { 131, 122, 209 }
-function DemonTools.string2color(str)
-  return string.tocolor(str)
-end
-
---- Returns a colored string where strForColor is run through DemonTools.string2color and applied to strToColor based on format.
--- @tparam string strForColor the string to turn into a color using DemonTools.string2color
--- @tparam string strToColor the string you want to color based on strForColor
--- @param format What format to use for the color portion. "d" for decho, "c" for cecho, or "h" for hecho. Defaults to "d"
--- @usage   dt.colorMunge("Demonnic", "Test") --returns "<131,122,209>Test"
-function DemonTools.colorMunge(strForColor, strToColor, format)
-  return colorMunge(strForColor, strToColor, format)
-end
-
---- Like colorMunge but also echos the result to win.
--- @tparam string strForColor the string to turn into a color using DemonTools.string2color
--- @tparam string strToEcho the string you want to color and echo based on strForColor
--- @param format What format to use for the color portion. "d" for decho, "c" for cecho, or "h" for hecho. Defaults to "d"
--- @param win the window to echo to. You must provide the format if you want to change the window. Defaults to "main"
-function DemonTools.colorMungeEcho(strForColor, strToEcho, format, win)
-  colorMungeEcho(strForColor, strToEcho, format, win)
-end
-
---- Converts milliseconds to hours:minutes:seconds:milliseconds
--- @tparam number milliseconds the number of milliseconds to convert
--- @tparam boolean tbl if true, returns the time as a key/value table instead
--- @usage dt.milliToHuman(37194572) --returns "10:19:54:572"
--- @usage display(dt.milliToHuman(37194572, true))
--- {
---   minutes = 19,
---   original = 37194572,
---   hours = 10,
---   milliseconds = 572,
---   seconds = 54
--- }
-function DemonTools.milliToHuman(milliseconds, tbl)
-  local human = milliToHuman(milliseconds)
-  local output
-  if tbl then
-    local timetbl = human:split(":")
-    output = {
-      hours = tonumber(timetbl[1]),
-      minutes = tonumber(timetbl[2]),
-      seconds = tonumber(timetbl[3]),
-      milliseconds = tonumber(timetbl[4]),
-      original = milliseconds,
-    }
-  else
-    output = human
-  end
-  return output
-end
-
---- Takes the name of a variable as a string and returns the value. "health" will return the value in varable health, "gmcp.Char.Vitals" will return the table at gmcp.Char.Vitals, etc
--- @tparam string variableString the string name of the variable you want the value of
--- @usage currentHP = 50
--- dt.getValueAt("currentHP") -- returns 50
-function DemonTools.getValueAt(variableString)
-  return getValueAt(variableString)
-end
-
---- Returns if a file or directory exists on the filesystem
--- @tparam string path the path to the file or directory to check
-function DemonTools.exists(path)
-  return exists(path)
-end
-
---- Returns if a path is a directory or not
--- @tparam string path the path to check
-function DemonTools.isDir(path)
-  return isDir(path)
-end
-
---- Returns true if running on windows, false otherwise
-function DemonTools.isWindows()
-  return isWindows()
-end
-
---- Creates a directory, creating each directory as necessary along the way.
--- @tparam string path the path to create
-function DemonTools.mkdir_p(path)
-  return mkdir_p(path)
-end
-
-DemonTools.htmlHeader = htmlHeader
-DemonTools.htmlHeaderPattern = htmlHeaderPattern
-
-local echoOutputs = {
-  Color = {
-    ["\27reset"] = "<reset>",
-    ["\27bold"] = "<b>",
-    ["\27boldoff"] = "</b>",
-    ["\27italics"] = "<i>",
-    ["\27italicsoff"] = "</i>",
-    ["\27underline"] = "<u>",
-    ["\27underlineoff"] = "</u>",
-    ["\27strikethrough"] = "<s>",
-    ["\27strikethroughoff"] = "</s>",
-    ["\27overline"] = "<o>",
-    ["\27overlineoff"] = "</o>",
-  },
-  Decimal = {
-    ["\27reset"] = "<r>",
-    ["\27bold"] = "<b>",
-    ["\27boldoff"] = "</b>",
-    ["\27italics"] = "<i>",
-    ["\27italicsoff"] = "</i>",
-    ["\27underline"] = "<u>",
-    ["\27underlineoff"] = "</u>",
-    ["\27strikethrough"] = "<s>",
-    ["\27strikethroughoff"] = "</s>",
-    ["\27overline"] = "<o>",
-    ["\27overlineoff"] = "</o>",
-  },
-  Hex = {
-    ["\27reset"] = "#r",
-    ["\27bold"] = "#b",
-    ["\27boldoff"] = "#/b",
-    ["\27italics"] = "#i",
-    ["\27italicsoff"] = "#/i",
-    ["\27underline"] = "#u",
-    ["\27underlineoff"] = "#/u",
-    ["\27strikethrough"] = "#s",
-    ["\27strikethroughoff"] = "#/s",
-    ["\27overline"] = "#o",
-    ["\27overlineoff"] = "#/o",
-  }
-}
-
-local echoPatterns = _Echos.Patterns
-local echoProcess = _Echos.Process
-
-function DemonTools.toHTML(t, reset)
-  reset = reset or {
-    background = { 0, 0, 0 },
-    bold = false,
-    foreground = { 255, 255, 255 },
-    italic = false,
-    overline = false,
-    reverse = false,
-    strikeout = false,
-    underline = false
-  }
-  local format = table.deepcopy(reset)
-  local result = getHTMLformat(format)
-  for _,v in ipairs(t) do
-    local formatChanged = false
-    if type(v) == "table" then
-      if v.fg then
-        format.foreground = {v.fg[1], v.fg[2], v.fg[3]}
-        formatChanged = true
-      end
-      if v.bg then
-        format.background = {v.bg[1], v.bg[2], v.bg[3]}
-        formatChanged = true
-      end
-    elseif v == "\27bold" then
-      format.bold = true
-      formatChanged = true
-    elseif v == "\27boldoff" then
-      format.bold = false
-      formatChanged = true
-    elseif v == "\27italics" then
-      format.italic = true
-      formatChanged = true
-    elseif v == "\27italicsoff" then
-      format.italic = false
-      formatChanged = true
-    elseif v == "\27underline" then
-      format.underline = true
-      formatChanged = true
-    elseif v == "\27underlineoff" then
-      format.underline = false
-      formatChanged = true
-    elseif v == "\27strikethrough" then
-      format.strikeout = true
-      formatChanged = true
-    elseif v == "\27strikethroughoff" then
-      format.strikeout = false
-      formatChanged = true
-    elseif v == "\27overline" then
-      format.overline = true
-      formatChanged = true
-    elseif v == "\27overlineoff" then
-      format.overline = false
-      formatChanged = true
-    elseif v == "\27reset" then
-      format = table.deepcopy(reset)
-      formatChanged = true
-    end
-    v = formatChanged and getHTMLformat(format) or v
-    result = result .. v
-  end
-  return result
-end
-
-local function toEcho(colorType, colors)
-  colorType = colorType:lower()
-  local result
-  if colorType == "hex" then
-    local fg,bg = "", ""
-    if colors.fg then
-      fg = string.format("%02x%02x%02x", unpack(colors.fg))
-    end
-    if colors.bg then
-      bg = string.format(",%02x%02x%02x", unpack(colors.bg))
-    end
-    result = string.format("#%s%s", fg, bg)
-  elseif colorType == "color" then
-    local fg,bg = "",""
-    if colors.fg then
-      fg = closestColor(colors.fg)
-    end
-    if colors.bg then
-      bg = ":" .. closestColor(colors.bg[1], colors.bg[2], colors.bg[3])
-    end
-    result = string.format("<%s%s>", fg, bg)
-  elseif colorType == "decimal" then
-    local fg,bg = "", ""
-    if colors.fg then
-      fg = string.format("%d,%d,%d", unpack(colors.fg))
-    end
-    if colors.bg then
-      bg = string.format(":%d,%d,%d", unpack(colors.bg))
-    end
-    result = string.format("<%s%s>", fg, bg)
-  end
-  return result
-end
-
-function DemonTools.echoConverter(str, from, to, resetFormat)
-  local strType, fromType, toType, resetType = type(str), type(from), type(to), type(resetFormat)
-  local errTemplate = "bad argument #{argNum} type ({argName} as string expected, got {argType})"
-  local argNum, argName, argType
-  local err = false
-  if strType ~= "string" then
-    argNum = 1
-    argName = "str"
-    argType = strType
-    err = true
-  elseif fromType ~= "string" then
-    argNum = 2
-    argName = "from"
-    argType = fromType
-    err = true
-  elseif toType ~= "string" then
-    argNum = 3
-    argName = "to"
-    argType = toType
-    err = true
-  elseif resetFormat and resetType ~= "table" then
-    argType = resetType
-    errTemplate = "bad argument #4 type (optional resetFormat as table of formatting options expected, got {argType})"
-    err = true
-  end
-  if err then
-    printError(f(errTemplate), true, true)
-  end
-  from = from:title()
-  local t = echoProcess(str, from)
-  if not echoPatterns[from] then
-    local msg = "argument #4 (from) must be a valid echo type. Valid types are: " .. table.concat(table.keys(echoPatterns), ",")
-  end
-  local processed = echoProcess(str, from)
-  if to:lower() == "html" then
-    return DemonTools.toHTML(processed, resetFormat)
-  end
-  local outputs = echoOutputs[to]
-  if not outputs then
-    local msg = "argument #3 (to) must be a valid echo type. Valid types are: " .. table.concat(table.keys(echoOutputs), ",")
-    printError(msg, true, true)
-  end
-  local result = ""
-  for _, token in ipairs(processed) do
-    local formatter = outputs[token]
-    if formatter and token:find("\27") then
-      result = result .. formatter
-    elseif type(token) == "table" then
-      result = result .. toEcho(to, token)
-    else
-      result = result .. token
-    end
-  end
-  return result
-end
-
-return DemonTools
- - -
-
-
-generated by LDoc 1.5.0 -Last updated 2023-05-29 18:41:27 -
-
- - diff --git a/src/resources/MDK/doc/source/echofile.lua.html b/src/resources/MDK/doc/source/echofile.lua.html deleted file mode 100755 index c9a17f1..0000000 --- a/src/resources/MDK/doc/source/echofile.lua.html +++ /dev/null @@ -1,395 +0,0 @@ - - - - - Reference - - - - -
- -
- -
-
-
- - -
- - - - - - -
- -

echofile.lua

-
---- set of functions for echoing files to things. Uses a slightly hacked up version of f-strings for interpolation/templating
--- @module echofile
--- @author Damian Monogue <demonnic@gmail.com>
--- @copyright 2021 Damian Monogue
--- @copyright 2016 Hisham Muhammad (https://github.com/hishamhm/f-strings/blob/master/LICENSE)
--- @license MIT, see LICENSE.lua
-local echofile = {}
-
--- following functions fiddled with from https://github.com/hishamhm/f-strings/blob/master/F.lua and https://hisham.hm/2016/01/04/string-interpolation-in-lua/
--- it seems to work :shrug:
-local load = load
-
-if _VERSION == "Lua 5.1" then
-  load = function(code, name, _, env)
-    local fn, err = loadstring(code, name)
-    if fn then
-      setfenv(fn, env)
-      return fn
-    end
-    return nil, err
-  end
-end
-
-local function f(str)
-  local outer_env = _ENV or getfenv(1)
-  return (str:gsub("%b{}", function(block)
-    local code = block:match("{(.*)}")
-    local exp_env = {}
-    setmetatable(exp_env, {
-      __index = function(_, k)
-        local stack_level = 5
-        while debug.getinfo(stack_level, "") ~= nil do
-          local i = 1
-          repeat
-            local name, value = debug.getlocal(stack_level, i)
-            if name == k then
-              return value
-            end
-            i = i + 1
-          until name == nil
-          stack_level = stack_level + 1
-        end
-        return rawget(outer_env, k)
-      end,
-    })
-    local fn, err = load("return " .. code, "expression `" .. code .. "`", "t", exp_env)
-    if fn then
-      return tostring(fn())
-    else
-      error(err, 0)
-    end
-  end))
-end
-
-local function xechoFile(options)
-  local filename = options.filename
-  local window = options.window
-  local func = options.func
-  local functionName = options.functionName
-  local fntype = type(filename)
-  if fntype ~= "string" then
-    return nil, f("{functionName}: filename as string expected, got {fnType}")
-  end
-  if not io.exists(filename) then
-    return nil, f("{functionName}: {filename} not found")
-  end
-  local file, err = io.open(filename, "r")
-  if not file then
-    return nil, err
-  end
-  local lines = file:read("*a")
-  if options.ansi then
-    lines = ansi2decho(lines)
-  end
-  if options.filter then
-    lines = f(lines)
-  end
-  return func(window, lines)
-end
-
-local function getOptions(etype, filter, window, filename)
-  if filename == nil then
-    filename = window
-    window = "main"
-  end
-  local ansi = false
-  if etype == "a" then
-    etype = 'd'
-    ansi = true
-  end
-  local options = {
-    filename = filename,
-    window = window,
-    func = _G[etype .. "echo"],
-    functionName = etype .. "echoFile([window,] filename)",
-    ansi = ansi,
-    filter = filter,
-  }
-  return options
-end
-
---- Takes a string and performs interpolation
---- Uses {} as the delimiter. Expressions will be evaluated
----@param str string: The string to interpolate
----@usage echofile = require("MDK.echofile")
---- echofile.f("{1+1}") -- returns "2"
---- local x = 4
---- echofile.f"4+3 = {x+3}" -- returns "4+3 = 7"
-function echofile.f(str)
-  return f(str)
-end
-
---- reads the contents of a file, converts it to decho and then dechos it
----@param window string: Optional window to cecho to
----@param filename string: Full path to file
----@see echofile.f
----@see echofile.cechoFile
----@usage local ec = require("MDK.echofile")
---- local cechoFile,f = ec.cechoFile, ec.f
---- cechoFile("C:/path/to/file") -- windows1
---- cechoFile("C:\\path\\to\\file") -- windows2
---- cechoFile("/path/to/file") -- Linux/MacOS
---- cechoFile("aMiniConsole", f"{getMudletHomeDir()}/myPkgName/helpfile") -- cecho a file from your pkg to a miniconsole
-function echofile.aechoFile(window, filename)
-  local options = getOptions("a", false, window, filename)
-  return xechoFile(options)
-end
-
---- reads the contents of a file and then cechos it
----@param window string: Optional window to cecho to
----@param filename string: Full path to file
----@see echofile.f
----@see echofile.cechoFilef
----@usage local ec = require("MDK.echofile")
---- local cechoFile,f = ec.cechoFile, ec.f
---- cechoFile("C:/path/to/file") -- windows1
---- cechoFile("C:\\path\\to\\file") -- windows2
---- cechoFile("/path/to/file") -- Linux/MacOS
---- cechoFile("aMiniConsole", f"{getMudletHomeDir()}/myPkgName/helpfile") -- cecho a file from your pkg to a miniconsole
-function echofile.aechoFilef(window, filename)
-  local options = getOptions("a", true, window, filename)
-  return xechoFile(options)
-end
-
---- reads the contents of a file and then cechos it
----@param window string: Optional window to cecho to
----@param filename string: Full path to file
----@see echofile.f
----@usage local ec = require("MDK.echofile")
---- local cechoFile,f = ec.cechoFile, ec.f
---- cechoFile("C:/path/to/file") -- windows1
---- cechoFile("C:\\path\\to\\file") -- windows2
---- cechoFile("/path/to/file") -- Linux/MacOS
---- cechoFile("aMiniConsole", f"{getMudletHomeDir()}/myPkgName/helpfile") -- cecho a file from your pkg to a miniconsole
-function echofile.cechoFile(window, filename)
-  local options = getOptions("c", false, window, filename)
-  return xechoFile(options)
-end
-
---- reads the contents of a file, interpolates it as per echofile.f and then cechos it
----@param window string: Optional window to cecho to
----@param filename string: Full path to file
----@see echofile.f
----@usage local ec = require("MDK.echofile")
---- local cechoFile,f = ec.cechoFile, ec.f
---- cechoFile("C:/path/to/file") -- windows1
---- cechoFile("C:\\path\\to\\file") -- windows2
---- cechoFile("/path/to/file") -- Linux/MacOS
---- cechoFile("aMiniConsole", f"{getMudletHomeDir()}/myPkgName/helpfile") -- cecho a file from your pkg to a miniconsole
-function echofile.cechoFilef(window, filename)
-  local options = getOptions("c", true, window, filename)
-  return xechoFile(options)
-end
-
---- reads the contents of a file and then dechos it
----@param window string: Optional window to decho to
----@param filename string: Full path to file
----@see echofile.f
----@see echofile.cechoFile
-function echofile.dechoFile(window, filename)
-  local options = getOptions("d", false, window, filename)
-  return xechoFile(options)
-end
-
---- reads the contents of a file, interpolates it as per echofile.f and then dechos it
----@param window string: Optional window to decho to
----@param filename string: Full path to file
----@see echofile.f
----@see echofile.cechoFile
-function echofile.dechoFilef(window, filename)
-  local options = getOptions("d", true, window, filename)
-  return xechoFile(options)
-end
-
---- reads the contents of a file and then hechos it
----@param window string: Optional window to hecho to
----@param filename string: Full path to file
----@see echofile.f
----@see echofile.cechoFile
-function echofile.hechoFile(window, filename)
-  local options = getOptions("h", false, window, filename)
-  return xechoFile(options)
-end
-
---- reads the contents of a file, interpolates it as per echofile.f and then hechos it
----@param window string: Optional window to hecho to
----@param filename string: Full path to file
----@see echofile.f
----@see echofile.cechoFile
-function echofile.hechoFilef(window, filename)
-  local options = getOptions("h", true, window, filename)
-  return xechoFile(options)
-end
-
---- reads the contents of a file, interpolates it as per echofile.f and then echos it
----@param window string: Optional window to echo to
----@param filename string: Full path to file
----@see echofile.f
----@see echofile.cechoFile
-function echofile.echoFile(window, filename)
-  local options = getOptions("", false, window, filename)
-  return xechoFile(options)
-end
-
---- reads the contents of a file, interpolates it as per echofile.f and then echos it
----@param window string: Optional window to echo to
----@param filename string: Full path to file
----@see echofile.f
----@see echofile.cechoFile
-function echofile.echoFilef(window, filename)
-  local options = getOptions("", true, window, filename)
-  return xechoFile(options)
-end
-
---- Adds c/d/h/echoFile functions to Geyser miniconsole and userwindow objects
----@usage require("MDK.echofile").patchGeyser()
---- myMC = Geyser.MiniConsole:new({name = "myMC"})
---- myMC:cechoFile(f"{getMudletHomeDir()}/helpfile")
-function echofile.patchGeyser()
-  if Geyser.MiniConsole.echoFile then
-    return
-  end
-  function Geyser.MiniConsole:echoFile(filename)
-    return echofile.echoFile(self.name, filename)
-  end
-  function Geyser.MiniConsole:echoFilef(filename)
-    return echofile.echoFilef(self.name, filename)
-  end
-  function Geyser.MiniConsole:aechoFile(filename)
-    return echofile.aechoFile(self.name, filename)
-  end
-  function Geyser.MiniConsole:aechoFilef(filename)
-    return echofile.aechoFilef(self.name, filename)
-  end
-  function Geyser.MiniConsole:cechoFile(filename)
-    return echofile.cechoFile(self.name, filename)
-  end
-  function Geyser.MiniConsole:cechoFilef(filename)
-    return echofile.cechoFilef(self.name, filename)
-  end
-  function Geyser.MiniConsole:dechoFile(filename)
-    return echofile.dechoFile(self.name, filename)
-  end
-  function Geyser.MiniConsole:dechoFilef(filename)
-    return echofile.dechoFilef(self.name, filename)
-  end
-  function Geyser.MiniConsole:hechoFile(filename)
-    return echofile.hechoFile(self.name, filename)
-  end
-  function Geyser.MiniConsole:hechoFilef(filename)
-    return echofile.hechoFilef(self.name, filename)
-  end
-end
-
---- Installs c/d/h/echoFile and f to the global namespace, and adds functions to Geyser
----@usage require("MDK.echofile").installGlobal()
---- f"{1+2}" -- returns "2"
---- dechoFile(f"{getMudletHomeDir()}/fileWithDechoLines.txt")
---- -- reads contents of fileWithDechoLines.txt from profile directory
---- -- and dechos them to the main console
-function echofile.installGlobal()
-  _G.f = f
-  _G.echoFile = echofile.echoFile
-  _G.echoFilef = echofile.echoFilef
-  _G.aechoFile = echofile.aechoFile
-  _G.aechoFilef = echofile.aechoFilef
-  _G.cechoFile = echofile.cechoFile
-  _G.cechoFilef = echofile.cechoFilef
-  _G.dechoFile = echofile.dechoFile
-  _G.dechoFilef = echofile.dechoFilef
-  _G.hechoFile = echofile.hechoFile
-  _G.hechoFilef = echofile.hechoFilef
-  echofile.patchGeyser()
-end
-
-return echofile
- - -
-
-
-generated by LDoc 1.5.0 -Last updated 2023-05-29 18:41:27 -
-
- - diff --git a/src/resources/MDK/doc/source/emco.lua.html b/src/resources/MDK/doc/source/emco.lua.html deleted file mode 100755 index d74c92e..0000000 --- a/src/resources/MDK/doc/source/emco.lua.html +++ /dev/null @@ -1,2452 +0,0 @@ - - - - - Reference - - - - -
- -
- -
-
-
- - -
- - - - - - -
- -

emco.lua

-
---- Embeddable Multi Console Object.
--- This is essentially YATCO, but with some tweaks, updates, and it returns an object
--- similar to Geyser so that you can a.) have multiple of them and b.) easily embed it
--- into your existing UI as you would any other Geyser element.
--- @classmod EMCO
--- @author Damian Monogue <demonnic@gmail.com>
--- @copyright 2020 Damian Monogue
--- @copyright 2021 Damian Monogue
--- @license MIT, see LICENSE.lua
-local EMCO = Geyser.Container:new({
-  name = "TabbedConsoleClass",
-  timestampExceptions = {},
-  path = "|h/log/|E/|y/|m/|d/",
-  fileName = "|N.|e",
-  bufferSize = "100000",
-  deleteLines = "1000",
-  blinkTime = 3,
-  tabFontSize = 8,
-  tabAlignment = "c",
-  fontSize = 9,
-  activeTabCSS = "",
-  inactiveTabCSS = "",
-  activeTabFGColor = "purple",
-  inactiveTabFGColor = "white",
-  activeTabBGColor = "<0,180,0>",
-  inactiveTabBGColor = "<60,60,60>",
-  consoleColor = "black",
-  tabBoxCSS = "",
-  tabBoxColor = "black",
-  consoleContainerCSS = "",
-  consoleContainerColor = "black",
-  tabHeight = 25,
-  leftMargin = 0,
-  rightMargin = 0,
-  topMargin = 0,
-  bottomMargin = 0,
-  gap = 1,
-  wrapAt = 300,
-  autoWrap = true,
-  logExclusions = {},
-  logFormat = "h",
-  gags = {},
-  notifyTabs = {},
-  notifyWithFocus = false,
-  cmdLineStyleSheet = [[
-    QPlainTextEdit {
-      border: 1px solid grey;
-    }
-  ]]
-})
-
--- patch Geyser.MiniConsole if it does not have its own display method defined
-if Geyser.MiniConsole.display == Geyser.display then
-  function Geyser.MiniConsole:display(...)
-    local arg = {...}
-    arg.n = table.maxn(arg)
-    if arg.n > 1 then
-      for i = 1, arg.n do
-        self:display(arg[i])
-      end
-    else
-      self:echo((prettywrite(arg[1], '  ') or 'nil') .. '\n')
-    end
-  end
-end
-
-local pathOfThisFile = (...):match("(.-)[^%.]+$")
-local ok, content = pcall(require, pathOfThisFile .. "loggingconsole")
-local LC
-if ok then
-  LC = content
-else
-  debugc("EMCO tried to require loggingconsole but could not because: " .. content)
-end
---- Creates a new Embeddable Multi Console Object.
--- <br>see https://github.com/demonnic/EMCO/wiki for information on valid constraints and defaults
--- @tparam table cons table of constraints which configures the EMCO.
--- <table class="tg">
--- <thead>
---   <tr>
---     <th>option name</th>
---     <th>description</th>
---     <th>default</th>
---   </tr>
--- </thead>
--- <tbody>
---   <tr>
---     <td class="tg-1">timestamp</td>
---     <td class="tg-1">display timestamps on the miniconsoles?</td>
---     <td class="tg-1">false</td>
---   </tr>
---   <tr>
---     <td class="tg-2">blankLine</td>
---     <td class="tg-2">put a blank line between appends/echos?</td>
---     <td class="tg-2">false</td>
---   </tr>
---   <tr>
---     <td class="tg-1">scrollbars</td>
---     <td class="tg-1">enable scrollbars for the miniconsoles?</td>
---     <td class="tg-1">false</td>
---   </tr>
---   <tr>
---     <td class="tg-2">customTimestampColor</td>
---     <td class="tg-2">if showing timestamps, use a custom color?</td>
---     <td class="tg-2">false</td>
---   </tr>
---   <tr>
---     <td class="tg-1">mapTab</td>
---     <td class="tg-1">should we attach the Mudlet Mapper to this EMCO?</td>
---     <td class="tg-1">false</td>
---   </tr>
---   <tr>
---     <td class="tg-2">mapTabName</td>
---     <td class="tg-2">Which tab should we attach the map to?
---                     <br>If mapTab is true and you do not set this, it will throw an error</td>
---     <td class="tg-2"></td>
---   </tr>
---   <tr>
---     <td class="tg-1">blinkFromAll</td>
---     <td class="tg-1">should tabs still blink, even if you're on the 'all' tab?</td>
---     <td class="tg-1">false</td>
---   </tr>
---   <tr>
---     <td class="tg-2">preserveBackground</td>
---     <td class="tg-2">preserve the miniconsole background color during append()?</td>
---     <td class="tg-2">false</td>
---   </tr>
---   <tr>
---     <td class="tg-1">gag</td>
---     <td class="tg-1">when running :append(), should we also gag the line?</td>
---     <td class="tg-1">false</td>
---   </tr>
---   <tr>
---     <td class="tg-2">timestampFormat</td>
---     <td class="tg-2">Format string for the timestamp. Uses getTime()</td>
---     <td class="tg-2">"HH:mm:ss"</td>
---   </tr>
---   <tr>
---     <td class="tg-1">timestampBGColor</td>
---     <td class="tg-1">Custom BG color to use for timestamps. Any valid Geyser.Color works.</td>
---     <td class="tg-1">"blue"</td>
---   </tr>
---   <tr>
---     <td class="tg-2">timestampFGColor</td>
---     <td class="tg-2">Custom FG color to use for timestamps. Any valid Geyser.Color works</td>
---     <td class="tg-2">"red"</td>
---   </tr>
---   <tr>
---     <td class="tg-1">allTab</td>
---     <td class="tg-1">Should we send everything to an 'all' tab?</td>
---     <td class="tg-1">false</td>
---   </tr>
---   <tr>
---     <td class="tg-2">allTabName</td>
---     <td class="tg-2">And which tab should we use for the 'all' tab?</td>
---     <td class="tg-2">"All"</td>
---   </tr>
---   <tr>
---     <td class="tg-1">blink</td>
---     <td class="tg-1">Should we blink tabs that have been written to since you looked at them?</td>
---     <td class="tg-1">false</td>
---   </tr>
---   <tr>
---     <td class="tg-2">blinkTime</td>
---     <td class="tg-2">How long to wait between blinks, in seconds?</td>
---     <td class="tg-2">3</td>
---   </tr>
---   <tr>
---     <td class="tg-1">fontSize</td>
---     <td class="tg-1">What font size to use for the miniconsoles?</td>
---     <td class="tg-1">9</td>
---   </tr>
---   <tr>
---     <td class="tg-2">font</td>
---     <td class="tg-2">What font to use for the miniconsoles?</td>
---     <td class="tg-2"></td>
---   </tr>
---   <tr>
---     <td class="tg-1">tabFont</td>
---     <td class="tg-1">What font to use for the tabs?</td>
---     <td class="tg-1"></td>
---   </tr>
---   <tr>
---     <td class="tg-2">activeTabCss</td>
---     <td class="tg-2">What css to use for the active tab?</td>
---     <td class="tg-2">""</td>
---   </tr>
---   <tr>
---     <td class="tg-1">inactiveTabCSS</td>
---     <td class="tg-1">What css to use for the inactive tabs?</td>
---     <td class="tg-1">""</td>
---   </tr>
---   <tr>
---     <td class="tg-2">activeTabFGColor</td>
---     <td class="tg-2">What color to use for the text on the active tab. Any Geyser.Color works.</td>
---     <td class="tg-2">"purple"</td>
---   </tr>
---   <tr>
---     <td class="tg-1">inactiveTabFGColor</td>
---     <td class="tg-1">What color to use for the text on the inactive tabs. Any Geyser.Color works.</td>
---     <td class="tg-1">"white"</td>
---   </tr>
---   <tr>
---     <td class="tg-2">activeTabBGColor</td>
---     <td class="tg-2">What BG color to use for the active tab? Any Geyser.Color works. Overriden by activeTabCSS</td>
---     <td class="tg-2">"<0,180,0>"</td>
---   </tr>
---   <tr>
---     <td class="tg-1">inactiveTabBGColor</td>
---     <td class="tg-1">What BG color to use for the inactavie tabs? Any Geyser.Color works. Overridden by inactiveTabCSS</td>
---     <td class="tg-1">"<60,60,60>"</td>
---   </tr>
---   <tr>
---     <td class="tg-2">consoleColor</td>
---     <td class="tg-2">Default background color for the miniconsoles. Any Geyser.Color works</td>
---     <td class="tg-2">"black"</td>
---   </tr>
---   <tr>
---     <td class="tg-1">tabBoxCSS</td>
---     <td class="tg-1">tss for the entire tabBox (not individual tabs)</td>
---     <td class="tg-1">""</td>
---   </tr>
---   <tr>
---     <td class="tg-2">tabBoxColor</td>
---     <td class="tg-2">What color to use for the tabBox? Any Geyser.Color works. Overridden by tabBoxCSS</td>
---     <td class="tg-2">"black"</td>
---   </tr>
---   <tr>
---     <td class="tg-1">consoleContainerCSS</td>
---     <td class="tg-1">CSS to use for the container holding the miniconsoles</td>
---     <td class="tg-1">""</td>
---   </tr>
---   <tr>
---     <td class="tg-2">consoleContainerColor</td>
---     <td class="tg-2">Color to use for the container holding the miniconsole. Any Geyser.Color works. Overridden by consoleContainerCSS</td>
---     <td class="tg-2">"black"</td>
---   </tr>
---   <tr>
---     <td class="tg-1">gap</td>
---     <td class="tg-1">How many pixels to place between the tabs and the miniconsoles?</td>
---     <td class="tg-1">1</td>
---   </tr>
---   <tr>
---     <td class="tg-2">consoles</td>
---     <td class="tg-2">List of the tabs for this EMCO in table format</td>
---     <td class="tg-2">{ "All" }</td>
---   </tr>
---   <tr>
---     <td class="tg-1">allTabExclusions</td>
---     <td class="tg-1">List of the tabs which should never echo to the 'all' tab in table format</td>
---     <td class="tg-1">{}</td>
---   </tr>
---   <tr>
---     <td class="tg-2">tabHeight</td>
---     <td class="tg-2">How many pixels high should the tabs be?</td>
---     <td class="tg-2">25</td>
---   </tr>
---   <tr>
---     <td class="tg-1">autoWrap</td>
---     <td class="tg-1">Use autoWrap for the miniconsoles?</td>
---     <td class="tg-1">true</td>
---   </tr>
---   <tr>
---     <td class="tg-2">wrapAt</td>
---     <td class="tg-2">How many characters to wrap it, if autoWrap is turned off?</td>
---     <td class="tg-2">300</td>
---   </tr>
---   <tr>
---     <td class="tg-1">leftMargin</td>
---     <td class="tg-1">Number of pixels to put between the left edge of the EMCO and the miniconsole?</td>
---     <td class="tg-1">0</td>
---   </tr>
---   <tr>
---     <td class="tg-2">rightMargin</td>
---     <td class="tg-2">Number of pixels to put between the right edge of the EMCO and the miniconsole?</td>
---     <td class="tg-2">0</td>
---   </tr>
---   <tr>
---     <td class="tg-1">bottomMargin</td>
---     <td class="tg-1">Number of pixels to put between the bottom edge of the EMCO and the miniconsole?</td>
---     <td class="tg-1">0</td>
---   </tr>
---   <tr>
---     <td class="tg-2">topMargin</td>
---     <td class="tg-2">Number of pixels to put between the top edge of the miniconsole container, and the miniconsole? This is in addition to gap</td>
---     <td class="tg-2">0</td>
---   </tr>
---   <tr>
---     <td class="tg-1">timestampExceptions</td>
---     <td class="tg-1">Table of tabnames which should not get timestamps even if timestamps are turned on</td>
---     <td class="tg-1">{}</td>
---   </tr>
---   <tr>
---     <td class="tg-2">tabFontSize</td>
---     <td class="tg-2">Font size for the tabs</td>
---     <td class="tg-2">8</td>
---   </tr>
---   <tr>
---     <td class="tg-1">tabBold</td>
---     <td class="tg-1">Should the tab text be bold? Boolean value</td>
---     <td class="tg-1">false</td>
---   </tr>
---   <tr>
---     <td class="tg-2">tabItalics</td>
---     <td class="tg-2">Should the tab text be italicized?</td>
---     <td class="tg-2">false</td>
---   </tr>
---   <tr>
---     <td class="tg-1">tabUnderline</td>
---     <td class="tg-1">Should the tab text be underlined?</td>
---     <td class="tg-1">false</td>
---   </tr>
---   <tr>
---     <td class="tg-2">tabAlignment</td>
---     <td class="tg-2">Valid alignments are 'c', 'center', 'l', 'left', 'r', 'right', or '' to not include the alignment as part of the echo (to allow the stylesheet to handle it)</td>
---     <td class="tg-2">'c'</td>
---   </tr>
---   <tr>
---     <td class="tg-1">commandLine</td>
---     <td class="tg-1">Should we enable commandlines for the miniconsoles?</td>
---     <td class="tg-1">false</td>
---   </tr>
---   <tr>
---     <td class="tg-2">cmdActions</td>
---     <td class="tg-2">A table with console names as keys, and values which are templates for the command to send. see the setCustomCommandline function for more</td>
---     <td class="tg-2">{}</td>
---   </tr>
---   <tr>
---     <td class="tg-1">cmdLineStyleSheet</td>
---     <td class="tg-1">What stylesheet to use for the command lines.</td>
---     <td class="tg-1">"QPlainTextEdit {\n      border: 1px solid grey;\n    }\n"</td>
---   </tr>
---   <tr>
---     <td class="tg-2">backgroundImages</td>
---     <td class="tg-2">A table containing definitions for the background images. Each entry should have a key the same name as the tab it applies to, with entries "image" which is the path to the image file,<br>and "mode" which determines how it is displayed. "border" stretches, "center" center, "tile" tiles, and "style". See Mudletwikilink for details.</td>
---     <td class="tg-2">{}</td>
---   </tr>
---   <tr>
---     <td class="tg-1">bufferSize</td>
---     <td class="tg-1">Number of lines of scrollback to keep for the miniconsoles</td>
---     <td class="tg-1">100000</td>
---   </tr>
---   <tr>
---     <td class="tg-2">deleteLines</td>
---     <td class="tg-2">Number of lines to delete if a console's buffer fills up.</td>
---     <td class="tg-2">1000</td>
---   </tr>
---   <tr>
---     <td class="tg-1">gags</td>
---     <td class="tg-1">A table of Lua patterns you wish to gag from being added to the EMCO. Useful for removing mob says and such example: {[[^A green leprechaun says, ".*"$]], "^Bob The Dark Lord of the Keep mutters darkly to himself.$"} see <a href="http://lua-users.org/wiki/PatternsTutorial">this tutorial</a> on Lua patterns for more information.</td>
---     <td class="tg-1">{}</td>
---   </tr>
---   <tr>
---     <td class="tg-2">notifyTabs</td>
---     <td class="tg-2">Tables containing the names of all tabs you want to send notifications. IE {"Says", "Tells", "Org"}</td>
---     <td class="tg-2">{}</td>
---   </tr>
---   <tr>
---     <td class="tg-1">notifyWithFocus</td>
---     <td class="tg-1">If true, EMCO will send notifications even if Mudlet has focus. If false, it will only send them when Mudlet does NOT have focus.</td>
---     <td class="tg-1">false</td>
---   </tr>
--- </tbody>
--- </table>
--- @tparam GeyserObject container The container to use as the parent for the EMCO
--- @return the newly created EMCO
-function EMCO:new(cons, container)
-  local funcName = "EMCO:new(cons, container)"
-  cons = cons or {}
-  cons.type = cons.type or "tabbedConsole"
-  cons.consoles = cons.consoles or {"All"}
-  if cons.mapTab then
-    if not type(cons.mapTabName) == "string" then
-      self:ce(funcName, [["mapTab" is true, thus constraint "mapTabName" as string expected, got ]] .. type(cons.mapTabName))
-    elseif not table.contains(cons.consoles, cons.mapTabName) then
-      self:ce(funcName, [["mapTabName" must be one of the consoles contained within constraint "consoles". Valid option for tha mapTab are: ]] ..
-                table.concat(cons.consoles, ","))
-    end
-  end
-  cons.allTabExclusions = cons.allTabExclusions or {}
-  if not type(cons.allTabExclusions) == "table" then
-    self:se(funcName, "allTabExclusions must be a table if it is provided")
-  end
-  local me = self.parent:new(cons, container)
-  setmetatable(me, self)
-  self.__index = self
-  -- set some defaults. Almost all the defaults we had for YATCO, plus a few new ones
-  me.cmdActions = cons.cmdActions or {}
-  if not type(me.cmdActions) == "table" then
-    self:se(funcName, "cmdActions must be a table if it is provided")
-  end
-  me.backgroundImages = cons.backgroundImages or {}
-  if not type(me.backgroundImages) == "table" then
-    self:se(funcName, "backgroundImages must be a table if provided.")
-  end
-  if me:fuzzyBoolean(cons.timestamp) then
-    me:enableTimestamp()
-  else
-    me:disableTimestamp()
-  end
-  if me:fuzzyBoolean(cons.customTimestampColor) then
-    me:enableCustomTimestampColor()
-  else
-    me:disableCustomTimestampColor()
-  end
-  if me:fuzzyBoolean(cons.mapTab) then
-    me.mapTab = true
-  else
-    me.mapTab = false
-  end
-  if me:fuzzyBoolean(cons.blinkFromAll) then
-    me:enableBlinkFromAll()
-  else
-    me:disableBlinkFromAll()
-  end
-  if me:fuzzyBoolean(cons.preserveBackground) then
-    me:enablePreserveBackground()
-  else
-    me:disablePreserveBackground()
-  end
-  if me:fuzzyBoolean(cons.gag) then
-    me:enableGag()
-  else
-    me:disableGag()
-  end
-  me:setTimestampFormat(cons.timestampFormat or "HH:mm:ss")
-  me:setTimestampBGColor(cons.timestampBGColor or "blue")
-  me:setTimestampFGColor(cons.timestampFGColor or "red")
-  if me:fuzzyBoolean(cons.allTab) then
-    me:enableAllTab(cons.allTab)
-  else
-    me:disableAllTab()
-  end
-  if me:fuzzyBoolean(cons.blink) then
-    me:enableBlink()
-  else
-    me:disableBlink()
-  end
-  if me:fuzzyBoolean(cons.blankLine) then
-    me:enableBlankLine()
-  else
-    me:disableBlankLine()
-  end
-  if me:fuzzyBoolean(cons.scrollbars) then
-    me.scrollbars = true
-  else
-    me.scrollbars = false
-  end
-  me.tabUnderline = me:fuzzyBoolean(cons.tabUnderline) and true or false
-  me.tabBold = me:fuzzyBoolean(cons.tabBold) and true or false
-  me.tabItalics = me:fuzzyBoolean(cons.tabItalics) and true or false
-  me.commandLine = me:fuzzyBoolean(cons.commandLine) and true or false
-  me.consoles = cons.consoles
-  me.font = cons.font
-  me.tabFont = cons.tabFont
-  me.currentTab = ""
-  me.tabs = {}
-  me.tabsToBlink = {}
-  me.mc = {}
-  if me.blink then
-    me:enableBlink()
-  end
-  me.gags = {}
-  for _,pattern in ipairs(cons.gags or {}) do
-    me:addGag(pattern)
-  end
-  for _,tname in ipairs(cons.notifyTabs or {}) do
-    me:addNotifyTab(tname)
-  end
-  if me:fuzzyBoolean(cons.notifyWithFocus) then
-    self:enableNotifyWithFocus()
-  end
-  me:reset()
-  if me.allTab then
-    me:setAllTabName(me.allTabName or me.consoles[1])
-  end
-  return me
-end
-
-function EMCO:readYATCO()
-  local config
-  if demonnic and demonnic.chat and demonnic.chat.config then
-    config = demonnic.chat.config
-  else
-    cecho("<white>(<blue>EMCO<white>)<reset> Could not find demonnic.chat.config, nothing to convert\n")
-    return
-  end
-  local constraints = "EMCO:new({\n"
-  constraints = string.format("%s  x = %d,\n", constraints, demonnic.chat.container.get_x())
-  constraints = string.format("%s  y = %d,\n", constraints, demonnic.chat.container.get_y())
-  constraints = string.format("%s  width = %d,\n", constraints, demonnic.chat.container.get_width())
-  constraints = string.format("%s  height = %d,\n", constraints, demonnic.chat.container.get_height())
-  if config.timestamp then
-    constraints = string.format("%s  timestamp = true,\n  timestampFormat = \"%s\",\n", constraints, config.timestamp)
-  else
-    constraints = string.format("%s  timestamp = false,\n", constraints)
-  end
-  if config.timestampColor then
-    constraints = string.format("%s  customTimestampColor = true,\n", constraints)
-  else
-    constraints = string.format("%s  customTimestampColor = false,\n", constraints)
-  end
-  if config.timestampFG then
-    constraints = string.format("%s  timestampFGColor = \"%s\",\n", constraints, config.timestampFG)
-  end
-  if config.timestampBG then
-    constraints = string.format("%s  timestampBGColor = \"%s\",\n", constraints, config.timestampBG)
-  end
-  if config.channels then
-    local channels = "consoles = {\n"
-    for _, channel in ipairs(config.channels) do
-      if _ == #config.channels then
-        channels = string.format("%s    \"%s\"", channels, channel)
-      else
-        channels = string.format("%s    \"%s\",\n", channels, channel)
-      end
-    end
-    channels = string.format("%s\n  },\n", channels)
-    constraints = string.format([[%s  %s]], constraints, channels)
-  end
-  if config.Alltab then
-    constraints = string.format("%s  allTab = true,\n", constraints)
-    constraints = string.format("%s  allTabName = \"%s\",\n", constraints, config.Alltab)
-  else
-    constraints = string.format("%s  allTab = false,\n", constraints)
-  end
-  if config.Maptab and config.Maptab ~= "" then
-    constraints = string.format("%s  mapTab = true,\n", constraints)
-    constraints = string.format("%s  mapTabName = \"%s\",\n", constraints, config.Maptab)
-  else
-    constraints = string.format("%s  mapTab = false,\n", constraints)
-  end
-  constraints = string.format("%s  blink = %s,\n", constraints, tostring(config.blink))
-  constraints = string.format("%s  blinkFromAll = %s,\n", constraints, tostring(config.blinkFromAll))
-  if config.fontSize then
-    constraints = string.format("%s  fontSize = %d,\n", constraints, config.fontSize)
-  end
-  constraints = string.format("%s  preserveBackground = %s,\n", constraints, tostring(config.preserveBackground))
-  constraints = string.format("%s  gag = %s,\n", constraints, tostring(config.gag))
-  constraints = string.format("%s  activeTabBGColor = \"<%s,%s,%s>\",\n", constraints, config.activeColors.r, config.activeColors.g,
-                              config.activeColors.b)
-  constraints = string.format("%s  inactiveTabBGColor = \"<%s,%s,%s>\",\n", constraints, config.inactiveColors.r, config.inactiveColors.g,
-                              config.inactiveColors.b)
-  constraints =
-    string.format("%s  consoleColor = \"<%s,%s,%s>\",\n", constraints, config.windowColors.r, config.windowColors.g, config.windowColors.b)
-  constraints = string.format("%s  activeTabFGColor = \"%s\",\n", constraints, config.activeTabText)
-  constraints = string.format("%s  inactiveTabFGColor = \"%s\"", constraints, config.inactiveTabText)
-  constraints = string.format("%s\n})", constraints)
-  return constraints
-end
-
---- Scans for the old YATCO configuration values and prints out a set of constraints to use.
--- with EMCO to achieve the same effect. Is just the invocation
-function EMCO:miniConvertYATCO()
-  local constraints = self:readYATCO()
-  cecho(
-    "<white>(<blue>EMCO<white>)<reset> Found a YATCO config. Here are the constraints to use with EMCO(x,y,width, and height have been converted to their absolute values):\n\n")
-  echo(constraints .. "\n")
-end
-
---- Echos to the main console a script object you can add which will fully convert YATCO to EMCO.
--- This replaces the demonnic.chat variable with a newly created EMCO object, so that the main
--- functions used to place information on the consoles (append(), cecho(), etc) should continue to
--- work in the user's triggers and events.
-function EMCO:convertYATCO()
-  local invocation = self:readYATCO()
-  local header = [[
-  <white>(<blue>EMCO<white>)<reset> Found a YATCO config. Make a new script, then copy and paste the following output into it.
-  <white>(<blue>EMCO<white>)<reset> Afterward, uninstall YATCO (you can leave YATCOConfig until you're sure everything is right) and restart Mudlet
-  <white>(<blue>EMCO<white>)<reset> If everything looks right, you can uninstall YATCOConfig.
-
-
--- Copy everything below this line until the next line starting with --
-demonnic = demonnic or {}
-demonnic.chat = ]]
-  cecho(string.format("%s%s\n--- End script\n", header, invocation))
-end
-
-function EMCO:checkTabPosition(position)
-  if position == nil then
-    return 0
-  end
-  return tonumber(position) or type(position)
-end
-
-function EMCO:checkTabName(tabName)
-  if not tostring(tabName) then
-    return "tabName as string expected, got" .. type(tabName)
-  end
-  tabName = tostring(tabName)
-  if table.contains(self.consoles, tabName) then
-    return "tabName must be unique, and we already have a tab named " .. tabName
-  else
-    return "clear"
-  end
-end
-
-function EMCO.ae(funcName, message)
-  error(string.format("%s: Argument Error: %s", funcName, message))
-end
-
-function EMCO:ce(funcName, message)
-  error(string.format("%s:gg Constraint Error: %s", funcName, message))
-end
-
---- Display the contents of one or more variables to an EMCO tab. like display() but targets the miniconsole
--- @tparam string tabName the name of the tab you want to display to
--- @param tabName string the tab to displayu to
--- @param item any The thing to display()
--- @param[opt] any item2 another thing to display()
-function EMCO:display(tabName, ...)
-  local funcName = "EMCO:display(tabName, item)"
-  if not table.contains(self.consoles, tabName) then
-    self.ae(funcName, "tabName must be a tab which exists in this EMCO. valid options are: " .. table.concat(self.consoles, ","))
-  end
-  self.mc[tabName]:display(...)
-end
-
---- Remove a tab from the EMCO
--- @param tabName string the name of the tab you want to remove from the EMCO
-function EMCO:removeTab(tabName)
-  local funcName = "EMCO:removeTab(tabName)"
-  if not table.contains(self.consoles, tabName) then
-    self.ae(funcName, "tabName must be a tab which exists in this EMCO. valid options are: " .. table.concat(self.consoles, ","))
-  end
-  if self.currentTab == tabName then
-    if self.allTab and self.allTabName then
-      self:switchTab(self.allTabName)
-    else
-      self:switchTab(self.consoles[1])
-    end
-  end
-  table.remove(self.consoles, table.index_of(self.consoles, tabName))
-  local window = self.mc[tabName]
-  local tab = self.tabs[tabName]
-  window:hide()
-  tab:hide()
-  self.tabBox:remove(tab)
-  self.tabBox:organize()
-  self.consoleContainer:remove(window)
-  self.mc[tabName] = nil
-  self.tabs[tabName] = nil
-end
-
---- Adds a tab to the EMCO object
--- @tparam string tabName the name of the tab to add
--- @tparam[opt] number position position in the tab switcher to put this tab
-function EMCO:addTab(tabName, position)
-  local funcName = "EMCO:addTab(tabName, position)"
-  position = self:checkTabPosition(position)
-  if type(position) == "string" then
-    self.ae(funcName, "position as number expected, got " .. position)
-  end
-  local tabCheck = self:checkTabName(tabName)
-  if tabCheck ~= "clear" then
-    self.ae(funcName, tabCheck)
-  end
-  if position == 0 then
-    table.insert(self.consoles, tabName)
-    self:createComponentsForTab(tabName)
-  else
-    table.insert(self.consoles, position, tabName)
-    self:reset()
-  end
-end
-
---- Switches the active, visible tab of the EMCO to tabName
--- @param tabName string the name of the tab to show
-function EMCO:switchTab(tabName)
-  local oldTab = self.currentTab
-  self.currentTab = tabName
-  if oldTab ~= tabName and oldTab ~= "" then
-    self.mc[oldTab]:hide()
-    self:adjustTabBackground(oldTab)
-    self.tabs[oldTab]:echo(oldTab, self.inactiveTabFGColor)
-    if self.blink then
-      if self.allTab and tabName == self.allTabName then
-        self.tabsToBlink = {}
-      elseif self.tabsToBlink[tabName] then
-        self.tabsToBlink[tabName] = nil
-      end
-    end
-  end
-  self:adjustTabBackground(tabName)
-  self.tabs[tabName]:echo(tabName, self.activeTabFGColor)
-  -- if oldTab and self.mc[oldTab] then
-  --   self.mc[oldTab]:hide()
-  -- end
-  self.mc[tabName]:show()
-  if oldTab ~= tabName then
-    raiseEvent("EMCO tab change", self.name, oldTab, tabName)
-  end
-end
-
---- Cycles between the tabs in order
--- @tparam boolean reverse Defaults to false. When true, moves backward through the tab list rather than forward.
-function EMCO:cycleTab(reverse)
-  -- add the property to demonnic.chat
-  local consoles = self.consoles
-  local cycleIndex = table.index_of(consoles, self.currentTab)
-
-  local maxIndex = #consoles
-  cycleIndex = reverse and cycleIndex - 1 or cycleIndex + 1
-  if cycleIndex > maxIndex then cycleIndex = 1 end
-  if cycleIndex < 1 then cycleIndex = maxIndex end
-  self:switchTab(consoles[cycleIndex])
-end
-
-function EMCO:createComponentsForTab(tabName)
-  local tab = Geyser.Label:new({name = string.format("%sTab%s", self.name, tabName)}, self.tabBox)
-  if self.tabFont then
-    tab:setFont(self.tabFont)
-  end
-  tab:setAlignment(self.tabAlignment)
-  tab:setFontSize(self.tabFontSize)
-  tab:setItalics(self.tabItalics)
-  tab:setBold(self.tabBold)
-  tab:setUnderline(self.tabUnderline)
-  tab:setClickCallback(self.switchTab, self, tabName)
-  self.tabs[tabName] = tab
-  self:adjustTabBackground(tabName)
-  tab:echo(tabName, self.inactiveTabFGColor)
-  local window
-  local windowConstraints = {
-    x = self.leftMargin,
-    y = self.topMargin,
-    height = string.format("-%dpx", self.bottomMargin),
-    width = string.format("-%dpx", self.rightMargin),
-    name = string.format("%sWindow%s", self.name, tabName),
-    commandLine = self.commandLine,
-    cmdLineStyleSheet = self.cmdLineStyleSheet,
-    path = self:processTemplate(self.path, tabName),
-    fileName = self:processTemplate(self.fileName, tabName),
-    logFormat = self.logFormat
-  }
-  if table.contains(self.logExclusions, tabName) then
-    windowConstraints.log = false
-  end
-  local parent = self.consoleContainer
-  local mapTab = self.mapTab and tabName == self.mapTabName
-  if mapTab then
-    window = Geyser.Mapper:new(windowConstraints, parent)
-  else
-    if LC then
-      window = LC:new(windowConstraints, parent)
-    else
-      window = Geyser.MiniConsole:new(windowConstraints, parent)
-    end
-    if self.font then
-      window:setFont(self.font)
-    end
-    window:setFontSize(self.fontSize)
-    window:setColor(self.consoleColor)
-    if self.autoWrap then
-      window:enableAutoWrap()
-    else
-      window:setWrap(self.wrapAt)
-    end
-    if self.scrollbars then
-      window:enableScrollBar()
-    else
-      window:disableScrollBar()
-    end
-    window:setBufferSize(self.bufferSize, self.deleteLines)
-  end
-  self.mc[tabName] = window
-  if not mapTab then
-    self:setCmdAction(tabName, nil)
-  end
-  window:hide()
-  self:processImage(tabName)
-  self:switchTab(tabName)
-end
-
---- Sets the buffer size and number of lines to delete for all managed miniconsoles.
---- @tparam number bufferSize number of lines of scrollback to maintain in the miniconsoles. Uses current value if nil is passed
---- @tparam number deleteLines number of line to delete if the buffer filles up. Uses current value if nil is passed
-function EMCO:setBufferSize(bufferSize, deleteLines)
-  bufferSize = bufferSize or self.bufferSize
-  deleteLines = deleteLines or self.deleteLines
-  self.bufferSize = bufferSize
-  self.deleteLines = deleteLines
-  for tabName, window in pairs(self.mc) do
-    local mapTab = self.mapTab and tabName == self.mapTabName
-    if not mapTab then
-      window:setBufferSize(bufferSize, deleteLines)
-    end
-  end
-end
-
---- Sets the background image for a tab's console. use EMCO:resetBackgroundImage(tabName) to remove an image.
---- @tparam string tabName the tab to change the background image for.
---- @tparam string imagePath the path to the image file to use.
---- @tparam string mode the mode to use. Will default to "center" if not provided.
-function EMCO:setBackgroundImage(tabName, imagePath, mode)
-  mode = mode or "center"
-  local tabNameType = type(tabName)
-  local imagePathType = type(imagePath)
-  local modeType = type(mode)
-  local funcName = "EMCO:setBackgroundImage(tabName, imagePath, mode)"
-  if tabNameType ~= "string" or not table.contains(self.consoles, tabName) then
-    self.ae(funcName, "tabName must be a string and an existing tab")
-  end
-  if imagePathType ~= "string" or not io.exists(imagePath) then
-    self.ae(funcName, "imagePath must be a string and point to an existing image file")
-  end
-  if modeType ~= "string" or not table.contains({"border", "center", "tile", "style"}, mode) then
-    self.ae(funcName, "mode must be one of 'border', 'center', 'tile', or 'style'")
-  end
-  local image = {image = imagePath, mode = mode}
-  self.backgroundImages[tabName] = image
-  self:processImage(tabName)
-end
-
---- Resets the background image on a tab's console, returning it to the background color
---- @tparam string tabName the tab to change the background image for.
-function EMCO:resetBackgroundImage(tabName)
-  local tabNameType = type(tabName)
-  local funcName = "EMCO:resetBackgroundImage(tabName)"
-  if tabNameType ~= "string" or not table.contains(self.consoles, tabName) then
-    self.ae(funcName, "tabName must be a string and an existing tab")
-  end
-  self.backgroundImages[tabName] = nil
-  self:processImage(tabName)
-end
-
---- Does the work of actually setting/resetting the background image on a tab
---- @tparam string tabName the name of the tab to process the image for.
---- @local
-function EMCO:processImage(tabName)
-  if self.mapTab and tabName == self.mapTabName then
-    return
-  end
-  local image = self.backgroundImages[tabName]
-  local window = self.mc[tabName]
-  if image then
-    if image.image and io.exists(image.image) then
-      window:setBackgroundImage(image.image, image.mode)
-    end
-  else
-    window:resetBackgroundImage()
-  end
-end
-
---- Replays the last numLines lines from the log for tabName
--- @param tabName the name of the tab to replay
--- @param numLines the number of lines to replay
-function EMCO:replay(tabName, numLines)
-  if not LC then
-    return
-  end
-  if self.mapTab and tabName == self.mapTabName then
-    return
-  end
-  numLines = numLines or 10
-  self.mc[tabName]:replay(numLines)
-end
-
---- Replays the last numLines in all miniconsoles
--- @param numLines
-function EMCO:replayAll(numLines)
-  if not LC then
-    return
-  end
-  numLines = numLines or 10
-  for _, tabName in ipairs(self.consoles) do
-    self:replay(tabName, numLines)
-  end
-end
-
---- Formats the string through EMCO's template. |E is replaced with the EMCO's name. |N is replaced with the tab's name.
--- @param str the string to replace tokens in
--- @param tabName optional, if included will be used for |N in the templated string.
-function EMCO:processTemplate(str, tabName)
-  local safeName = self.name:gsub("[<>:'\"?*]", "_")
-  local safeTabName = tabName and tabName:gsub("[<>:'\"?*]", "_") or ""
-  str = str:gsub("|E", safeName)
-  str = str:gsub("|N", safeTabName)
-  return str
-end
-
---- Sets the path for the EMCO for logging
--- @param path the template for the path. @see EMCO:new()
-function EMCO:setPath(path)
-  if not LC then
-    return
-  end
-  path = path or self.path
-  self.path = path
-  path = self:processTemplate(path)
-  for name, window in pairs(self.mc) do
-    if not (self.mapTab and self.mapTabName == name) then
-      window:setPath(path)
-    end
-  end
-end
-
---- Sets the fileName for the EMCO for logging
--- @param fileName the template for the path. @see EMCO:new()
-function EMCO:setFileName(fileName)
-  if not LC then
-    return
-  end
-  fileName = fileName or self.fileName
-  self.fileName = fileName
-  fileName = self:processTemplate(fileName)
-  for name, window in pairs(self.mc) do
-    if not (self.mapTab and self.mapTabName == name) then
-      window:setFileName(fileName)
-    end
-  end
-end
-
---- Sets the stylesheet for command lines in this EMCO
--- @tparam string styleSheet the stylesheet to use for the command line. See https://wiki.mudlet.org/w/Manual:Lua_Functions#setCmdLineStyleSheet for examples
-function EMCO:setCmdLineStyleSheet(styleSheet)
-  self.cmdLineStyleSheet = styleSheet
-  if not styleSheet then
-    return
-  end
-  for _, window in pairs(self.mc) do
-    window:setCmdLineStyleSheet(styleSheet)
-  end
-end
---- Enables the commandLine on the specified tab.
--- @tparam string tabName the name of the tab to turn the commandLine on for
--- @param template the template for the commandline to use, or the function to run when enter is hit.
--- @usage myEMCO:enableCmdLine(tabName, template)
-function EMCO:enableCmdLine(tabName, template)
-  if not table.contains(self.consoles, tabName) then
-    return nil, f"{self.name}:enableCmdLine(tabName,template) tabName is not in the console list. Valid options are {table.concat(self.consoles, 'm')}"
-  end
-  local window = self.mc[tabName]
-  window:enableCommandLine()
-  if self.cmdLineStyleSheet then
-    window:setCmdLineStyleSheet(self.cmdLineStyleSheet)
-  end
-  self:setCmdAction(tabName, template)
-end
-
---- Enables all command lines, using whatever template they may currently have set
-function EMCO:enableAllCmdLines()
-  for _, tabName in ipairs(self.consoles) do
-    self:enableCmdLine(tabName, self.cmdActions[tabName])
-  end
-end
-
---- Disables all commands line, but does not change their template
-function EMCO:disableAllCmdLines()
-  for _, tabName in ipairs(self.consoles) do
-    self:disableCmdLine(tabName)
-  end
-end
-
---- Disables the command line for a particular tab
--- @tparam string tabName the name of the tab to disable the command line of.
-function EMCO:disableCmdLine(tabName)
-  if not table.contains(self.consoles, tabName) then
-    return nil, f"{self.name}:disableCmdLine(tabName,template) tabName is not in the console list. Valid options are {table.concat(self.consoles, 'm')}"
-  end
-  local window = self.mc[tabName]
-  window:disableCommandLine()
-end
-
---- Sets the command action for a tab's command line. Can either be a template string to send where '|t' is replaced by the text sent, or a funnction which takes the text
---- @tparam string tabName the name of the tab to set the command action on
---- @param template the template for the commandline to use, or the function to run when enter is hit.
---- @usage myEMCO:setCmdAction("CT", "ct |t") -- will send everything in the CT tab's command line to CT by doing "ct Hi there!" if you type "Hi there!" in CT's command line
---- @usage myEMCO:setCmdAction("CT", function(txt) send("ct " .. txt) end) -- functionally the same as the above
-function EMCO:setCmdAction(tabName, template)
-  template = template or self.cmdActions[tabName]
-  if template == "" then
-    template = nil
-  end
-  self.cmdActions[tabName] = template
-  local window = self.mc[tabName]
-  if template then
-    if type(template) == "string" then
-      window:setCmdAction(function(txt)
-        txt = template:gsub("|t", txt)
-        send(txt)
-      end)
-    elseif type(template) == "function" then
-      window:setCmdAction(template)
-    else
-      debugc(string.format(
-               "EMCO:setCmdAction(tabName, template): template must be a string or function if provided. Leaving CmdAction for tab %s be. Template type was: %s",
-               tabName, type(template)))
-    end
-  else
-    window:resetCmdAction()
-  end
-end
-
---- Resets the command action for tabName's miniconsole, which makes it work like the normal commandline
---- @tparam string tabName the name of the tab to reset the cmdAction for
-function EMCO:resetCmdAction(tabName)
-  self.cmdActions[tabName] = nil
-  self.mc[tabName]:resetCmdAction()
-end
-
---- Gets the contents of tabName's cmdLine
---- @param tabName the name of the tab to get the commandline of
-function EMCO:getCmdLine(tabName)
-  return self.mc[tabName]:getCmdLine()
-end
-
---- Prints to tabName's command line
---- @param tabName the tab whose command line you want to print to
---- @param txt the text to print to the command line
-function EMCO:printCmd(tabName, txt)
-  return self.mc[tabName]:printCmd(txt)
-end
-
---- Clears tabName's command line
---- @tparam string tabName the tab whose command line you want to clear
-function EMCO:clearCmd(tabName)
-  return self.mc[tabName]:clearCmd()
-end
-
---- Appends text to tabName's command line
---- @tparam string tabName the tab whose command line you want to append to
---- @tparam string txt the text to append to the command line
-function EMCO:appendCmd(tabName, txt)
-  return self.mc[tabName]:appendCmd(txt)
-end
-
---- resets the object, redrawing everything
-function EMCO:reset()
-  self:createContainers()
-  for _, tabName in ipairs(self.consoles) do
-    self:createComponentsForTab(tabName)
-  end
-
-  local default = self.allTabName or self.consoles[1]
-  self:switchTab(default)
-end
-
-function EMCO:createContainers()
-  self.tabBoxLabel = Geyser.Label:new({
-    x = 0,
-    y = 0,
-    width = "100%",
-    height = tostring(tonumber(self.tabHeight) + 2) .. "px",
-    name = self.name .. "TabBoxLabel",
-  }, self)
-  self.tabBox = Geyser.HBox:new({x = 0, y = 0, width = "100%", height = "100%", name = self.name .. "TabBox"}, self.tabBoxLabel)
-  self.tabBoxLabel:setStyleSheet(self.tabBoxCSS)
-  self.tabBoxLabel:setColor(self.tabBoxColor)
-
-  local heightPlusGap = tonumber(self.tabHeight) + tonumber(self.gap)
-  self.consoleContainer = Geyser.Label:new({
-    x = 0,
-    y = tostring(heightPlusGap) .. "px",
-    width = "100%",
-    height = "-0px",
-    name = self.name .. "ConsoleContainer",
-  }, self)
-  self.consoleContainer:setStyleSheet(self.consoleContainerCSS)
-  self.consoleContainer:setColor(self.consoleContainerColor)
-end
-
-function EMCO:stripTimeChars(str)
-  return string.gsub(string.trim(str), '[ThHmMszZaApPdy0-9%-%+:. ]', '')
-end
-
---- Expands boolean definitions to be more flexible.
--- <br>True values are "true", "yes", "0", 0, and true
--- <br>False values are "false", "no", "1", 1, false, and nil
--- @param bool item to test for truthiness
-function EMCO:fuzzyBoolean(bool)
-  if type(bool) == "boolean" or bool == nil then
-    return bool
-  elseif tostring(bool) then
-    local truth = {"yes", "true", "0"}
-    local untruth = {"no", "false", "1"}
-    local boolstr = tostring(bool)
-    if table.contains(truth, boolstr) then
-      return true
-    elseif table.contains(untruth, boolstr) then
-      return false
-    else
-      return nil
-    end
-  else
-    return nil
-  end
-end
-
---- clears a specific tab
---- @tparam string tabName the name of the tab to clear
-function EMCO:clear(tabName)
-  local funcName = "EMCO:clear(tabName)"
-  if not table.contains(self.consoles, tabName) then
-    self.ae(funcName, "tabName must be an existing tab")
-  end
-  if self.mapTab and self.mapTabName == tabName then
-    self.ae(funcName, "Cannot clear the map tab")
-  end
-  self.mc[tabName]:clear()
-end
-
---- clears all the tabs
-function EMCO:clearAll()
-  for _, tabName in ipairs(self.consoles) do
-    if not self.mapTab or (tabName ~= self.mapTabName) then
-      self:clear(tabName)
-    end
-  end
-end
-
---- sets the font for all tabs
---- @tparam string font the font to use.
-function EMCO:setTabFont(font)
-  self.tabFont = font
-  for _, tab in pairs(self.tabs) do
-    tab:setFont(font)
-  end
-end
-
---- sets the font for a single tab. If you use setTabFont this will be overridden
---- @tparam string tabName the tab to change the font of
---- @tparam string font the font to use for that tab
-function EMCO:setSingleTabFont(tabName, font)
-  local funcName = "EMCO:setSingleTabFont(tabName, font)"
-  if not table.contains(self.consoles, tabName) then
-    self.ae(funcName, "tabName must be an existing tab")
-  end
-  self.tabs[tabName]:setFont(font)
-end
-
---- sets the font for all the miniconsoles
---- @tparam string font the name of the font to use
-function EMCO:setFont(font)
-  local af = getAvailableFonts()
-  if not (af[font] or font == "") then
-    local err = "EMCO:setFont(font): attempt to call setFont with font '" .. font ..
-                  "' which is not available, see getAvailableFonts() for valid options\n"
-    err = err .. "In the meantime, we will use a similar font which isn't the one you asked for but we hope is close enough"
-    debugc(err)
-  end
-  self.font = font
-  for _, tabName in pairs(self.consoles) do
-    if not self.mapTab or tabName ~= self.mapTabName then
-      self.mc[tabName]:setFont(font)
-    end
-  end
-end
-
---- sets the font for a specific miniconsole. If setFont is called this will be overridden
---- @tparam string tabName the name of window to set the font for
---- @tparam string font the name of the font to use
-function EMCO:setSingleWindowFont(tabName, font)
-  local funcName = "EMCO:setSingleWindowFont(tabName, font)"
-  if not table.contains(self.consoles, tabName) then
-    self.ae(funcName, "tabName must be an existing tab")
-  end
-  local af = getAvailableFonts()
-  if not (af[font] or font == "") then
-    local err = "EMCO:setSingleWindowFont(tabName, font): attempt to call setFont with font '" .. font ..
-                  "' which is not available, see getAvailableFonts() for valid options\n"
-    err = err .. "In the meantime, we will use a similar font which isn't the one you asked for but we hope is close enough"
-    debugc(err)
-  end
-  self.mc[tabName]:setFont(font)
-end
-
---- sets the font size for all tabs
---- @tparam number fontSize the font size to use for the tabs
-function EMCO:setTabFontSize(fontSize)
-  self.tabFontSize = fontSize
-  for _, tab in pairs(self.tabs) do
-    tab:setFontSize(fontSize)
-  end
-end
-
---- Sets the alignment for all the tabs
--- @param alignment Valid alignments are 'c', 'center', 'l', 'left', 'r', 'right', or '' to not include the alignment as part of the echo
-function EMCO:setTabAlignment(alignment)
-  self.tabAlignment = alignment
-  for _, tab in pairs(self.tabs) do
-    tab:setAlignment(self.tabAlignment)
-  end
-end
-
---- enables underline on all tabs
-function EMCO:enableTabUnderline()
-  self.tabUnderline = true
-  for _, tab in pairs(self.tabs) do
-    tab:setUnderline(self.tabUnderline)
-  end
-end
-
---- disables underline on all tabs
-function EMCO:disableTabUnderline()
-  self.tabUnderline = false
-  for _, tab in pairs(self.tabs) do
-    tab:setUnderline(self.tabUnderline)
-  end
-end
-
---- enables italics on all tabs
-function EMCO:enableTabItalics()
-  self.tabItalics = true
-  for _, tab in pairs(self.tabs) do
-    tab:setItalics(self.tabItalics)
-  end
-end
-
---- enables italics on all tabs
-function EMCO:disableTabItalics()
-  self.tabItalics = false
-  for _, tab in pairs(self.tabs) do
-    tab:setItalics(self.tabItalics)
-  end
-end
-
---- enables bold on all tabs
-function EMCO:enableTabBold()
-  self.tabBold = true
-  for _, tab in pairs(self.tabs) do
-    tab:setBold(self.tabBold)
-  end
-end
-
---- disables bold on all tabs
-function EMCO:disableTabBold()
-  self.tabBold = false
-  for _, tab in pairs(self.tabs) do
-    tab:setBold(self.tabBold)
-  end
-end
-
---- enables custom colors for the timestamp, if displayed
-function EMCO:enableCustomTimestampColor()
-  self.customTimestampColor = true
-end
-
---- disables custom colors for the timestamp, if displayed
-function EMCO:disableCustomTimestampColor()
-  self.customTimestampColor = false
-end
-
---- enables the display of timestamps
-function EMCO:enableTimestamp()
-  self.timestamp = true
-end
-
---- disables the display of timestamps
-function EMCO:disableTimestamp()
-  self.timestamp = false
-end
-
---- Sets the formatting for the timestamp, if enabled
--- @tparam string format Format string which describes the display of the timestamp. See: https://wiki.mudlet.org/w/Manual:Lua_Functions#getTime
-function EMCO:setTimestampFormat(format)
-  local funcName = "EMCO:setTimestampFormat(format)"
-  local strippedFormat = self:stripTimeChars(format)
-  if strippedFormat ~= "" then
-    self.ae(funcName,
-            "format contains invalid time format characters. Please see https://wiki.mudlet.org/w/Manual:Lua_Functions#getTime for formatting information")
-  else
-    self.timestampFormat = format
-  end
-end
-
---- Sets the background color for the timestamp, if customTimestampColor is enabled.
--- @param color Color string suitable for decho or hecho, or color name eg "purple", or table of colors {r,g,b}
-function EMCO:setTimestampBGColor(color)
-  self.timestampBGColor = color
-end
---- Sets the foreground color for the timestamp, if customTimestampColor is enabled.
--- @param color Color string suitable for decho or hecho, or color name eg "purple", or table of colors {r,g,b}
-function EMCO:setTimestampFGColor(color)
-  self.timestampFGColor = color
-end
-
---- Sets the 'all' tab name.
--- <br>This is the name of the tab itself
--- @tparam string allTabName name of the tab to use as the all tab. Must be a tab which exists in the object.
-function EMCO:setAllTabName(allTabName)
-  local funcName = "EMCO:setAllTabName(allTabName)"
-  local allTabNameType = type(allTabName)
-  if allTabNameType ~= "string" then
-    self.ae(funcName, "allTabName expected as string, got" .. allTabNameType)
-  end
-  if not table.contains(self.consoles, allTabName) then
-    self.ae(funcName, "allTabName must be the name of one of the console tabs. Valid options are: " .. table.concat(self.consoles, ","))
-  end
-  self.allTabName = allTabName
-end
-
---- Enables use of the 'all' tab
-function EMCO:enableAllTab()
-  self.allTab = true
-end
-
---- Disables use of the 'all' tab
-function EMCO:disableAllTab()
-  self.allTab = false
-end
-
---- Enables tying the Mudlet Mapper to one of the tabs.
--- <br>mapTabName must be set, or this will error. Forces a redraw of the entire object
-function EMCO:enableMapTab()
-  local funcName = "EMCO:enableMapTab()"
-  if not self.mapTabName then
-    error(funcName ..
-            ": cannot enable the map tab, mapTabName not set. try running :setMapTabName(mapTabName) first with the name of the tab you want to bind the map to")
-  end
-  self.mapTab = true
-  self:reset()
-end
-
---- disables binding the Mudlet Mapper to one of the tabs.
--- <br>CAUTION: this may have unexpected behaviour, as you can only open one Mapper console per profile
--- so you can't really unbind it. Binding of the Mudlet Mapper is best decided at instantiation.
-function EMCO:disableMapTab()
-  self.mapTab = false
-end
-
---- sets the name of the tab to bind the Mudlet Map.
--- <br>Forces a redraw of the object
--- <br>CAUTION: Mudlet only allows one Map object to be open at one time, so if you are going to attach the map to an object
--- you should probably do it at instantiation.
--- @tparam string mapTabName name of the tab to connect the Mudlet Map to.
-function EMCO:setMapTabName(mapTabName)
-  local funcName = "EMCO:setMapTabName(mapTabName)"
-  local mapTabNameType = type(mapTabName)
-  if mapTabNameType ~= "string" then
-    self.ae(funcName, "mapTabName as string expected, got" .. mapTabNameType)
-  end
-  if not table.contains(self.consoles, mapTabName) and mapTabName ~= "" then
-    self.ae(funcName, "mapTabName must be one of the existing console tabs. Current tabs are: " .. table.concat(self.consoles, ","))
-  end
-  self.mapTabName = mapTabName
-end
-
---- Enables tab blinking even if you're on the 'all' tab
-function EMCO:enableBlinkFromAll()
-  self.enableBlinkFromAll = true
-end
-
---- Disables tab blinking when you're on the 'all' tab
-function EMCO:disableBlinkFromAll()
-  self.enableBlinkFromAll = false
-end
-
---- Enables gagging of the line passed in to :append(tabName)
-function EMCO:enableGag()
-  self.gag = true
-end
-
---- Disables gagging of the line passed in to :append(tabName)
-function EMCO:disableGag()
-  self.gag = false
-end
-
---- Enables tab blinking when new information comes in to an inactive tab
-function EMCO:enableBlink()
-  self.blink = true
-  if not self.blinkTimerID then
-    self.blinkTimerID = tempTimer(self.blinkTime, function()
-      self:doBlink()
-    end, true)
-  end
-end
-
---- Disables tab blinking when new information comes in to an inactive tab
-function EMCO:disableBlink()
-  self.blink = false
-  if self.blinkTimerID then
-    killTimer(self.blinkTimerID)
-    self.blinkTimerID = nil
-  end
-end
-
---- Enables preserving the chat's background over the background of an incoming :append()
-function EMCO:enablePreserveBackground()
-  self.preserveBackground = true
-end
-
---- Enables preserving the chat's background over the background of an incoming :append()
-function EMCO:disablePreserveBackground()
-  self.preserveBackground = false
-end
-
---- Sets how long in seconds to wait between blinks
--- @tparam number blinkTime time in seconds to wait between blinks
-function EMCO:setBlinkTime(blinkTime)
-  local funcName = "EMCO:setBlinkTime(blinkTime)"
-  local blinkTimeNumber = tonumber(blinkTime)
-  if not blinkTimeNumber then
-    self.ae(funcName, "blinkTime as number expected, got " .. type(blinkTime))
-  else
-    self.blinkTime = blinkTimeNumber
-    if self.blinkTimerID then
-      killTimer(self.blinkTimerID)
-    end
-    self.blinkTimerID = tempTimer(blinkTimeNumber, function()
-      self:blink()
-    end, true)
-  end
-end
-
-function EMCO:doBlink()
-  if self.hidden or self.auto_hidden or not self.blink then
-    return
-  end
-  for tab, _ in pairs(self.tabsToBlink) do
-    self.tabs[tab]:flash()
-  end
-end
-
---- Sets the font size of the attached consoles
--- @tparam number fontSize font size for attached consoles
-function EMCO:setFontSize(fontSize)
-  local funcName = "EMCO:setFontSize(fontSize)"
-  local fontSizeNumber = tonumber(fontSize)
-  local fontSizeType = type(fontSize)
-  if not fontSizeNumber then
-    self.ae(funcName, "fontSize as number expected, got " .. fontSizeType)
-  else
-    self.fontSize = fontSizeNumber
-    for _, tabName in ipairs(self.consoles) do
-      if self.mapTab and tabName == self.mapTabName then
-        -- skip this one
-      else
-        local window = self.mc[tabName]
-        window:setFontSize(fontSizeNumber)
-      end
-    end
-  end
-end
-
-function EMCO:adjustTabNames()
-  for _, console in ipairs(self.consoles) do
-    if console == self.currentTab then
-      self.tabs[console]:echo(console, self.activTabFGColor, 'c')
-    else
-      self.tabs[console]:echo(console, self.inactiveTabFGColor, 'c')
-    end
-  end
-end
-
-function EMCO:adjustTabBackground(console)
-  local tab = self.tabs[console]
-  local activeTabCSS = self.activeTabCSS
-  local inactiveTabCSS = self.inactiveTabCSS
-  local activeTabBGColor = self.activeTabBGColor
-  local inactiveTabBGColor = self.inactiveTabBGColor
-  if console == self.currentTab then
-    if activeTabCSS and activeTabCSS ~= "" then
-      tab:setStyleSheet(activeTabCSS)
-    elseif activeTabBGColor then
-      tab:setColor(activeTabBGColor)
-    end
-  else
-    if inactiveTabCSS and inactiveTabCSS ~= "" then
-      tab:setStyleSheet(inactiveTabCSS)
-    elseif inactiveTabBGColor then
-      tab:setColor(inactiveTabBGColor)
-    end
-  end
-end
-
-function EMCO:adjustTabBackgrounds()
-  for _, console in ipairs(self.consoles) do
-    self:adjustTabBackground(console)
-  end
-end
-
---- Sets the inactiveTabCSS
--- @tparam string stylesheet the stylesheet to use for inactive tabs.
-function EMCO:setInactiveTabCSS(stylesheet)
-  self.inactiveTabCSS = stylesheet
-  self:adjustTabBackgrounds()
-end
-
---- Sets the activeTabCSS
--- @tparam string stylesheet the stylesheet to use for active tab.
-function EMCO:setActiveTabCSS(stylesheet)
-  self.activeTabCSS = stylesheet
-  self:adjustTabBackgrounds()
-end
-
---- Sets the FG color for the active tab
--- @param color Color string suitable for decho or hecho, or color name eg "purple", or table of colors {r,g,b}
-function EMCO:setActiveTabFGColor(color)
-  self.activeTabFGColor = color
-  self:adjustTabNames()
-end
-
---- Sets the FG color for the inactive tab
--- @param color Color string suitable for decho or hecho, or color name eg "purple", or table of colors {r,g,b}
-function EMCO:setInactiveTabFGColor(color)
-  self.inactiveTabFGColor = color
-  self:adjustTabNames()
-end
-
---- Sets the BG color for the active tab.
--- <br>NOTE: If you set CSS for the active tab, it will override this setting.
--- @param color Color string suitable for decho or hecho, or color name eg "purple", or table of colors {r,g,b}
-function EMCO:setActiveTabBGColor(color)
-  self.activeTabBGColor = color
-  self:adjustTabBackgrounds()
-end
-
---- Sets the BG color for the inactive tab.
--- <br>NOTE: If you set CSS for the inactive tab, it will override this setting.
--- @param color Color string suitable for decho or hecho, or color name eg "purple", or table of colors {r,g,b}
-function EMCO:setInactiveTabBGColor(color)
-  self.inactiveTabBGColor = color
-  self:adjustTabBackgrounds()
-end
-
---- Sets the BG color for the consoles attached to this object
--- @param color Color string suitable for decho or hecho, or color name eg "purple", or table of colors {r,g,b}
-function EMCO:setConsoleColor(color)
-  self.consoleColor = color
-  self:adjustConsoleColors()
-end
-
-function EMCO:adjustConsoleColors()
-  for _, console in ipairs(self.consoles) do
-    if self.mapTab and self.mapTabName == console then
-      -- skip Map
-    else
-      self.mc[console]:setColor(self.consoleColor)
-    end
-  end
-end
-
---- Sets the CSS to use for the tab box which contains the tabs for the object
--- @tparam string css The css styling to use for the tab box
-function EMCO:setTabBoxCSS(css)
-  local funcName = "EMCHO:setTabBoxCSS(css)"
-  local cssType = type(css)
-  if cssType ~= "string" then
-    self.ae(funcName, "css as string expected, got " .. cssType)
-  else
-    self.tabBoxCSS = css
-    self:adjustTabBoxBackground()
-  end
-end
-
---- Sets the color to use for the tab box background
--- @param color Color string suitable for decho or hecho, or color name eg "purple", or table of colors {r,g,b}
-function EMCO:setTabBoxColor(color)
-  self.tabBoxColor = color
-  self:adjustTabBoxBackground()
-end
-
-function EMCO:adjustTabBoxBackground()
-  self.tabBoxLabel:setStyleSheet(self.tabBoxCSS)
-  self.tabBoxLabel:setColor(self.tabBoxColor)
-end
-
---- Sets the color for the container which holds the consoles attached to this object.
--- @param color Color string suitable for decho or hecho, or color name eg "purple", or table of colors {r,g,b}
-function EMCO:setConsoleContainerColor(color)
-  self.consoleContainerColor = color
-  self:adjustConsoleContainerBackground()
-end
-
---- Sets the CSS to use for the container which holds the consoles attached to this object
--- @tparam string css CSS to use for the container
-function EMCO:setConsoleContainerCSS(css)
-  self.consoleContainerCSS = css
-  self:adjustConsoleContainerBackground()
-end
-
-function EMCO:adjustConsoleContainerBackground()
-  self.consoleContainer:setStyleSheet(self.consoleContainerCSS)
-  self.consoleContainer:setColor(self.consoleContainerColor)
-end
-
---- Sets the amount of space to use between the tabs and the consoles
--- @tparam number gap Number of pixels to keep between the tabs and consoles
-function EMCO:setGap(gap)
-  local gapNumber = tonumber(gap)
-  local funcName = "EMCO:setGap(gap)"
-  local gapType = type(gap)
-  if not gapNumber then
-    self.ae(funcName, "gap expected as number, got " .. gapType)
-  else
-    self.gap = gapNumber
-    self:reset()
-  end
-end
-
---- Sets the height of the tabs in pixels
--- @tparam number tabHeight the height of the tabs for the object, in pixels
-function EMCO:setTabHeight(tabHeight)
-  local tabHeightNumber = tonumber(tabHeight)
-  local funcName = "EMCO:setTabHeight(tabHeight)"
-  local tabHeightType = type(tabHeight)
-  if not tabHeightNumber then
-    self.ae(funcName, "tabHeight as number expected, got " .. tabHeightType)
-  else
-    self.tabHeight = tabHeightNumber
-    self:reset()
-  end
-end
-
---- Enables autowrap for the object, and by extension all attached consoles.
--- <br>To enable autoWrap for a specific miniconsole only, call myEMCO.windows[tabName]:enableAutoWrap()
--- but be warned if you do this it may be overwritten by future calls to EMCO:enableAutoWrap() or :disableAutoWrap()
-function EMCO:enableAutoWrap()
-  self.autoWrap = true
-  for _, console in ipairs(self.consoles) do
-    if self.mapTab and console == self.mapTabName then
-      -- skip the map
-    else
-      self.mc[console]:enableAutoWrap()
-    end
-  end
-end
-
---- Disables autowrap for the object, and by extension all attached consoles.
--- <br>To disable autoWrap for a specific miniconsole only, call myEMCO.windows[tabName]:disableAutoWrap()
--- but be warned if you do this it may be overwritten by future calls to EMCO:enableAutoWrap() or :disableAutoWrap()
-function EMCO:disableAutoWrap()
-  self.autoWrap = false
-  for _, console in ipairs(self.consoles) do
-    if self.mapTab and self.mapTabName == console then
-      -- skip Map
-    else
-      self.mc[console]:disableAutoWrap()
-    end
-  end
-end
-
---- Sets the number of characters to wordwrap the attached consoles at.
--- <br>it is generally recommended to make use of autoWrap unless you need
--- a specific width for some reason
-function EMCO:setWrap(wrapAt)
-  local funcName = "EMCO:setWrap(wrapAt)"
-  local wrapAtNumber = tonumber(wrapAt)
-  local wrapAtType = type(wrapAt)
-  if not wrapAtNumber then
-    self.ae(funcName, "wrapAt as number expect, got " .. wrapAtType)
-  else
-    self.wrapAt = wrapAtNumber
-    for _, console in ipairs(self.consoles) do
-      if self.mapTab and self.mapTabName == console then
-        -- skip the Map
-      else
-        self.mc[console]:setWrap(wrapAtNumber)
-      end
-    end
-  end
-end
-
---- Appends the current line from the MUD to a tab.
--- <br>depending on this object's configuration, may gag the line
--- <br>depending on this object's configuration, may gag the next prompt
--- @tparam string tabName The name of the tab to append the line to
--- @tparam boolean excludeAll if true, will exclude this from being mirrored to the allTab
-function EMCO:append(tabName, excludeAll)
-  local funcName = "EMCO:append(tabName, excludeAll)"
-  local tabNameType = type(tabName)
-  local validTab = table.contains(self.consoles, tabName)
-  if tabNameType ~= "string" then
-    self.ae(funcName, "tabName as string expected, got " .. tabNameType)
-  elseif not validTab then
-    self.ae(funcName, "tabName must be a tab which is contained in this object. Valid tabnames are: " .. table.concat(self.consoles, ","))
-  end
-  self:xEcho(tabName, nil, 'a', excludeAll)
-end
-
-function EMCO:checkEchoArgs(funcName, tabName, message, excludeAll)
-  local tabNameType = type(tabName)
-  local messageType = type(message)
-  local validTabName = table.contains(self.consoles, tabName)
-  local excludeAllType = type(excludeAll)
-  local ae = self.ae
-  if tabNameType ~= "string" then
-    ae(funcName, "tabName as string expected, got " .. tabNameType)
-  elseif messageType ~= "string" then
-    ae(funcName, "message as string expected, got " .. messageType)
-  elseif not validTabName then
-    ae(funcName, "tabName must be the name of a tab attached to this object. Valid names are: " .. table.concat(self.consoles, ","))
-  elseif excludeAllType ~= "nil" and excludeAllType ~= "boolean" then
-    ae(funcName, "optional argument excludeAll expected as boolean, got " .. excludeAllType)
-  end
-end
-
---- Adds a tab to the list of tabs to send OS toast/popup notifications for
---@tparam string tabName the name of a tab to enable notifications for
---@return true if it was added, false if it was already included, nil if the tab does not exist.
-function EMCO:addNotifyTab(tabName)
-  if not table.contains(self.consoles, tabName) then
-    return nil, "Tab does not exist"
-  end
-  if self.notifyTabs[tabName] then
-    return false
-  end
-  self.notifyTabs[tabName] = true
-  return true
-end
-
---- Removes a tab from the list of tabs to send OS toast/popup notifications for
---@tparam string tabName the name of a tab to disable notifications for
---@return true if it was removed, false if it wasn't enabled to begin with, nil if the tab does not exist.
-function EMCO:removeNotifyTab(tabName)
-  if not table.contains(self.consoles, tabName) then
-    return nil, "Tab does not exist"
-  end
-  if not self.notifyTabs[tabName] then
-    return false
-  end
-  self.notifyTabs[tabName] = nil
-  return true
-end
-
---- Adds a pattern to the gag list for the EMCO
---@tparam string pattern a Lua pattern to gag. http://lua-users.org/wiki/PatternsTutorial
---@return true if it was added, false if it was already included.
-function EMCO:addGag(pattern)
-  if self.gags[pattern] then
-    return false
-  end
-  self.gags[pattern] = true
-  return true
-end
-
---- Removes a pattern from the gag list for the EMCO
---@tparam string pattern a Lua pattern to no longer gag. http://lua-users.org/wiki/PatternsTutorial
---@return true if it was removed, false if it was not there to remove.
-function EMCO:removeGag(pattern)
-  if self.gags[pattern] then
-    self.gags[pattern] = nil
-    return true
-  end
-  return false
-end
-
---- Checks if a string matches any of the EMCO's gag patterns
---@tparam string str The text you're testing against the gag patterns
---@return false if it does not match any gag patterns. true and the matching pattern if it does match.
-function EMCO:matchesGag(str)
-  for pattern,_ in pairs(self.gags) do
-    if str:match(pattern) then
-      return true, pattern
-    end
-  end
-  return false
-end
-
---- Enables sending OS notifications even if Mudlet has focus
-function EMCO:enableNotifyWithFocus()
-  self.notifyWithFocus = true
-end
-
---- Disables sending OS notifications if Mudlet has focus
-function EMCO:disableNotifyWithFocus()
-  self.notifyWithFocus = false
-end
-
-function EMCO:strip(message, xtype)
-  local strippers = {
-    a = function(msg) return msg end,
-    echo = function(msg) return msg end,
-    cecho = cecho2string,
-    decho = decho2string,
-    hecho = hecho2string,
-  }
-  local result = strippers[xtype](message)
-  return result
-end
-
-function EMCO:sendNotification(tabName, msg)
-  if self.notifyWithFocus or not hasFocus() then
-    if self.notifyTabs[tabName] then
-      showNotification(f'{self.name}:{tabName}', msg)
-    end
-  end
-end
-
-function EMCO:xEcho(tabName, message, xtype, excludeAll)
-  if self.mapTab and self.mapTabName == tabName then
-    error("You cannot send text to the Map tab")
-  end
-  local console = self.mc[tabName]
-  local allTab = (self.allTab and not excludeAll and not table.contains(self.allTabExclusions, tabName) and tabName ~= self.allTabName) and
-                   self.mc[self.allTabName] or false
-  local ofr, ofg, ofb, obr, obg, obb
-  if xtype == "a" then
-    local line = getCurrentLine()
-    local mute, reason = self:matchesGag(line)
-    if mute then
-      debugc(f"{self.name}:append(tabName) denied because current line matches the pattern '{reason}'")
-      return
-    end
-    selectCurrentLine()
-    ofr, ofg, ofb = getFgColor()
-    obr, obg, obb = getBgColor()
-    if self.preserveBackground then
-      local r, g, b = Geyser.Color.parse(self.consoleColor)
-      setBgColor(r, g, b)
-    end
-    copy()
-    if self.preserveBackground then
-      setBgColor(obr, obg, obb)
-    end
-    deselect()
-    resetFormat()
-  else
-    local mute, reason = self:matchesGag(message)
-    if mute then
-      debugc(f"{self.name}:{xtype}(tabName, msg, excludeAll) denied because msg matches '{reason}'")
-      return
-    end
-    ofr, ofg, ofb = Geyser.Color.parse("white")
-    obr, obg, obb = Geyser.Color.parse(self.consoleColor)
-  end
-  if self.timestamp then
-    local colorString = ""
-    if self.customTimestampColor then
-      local tfr, tfg, tfb = Geyser.Color.parse(self.timestampFGColor)
-      local tbr, tbg, tbb = Geyser.Color.parse(self.timestampBGColor)
-      colorString = string.format("<%s,%s,%s:%s,%s,%s>", tfr, tfg, tfb, tbr, tbg, tbb)
-    else
-      colorString = string.format("<%s,%s,%s:%s,%s,%s>", ofr, ofg, ofb, obr, obg, obb)
-    end
-    local timestamp = getTime(true, self.timestampFormat)
-    local fullTimestamp = string.format("%s%s<r> ", colorString, timestamp)
-    if not table.contains(self.timestampExceptions, tabName) then
-      console:decho(fullTimestamp)
-    end
-    if allTab and tabName ~= self.allTabName and not table.contains(self.timestampExceptions, self.allTabName) then
-      allTab:decho(fullTimestamp)
-    end
-  end
-  if self.blink and tabName ~= self.currentTab then
-    if not (self.allTabName == self.currentTab and not self.blinkFromAll) then
-      self.tabsToBlink[tabName] = true
-    end
-  end
-  if xtype == "a" then
-    console:appendBuffer()
-    local txt = self:strip(getCurrentLine(), xtype)
-    self:sendNotification(tabName, txt)
-    if allTab then
-      allTab:appendBuffer()
-    end
-    if self.gag then
-      deleteLine()
-      if self.gagPrompt then
-        tempPromptTrigger(function()
-          deleteLine()
-        end, 1)
-      end
-    end
-  else
-    console[xtype](console, message)
-    self:sendNotification(tabName, self:strip(message, xtype))
-    if allTab then
-      allTab[xtype](allTab, message)
-    end
-  end
-  if self.blankLine then
-    console:echo("\n")
-    if allTab then
-      allTab:echo("\n")
-    end
-  end
-end
-
---- cecho to a tab, maintaining functionality
--- @tparam string tabName the name of the tab to cecho to
--- @tparam string message the message to cecho to that tab's console
--- @tparam boolean excludeAll if true, will exclude this from being mirrored to the allTab
-function EMCO:cecho(tabName, message, excludeAll)
-  local funcName = "EMCO:cecho(tabName, message, excludeAll)"
-  self:checkEchoArgs(funcName, tabName, message, excludeAll)
-  self:xEcho(tabName, message, 'cecho', excludeAll)
-end
-
---- decho to a tab, maintaining functionality
--- @tparam string tabName the name of the tab to decho to
--- @tparam string message the message to decho to that tab's console
--- @tparam boolean excludeAll if true, will exclude this from being mirrored to the allTab
-function EMCO:decho(tabName, message, excludeAll)
-  local funcName = "EMCO:decho(console, message, excludeAll)"
-  self:checkEchoArgs(funcName, tabName, message, excludeAll)
-  self:xEcho(tabName, message, 'decho', excludeAll)
-end
-
---- hecho to a tab, maintaining functionality
--- @tparam string tabName the name of the tab to hecho to
--- @tparam string message the message to hecho to that tab's console
--- @tparam boolean excludeAll if true, will exclude this from being mirrored to the allTab
-function EMCO:hecho(tabName, message, excludeAll)
-  local funcName = "EMCO:hecho(console, message, excludeAll)"
-  self:checkEchoArgs(funcName, tabName, message, excludeAll)
-  self:xEcho(tabName, message, 'hecho', excludeAll)
-end
-
---- echo to a tab, maintaining functionality
--- @tparam string tabName the name of the tab to echo to
--- @tparam string message the message to echo to that tab's console
--- @tparam boolean excludeAll if true, will exclude this from being mirrored to the allTab
-function EMCO:echo(tabName, message, excludeAll)
-  local funcName = "EMCO:echo(console, message, excludeAll)"
-  self:checkEchoArgs(funcName, tabName, message, excludeAll)
-  self:xEcho(tabName, message, 'echo', excludeAll)
-end
-
--- internal function used for type checking echoLink/Popup arguments
-function EMCO:checkLinkArgs(funcName, tabName, text, commands, hints, excludeAll, popup)
-  local expectedType = popup and "table" or "string"
-  local textType = type(text)
-  local commandsType = type(commands)
-  local hintsType = type(hints)
-  local tabNameType = type(tabName)
-  local validTabName = table.contains(self.consoles, tabName)
-  local excludeAllType = type(excludeAll)
-  local sf = string.format
-  local ae = self.ae
-  if textType ~= "string" then
-    ae(funcName, "text as string expected, got " .. textType)
-  elseif commandsType ~= expectedType then
-    ae(funcName, sf("commands as %s expected, got %s", expectedType, commandsType))
-  elseif hintsType ~= expectedType then
-    ae(funcName, sf("hints as %s expected, got %s", expectedType, hintsType))
-  elseif tabNameType ~= "string" then
-    ae(funcName, "tabName as string expected, got " .. tabNameType)
-  elseif not validTabName then
-    ae(funcName, sf("tabName must be a tab which exists, tab %s could not be found", tabName))
-  elseif self.mapTab and tabName == self.mapTabName then
-    ae(funcName, sf("You cannot echo to the map tab, and %s is configured as the mapTabName", tabName))
-  elseif excludeAllType ~= "nil" and excludeAllType ~= "boolean" then
-    ae(funcName, "Optional argument excludeAll expected as boolean, got " .. excludeAllType)
-  end
-end
-
--- internal function used for handling echoLink/popup
-function EMCO:xLink(tabName, linkType, text, commands, hints, useCurrentFormat, excludeAll)
-  local gag, reason = self:matchesGag(text)
-  if gag then
-    debugc(f"{self.name}:{linkType}(tabName, text, command, hint, excludeAll) denied because text matches '{reason}'")
-    return
-  end
-  local console = self.mc[tabName]
-  local allTab = (self.allTab and not excludeAll and not table.contains(self.allTabExclusions, tabName) and tabName ~= self.allTabName) and
-                   self.mc[self.allTabName] or false
-  local arguments = {text, commands, hints, useCurrentFormat}
-  if self.timestamp then
-    local colorString = ""
-    if self.customTimestampColor then
-      local tfr, tfg, tfb = Geyser.Color.parse(self.timestampFGColor)
-      local tbr, tbg, tbb = Geyser.Color.parse(self.timestampBGColor)
-      colorString = string.format("<%s,%s,%s:%s,%s,%s>", tfr, tfg, tfb, tbr, tbg, tbb)
-    else
-      local ofr, ofg, ofb = Geyser.Color.parse("white")
-      local obr, obg, obb = Geyser.Color.parse(self.consoleColor)
-      colorString = string.format("<%s,%s,%s:%s,%s,%s>", ofr, ofg, ofb, obr, obg, obb)
-    end
-    local timestamp = getTime(true, self.timestampFormat)
-    local fullTimestamp = string.format("%s%s<r> ", colorString, timestamp)
-    if not table.contains(self.timestampExceptions, tabName) then
-      console:decho(fullTimestamp)
-    end
-    if allTab and tabName ~= self.allTabName and not table.contains(self.timestampExceptions, self.allTabName) then
-      allTab:decho(fullTimestamp)
-    end
-  end
-  console[linkType](console, unpack(arguments))
-  if allTab then
-    allTab[linkType](allTab, unpack(arguments))
-  end
-end
-
---- cechoLink to a tab
--- @tparam string tabName the name of the tab to cechoLink to
--- @tparam string text the text underlying the link
--- @tparam string command the lua code to run in string format
--- @tparam string hint the tooltip hint to use for the link
--- @tparam boolean excludeAll if true, will exclude this from being mirrored to the allTab
-function EMCO:cechoLink(tabName, text, command, hint, excludeAll)
-  local funcName = "EMCO:cechoLink(tabName, text, command, hint)"
-  self:checkLinkArgs(funcName, tabName, text, command, hint, excludeAll)
-  self:xLink(tabName, "cechoLink", text, command, hint, true, excludeAll)
-end
-
---- dechoLink to a tab
--- @tparam string tabName the name of the tab to dechoLink to
--- @tparam string text the text underlying the link
--- @tparam string command the lua code to run in string format
--- @tparam string hint the tooltip hint to use for the link
--- @tparam boolean excludeAll if true, will exclude this from being mirrored to the allTab
-function EMCO:dechoLink(tabName, text, command, hint, excludeAll)
-  local funcName = "EMCO:dechoLink(tabName, text, command, hint)"
-  self:checkLinkArgs(funcName, tabName, text, command, hint, excludeAll)
-  self:xLink(tabName, "dechoLink", text, command, hint, true, excludeAll)
-end
-
---- hechoLink to a tab
--- @tparam string tabName the name of the tab to hechoLink to
--- @tparam string text the text underlying the link
--- @tparam string command the lua code to run in string format
--- @tparam string hint the tooltip hint to use for the link
--- @tparam boolean excludeAll if true, will exclude this from being mirrored to the allTab
-function EMCO:hechoLink(tabName, text, command, hint, excludeAll)
-  local funcName = "EMCO:hechoLink(tabName, text, command, hint)"
-  self:checkLinkArgs(funcName, tabName, text, command, hint, excludeAll)
-  self:xLink(tabName, "hechoLink", text, command, hint, true, excludeAll)
-end
-
---- echoLink to a tab
--- @tparam string tabName the name of the tab to echoLink to
--- @tparam string text the text underlying the link
--- @tparam string command the lua code to run in string format
--- @tparam string hint the tooltip hint to use for the link
--- @tparam boolean useCurrentFormat use the format for the window or blue on black (hyperlink colors)
--- @tparam boolean excludeAll if true, will exclude this from being mirrored to the allTab
-function EMCO:echoLink(tabName, text, command, hint, useCurrentFormat, excludeAll)
-  local funcName = "EMCO:echoLink(tabName, text, command, hint, useCurrentFormat)"
-  self:checkLinkArgs(funcName, tabName, text, command, hint, excludeAll)
-  self:xLink(tabName, "echoLink", text, command, hint, useCurrentFormat, excludeAll)
-end
-
---- cechoPopup to a tab
--- @tparam string tabName the name of the tab to cechoPopup to
--- @tparam string text the text underlying the link
--- @tparam table commands the lua code to run in string format
--- @tparam table hints the tooltip hint to use for the link
--- @tparam boolean excludeAll if true, will exclude this from being mirrored to the allTab
-function EMCO:cechoPopup(tabName, text, commands, hints, excludeAll)
-  local funcName = "EMCO:cechoPopup(tabName, text, commands, hints)"
-  self:checkLinkArgs(funcName, tabName, text, commands, hints, excludeAll, true)
-  self:xLink(tabName, "cechoPopup", text, commands, hints, true, excludeAll)
-end
-
---- dechoPopup to a tab
--- @tparam string tabName the name of the tab to dechoPopup to
--- @tparam string text the text underlying the link
--- @tparam table commands the lua code to run in string format
--- @tparam table hints the tooltip hint to use for the link
--- @tparam boolean excludeAll if true, will exclude this from being mirrored to the allTab
-function EMCO:dechoPopup(tabName, text, commands, hints, excludeAll)
-  local funcName = "EMCO:dechoPopup(tabName, text, commands, hints)"
-  self:checkLinkArgs(funcName, tabName, text, commands, hints, excludeAll, true)
-  self:xLink(tabName, "dechoPopup", text, commands, hints, true, excludeAll)
-end
-
---- hechoPopup to a tab
--- @tparam string tabName the name of the tab to hechoPopup to
--- @tparam string text the text underlying the link
--- @tparam table commands the lua code to run in string format
--- @tparam table hints the tooltip hint to use for the link
--- @tparam boolean excludeAll if true, will exclude this from being mirrored to the allTab
-function EMCO:hechoPopup(tabName, text, commands, hints, excludeAll)
-  local funcName = "EMCO:hechoPopup(tabName, text, commands, hints)"
-  self:checkLinkArgs(funcName, tabName, text, commands, hints, excludeAll, true)
-  self:xLink(tabName, "hechoPopup", text, commands, hints, true, excludeAll)
-end
-
---- echoPopup to a tab
--- @tparam string tabName the name of the tab to echoPopup to
--- @tparam string text the text underlying the link
--- @tparam table commands the lua code to run in string format
--- @tparam table hints the tooltip hint to use for the link
--- @tparam boolean useCurrentFormat use the format for the window or blue on black (hyperlink colors)
--- @tparam boolean excludeAll if true, will exclude this from being mirrored to the allTab
-function EMCO:echoPopup(tabName, text, commands, hints, useCurrentFormat, excludeAll)
-  local funcName = "EMCO:echoPopup(tabName, text, commands, hints, useCurrentFormat)"
-  self:checkLinkArgs(funcName, tabName, text, commands, hints, excludeAll, true)
-  self:xLink(tabName, "echoPopup", text, commands, hints, useCurrentFormat, excludeAll)
-end
-
---- adds a tab to the exclusion list for echoing to the allTab
--- @tparam string tabName the name of the tab to add to the exclusion list
-function EMCO:addAllTabExclusion(tabName)
-  local funcName = "EMCO:addAllTabExclusion(tabName)"
-  self:validTabNameOrError(tabName, funcName)
-  if not table.contains(self.allTabExclusions, tabName) then
-    table.insert(self.allTabExclusions, tabName)
-  end
-end
-
---- removess a tab from the exclusion list for echoing to the allTab
--- @tparam string tabName the name of the tab to remove from the exclusion list
-function EMCO:removeAllTabExclusion(tabName)
-  local funcName = "EMCO:removeAllTabExclusion(tabName)"
-  self:validTabNameOrError(tabName, funcName)
-  local index = table.index_of(self.allTabExclusions, tabName)
-  if index then
-    table.remove(self.allTabExclusions, index)
-  end
-end
-
-function EMCO:validTabNameOrError(tabName, funcName)
-  local ae = self.ae
-  local tabNameType = type(tabName)
-  local validTabName = table.contains(self.consoles, tabName)
-  if tabNameType ~= "string" then
-    ae(funcName, "tabName as string expected, got " .. tabNameType)
-  elseif not validTabName then
-    ae(funcName, string.format("tabName %s does not exist in this EMCO. valid tabs: " .. table.concat(self.consoles, ",")))
-  end
-end
-
-function EMCO:addTimestampException(tabName)
-  local funcName = "EMCO:addTimestampException(tabName)"
-  self:validTabNameOrError(tabName, funcName)
-  if not table.contains(self.timestampExceptions, tabName) then
-    table.insert(self.timestampExceptions, tabName)
-  end
-end
-
-function EMCO:removeTimestampException(tabName)
-  local funcName = "EMCO:removeTimestampTabException(tabName)"
-  self:validTabNameOrError(tabName, funcName)
-  local index = table.index_of(self.timestampExceptions, tabName)
-  if index then
-    table.remove(self.timestampExceptions, index)
-  end
-end
-
---- Enable placing a blank line between all messages.
-function EMCO:enableBlankLine()
-  self.blankLine = true
-end
-
---- Enable placing a blank line between all messages.
-function EMCO:disableBlankLine()
-  self.blankLine = false
-end
-
---- Enable scrollbars for the miniconsoles
-function EMCO:enableScrollbars()
-  self.scrollbars = true
-  self:adjustScrollbars()
-end
-
---- Disable scrollbars for the miniconsoles
-function EMCO:disableScrollbars()
-  self.scrollbars = false
-  self:adjustScrollbars()
-end
-
-function EMCO:adjustScrollbars()
-  for _, console in ipairs(self.consoles) do
-    if self.mapTab and self.mapTabName == console then
-      -- skip the Map tab
-    else
-      if self.scrollbars then
-        self.mc[console]:enableScrollBar()
-      else
-        self.mc[console]:disableScrollBar()
-      end
-    end
-  end
-end
-
---- Save an EMCO's configuration for reloading later. Filename is based on the EMCO's name property.
-function EMCO:save()
-  local configtable = {
-    timestamp = self.timestamp,
-    blankLine = self.blankLine,
-    scrollbars = self.scrollbars,
-    customTimestampColor = self.customTimestampColor,
-    mapTab = self.mapTab,
-    mapTabName = self.mapTabName,
-    blinkFromAll = self.blinkFromAll,
-    preserveBackground = self.preserveBackground,
-    gag = self.gag,
-    timestampFormat = self.timestampFormat,
-    timestampFGColor = self.timestampFGColor,
-    timestampBGColor = self.timestampBGColor,
-    allTab = self.allTab,
-    allTabName = self.allTabName,
-    blink = self.blink,
-    blinkTime = self.blinkTime,
-    fontSize = self.fontSize,
-    font = self.font,
-    tabFont = self.tabFont,
-    activeTabCSS = self.activeTabCSS,
-    inactiveTabCSS = self.inactiveTabCSS,
-    activeTabFGColor = self.activeTabFGColor,
-    activeTabBGColor = self.activeTabBGColor,
-    inactiveTabFGColor = self.inactiveTabFGColor,
-    inactiveTabBGColor = self.inactiveTabBGColor,
-    consoleColor = self.consoleColor,
-    tabBoxCSS = self.tabBoxCSS,
-    tabBoxColor = self.tabBoxColor,
-    consoleContainerCSS = self.consoleContainerCSS,
-    consoleContainerColor = self.consoleContainerColor,
-    gap = self.gap,
-    consoles = self.consoles,
-    allTabExclusions = self.allTabExclusions,
-    timestampExceptions = self.timestampExceptions,
-    tabHeight = self.tabHeight,
-    autoWrap = self.autoWrap,
-    wrapAt = self.wrapAt,
-    leftMargin = self.leftMargin,
-    rightMargin = self.rightMargin,
-    bottomMargin = self.bottomMargin,
-    topMargin = self.topMargin,
-    x = self.x,
-    y = self.y,
-    height = self.height,
-    width = self.width,
-    tabFontSize = self.tabFontSize,
-    tabBold = self.tabBold,
-    tabItalics = self.tabItalics,
-    tabUnderline = self.tabUnderline,
-    tabAlignment = self.tabAlignment,
-    bufferSize = self.bufferSize,
-    deleteLines = self.deleteLines,
-    logExclusions = self.logExclusions,
-    gags = self.gags,
-    notifyTabs = self.notifyTabs,
-    notifyWithFocus = self.notifyWithFocus,
-    cmdLineStyleSheet = self.cmdLineStyleSheet,
-  }
-  local dirname = getMudletHomeDir() .. "/EMCO/"
-  local filename = dirname .. self.name:gsub("[<>:'\"/\\|?*]", "_") .. ".lua"
-  if not (io.exists(dirname)) then
-    lfs.mkdir(dirname)
-  end
-  table.save(filename, configtable)
-end
-
---- Load and apply a saved config for this EMCO
-function EMCO:load()
-  local dirname = getMudletHomeDir() .. "/EMCO/"
-  local filename = dirname .. self.name .. ".lua"
-  local configTable = {}
-  if io.exists(filename) then
-    table.load(filename, configTable)
-  else
-    debugc(string.format("Attempted to load config for EMCO named %s but the file could not be found. Filename: %s", self.name, filename))
-    return
-  end
-
-  self.timestamp = configTable.timestamp
-  self.blankLine = configTable.blankLine
-  self.scrollbars = configTable.scrollbars
-  self.customTimestampColor = configTable.customTimestampColor
-  self.mapTab = configTable.mapTab
-  self.mapTabName = configTable.mapTabName
-  self.blinkFromAll = configTable.blinkFromAll
-  self.preserveBackground = configTable.preserveBackground
-  self.gag = configTable.gag
-  self.timestampFormat = configTable.timestampFormat
-  self.timestampFGColor = configTable.timestampFGColor
-  self.timestampBGColor = configTable.timestampBGColor
-  self.allTab = configTable.allTab
-  self.allTabName = configTable.allTabName
-  self.blink = configTable.blink
-  self.blinkTime = configTable.blinkTime
-  self.activeTabCSS = configTable.activeTabCSS
-  self.inactiveTabCSS = configTable.inactiveTabCSS
-  self.activeTabFGColor = configTable.activeTabFGColor
-  self.activeTabBGColor = configTable.activeTabBGColor
-  self.inactiveTabFGColor = configTable.inactiveTabFGColor
-  self.inactiveTabBGColor = configTable.inactiveTabBGColor
-  self.consoleColor = configTable.consoleColor
-  self.tabBoxCSS = configTable.tabBoxCSS
-  self.tabBoxColor = configTable.tabBoxColor
-  self.consoleContainerCSS = configTable.consoleContainerCSS
-  self.consoleContainerColor = configTable.consoleContainerColor
-  self.gap = configTable.gap
-  self.consoles = configTable.consoles
-  self.allTabExclusions = configTable.allTabExclusions
-  self.timestampExceptions = configTable.timestampExceptions
-  self.tabHeight = configTable.tabHeight
-  self.wrapAt = configTable.wrapAt
-  self.leftMargin = configTable.leftMargin
-  self.rightMargin = configTable.rightMargin
-  self.bottomMargin = configTable.bottomMargin
-  self.topMargin = configTable.topMargin
-  self.tabFontSize = configTable.tabFontSize
-  self.tabBold = configTable.tabBold
-  self.tabItalics = configTable.tabItalics
-  self.tabUnderline = configTable.tabUnderline
-  self.tabAlignment = configTable.tabAlignment
-  self.bufferSize = configTable.bufferSize
-  self.deleteLines = configTable.deleteLines
-  self.logExclusions = configTable.logExclusions
-  self.gags = configTable.gags
-  self.notifyTabs = configTable.notifyTabs
-  self.notifyWithFocus = configTable.notifyWithFocus
-  self.cmdLineStyleSheet = configTable.cmdLineStyleSheet
-  self:move(configTable.x, configTable.y)
-  self:resize(configTable.width, configTable.height)
-  self:reset()
-  if configTable.fontSize then
-    self:setFontSize(configTable.fontSize)
-  end
-  if configTable.font then
-    self:setFont(configTable.font)
-  end
-  if configTable.tabFont then
-    self:setTabFont(configTable.tabFont)
-  end
-  if configTable.autoWrap then
-    self:enableAutoWrap()
-  else
-    self:disableAutoWrap()
-  end
-end
-
---- Enables logging for tabName
---@tparam string tabName the name of the tab you want to enable logging for
-function EMCO:enableTabLogging(tabName)
-  local console = self.mc[tabName]
-  if not console then
-    debugc(f"EMCO:enableTabLogging(tabName): tabName {tabName} not found.")
-    return
-  end
-  console.log = true
-  local logDisabled = table.index_of(self.logExclusions, tabName)
-  if logDisabled then table.remove(self.logExclusions, logDisabled) end
-end
-
---- Disables logging for tabName
---@tparam string tabName the name of the tab you want to disable logging for
-function EMCO:disableTabLogging(tabName)
-  local console = self.mc[tabName]
-  if not console then
-    debugc(f"EMCO:disableTabLogging(tabName): tabName {tabName} not found.")
-    return
-  end
-  console.log = false
-  local logDisabled = table.index_of(self.logExclusions, tabName)
-  if not logDisabled then table.insert(self.logExclusions, tabName) end
-end
-
---- Enables logging on all EMCO managed consoles
-function EMCO:enableAllLogging()
-  for _,console in pairs(self.mc) do
-    console.log = true
-  end
-  self.logExclusions = {}
-end
-
---- Disables logging on all EMCO managed consoles
-function EMCO:disableAllLogging()
-  self.logExclusions = {}
-  for tabName,console in pairs(self.mc) do
-    console.log = false
-    self.logExclusions[#self.logExclusions+1] = tabName
-  end
-end
-
-EMCO.parent = Geyser.Container
-
-return EMCO
- - -
-
-
-generated by LDoc 1.5.0 -Last updated 2023-05-29 18:41:27 -
-
- - diff --git a/src/resources/MDK/doc/source/figlet.lua.html b/src/resources/MDK/doc/source/figlet.lua.html deleted file mode 100755 index 6cc06fb..0000000 --- a/src/resources/MDK/doc/source/figlet.lua.html +++ /dev/null @@ -1,366 +0,0 @@ - - - - - Reference - - - - -
- -
- -
-
-
- - -
- - - - - - -
- -

figlet.lua

-
---- Figlet
--- A module to read figlet fonts and produce figlet ascii art from text
--- @module figlet
--- @copyright 2010,2011 Nick Gammon
--- @copyright 2022 Damian Monogue
-local Figlet = {}
-
---[[
-  Based on figlet.
-
-  FIGlet Copyright 1991, 1993, 1994 Glenn Chappell and Ian Chai
-  FIGlet Copyright 1996, 1997 John Cowan
-  Portions written by Paul Burton
-  Internet: <ianchai@usa.net>
-  FIGlet, along with the various FIGlet fonts and documentation, is
-    copyrighted under the provisions of the Artistic License (as listed
-    in the file "artistic.license" which is included in this package.
-
---]]
-
---[[
-   Latin-1 codes for German letters, respectively:
-     LATIN CAPITAL LETTER A WITH DIAERESIS = A-umlaut
-     LATIN CAPITAL LETTER O WITH DIAERESIS = O-umlaut
-     LATIN CAPITAL LETTER U WITH DIAERESIS = U-umlaut
-     LATIN SMALL LETTER A WITH DIAERESIS = a-umlaut
-     LATIN SMALL LETTER O WITH DIAERESIS = o-umlaut
-     LATIN SMALL LETTER U WITH DIAERESIS = u-umlaut
-     LATIN SMALL LETTER SHARP S = ess-zed
---]]
-
-local deutsch = {196, 214, 220, 228, 246, 252, 223}
-local fcharlist = {}
-local magic, hardblank, charheight, maxlen, smush, cmtlines, ffright2left, smush2
-
-local function readfontchar(fontfile, theord)
-
-  local t = {}
-  fcharlist[theord] = t
-
-  -- read each character line
-
-  --[[
-
-  eg.
-
-  __  __ @
- |  \/  |@
- | \  / |@
- | |\/| |@
- | |  | |@
- |_|  |_|@
-         @
-         @@
---]]
-
-  for i = 1, charheight do
-    local line = assert(fontfile:read("*l"), "Not enough character lines for character " .. theord)
-    local line = string.gsub(line, "%s+$", "") -- remove trailing spaces
-    assert(line ~= "", "Unexpected empty line")
-
-    -- find the last character (eg. @)
-    local endchar = line:sub(-1) -- last character
-
-    -- trim one or more of the last character from the end
-    while line:sub(-1) == endchar do
-      line = line:sub(1, #line - 1)
-    end -- while line ends with endchar
-
-    table.insert(t, line)
-
-  end -- for each line
-
-end -- readfontchar
-
---- Reads a figlet font file (.flf) into memory and readies it for use by the next figlet
--- These files are cached in memory so that future calls to load a font just read from there.
--- @param filename the full path to the file to read the font from
-function Figlet.readfont(filename)
-  local fontfile = assert(io.open(filename, "r"))
-  local s
-
-  fcharlist = {}
-
-  -- header line
-  s = assert(fontfile:read("*l"), "Empty FIGlet file")
-
-  -- eg.  flf2a$ 8 6          59     15     10        0             24463   153
-  --      magic  charheight  maxlen  smush  cmtlines  ffright2left  smush2  ??
-
-  -- configuration line
-  magic, hardblank, charheight, maxlen, smush, cmtlines, ffright2left, smush2 = string.match(s,
-                                                                                             "^(flf2).(.) (%d+) %d+ (%d+) (%-?%d+) (%d+) ?(%d*) ?(%d*) ?(%-?%d*)")
-
-  assert(magic, "Not a FIGlet 2 font file")
-
-  -- convert to numbers
-  charheight = tonumber(charheight)
-  maxlen = tonumber(maxlen)
-  smush = tonumber(smush)
-  cmtlines = tonumber(cmtlines)
-
-  -- sanity check
-  if charheight < 1 then
-    charheight = 1
-  end -- if
-
-  -- skip comment lines
-  for i = 1, cmtlines do
-    assert(fontfile:read("*l"), "Not enough comment lines")
-  end -- for
-
-  -- get characters space to tilde
-  for theord = string.byte(' '), string.byte('~') do
-    readfontchar(fontfile, theord)
-  end -- for
-
-  -- get 7 German characters
-  for theord = 1, 7 do
-    readfontchar(fontfile, deutsch[theord])
-  end -- for
-
-  -- get extra ones like:
-  -- 0x0395  GREEK CAPITAL LETTER EPSILON
-  -- 246  LATIN SMALL LETTER O WITH DIAERESIS
-
-  repeat
-    local extra = fontfile:read("*l")
-    if not extra then
-      break
-    end -- if eof
-
-    local negative, theord = string.match(extra, "^(%-?)0[xX](%x+)")
-    if theord then
-      theord = tonumber(theord, 16)
-      if negative == "-" then
-        theord = -theord
-      end -- if negative
-    else
-      theord = string.match(extra, "^%d+")
-      assert(theord, "Unexpected line:" .. extra)
-      theord = tonumber(theord)
-    end -- if
-
-    readfontchar(fontfile, theord)
-
-  until false
-
-  fontfile:close()
-
-  -- remove leading/trailing spaces
-
-  for k, v in pairs(fcharlist) do
-
-    -- first see if all lines have a leading space or a trailing space
-    local leading_space = true
-    local trailing_space = true
-    for _, line in ipairs(v) do
-      if line:sub(1, 1) ~= " " then
-        leading_space = false
-      end -- if
-      if line:sub(-1, -1) ~= " " then
-        trailing_space = false
-      end -- if
-    end -- for each line
-
-    -- now remove them if necessary
-    for i, line in ipairs(v) do
-      if leading_space then
-        v[i] = line:sub(2)
-      end -- removing leading space
-      if trailing_space then
-        v[i] = line:sub(1, -2)
-      end -- removing trailing space
-    end -- for each line
-  end -- for each character
-end -- readfont
-
--- add one character to output lines
-local function addchar(which, output, kern, smush)
-  local c = fcharlist[string.byte(which)]
-  if not c then
-    return
-  end -- if doesn't exist
-
-  for i = 1, charheight do
-
-    if smush and output[i] ~= "" and which ~= " " then
-      local lhc = output[i]:sub(-1)
-      local rhc = c[i]:sub(1, 1)
-      output[i] = output[i]:sub(1, -2) -- remove last character
-      if rhc ~= " " then
-        output[i] = output[i] .. rhc
-      else
-        output[i] = output[i] .. lhc
-      end
-      output[i] = output[i] .. c[i]:sub(2)
-
-    else
-      output[i] = output[i] .. c[i]
-    end -- if
-
-    if not (kern or smush) or which == " " then
-      output[i] = output[i] .. " "
-    end -- if
-  end -- for
-
-end -- addchar
-
---- Returns a table of lines representing a string as figlet
--- @tparam string s the text to make into a figlet
--- @tparam boolean kern should we reduce spacing
--- @tparam boolean smush causes the letters to share edges, condensing it even further
-function Figlet.ascii_art(s, kern, smush)
-  assert(fcharlist)
-  assert(charheight > 0)
-
-  -- make table of output lines
-  local output = {}
-  for i = 1, charheight do
-    output[i] = ""
-  end -- for
-
-  for i = 1, #s do
-    local c = s:sub(i, i)
-
-    if c >= " " and c < "\127" then
-      addchar(c, output, kern, smush)
-    end -- if in range
-
-  end -- for
-
-  -- fix up blank character so we can do a string.gsub on it
-  local fixedblank = string.gsub(hardblank, "[%%%]%^%-$().[*+?]", "%%%1")
-
-  for i, line in ipairs(output) do
-    output[i] = string.gsub(line, fixedblank, " ")
-  end -- for
-
-  return output
-end -- function ascii_art
-
---- Returns the figlet as a string, rather than a table
--- @tparam string str the string the make into a figlet
--- @tparam boolean kern should we reduce the space between letters?
--- @tparam boolean smush should the letters share edges, further condensing the output?
--- @see ascii_art
-function Figlet.getString(str, kern, smush)
-  local tbl = Figlet.ascii_art(str, kern, smush)
-  return table.concat(tbl, "\n")
-end
-
---- Returns a figlet as a string, with kern set to true.
--- @tparam string str The string to turn into a figlet
--- @see getString
-function Figlet.getKern(str)
-  return Figlet.getString(str, true)
-end
-
---- Returns a figlet as a string, with smush set to true.
--- @tparam string str The string to turn into a figlet
--- @see getString
-function Figlet.getSmush(str)
-  return Figlet.getString(str, true, true)
-end
-
-return Figlet
- - -
-
-
-generated by LDoc 1.5.0 -Last updated 2023-05-29 18:41:27 -
-
- - diff --git a/src/resources/MDK/doc/source/ftext.lua.html b/src/resources/MDK/doc/source/ftext.lua.html deleted file mode 100755 index 89e04d7..0000000 --- a/src/resources/MDK/doc/source/ftext.lua.html +++ /dev/null @@ -1,1796 +0,0 @@ - - - - - Reference - - - - -
- -
- -
-
-
- - -
- - - - - - -
- -

ftext.lua

-
---- ftext
--- functions to format and print text, and the objects which use them
--- @module ftext
--- @author Damian Monogue <demonnic@gmail.com>
--- @copyright 2020 Damian Monogue
--- @copyright 2021 Damian Monogue
--- @copyright 2022 Damian Monogue
--- @license MIT, see LICENSE.lua
-local ftext = {}
-local dec = {"d", "decimal", "dec"}
-local hex = {"h", "hexidecimal", "hex"}
-local col = {"c", "color", "colour", "col", "name"}
-
---- Performs wordwrapping on a string, given a length limit. Does not understand colour tags and will count them as characters in the string
--- @tparam string str the string to wordwrap
--- @tparam number limit the line length to wrap at
-function ftext.wordWrap(str, limit, indent, indent1)
-  -- pulled from http://lua-users.org/wiki/StringRecipes
-  indent = indent or ""
-  indent1 = indent1 or indent
-  limit = limit or 72
-  local here = 1 - #indent1
-  local function check(sp, st, word, fi)
-    if fi - here > limit then
-      here = st - #indent
-      return "\n" .. indent .. word
-    end
-  end
-  return indent1 .. str:gsub("(%s+)()(%S+)()", check)
-end
-
---- Performs wordwrapping on a string, while ignoring color tags of a given type.
--- @tparam string text the string you are wordwrapping
--- @tparam number limit the line length to wrap at
--- @tparam string type What type of color codes to ignore. 'c' for cecho, 'd' for decho, 'h' for hecho, and anything else or nil to pass the string on to wordWrap
-function ftext.xwrap(text, limit, type)
-  local colorPattern
-  if table.contains(dec, type) then
-    colorPattern = _Echos.Patterns.Decimal[1]
-  elseif table.contains(hex, type) then
-    colorPattern = _Echos.Patterns.Hex[1]
-  elseif table.contains(col, type) then
-    colorPattern = _Echos.Patterns.Color[1]
-  else
-    return ftext.wordWrap(text, limit)
-  end
-  local strippedString = rex.gsub(text, colorPattern, "")
-  local strippedLines = ftext.wordWrap(strippedString, limit):split("\n")
-  local lineIndex = 1
-  local line = ""
-  local strLine = ""
-  local lines = {}
-  local strLines = {}
-  local workingLine = strippedLines[lineIndex]:split("")
-  local workingLineLength = #workingLine
-  local lineColumn = 0
-  for str, color, res in rex.split(text, colorPattern) do
-    if res then
-      if type == "Hex" then
-        color = "#r"
-      elseif type == "Dec" then
-        color = "<r>"
-      elseif type == "Color" then
-        color = "<reset>"
-      end
-    end
-    color = color or ""
-    local strLen = str:len()
-    if lineColumn + strLen <= workingLineLength then
-      strLine = strLine .. str
-      line = line .. str .. color
-      lineColumn = lineColumn + strLen
-    else
-      local neededChars = workingLineLength - lineColumn
-      local take = str:sub(1, neededChars)
-      local leave = str:sub(neededChars + 1, -1)
-      strLine = strLine .. take
-      line = line .. take
-      table.insert(lines, line)
-      table.insert(strLines, strLine)
-      line = ""
-      strLine = ""
-      lineIndex = lineIndex + 1
-      workingLine = strippedLines[lineIndex]:split("")
-      workingLineLength = #workingLine
-      lineColumn = 0
-      if leave:sub(1, 1) == " " then
-        leave = leave:sub(2, -1)
-      end
-      while leave ~= "" do
-        take = leave:sub(1, workingLineLength)
-        leave = leave:sub(workingLineLength + 1, -1)
-        if leave:sub(1, 1) == " " then
-          leave = leave:sub(2, -1)
-        end
-        if take:len() < workingLineLength then
-          lineColumn = take:len()
-          line = line .. take .. color
-          strLine = strLine .. take
-        else
-          lineIndex = lineIndex + 1
-          workingLine = strippedLines[lineIndex]
-          if workingLine then
-            workingLine = strippedLines[lineIndex]:split("")
-            workingLineLength = #workingLine
-          end
-          table.insert(lines, take)
-          table.insert(strLines, take)
-        end
-        if leave == "\n" then
-          table.insert(lines, leave)
-          table.insert(strLines, leave)
-          leave = ""
-        end
-      end
-    end
-  end
-  if line ~= "" then
-    table.insert(lines, line)
-  end
-  return table.concat(lines, "\n")
-end
-
---- The main course, this function returns a formatted string, based on a table of options
--- @tparam string str the string to format
--- @tparam table opts the table of options which control the formatting
--- <br><br>Table of options
--- <table class="tg">
--- <thead>
---   <tr>
---     <th>option name</th>
---     <th>description</th>
---     <th>default</th>
---   </tr>
--- </thead>
--- <tbody>
---   <tr>
---     <td class="tg-1">wrap</td>
---     <td class="tg-1">Should it wordwrap to multiple lines?</td>
---     <td class="tg-1">true</td>
---   </tr>
---   <tr>
---     <td class="tg-2">formatType</td>
---     <td class="tg-2">Determines how it formats for color. 'c' for cecho, 'd' for decho, 'h' for hecho, and anything else for no colors</td>
---     <td class="tg-2">""</td>
---   </tr>
---   <tr>
---     <td class="tg-1">width</td>
---     <td class="tg-1">How wide should we format the text?</td>
---     <td class="tg-1">80</td>
---   </tr>
---   <tr>
---     <td class="tg-2">cap</td>
---     <td class="tg-2">what characters to use for the endcap.</td>
---     <td class="tg-2">""</td>
---   </tr>
---   <tr>
---     <td class="tg-1">capColor</td>
---     <td class="tg-1">what color to make the endcap?</td>
---     <td class="tg-1">the correct 'white' for your formatType</td>
---   </tr>
---   <tr>
---     <td class="tg-2">spacer</td>
---     <td class="tg-2">What character to use for empty space. Must be a single character</td>
---     <td class="tg-2">" "</td>
---   </tr>
---   <tr>
---     <td class="tg-1">spacerColor</td>
---     <td class="tg-1">what color should the spacer be?</td>
---     <td class="tg-1">the correct 'white' for your formatType</td>
---   </tr>
---   <tr>
---     <td class="tg-2">textColor</td>
---     <td class="tg-2">what color should the text itself be?</td>
---     <td class="tg-2">the correct 'white' for your formatType</td>
---   </tr>
---   <tr>
---     <td class="tg-1">alignment</td>
---     <td class="tg-1">How should the text be aligned within the width. "center", "left", or "right"</td>
---     <td class="tg-1">"center"</td>
---   </tr>
---   <tr>
---     <td class="tg-2">nogap</td>
---     <td class="tg-2">Should we put a literal space between the spacer character and the text?</td>
---     <td class="tg-2">false</td>
---   </tr>
---   <tr>
---     <td class="tg-1">inside</td>
---     <td class="tg-1">Put the spacers inside the caps?</td>
---     <td class="tg-1">false</td>
---   </tr>
---   <tr>
---     <td class="tg-2">mirror</td>
---     <td class="tg-2">Should the endcap be reversed on the right? IE [[ becomes ]]</td>
---     <td class="tg-2">true</td>
---   </tr>
---     <td class="tg-1">truncate</td>
---     <td class="tg-1">Cut the string to width. Is superceded by wrap being true.</td>
---     <td class="tg-1">false</td>
---   </tr>
--- </tbody>
--- </table>
-function ftext.fText(str, opts)
-  local options = ftext.fixFormatOptions(str, opts)
-  if options.wrap and (options.strLen > options.effWidth) then
-    local wrapped = ""
-    if str:find("\n") then
-      for _,line in ipairs(str:split("\n")) do
-        local newline = "\n"
-        if _ == 1 then newline = "" end
-        wrapped = wrapped .. newline .. ftext.xwrap(line, options.effWidth, options.formatType)
-      end
-    else
-      wrapped = ftext.xwrap(str, options.effWidth, options.formatType)
-    end
-    local lines = wrapped:split("\n")
-    local formatted = {}
-    options.fixed = false
-    for _, line in ipairs(lines) do
-      table.insert(formatted, ftext.fLine(line, options))
-    end
-    return table.concat(formatted, "\n")
-  else
-    return ftext.fLine(str, options)
-  end
-end
-
--- internal function, used to set defaults and type correct the options table
-function ftext.fixFormatOptions(str, opts)
-  if opts.fixed then
-    return table.deepcopy(opts)
-  end
-  -- Set up all the things we might call the different echo types
-  if opts == nil then
-    opts = {}
-  end -- don't overwrite options if they passed them
-  -- but if they passed something other than a table as the options than oopsie!
-  if type(opts) ~= "table" then
-    error("Improper argument: options expected to be passed as table")
-  end
-  -- now we make a copy of the table, so we don't edit the original during all this
-  local options = table.deepcopy(opts)
-  if options.wrap == nil then
-    options.wrap = true
-  end -- wrap by default.
-  if options.truncate == nil then
-    options.truncate = false
-  end -- do not truncate by default
-  options.formatType = options.formatType or "" -- by default, no color formatting.
-  options.width = options.width or 80 -- default 80 width
-  options.cap = options.cap or "" -- no cap by default
-  options.spacer = options.spacer or " " -- default spacer is the space character
-  options.alignment = options.alignment or "center" -- default alignment is centered
-  if options.nogap == nil then
-    options.nogap = false
-  end
-  if options.inside == nil then
-    options.inside = false
-  end -- by default, we don't put the spacer inside
-  if not options.mirror == false then
-    options.mirror = options.mirror or true
-  end -- by default, we do want to use mirroring for the caps
-  -- setup default options for colors based on the color formatting type
-  if table.contains(dec, options.formatType) then
-    options.capColor = options.capColor or "<255,255,255>"
-    options.spacerColor = options.spacerColor or "<255,255,255>"
-    options.textColor = options.textColor or "<255,255,255>"
-    options.colorReset = "<r>"
-    options.colorPattern = _Echos.Patterns.Decimal[1]
-  elseif table.contains(hex, options.formatType) then
-    options.capColor = options.capColor or "#FFFFFF"
-    options.spacerColor = options.spacerColor or "#FFFFFF"
-    options.textColor = options.textColor or "#FFFFFF"
-    options.colorReset = "#r"
-    options.colorPattern = _Echos.Patterns.Hex[1]
-  elseif table.contains(col, options.formatType) then
-    options.capColor = options.capColor or "<white>"
-    options.spacerColor = options.spacerColor or "<white>"
-    options.textColor = options.textColor or "<white>"
-    options.colorReset = "<reset>"
-    options.colorPattern = _Echos.Patterns.Color[1]
-  else
-    options.capColor = ""
-    options.spacerColor = ""
-    options.textColor = ""
-    options.colorReset = ""
-    options.colorPattern = ""
-  end
-  options.originalString = str
-  options.strippedString = rex.gsub(tostring(str), options.colorPattern, "")
-  options.strLen = string.len(options.strippedString)
-  options.leftCap = options.cap
-  options.rightCap = options.cap
-  options.capLen = string.len(options.cap)
-  local gapSpaces = 0
-  if not options.nogap then
-    if options.alignment == "center" then
-      gapSpaces = 2
-    else
-      gapSpaces = 1
-    end
-  end
-  options.nontextlength = options.width - options.strLen - gapSpaces
-  options.leftPadLen = math.floor(options.nontextlength / 2)
-  options.rightPadLen = options.nontextlength - options.leftPadLen
-  options.effWidth = options.width - ((options.capLen * gapSpaces) + gapSpaces)
-  if options.capLen > options.leftPadLen then
-    options.cap = options.cap:sub(1, options.leftPadLen)
-    options.capLen = string.len(options.cap)
-  end
-  options.fixed = true
-  return options
-end
-
--- internal function, processes a single line of the wrapped string.
-function ftext.fLine(str, opts)
-  local options = ftext.fixFormatOptions(str, opts)
-  local truncate, strLen, width = options.truncate, options.strLen, options.width
-  if truncate and strLen > width then
-    local wrapped = ftext.xwrap(str, options.effWidth, options.formatType)
-    local lines = wrapped:split("\n")
-    str = lines[1]
-  end
-  local leftCap = options.leftCap
-  local rightCap = options.rightCap
-  local leftPadLen = options.leftPadLen
-  local rightPadLen = options.rightPadLen
-  local capLen = options.capLen
-
-  if options.alignment == "center" then -- we're going to center something
-    if options.mirror then -- if we're reversing the left cap and the right cap (IE {{[[ turns into ]]}} )
-      rightCap = string.gsub(rightCap, "<", ">")
-      rightCap = string.gsub(rightCap, "%[", "%]")
-      rightCap = string.gsub(rightCap, "{", "}")
-      rightCap = string.gsub(rightCap, "%(", "%)")
-      rightCap = string.reverse(rightCap)
-    end -- otherwise, they'll be the same, so don't do anything
-    if not options.nogap then
-      str = string.format(" %s ", str)
-    end
-
-  elseif options.alignment == "right" then -- we'll right-align the text
-    leftPadLen = leftPadLen + rightPadLen
-    rightPadLen = 0
-    rightCap = ""
-    if not options.nogap then
-      str = string.format(" %s", str)
-    end
-
-  else -- Ok, so if it's not center or right, we assume it's left. We don't do justified. Sorry.
-    rightPadLen = rightPadLen + leftPadLen
-    leftPadLen = 0
-    leftCap = ""
-    if not options.nogap then
-      str = string.format("%s ", str)
-    end
-  end -- that's it, took care of both left, right, and center formattings, now to output the durn thing.
-  local fullLeftCap = string.format("%s%s%s", options.capColor, leftCap, options.colorReset)
-  local fullLeftSpacer = string.format("%s%s%s", options.spacerColor, string.rep(options.spacer, (leftPadLen - capLen)), options.colorReset)
-  local fullText = string.format("%s%s%s", options.textColor, str, options.colorReset)
-  local fullRightSpacer = string.format("%s%s%s", options.spacerColor, string.rep(options.spacer, (rightPadLen - capLen)), options.colorReset)
-  local fullRightCap = string.format("%s%s%s", options.capColor, rightCap, options.colorReset)
-
-  if options.inside then
-    -- "endcap===== some text =====endcap"
-    -- "endcap===== some text =====pacdne"
-    -- "endcap================= some text"
-    -- "some text =================endcap"
-    local finalString = string.format("%s%s%s%s%s", fullLeftCap, fullLeftSpacer, fullText, fullRightSpacer, fullRightCap)
-    return finalString
-  else
-    -- "=====endcap some text endcap====="
-    -- "=====endcap some text pacdne====="
-    -- "=================endcap some text"
-    -- "some text endcap================="
-
-    local finalString = string.format("%s%s%s%s%s", fullLeftSpacer, fullLeftCap, fullText, fullRightCap, fullRightSpacer)
-    return finalString
-  end
-end
-
--- Functions below here are honestly for backwards compatibility and subject to removal soon.
--- They just force some options table overrides for the most part.
-
--- no colors, no wrap
-function ftext.align(str, opts)
-  local options = {}
-  if opts == nil then
-    opts = {}
-  end
-  if type(opts) == "table" then
-    options = table.deepcopy(opts)
-    options.formatType = ""
-    options.wrap = false
-  else
-    error("Improper argument: options expected to be passed as table")
-  end
-  options = ftext.fixFormatOptions(str, options)
-  return ftext.fLine(str, options)
-end
-
--- decho formatting, no wrap
-function ftext.dalign(str, opts)
-  local options = {}
-  if opts == nil then
-    opts = {}
-  end
-  if type(opts) == "table" then
-    options = table.deepcopy(opts)
-    options.formatType = "d"
-    options.wrap = false
-  else
-    error("Improper argument: options expected to be passed as table")
-  end
-  options = ftext.fixFormatOptions(str, options)
-  return ftext.fLine(str, options)
-end
-
--- cecho formatting, no wrap
-function ftext.calign(str, opts)
-  local options = {}
-  if opts == nil then
-    opts = {}
-  end
-  if type(opts) == "table" then
-    options = table.deepcopy(opts)
-    options.formatType = "c"
-    options.wrap = false
-  else
-    error("Improper argument: options expected to be passed as table")
-  end
-  options = ftext.fixFormatOptions(str, options)
-  return ftext.fLine(str, options)
-end
-
--- hecho formatting, no wrap
-function ftext.halign(str, opts)
-  local options = {}
-  if opts == nil then
-    opts = {}
-  end
-  if type(opts) == "table" then
-    options = table.deepcopy(opts)
-    options.formatType = "h"
-    options.wrap = false
-  else
-    error("Improper argument: options expected to be passed as table")
-  end
-  options = ftext.fixFormatOptions(str, options)
-  return ftext.fLine(str, options)
-end
-
--- literally just fText but forces cecho formatting
-function ftext.cfText(str, opts)
-  local options = {}
-  if opts == nil then
-    opts = {}
-  end
-  if type(opts) == "table" then
-    options = table.deepcopy(opts)
-    options.formatType = "c"
-  else
-    error("Improper argument: options expected to be passed as table")
-  end
-  options = ftext.fixFormatOptions(str, options)
-  return ftext.fText(str, options)
-end
-
--- fText but forces decho formatting
-function ftext.dfText(str, opts)
-  local options = {}
-  if opts == nil then
-    opts = {}
-  end
-  if type(opts) == "table" then
-    options = table.deepcopy(opts)
-    options.formatType = "d"
-  else
-    error("Improper argument: options expected to be passed as table")
-  end
-  options = ftext.fixFormatOptions(str, options)
-  return ftext.fText(str, options)
-end
-
--- fText but forces hecho formatting
-function ftext.hfText(str, opts)
-  local options = {}
-  if opts == nil then
-    opts = {}
-  end
-  if type(opts) == "table" then
-    options = table.deepcopy(opts)
-    options.formatType = "h"
-  else
-    error("Improper argument: options expected to be passed as table")
-  end
-  options = ftext.fixFormatOptions(str, options)
-  return ftext.fText(str, options)
-end
-
---- Stand alone text formatter object. Remembers the options you set and can be adjusted as needed
--- @type ftext.TextFormatter
--- @author Damian Monogue <demonnic@gmail.com>
--- @copyright 2020 Damian Monogue
--- @license MIT, see LICENSE.lua
-
-local TextFormatter = {}
-TextFormatter.validFormatTypes = {'d', 'dec', 'decimal', 'h', 'hex', 'hexidecimal', 'c', 'color', 'colour', 'col', 'name', 'none', 'e', 'plain', ''}
-
---- Set's the formatting type whether it's for cecho, decho, or hecho
--- @tparam string typeToSet What type of formatter is this? Valid options are { 'd', 'dec', 'decimal', 'h', 'hex', 'hexidecimal', 'c', 'color', 'colour', 'col', 'name'}
-function TextFormatter:setType(typeToSet)
-  local isNotValid = not table.contains(self.validFormatTypes, typeToSet)
-  if isNotValid then
-    error("TextFormatter:setType: Invalid argument, valid types are:" .. table.concat(self.validFormatTypes, ", "))
-  end
-  self.options.formatType = typeToSet
-end
-
-function TextFormatter:toBoolean(thing)
-  if type(thing) ~= "boolean" then
-    if thing == "true" then
-      thing = true
-    elseif thing == "false" then
-      thing = false
-    else
-      return nil
-    end
-  end
-  return thing
-end
-
-function TextFormatter:checkString(str)
-  if type(str) ~= "string" then
-    if tostring(str) then
-      str = tostring(str)
-    else
-      return nil
-    end
-  end
-  return str
-end
-
---- Sets whether or not we should do word wrapping.
--- @tparam boolean shouldWrap should we do wordwrapping?
-function TextFormatter:setWrap(shouldWrap)
-  local argumentType = type(shouldWrap)
-  shouldWrap = self:toBoolean(shouldWrap)
-  if shouldWrap == nil then
-    error("TextFormatter:setWrap(shouldWrap) Argument error, boolean expected, got " .. argumentType ..
-            ", if you want to set the number of characters wide to format for, use setWidth()")
-  end
-  self.options.wrap = shouldWrap
-end
-
---- Sets the width we should format for
--- @tparam number width the width we should format for
-function TextFormatter:setWidth(width)
-  if type(width) ~= "number" then
-    if tonumber(width) then
-      width = tonumber(width)
-    else
-      error("TextFormatter:setWidth(width): Argument error, number expected, got " .. type(width))
-    end
-  end
-  self.options.width = width
-end
-
---- Sets the cap for the formatter
--- @tparam string cap the string to use for capping the formatted string.
-function TextFormatter:setCap(cap)
-  local argumentType = type(cap)
-  local cap = self:checkString(cap)
-  if cap == nil then
-    error("TextFormatter:setCap(cap): Argument error, string expect, got " .. argumentType)
-  end
-  self.options.cap = cap
-end
-
---- Sets the color for the format cap
--- @tparam string capColor Color which can be formatted via Geyser.Color.parse()
-function TextFormatter:setCapColor(capColor)
-  local argumentType = type(capColor)
-  local capColor = self:checkString(capColor)
-  if capColor == nil then
-    error("TextFormatter:setCapColor(capColor): Argument error, string expected, got " .. argumentType)
-  end
-  self.options.capColor = capColor
-end
-
---- Sets the color for spacing character
--- @tparam string spacerColor Color which can be formatted via Geyser.Color.parse()
-function TextFormatter:setSpacerColor(spacerColor)
-  local argumentType = type(spacerColor)
-  local spacerColor = self:checkString(spacerColor)
-  if spacerColor == nil then
-    error("TextFormatter:setSpacerColor(spacerColor): Argument error, string expected, got " .. argumentType)
-  end
-  self.options.spacerColor = spacerColor
-end
-
---- Sets the color for formatted text
--- @tparam string textColor Color which can be formatted via Geyser.Color.parse()
-function TextFormatter:setTextColor(textColor)
-  local argumentType = type(textColor)
-  local textColor = self:checkString(textColor)
-  if textColor == nil then
-    error("TextFormatter:setTextColor(textColor): Argument error, string expected, got " .. argumentType)
-  end
-  self.options.textColor = textColor
-end
-
---- Sets the spacing character to use. Should be a single character
--- @tparam string spacer the character to use for spacing
-function TextFormatter:setSpacer(spacer)
-  local argumentType = type(spacer)
-  local spacer = self:checkString(spacer)
-  if spacer == nil then
-    error("TextFormatter:setSpacer(spacer): Argument error, string expect, got " .. argumentType)
-  end
-  self.options.spacer = spacer
-end
-
---- Set the alignment to format for
--- @tparam string alignment How to align the formatted string. Valid options are 'left', 'right', or 'center'
-function TextFormatter:setAlignment(alignment)
-  local validAlignments = {"left", "right", "center"}
-  if not table.contains(validAlignments, alignment) then
-    error("TextFormatter:setAlignment(alignment): Argument error: Only valid arguments for setAlignment are 'left', 'right', or 'center'. You sent" ..
-            alignment)
-  end
-  self.options.alignment = alignment
-end
-
---- Set whether the the spacer should go inside the the cap or outside of it
--- @tparam boolean spacerInside
-function TextFormatter:setInside(spacerInside)
-  local argumentType = type(spacerInside)
-  spacerInside = self:toBoolean(spacerInside)
-  if spacerInside == nil then
-    error("TextFormatter:setInside(spacerInside) Argument error, boolean expected, got " .. argumentType)
-  end
-  self.options.inside = spacerInside
-end
-
---- Set whether we should mirror/reverse the caps. IE << becomes >> if set to true
--- @tparam boolean shouldMirror
-function TextFormatter:setMirror(shouldMirror)
-  local argumentType = type(shouldMirror)
-  shouldMirror = self:toBoolean(shouldMirror)
-  if shouldMirror == nil then
-    error("TextFormatter:setMirror(shouldMirror): Argument error, boolean expected, got " .. argumentType)
-  end
-  self.options.mirror = shouldMirror
-end
-
---- Set whether we should remove the gap spaces between the text and spacer characters. "===some text===" if set to true, "== some text ==" if set to false
--- @tparam boolean noGap
-function TextFormatter:setNoGap(noGap)
-  local argumentType = type(noGap)
-  noGap = self:toBoolean(noGap)
-  if noGap == nil then
-    error("TextFormatter:setNoGap(noGap): Argument error, boolean expected, got " .. argumentType)
-  end
-  self.options.noGap = noGap
-end
-
---- Enables truncation (cutting to length). You still need to ensure wrap is disabled, as it supercedes.
-function TextFormatter:enableTruncate()
-  self.options.truncate = true
-end
-
---- Disables truncation (cutting to length). You still need to ensure wrap is enabled if you want it to wrap.
-function TextFormatter:disableTruncate()
-  self.options.truncate = false
-end
-
---- Format a string based on the stored options
--- @tparam string str The string to format
-function TextFormatter:format(str)
-  return ftext.fText(str, self.options)
-end
-
---- Creates and returns a new TextFormatter.
--- @tparam table options the options for the text formatter to use when running format()
--- <br><br>Table of options
--- <table class="tg">
--- <thead>
---   <tr>
---     <th>option name</th>
---     <th>description</th>
---     <th>default</th>
---   </tr>
--- </thead>
--- <tbody>
---   <tr>
---     <td class="tg-1">wrap</td>
---     <td class="tg-1">Should it wordwrap to multiple lines?</td>
---     <td class="tg-1">true</td>
---   </tr>
---   <tr>
---     <td class="tg-2">formatType</td>
---     <td class="tg-2">Determines how it formats for color. 'c' for cecho, 'd' for decho, 'h' for hecho, and anything else for no colors</td>
---     <td class="tg-2">"c"</td>
---   </tr>
---   <tr>
---     <td class="tg-1">width</td>
---     <td class="tg-1">How wide should we format the text?</td>
---     <td class="tg-1">80</td>
---   </tr>
---   <tr>
---     <td class="tg-2">cap</td>
---     <td class="tg-2">what characters to use for the endcap.</td>
---     <td class="tg-2">""</td>
---   </tr>
---   <tr>
---     <td class="tg-1">capColor</td>
---     <td class="tg-1">what color to make the endcap?</td>
---     <td class="tg-1">the correct 'white' for your formatType</td>
---   </tr>
---   <tr>
---     <td class="tg-2">spacer</td>
---     <td class="tg-2">What character to use for empty space. Must be a single character</td>
---     <td class="tg-2">" "</td>
---   </tr>
---   <tr>
---     <td class="tg-1">spacerColor</td>
---     <td class="tg-1">what color should the spacer be?</td>
---     <td class="tg-1">the correct 'white' for your formatType</td>
---   </tr>
---   <tr>
---     <td class="tg-2">textColor</td>
---     <td class="tg-2">what color should the text itself be?</td>
---     <td class="tg-2">the correct 'white' for your formatType</td>
---   </tr>
---   <tr>
---     <td class="tg-1">alignment</td>
---     <td class="tg-1">How should the text be aligned within the width. "center", "left", or "right"</td>
---     <td class="tg-1">"center"</td>
---   </tr>
---   <tr>
---     <td class="tg-2">nogap</td>
---     <td class="tg-2">Should we put a literal space between the spacer character and the text?</td>
---     <td class="tg-2">false</td>
---   </tr>
---   <tr>
---     <td class="tg-1">inside</td>
---     <td class="tg-1">Put the spacers inside the caps?</td>
---     <td class="tg-1">false</td>
---   </tr>
---   <tr>
---     <td class="tg-2">mirror</td>
---     <td class="tg-2">Should the endcap be reversed on the right? IE [[ becomes ]]</td>
---     <td class="tg-2">true</td>
---   </tr>
---     <td class="tg-1">truncate</td>
---     <td class="tg-1">Cut the string to width. Is superceded by wrap being true.</td>
---     <td class="tg-1">false</td>
---   </tr>
--- </tbody>
--- </table>
--- @usage
--- local TextFormatter = require("MDK.ftext").TextFormatter
--- myFormatter = TextFormatter:new( {
---   width = 40,
---   cap = "[CAP]",
---   capColor = "<orange>",
---   textColor = "<light_blue>"
--- })
--- myMessage = "This is a test of the emergency broadcasting system. This is only a test"
--- cecho(myFormatter:format(myMessage))
-
-function TextFormatter:new(options)
-  if options == nil then
-    options = {}
-  end
-  if options and type(options) ~= "table" then
-    error("TextFormatter:new(options): Argument error, table expected, got " .. type(options))
-  end
-  local me = {}
-  me.options = {formatType = "c", wrap = true, width = 80, cap = "", spacer = " ", alignment = "center", inside = true, mirror = false}
-  for option, value in pairs(options) do
-    me.options[option] = value
-  end
-  setmetatable(me, self)
-  self.__index = self
-  return me
-end
-ftext.TextFormatter = TextFormatter
-
---- Easy formatting for text tables
--- @type ftext.TableMaker
--- @author Damian Monogue <demonnic@gmail.com>
--- @copyright 2020 Damian Monogue
--- @license MIT, see LICENSE.lua
-
-local TableMaker = {
-  headCharacter = "*",
-  footCharacter = "*",
-  edgeCharacter = "*",
-  rowSeparator = "-",
-  separator = "|",
-  separateRows = true,
-  colorReset = "<reset>",
-  formatType = "c",
-  printHeaders = true,
-  autoEcho = false,
-  title = "",
-  printTitle = false,
-  headerTitle = false,
-  forceHeaderSeparator = false,
-  autoEchoConsole = "main",
-}
-
-function TableMaker:checkPosition(position, func)
-  if position == nil then
-    position = 0
-  end
-  if type(position) ~= "number" then
-    if tonumber(position) then
-      position = tonumber(position)
-    else
-      error(func .. ": Argument error: position expected as number, got " .. type(position))
-    end
-  end
-  return position
-end
-
-function TableMaker:insert(tbl, pos, item)
-  if pos ~= 0 then
-    table.insert(tbl, pos, item)
-  else
-    table.insert(tbl, item)
-  end
-end
-
---- Get the TextFormatter which defines the format of a specific column
--- @tparam number position The position of the column you're getting, counting from the left. If not provided will return the last column.
-function TableMaker:getColumn(position)
-  position = position or #self.columns
-  position = self:checkPosition(position, "TableMaker:getColumn(position)")
-  return self.columns[position]
-end
-
---- Adds a column definition for the table.
--- @tparam table options Table of options suitable for a TextFormatter object. See https://github.com/demonnic/fText/wiki/fText
--- @tparam number position The position of the column you're adding, counting from the left. If not provided will add it as the last column
-function TableMaker:addColumn(options, position)
-  if options == nil then
-    options = {}
-  end
-  if not type(options) == "table" then
-    error("TableMaker:addColumn(options, position): Argument error: options expected as table, got " .. type(options))
-  end
-  local options = table.deepcopy(options)
-  position = self:checkPosition(position, "TableMaker:addColumn(options, position)")
-  options.width = options.width or 20
-  options.name = options.name or ""
-  local formatter = TextFormatter:new(options)
-  self:insert(self.columns, position, formatter)
-end
-
---- Deletes a column at the given position
--- @tparam number position the column you wish to delete
-function TableMaker:deleteColumn(position)
-  if position == nil then
-    error("TableMaker:deleteColumn(position): Argument Error: position as number expected, got nil")
-  end
-  position = self:checkPosition(position)
-  local maxColumn = #self.columns
-  if position > maxColumn then
-    error(
-      "TableMaker:deleteColumn(position): Argument Error: position provided was larger than number of columns in the table. Number of columns: " ..
-        #self.columns)
-  end
-  table.remove(self.columns, position)
-end
-
---- Replaces a column at a specific position with the newly provided formatting
--- @tparam table options table of options suitable for a TextFormatter object. See https://github.com/demonnic/fText/wiki/fText
--- @tparam number position which column you are replacing, counting from the left.
-function TableMaker:replaceColumn(options, position)
-  if position == nil then
-    error("TableMaker:replaceColumn(options, position): Argument error: position as number expected, got nil")
-  end
-  position = self:checkPosition(position)
-  if type(options) ~= "table" then
-    error("TableMaker:replaceColumn(options, position): Argument error: options as table expected, got " .. type(options))
-  end
-  if #self.columns < position then
-    error(
-      "TableMaker:replaceColumn(options, position): you cannot specify a position higher than the number of columns currently in the TableMaker. You sent:" ..
-        position .. " and there are: " .. #self.columns .. "columns in the TableMaker")
-  end
-  options.width = options.width or 20
-  options.name = options.name or ""
-  local formatter = TextFormatter:new(options)
-  self.columns[position] = formatter
-end
-
---- Gets the row of output at a specific position
--- @tparam number position The position of the row you want to get, coutning from the top down. If not provided defaults to the last row in the table
--- @return table of entries in the specified row
-function TableMaker:getRow(position)
-  position = position or #self.rows
-  position = self:checkPosition(position, "TableMaker:getRow(position)")
-  return self.rows[position]
-end
-
---- Adds a row of output to the table
--- @tparam table columnEntries This indexed table contains an entry for each column in the table. Entries in the table must be strings, a table of options for insertPopup or insertLink, or a function which returns one of these things
--- @tparam number position position for the row you want to add, counting from the top down. If not provided defaults to the last line in the table.
-function TableMaker:addRow(columnEntries, position)
-  local columnEntriesType = type(columnEntries)
-  if columnEntriesType ~= "table" then
-    error("TableMaker:addRow(columnEntries, position): Argument error, columnEntries expected as table, got " .. columnEntriesType)
-  end
-  for _, entry in ipairs(columnEntries) do
-    local entryCheck = self:checkEntry(entry)
-    if entryCheck == 0 then
-      if type(entry) == "function" then
-        error(
-          "TableMaker:addRow(columnEntries, position): Argument Error, you provided a function for a columnEntry but it does not return a string. We need a string. It was entry number " ..
-            _ .. "in columnEntries")
-      else
-        error("TableMaker:addRow(columnEntries, position): Argument error, columnEntries items expected as string, got:" .. type(entry))
-      end
-    end
-  end
-  position = self:checkPosition(position, "TableMaker:addRow(columnEntries, position)")
-  self:insert(self.rows, position, columnEntries)
-end
-
---- Deletes the row at the given position
--- @tparam number position the row to delete
-function TableMaker:deleteRow(position)
-  if position == nil then
-    error("TableMaker:deleteRow(position): Argument Error: position as number expected, got nil")
-  end
-  position = self:checkPosition(position, "TableMaker:deleteRow(position)")
-  local maxRow = #self.rows
-  if position > maxRow then
-    error("TableMaker:deleteRow(position): Argument Error: position given was > the number of rows we have # of rows is:" .. maxRow)
-  end
-  table.remove(self.rows, position)
-end
-
---- Replaces a row of output in the table
--- @tparam table columnEntries This indexed table contains an entry for each column in the table. Entries in the table must be strings, a table of options for insertPopup or insertLink, or a function which returns one of these things
--- @tparam number position position for the row you want to add, counting from the top down.
-function TableMaker:replaceRow(columnEntries, position)
-  if position == nil then
-    error("TableMaker:replaceRow(columnEntries, position): ArgumentError: position expected as number, received nil")
-  end
-  position = self:checkPosition(position, "TableMaker:replaceRow(columnEntries, position)")
-  if #self.rows < position then
-    error(
-      "TableMaker:replaceRow(columnEntries, position): position cannot be greater than the number of rows already in the tablemaker. You provided: " ..
-        position .. " and there are " .. #self.rows .. "rows in the TableMaker")
-  end
-  for _, entry in ipairs(columnEntries) do
-    local entryCheck = self:checkEntry(entry)
-    if entryCheck == 0 then
-      if type(entry) == "function" then
-        error(
-          "TableMaker:replaceRow(columnEntries, position): Argument Error: you provided a function for a columnEntry but it does not return a string. We need a string. It was entry number " ..
-            _ .. "in columnEntries")
-      else
-        error("TableMaker:replaceRow(columnEntries, position): Argument error: columnEntries items expected as string, got:" .. type(entry))
-      end
-    end
-  end
-  self.rows[position] = columnEntries
-end
-
-function TableMaker:checkEntry(entry)
-  local allowedTypes = {"string"}
-  if self.allowPopups then
-    table.insert(allowedTypes, "table")
-  end
-  local entryType = type(entry)
-  if entryType == "function" then
-    entryType = type(entry())
-  end
-  if table.contains(allowedTypes, entryType) then
-    return entry
-  else
-    return 0
-  end
-end
-
-function TableMaker:checkNumber(num)
-  if num == nil then
-    num = 0
-  end
-  if not tonumber(num) then
-    num = 0
-  end
-  return tonumber(num)
-end
-
---- Get the contents and formatter for a specific cell
--- @tparam number row the row number of the cell, counted top down.
--- @tparam number column the column number of the cell, counted from the left.
--- @return the base text and TextFormatter for the cell at the specific row and column number
-function TableMaker:getCell(row, column)
-  local rowType = type(row)
-  local columnType = type(column)
-  local maxRow = #self.rows
-  local maxColumn = #self.columns
-  local ae = "TableMaker:getCell(row, column): Argument error:"
-  row = self:checkNumber(row)
-  column = self:checkNumber(column)
-  if row == 0 then
-    if rowType ~= "number" then
-      printError(f"{ae} row as number expected, got {rowType}", true, true)
-    else
-      printError(f"{ae} rows start at 1, and you asked for row 0", true, true)
-    end
-  elseif column == 0 then
-    if columnType ~= "number" then
-      printError(f"{ae} column as number expected, got {columnType}", true, true)
-    else
-      printError(f"{ae} columns start at 1, and you asked for column 0", true, true)
-    end
-  elseif row > maxRow then
-    printError(f"{ae} row exceeds number of rows in table ({maxRow})")
-  elseif column > maxColumn then
-    printError(f"{ae} column exceeds number of columns in table ({maxColumn})", true, true)
-  end
-  return self.rows[row][column], self.columns[column]
-end
-
---- Sets a specific cell's display information
--- @tparam number row the row number of the cell, counted from the top down
--- @tparam number column the column number of the cell, counted from the left
--- @param entry What to set the entry to. Must be a string, or a table of options for insertLink/insertPopup if allowPopups is set. Or a function which returns one of these things
-function TableMaker:setCell(row, column, entry)
-  local maxRow = #self.rows
-  local maxColumn = #self.columns
-  local ae = "TableMaker:setCell(row, column, entry): Argument Error:"
-  row = self:checkNumber(row)
-  if row == 0 then
-    error(ae .. " row must be a number, you provided " .. type(row))
-  end
-  column = self:checkNumber(column)
-  if column == 0 then
-    error(ae .. " column must be a number, you provided " .. type(column))
-  end
-  if row > maxRow then
-    error(ae .. " row is higher than the number of rows in the table. Highest row:" .. maxRow)
-  end
-  if column > maxColumn then
-    error(ae .. " column is higher than the number of columns in the table. Highest column:" .. maxColumn)
-  end
-  local entryType = type(entry)
-  entry = self:checkEntry(entry)
-  if entry == 0 then
-    if entryType == "function" then
-      error(ae .. " entry was provided as a function, but does not return a string. We need a string in the end")
-    else
-      error("TableMaker:setCell(row, column, entry): Argument Error: entry must be a string, or a function which returns a string. You provided a " .. entryType)
-    end
-  end
-  self.rows[row][column] = entry
-end
-
-function TableMaker:totalWidth()
-  local width = 0
-  local numberOfColumns = #self.columns
-  local separatorWidth = string.len(self.separator)
-  local edgeWidth = string.len(self.edgeCharacter) * 2
-  for _, column in ipairs(self.columns) do
-    width = width + column.options.width
-  end
-  separatorWidth = separatorWidth * (numberOfColumns - 1)
-  width = width + edgeWidth + separatorWidth
-  return width
-end
-
-function TableMaker:getType()
-  local dec = {"d", "decimal", "dec"}
-  local hex = {"h", "hexidecimal", "hex"}
-  local col = {"c", "color", "colour", "col", "name"}
-  if table.contains(dec, self.formatType) then
-    return 'd'
-  elseif table.contains(hex, self.formatType) then
-    return 'h'
-  elseif table.contains(col, self.formatType) then
-    return 'c'
-  else
-    return ''
-  end
-end
-
-function TableMaker:echo(message, echoType, ...)
-  local fType = self:getType()
-  local consoleType = type(self.autoEchoConsole)
-  local console = ""
-  if echoType == nil then
-    echoType = ""
-  end
-  if consoleType == "string" then
-    console = self.autoEchoConsole
-  elseif consoleType == "nil" then
-    console = "main"
-  else
-    console = self.autoEchoConsole.name
-  end
-  local functionName = string.format("%secho%s", fType, echoType)
-  local func = _G[functionName]
-  if echoType == "" then
-    func(console, message)
-  else
-    func(console, message, ...)
-  end
-end
-
-function TableMaker:scanRow(rowToScan)
-  local row = table.deepcopy(rowToScan)
-  local rowEntries = #row
-  local numberOfColumns = #self.columns
-  local columns = {}
-  local linesInRow = 0
-  local rowText = ""
-  local ec = self.frameColor .. self.edgeCharacter .. self.colorReset
-  local sep = self.separatorColor .. self.separator .. self.colorReset
-
-  if rowEntries < numberOfColumns then
-    local entriesNeeded = numberOfColumns - rowEntries
-    for i = 1, entriesNeeded do
-      table.insert(row, "")
-    end
-  end
-  for index, formatter in ipairs(self.columns) do
-    local str = row[index]
-    local column = ""
-    if type(str) == "function" then
-      str = str()
-    end
-    column = formatter:format(str)
-    table.insert(columns, column:split("\n"))
-  end
-  for _, rowLines in ipairs(columns) do
-    if linesInRow < #rowLines then
-      linesInRow = #rowLines
-    end
-  end
-  for index, rowLines in ipairs(columns) do
-    if #rowLines < linesInRow then
-      local neededLines = linesInRow - #rowLines
-      for i = 1, neededLines do
-        table.insert(rowLines, self.columns[index]:format(""))
-      end
-    end
-  end
-  for i = 1, linesInRow do
-    local thisLine = ec
-    for index, column in ipairs(columns) do
-      if index == 1 then
-        thisLine = string.format("%s%s", thisLine, column[i])
-      else
-        thisLine = string.format("%s%s%s", thisLine, sep, column[i])
-      end
-    end
-    thisLine = string.format("%s%s", thisLine, ec)
-    if rowText == "" then
-      rowText = thisLine
-    else
-      rowText = string.format("%s\n%s", rowText, thisLine)
-    end
-  end
-  return rowText
-end
-
-function TableMaker:echoRow(rowToScan)
-  local row = table.deepcopy(rowToScan)
-  local rowEntries = #row
-  local numberOfColumns = #self.columns
-  local columns = {}
-  local linesInRow = 0
-  local ec = self.frameColor .. self.edgeCharacter .. self.colorReset
-  local sep = self.separatorColor .. self.separator .. self.colorReset
-  if rowEntries < numberOfColumns then
-    local entriesNeeded = numberOfColumns - rowEntries
-    for i = 1, entriesNeeded do
-      table.insert(row, "")
-    end
-  end
-  for index, formatter in ipairs(self.columns) do
-    local str = row[index]
-    local column = ""
-    if type(str) == "function" then
-      str = str()
-    end
-    if type(str) == "table" then
-      str = str[1]
-    end
-    column = formatter:format(str)
-    table.insert(columns, column:split("\n"))
-  end
-  for _, rowLines in ipairs(columns) do
-    if linesInRow < #rowLines then
-      linesInRow = #rowLines
-    end
-  end
-  for index, rowLines in ipairs(columns) do
-    if #rowLines < linesInRow then
-      local neededLines = linesInRow - #rowLines
-      for i = 1, neededLines do
-        table.insert(rowLines, self.columns[index]:format(""))
-      end
-    end
-  end
-  for i = 1, linesInRow do
-    self:echo(ec)
-    for index, column in ipairs(columns) do
-      local message = column[i]
-      if index ~= 1 then
-        self:echo(sep)
-      end
-      if type(row[index]) == "string" then
-        self:echo(message)
-      elseif type(row[index]) == "table" then
-        local rowEntry = row[index]
-        local echoType = ""
-        if type(rowEntry[2]) == "string" then
-          echoType = "Link"
-        elseif type(rowEntry[2]) == "table" then
-          echoType = "Popup"
-        end
-        self:echo(message, echoType, rowEntry[2], rowEntry[3], rowEntry[4] or true)
-      end
-    end
-    self:echo(ec)
-    self:echo("\n")
-  end
-end
-
-function TableMaker:makeHeader()
-  local totalWidth = self:totalWidth()
-  local ec = self.frameColor .. self.edgeCharacter .. self.colorReset
-  local sep = self.separatorColor .. self.separator .. self.colorReset
-  local header = self.frameColor .. string.rep(self.headCharacter, totalWidth) .. self.colorReset
-  local columnHeaders = ""
-  if self.printHeaders then
-    local columnEntries = {}
-    for _, v in ipairs(self.columns) do
-      table.insert(columnEntries, v:format(v.options.name))
-    end
-    local divWithNewlines = self.headerTitle and header or self:createRowDivider()
-    divWithNewlines = "\n" .. divWithNewlines
-    columnHeaders = string.format("\n%s%s%s%s", ec, table.concat(columnEntries, sep), ec, (self.separateRows or self.forceHeaderSeparator) and divWithNewlines or '')
-  end
-  local title = self:makeTitle(totalWidth, header)
-  header = string.format("%s%s%s", header, title, columnHeaders)
-  return header
-end
-
-function TableMaker:makeTitle(totalWidth, header)
-  if not self.printTitle then
-    return ""
-  end
-  local title = ftext.fText(self.title, {width = totalWidth, alignment = "center", cap = self.headCharacter, capColor = self.frameColor, inside = true, textColor = self.titleColor, formatType = self.formatType})
-  title = string.format("\n%s\n%s", title, header)
-  return title
-end
-
-function TableMaker:createRowDivider()
-  local columnPieces = {}
-  for _, v in ipairs(self.columns) do
-    local piece = string.format("%s%s%s", self.separatorColor, string.rep(self.rowSeparator, v.options.width), self.colorReset)
-    table.insert(columnPieces, piece)
-  end
-  local ec = self.frameColor .. self.edgeCharacter .. self.colorReset
-  local sep = self.separatorColor .. self.separator .. self.colorReset
-  return string.format("%s%s%s", ec, table.concat(columnPieces, sep), ec)
-end
-
---- set the title of the table
--- @tparam string title The title of the table.
-function TableMaker:setTitle(title)
-  self.title = title
-  if self.autoEcho then self:assemble() end
-end
-
---- set the rowSeparator for the table
--- @tparam string char The row separator to use
-function TableMaker:setRowSeparator(char)
-  self.rowSeparator = char
-  if self.autoEcho then self:assemble() end
-end
-
---- set the edgeCharacter for the table
--- @tparam string char The edge character to use
-function TableMaker:setEdgeCharacter(char)
-  self.edgeCharacter = char
-  if self.autoEcho then self:assemble() end
-end
-
---- set the foot character for the table
--- @tparam string char The foot character to use
-function TableMaker:setFootCharacter(char)
-  self.footCharacter = char
-  if self.autoEcho then self:assemble() end
-end
-
---- set the head character for the table
--- @tparam string char The head character to use
-function TableMaker:setHeadCharacter(char)
-  self.headCharacter = char
-  if self.autoEcho then self:assemble() end
-end
-
---- set the column separator character for the table
--- @tparam string char The separator character to use
-function TableMaker:setSeparator(char)
-  self.separator = char
-  if self.autoEcho then self:assemble() end
-end
-
---- set the title color for the table
--- @tparam string color The title color to use. Should match the color type of the tablemaker (cecho by default)
-function TableMaker:setTitleColor(color)
-  self.titleColor = color
-  if self.autoEcho then self:assemble() end
-end
-
---- set the title color for the table
--- @tparam string color The separator color to use. Should match the color type of the tablemaker (cecho by default)
-function TableMaker:setSeparatorColor(color)
-  self.separatorColor = color
-  if self.autoEcho then self:assemble() end
-end
-
---- set the title color for the table
--- @tparam string color The frame color to use. Should match the color type of the tablemaker (cecho by default)
-function TableMaker:setFrameColor(color)
-  self.frameColor = color
-  if self.autoEcho then self:assemble() end
-end
-
---- Force a separator between the header and first row, even if the row separator is disabled for the overall table
-function TableMaker:enableForceHeaderSeparator()
-  self.forceHeaderSeparator = true
-  if self.autoEcho then self:assemble() end
-end
-
---- Do not force a separator between the header and first row, even if the row separator is disabled for the overall table
-function TableMaker:disableForceHeaderSeparator()
-  self.forceHeaderSeparator = false
-  if self.autoEcho then self:assemble() end
-end
-
---- Enable using the title separator for the column headers as well
-function TableMaker:enableHeaderTitle()
-  self.headerTitle = true
-  if self.autoEcho then self:assemble() end
-end
-
---- Disable using the title separator for the column headers as well
-function TableMaker:disableHeaderTitle()
-  self.headerTitle = false
-  if self.autoEcho then self:assemble() end
-end
-
---- enable printing the title of the table
-function TableMaker:enablePrintTitle()
-  self.printTitle = true
-  if self.autoEcho then self:assemble() end
-end
-
---- disable printing the title of the table
-function TableMaker:disablePrintTitle()
-  self.printTitle = false
-  if self.autoEcho then self:assemble() end
-end
-
---- enable printing of the column headers
-function TableMaker:enablePrintHeaders()
-  self.printHeaders = true
-  if self.autoEcho then self:assemble() end
-end
-
---- disable printing of the column headers
-function TableMaker:disablePrintHeaders()
-  self.printHeaders = false
-  if self.autoEcho then self:assemble() end
-end
-
---- enable printing the separator line between rows
-function TableMaker:enableRowSeparator()
-  self.separateRows = true
-  if self.autoEcho then self:assemble() end
-end
-
---- enable printing the separator line between rows
-function TableMaker:disableRowSeparator()
-  self.separateRows = false
-  if self.autoEcho then self:assemble() end
-end
-
---- enables making cells which incorporate insertLink/insertPopup
-function TableMaker:enablePopups()
-  self.autoEcho = true
-  self.allowPopups = true
-  if self.autoEcho then self:assemble() end
-end
-
---- enables autoEcho so that when assemble is called it echos automatically
-function TableMaker:enableAutoEcho()
-  self.autoEcho = true
-  self:assemble()
-end
-
---- disables autoecho. Cannot be used if allowPopups is set
-function TableMaker:disableAutoEcho()
-  if self.allowPopups then
-    error("TableMaker:disableAutoEcho(): you cannot disable autoEcho once you have enabled popups.")
-  else
-    self.autoEcho = false
-  end
-end
-
---- Enables automatically clearing the miniconsole we echo to
-function TableMaker:enableAutoClear()
-  self.autoClear = true
-  if self.autoEcho then self:assemble() end
-end
-
---- Disables automatically clearing the miniconsole we echo to
-function TableMaker:disableAutoClear()
-  self.autoClear = false
-end
-
---- Set the miniconsole to echo to
--- @param console The miniconsole to autoecho to. Set to "main" or do not pass the parameter to autoecho to the main console. Can be a string name of the console, or a Geyser MiniConsole
-function TableMaker:setAutoEchoConsole(console)
-  local funcName = "TableMaker:setAutoEchoConsole(console)"
-  if console == nil then
-    console = "main"
-  end
-  local consoleType = type(console)
-  if consoleType ~= "string" and consoleType ~= "table" then
-    error(funcName .. " ArgumentError: console as string or a Geyser MiniConsole or UserWindow expected, got " .. consoleType)
-  elseif consoleType == "table" and not (console.type == "miniConsole" or console.type == "userwindow") then
-    error(funcName .. " ArgumentError: console received was a table and may be a Geyser object, but console.type is not miniConsole, it is " ..
-            console.type)
-  end
-  self.autoEchoConsole = console
-  if self.autoEcho then self:assemble() end
-end
-
---- Assemble the table. If autoEcho is enabled/set to true, will automatically echo. Otherwise, returns the formatted string to echo the table
-function TableMaker:assemble()
-  if self.allowPopups and self.autoEcho then
-    self:popupAssemble()
-  else
-    return self:textAssemble()
-  end
-end
-
-function TableMaker:popupAssemble()
-  if self.autoClear then
-    local console = self.autoEchoConsole
-    if console and console ~= "main" then
-      if type(console) == "table" then
-        console = console.name
-      end
-      clearWindow(console)
-    end
-  end
-  local divWithNewLines = string.format("%s\n", self:createRowDivider())
-  local header = self:makeHeader() .. "\n"
-  local footer = string.format("%s%s%s\n", self.frameColor, string.rep(self.footCharacter, self:totalWidth()), self.colorReset)
-  self:echo(header)
-  for _, row in ipairs(self.rows) do
-    if _ ~= 1 and self.separateRows then
-      self:echo(divWithNewLines)
-    end
-    self:echoRow(row)
-  end
-  self:echo(footer)
-end
-
-function TableMaker:textAssemble()
-  local sheet = ""
-  local rows = {}
-  for _, row in ipairs(self.rows) do
-    table.insert(rows, self:scanRow(row))
-  end
-  local divWithNewlines = string.format("\n%s\n", self:createRowDivider())
-  local footer = string.format("%s%s%s", self.frameColor, string.rep(self.footCharacter, self:totalWidth()), self.colorReset)
-  sheet = string.format("%s\n%s\n%s\n", self:makeHeader(), table.concat(rows, self.separateRows and divWithNewlines or "\n"), footer)
-  if self.autoEcho then
-    local console = self.autoEchoConsole or "main"
-    if type(console) == "table" then
-      console = console.name
-    end
-    if self.autoClear and console ~= "main" then
-      clearWindow(console)
-    end
-    self:echo(sheet)
-  end
-  return sheet
-end
-
---- Creates and returns a new TableMaker.
--- see https://github.com/demonnic/MDK/wiki/fText%3A-TableMaker%3A-Examples for usage
--- @tparam table options table of options for the TableMaker object
--- <br><br>Table of new options
--- <table class="tg">
--- <thead>
---   <tr>
---     <th>option name</th>
---     <th>description</th>
---     <th>default</th>
---   </tr>
--- </thead>
--- <tbody>
---   <tr>
---     <td class="tg-1">formatType</td>
---     <td class="tg-1">Determines how it formats for color. 'c' for cecho, 'd' for decho, 'h' for hecho, and anything else for no colors</td>
---     <td class="tg-1">c</td>
---   </tr>
---   <tr>
---     <td class="tg-2">printHeaders</td>
---     <td class="tg-2">print top row as header</td>
---     <td class="tg-2">true</td>
---   </tr>
---   <tr>
---     <td class="tg-1">headCharacter</td>
---     <td class="tg-1">The character used to construct the very top of the table. A solid line of these characters is used</td>
---     <td class="tg-1">"*"</td>
---   </tr>
---   <tr>
---     <td class="tg-2">footCharacter</td>
---     <td class="tg-2">The character used to construct the very bottom of the table. A solid line of these characters is used</td>
---     <td class="tg-2">"*"</td>
---   </tr>
---   <tr>
---     <td class="tg-1">edgeCharacter</td>
---     <td class="tg-1">the character used to form the left and right edges of the table. There is one on either side of every line</td>
---     <td class="tg-1">"*"</td>
---   </tr>
---   <tr>
---     <td class="tg-2">frameColor</td>
---     <td class="tg-2">The color to use for the frame. The frame is the border around the outside edge of the table (headCharacter, footCharacter, and edgeCharacters will all be this color).</td>
---     <td class="tg-2">the correct 'white' for your formatType</td>
---   </tr>
---   <tr>
---     <td class="tg-1">rowSeparator</td>
---     <td class="tg-1">the character used to form the lines between rows of text</td>
---     <td class="tg-1">"-"</td>
---   </tr>
---   <tr>
---     <td class="tg-2">separator</td>
---     <td class="tg-2">Character used between columns.</td>
---     <td class="tg-2">"|"</td>
---   </tr>
---   <tr>
---     <td class="tg-1">separatorColor</td>
---     <td class="tg-1">the color used for the separators, the things which divide the rows and columns internally. (separator and rowSeparator will be this color)</td>
---     <td class="tg-1">frameColor</td>
---   </tr>
---   <tr>
---     <td class="tg-2">autoEcho</td>
---     <td class="tg-2">echo the table automatically in addition to returning the string representation?</td>
---     <td class="tg-2">false</td>
---   </tr>
---   <tr>
---     <td class="tg-1">autoEchoConsole</td>
---     <td class="tg-1">MiniConsole to autoEcho to</td>
---     <td class="tg-1">"main"</td>
---   </tr>
---   <tr>
---     <td class="tg-2">autoClear</td>
---     <td class="tg-2">If autoEchoing, and not echoing to the main console, should we clear the console before outputting?</td>
---     <td class="tg-2">false</td>
---   </tr>
---   <tr>
---     <td class="tg-1">allowPopups</td>
---     <td class="tg-1">setting this to true allows you to make cells in the table clickable, as well as give them right-click menus.<br>
---                        Please see Clickable Tables <a href="https://github.com/demonnic/fText/wiki/ClickableTables">HERE</a></td>
---     <td class="tg-1">false</td>
---   </tr>
---   <tr>
---     <td class="tg-2">separateRows</td>
---     <td class="tg-2">When false, will not print the separator line between rows</td>
---     <td class="tg-2">true</td>
---   </tr>
---   <tr>
---     <td class="tg-1">title</td>
---     <td class="tg-1">The overall title of the table. Displayed at the top</td>
---     <td class="tg-1">""</td>
---   </tr>
---   <tr>
---     <td class="tg-2">titleColor</td>
---     <td class="tg-2">What color to use for the title text</td>
---     <td class="tg-2">formatColor</td>
---   </tr>
---   <tr>
---     <td class="tg-1">printTitle</td>
---     <td class="tg-1">Should we print the title of the table at the very tip-top?</td>
---     <td class="tg-1">false</td>
---   </tr>
---   <tr>
---     <td class="tg-2">headerTitle</td>
---     <td class="tg-2">Use the same separator for the column headers as the title/top, rather than the row separator</td>
---     <td class="tg-2">formatColor</td>
---   </tr>
---   <tr>
---     <td class="tg-1">forceHeaderSeparator</td>
---     <td class="tg-1">Force a separator between the column headers and the first row, even if rowSeparator is false.</td>
---     <td class="tg-1">false</td>
---   </tr>
--- </tbody>
--- </table>
-function TableMaker:new(options)
-  local funcName = "TableMaker:new(options)"
-  local me = {}
-  setmetatable(me, self)
-  self.__index = self
-  if options == nil then
-    options = {}
-  end
-  if type(options) ~= "table" then
-    error("TableMaker:new(options): ArgumentError: options expected as table, got " .. type(options))
-  end
-  local options = table.deepcopy(options)
-  if options.allowPopups == true then
-    options.autoEcho = true
-  else
-    options.allowPopups = false
-  end
-  local columns = false
-  if options.columns then
-    if type(options.columns) ~= "table" then
-      error("TableMaker:new(options): option error: You provided an options.columns entry of type " .. type(options.columns) ..
-              " and columns must a table with entries suitable for TableFormatter:addColumn().")
-    end
-    columns = table.deepcopy(options.columns)
-    options.columns = nil
-  end
-  local rows = false
-  if options.rows then
-    if type(options.rows) ~= "table" then
-      error("TableMaker:new(options): option error: You provided an options.rows entry of type " .. type(options.rows) ..
-              " and rows must be a table with entrys suitable for TableFormatter:addRow()")
-    end
-    rows = table.deepcopy(options.rows)
-    options.rows = nil
-  end
-  for option, value in pairs(options) do
-    me[option] = value
-  end
-  local dec = {"d", "decimal", "dec"}
-  local hex = {"h", "hexidecimal", "hex"}
-  local col = {"c", "color", "colour", "col", "name"}
-  if table.contains(dec, me.formatType) then
-    me.frameColor = me.frameColor or "<255,255,255>"
-    me.separatorColor = me.separatorColor or me.frameColor
-    me.titleColor = me.titleColor or me.frameColor
-    me.colorReset = "<r>"
-  elseif table.contains(hex, me.formatType) then
-    me.frameColor = me.frameColor or "#ffffff"
-    me.separatorColor = me.separatorColor or me.frameColor
-    me.titleColor = me.titleColor or me.frameColor
-    me.colorReset = "#r"
-  elseif table.contains(col, me.formatType) then
-    me.frameColor = me.frameColor or "<white>"
-    me.separatorColor = me.separatorColor or me.frameColor
-    me.titleColor = me.titleColor or me.frameColor
-    me.colorReset = "<reset>"
-  else
-    me.frameColor = ""
-    me.separatorColor = ""
-    me.titleColor = ""
-    me.colorReset = ""
-  end
-  me.columns = {}
-  me.rows = {}
-  if columns then
-    for _, column in ipairs(columns) do
-      me:addColumn(column)
-    end
-  end
-  if rows then
-    for _, row in ipairs(rows) do
-      me:addRow(row)
-    end
-  end
-  return me
-end
-ftext.TableMaker = TableMaker
-
-return ftext
- - -
-
-
-generated by LDoc 1.5.0 -Last updated 2023-05-29 18:41:27 -
-
- - diff --git a/src/resources/MDK/doc/source/ftext_spec.lua.html b/src/resources/MDK/doc/source/ftext_spec.lua.html deleted file mode 100755 index 4cd397e..0000000 --- a/src/resources/MDK/doc/source/ftext_spec.lua.html +++ /dev/null @@ -1,546 +0,0 @@ - - - - - Reference - - - - -
- -
- -
-
-
- - -
- - - - - - -
- -

ftext_spec.lua

-
-local ftext = require("MDK.ftext")
-
-describe("ftext:", function()
-  describe("ftext.fText:", function()
-    local fText = ftext.fText
-
-    it("Should properly center text", function()
-      local expected = "     some text      "
-      local actual = fText("some text", {width = 20})
-      assert.equals(expected, actual)
-      assert.equals(20, actual:len())
-    end)
-
-    it("Should properly pad left aligned text", function()
-      local expected = "some text           "
-      local actual = fText("some text", {width = 20, alignment = "left"})
-      assert.equals(expected, actual)
-      assert.equals(20, actual:len())
-    end)
-
-    it("Should properly pad right aligned text", function()
-      local expected = "           some text"
-      local actual = fText("some text", {width = 20, alignment = "right"})
-      assert.equals(expected, actual)
-      assert.equals(20, actual:len())
-    end)
-
-    it("Should wrap lines to the correct length", function()
-      local str = "This is a test of the emergency broadcast system. This is only a test"
-      local options = {width = 10, alignment = "centered"}
-      local actual = fText(str, options)
-      for _, line in ipairs(actual:split("\n")) do
-        assert.equals(line:len(), 10)
-      end
-      options.width = 15
-      actual = fText(str, options)
-      for _, line in ipairs(actual:split("\n")) do
-        assert.equals(line:len(), 15)
-      end
-    end)
-
-    describe("non-space spacer character:", function()
-      local str = "some text"
-      local options = {width = "20", alignment = "left", spacer = "="}
-      it("Should work with left align", function()
-        local expected = "some text =========="
-        local actual = fText(str, options)
-        assert.equals(expected, actual)
-        assert.equals(20, actual:len())
-      end)
-
-      it("Should work with right align", function()
-        local expected = "========== some text"
-        options.alignment = "right"
-        local actual = fText(str, options)
-        assert.equals(expected, actual)
-        assert.equals(20, actual:len())
-      end)
-
-      it("Should work with center align", function()
-        local expected = ("==== some text =====")
-        options.alignment = "center"
-        local actual = fText(str, options)
-        assert.equals(expected, actual)
-        assert.equals(20, actual:len())
-      end)
-    end)
-
-    describe("nogap option:", function()
-      local str = "some text"
-      local options = {width = "20", alignment = "left", spacer = "=", nogap = true}
-
-      it("Should work with left align", function()
-        local expected = "some text==========="
-        local actual = fText(str, options)
-        assert.equals(expected, actual)
-        assert.equals(20, actual:len())
-      end)
-
-      it("Should work with right align", function()
-        local expected = "===========some text"
-        options.alignment = "right"
-        local actual = fText(str, options)
-        assert.equals(expected, actual)
-        assert.equals(20, actual:len())
-      end)
-
-      it("Should work with center align", function()
-        local expected = "=====some text======"
-        options.alignment = "center"
-        local actual = fText(str, options)
-        assert.equals(expected, actual)
-        assert.equals(20, actual:len())
-      end)
-    end)
-
-    describe("cap functionality", function()
-      local str = "some text"
-      local options = {width = 20, spacer = "=", cap = "|"}
-
-      it("Should place the spacer outside the cap by default", function()
-        local expected = "===| some text |===="
-        local actual = fText(str, options)
-        assert.equals(expected, actual)
-        assert.equals(20, actual:len())
-      end)
-
-      it("Should place it inside the cap if inside option is true", function()
-        local expected = "|=== some text ====|"
-        options.inside = true
-        local actual = fText(str, options)
-        options.inside = nil
-        assert.equals(expected, actual)
-        assert.equals(20, actual:len())
-      end)
-
-      it("Should mirror certain characters with their opposites", function()
-        local expected = "===[ some text ]===="
-        options.mirror = true
-        options.cap = "["
-        local actual = fText(str, options)
-        assert.equals(expected, actual)
-        options.inside = true
-        expected = "[=== some text ====]"
-        actual = fText(str, options)
-        assert.equals(expected, actual)
-        options.inside = nil
-        options.cap = "<"
-        expected = "===< some text >===="
-        actual = fText(str, options)
-        assert.equals(expected, actual)
-        options.cap = "{"
-        expected = "==={ some text }===="
-        actual = fText(str, options)
-        assert.equals(expected, actual)
-        options.cap = "("
-        expected = "===( some text )===="
-        actual = fText(str, options)
-        assert.equals(expected, actual)
-        options.cap = "|"
-        expected = "===| some text |===="
-        actual = fText(str, options)
-        assert.equals(expected, actual)
-      end)
-    end)
-  end)
-
-  describe("ftext.cfText", function()
-    local cfText = ftext.cfText
-    local str = "some text"
-    local options = {
-      width = 20,
-      spacer = "=",
-      cap = "[",
-      inside = true,
-      mirror = true,
-      capColor = "<purple>",
-      spacerColor = "<green>",
-      textColor = "<red>",
-    }
-    it("Should handle cecho colored text", function()
-      local expectedStripped = "[=== some text ====]"
-      local expected = "<purple>[<reset><green>===<reset><red> some text <reset><green>====<reset><purple>]<reset>"
-      local actual = cfText(str, options)
-      local actualStripped = cecho2string(actual)
-      assert.equals(expected, actual)
-      assert.equals(expectedStripped, actualStripped)
-      assert.equals(20, actualStripped:len())
-      expectedStripped = "===[ some text ]===="
-      expected = "<green>===<reset><purple>[<reset><red> some text <reset><purple>]<reset><green>====<reset>"
-      options.inside = false
-      actual = cfText(str, options)
-      actualStripped = cecho2string(actual)
-      assert.equals(expected, actual)
-      assert.equals(expectedStripped, actualStripped)
-      assert.equals(20, actualStripped:len())
-    end)
-
-    it("Should wrap cecho lines to the correct length", function()
-      local str = "This is a test of the emergency broadcast system. This is only a test"
-      local options = {width = 10, alignment = "centered"}
-      local actual = cfText(str, options)
-      for _, line in ipairs(actual:split("\n")) do
-        assert.equals(cecho2string(line):len(), 10)
-      end
-      options.width = 15
-      actual = cfText(str, options)
-      for _, line in ipairs(actual:split("\n")) do
-        assert.equals(cecho2string(line):len(), 15)
-      end
-    end)
-
-  end)
-
-  describe("ftext.dfText", function()
-    local dfText = ftext.dfText
-    local str = "some text"
-    local options = {
-      width = 20,
-      spacer = "=",
-      cap = "[",
-      inside = true,
-      mirror = true,
-      capColor = "<160,32,240>",
-      spacerColor = "<0,255,0>",
-      textColor = "<255,0,0>",
-    }
-    it("Should handle decho colored text", function()
-      local expectedStripped = "[=== some text ====]"
-      local expected = "<160,32,240>[<r><0,255,0>===<r><255,0,0> some text <r><0,255,0>====<r><160,32,240>]<r>"
-      local actual = dfText(str, options)
-      local actualStripped = decho2string(actual)
-      assert.equals(expected, actual)
-      assert.equals(expectedStripped, actualStripped)
-      assert.equals(20, actualStripped:len())
-      expectedStripped = "===[ some text ]===="
-      expected = "<0,255,0>===<r><160,32,240>[<r><255,0,0> some text <r><160,32,240>]<r><0,255,0>====<r>"
-      options.inside = false
-      actual = dfText(str, options)
-      actualStripped = decho2string(actual)
-      assert.equals(expected, actual)
-      assert.equals(expectedStripped, actualStripped)
-      assert.equals(20, actualStripped:len())
-    end)
-
-    it("Should wrap decho lines to the correct length", function()
-      local str = "This is a test of the emergency broadcast system. This is only a test"
-      local options = {width = 10, alignment = "centered"}
-      local actual = dfText(str, options)
-      for _, line in ipairs(actual:split("\n")) do
-        assert.equals(decho2string(line):len(), 10)
-      end
-      options.width = 15
-      actual = dfText(str, options)
-      for _, line in ipairs(actual:split("\n")) do
-        assert.equals(decho2string(line):len(), 15)
-      end
-    end)
-  end)
-
-  describe("ftext.hfText", function()
-    local hfText = ftext.hfText
-    local str = "some text"
-    local options = {
-      width = 20,
-      spacer = "=",
-      cap = "[",
-      inside = true,
-      mirror = true,
-      capColor = "#a020f0",
-      spacerColor = "#00ff00",
-      textColor = "#ff0000",
-    }
-    it("Should handle hecho colored text", function()
-      local expectedStripped = "[=== some text ====]"
-      local expected = "#a020f0[#r#00ff00===#r#ff0000 some text #r#00ff00====#r#a020f0]#r"
-      local actual = hfText(str, options)
-      local actualStripped = hecho2string(actual)
-      assert.equals(expected, actual)
-      assert.equals(expectedStripped, actualStripped)
-      assert.equals(20, actualStripped:len())
-      expectedStripped = "===[ some text ]===="
-      expected = "#00ff00===#r#a020f0[#r#ff0000 some text #r#a020f0]#r#00ff00====#r"
-      options.inside = false
-      actual = hfText(str, options)
-      actualStripped = hecho2string(actual)
-      assert.equals(expected, actual)
-      assert.equals(expectedStripped, actualStripped)
-      assert.equals(20, actualStripped:len())
-    end)
-
-    it("Should wrap hecho lines to the correct length", function()
-      local str = "This is a test of the emergency broadcast system. This is only a test"
-      local options = {width = 10, alignment = "centered"}
-      local actual = hfText(str, options)
-      for _, line in ipairs(actual:split("\n")) do
-        assert.equals(hecho2string(line):len(), 10)
-      end
-      options.width = 15
-      actual = hfText(str, options)
-      for _, line in ipairs(actual:split("\n")) do
-        assert.equals(hecho2string(line):len(), 15)
-      end
-    end)
-  end)
-
-  describe("ftext.TextFormatter", function()
-    local tf = ftext.TextFormatter
-    local str = "some text"
-    local formatter
-
-    before_each(function()
-      formatter = tf:new({width = 20})
-    end)
-
-    it("Should let you change width using :setWidth", function()
-      formatter:setWidth(80)
-      local expected =
-        "<white><reset><white>                                  <reset><white> some text <reset><white>                                   <reset><white><reset>"
-      local actual = formatter:format(str)
-      assert.equals(expected, actual)
-      assert.equals(80, cecho2string(actual):len())
-    end)
-
-    it("Should format for cecho by default", function()
-      local expected = "<white><reset><white>    <reset><white> some text <reset><white>     <reset><white><reset>"
-      local expectedStripped = "     some text      "
-      local actual = formatter:format(str)
-      local actualStripped = cecho2string(actual)
-      assert.equals(expected, actual)
-      assert.equals(expectedStripped, actualStripped)
-      assert.equals(20, actualStripped:len())
-    end)
-
-    it("Should produce the same line as cfText given the same options", function()
-      local expected = ftext.cfText(str, formatter.options)
-      local actual = formatter:format(str)
-      assert.equals(expected, actual)
-    end)
-
-    it("Should let you change type using :setType", function()
-      formatter:setType("h")
-      local expected = ftext.hfText(str, formatter.options)
-      local actual = formatter:format(str)
-      assert.equals(expected, actual)
-      formatter:setType("d")
-      expected = ftext.dfText(str, formatter.options)
-      actual = formatter:format(str)
-      assert.equals(expected, actual)
-      formatter:setType("")
-      expected = ftext.fText(str, formatter.options)
-      actual = formatter:format(str)
-      assert.equals(expected, actual)
-    end)
-
-    it("Should default to word wrapping, and let you change it with :setWrap", function()
-      formatter:setWidth(10)
-      local expected =
-        "<white><reset><white>  <reset><white> some <reset><white>  <reset><white><reset>\n<white><reset><white>  <reset><white> text <reset><white>  <reset><white><reset>"
-      local actual = formatter:format(str)
-      assert.equals(expected, actual)
-      expected = "<white><reset><white><reset><white> some text <reset><white><reset><white><reset>"
-      formatter:setWrap(false)
-      actual = formatter:format(str)
-      assert.equals(expected, actual)
-    end)
-
-    it("Should allow you to change the cap using :setCap", function()
-      formatter:setCap('|')
-      local expected = "<white>|<reset><white>   <reset><white> some text <reset><white>    <reset><white>|<reset>"
-      local actual = formatter:format(str)
-      assert.equals(expected, actual)
-    end)
-
-    it("Should allow you to change the capColor using :setCapColor", function()
-      formatter:setCapColor('<red>')
-      local expected = "<red><reset><white>    <reset><white> some text <reset><white>     <reset><red><reset>"
-      local actual = formatter:format(str)
-      assert.equals(expected, actual)
-    end)
-
-    it("Should allow you to change the spacer color using :setSpacerColor", function()
-      formatter:setSpacerColor("<red>")
-      local expected = "<white><reset><red>    <reset><white> some text <reset><red>     <reset><white><reset>"
-      local actual = formatter:format(str)
-      assert.equals(expected, actual)
-    end)
-
-    it("Should allow you to change the text color using :setTextColor", function()
-      formatter:setTextColor("<red>")
-      local expected = "<white><reset><white>    <reset><red> some text <reset><white>     <reset><white><reset>"
-      local actual = formatter:format(str)
-      assert.equals(expected, actual)
-    end)
-
-    it("Should allow you to change the spacer using :setSpacer", function()
-      formatter:setSpacer("=")
-      -- local expected = "<white><reset><white>    <reset><white> some text <reset><white>     <reset><white><reset>"
-      local expected = "<white><reset><white>====<reset><white> some text <reset><white>=====<reset><white><reset>"
-      local actual = formatter:format(str)
-      assert.equals(expected, actual)
-    end)
-
-    it("Should allow you to set the alignment using :setAlignment", function()
-      formatter:setAlignment("left")
-      local expected = "<white><reset><white><reset><white>some text <reset><white>          <reset><white><reset>"
-      local actual = formatter:format(str)
-      assert.equals(expected, actual)
-      formatter:setAlignment("right")
-      expected = "<white><reset><white>          <reset><white> some text<reset><white><reset><white><reset>"
-      actual = formatter:format(str)
-      assert.equals(expected, actual)
-    end)
-
-    it("Should allow you to change the 'inside' option using :setInside", function()
-      formatter:setInside(false)
-      local expected = "<white>    <reset><white><reset><white> some text <reset><white><reset><white>     <reset>"
-      local actual = formatter:format(str)
-      assert.equals(expected, actual)
-    end)
-
-    it("Should allow you to change the mirror option using :setMirror", function()
-      formatter:setCap('<')
-      formatter:setMirror(true)
-      local expected = "<white><<reset><white>   <reset><white> some text <reset><white>    <reset><white>><reset>"
-      local actual = formatter:format(str)
-      assert.equal(expected, actual)
-    end)
-  end)
-
-  describe("ftext.TableMaker", function()
-    local TableMaker = ftext.TableMaker
-    local tm
-    before_each(function()
-      tm = TableMaker:new()
-      tm:addColumn({name = "col1", width = 15, textColor = "<red>"})
-      tm:addColumn({name = "col2", width = 15, textColor = "<blue>"})
-      tm:addColumn({name = "col3", width = 15, textColor = "<green>"})
-      tm:addRow({"some text", "more text", "other text"})
-      tm:addRow({"little text", "bigger text", "text"})
-    end)
-
-    it("Should assemble a formatted table given default options", function()
-      local expected = [[<white>*************************************************<reset>
-<white>*<reset><white><reset><white>    <reset><red> col1 <reset><white>     <reset><white><reset><white>|<reset><white><reset><white>    <reset><blue> col2 <reset><white>     <reset><white><reset><white>|<reset><white><reset><white>    <reset><green> col3 <reset><white>     <reset><white><reset><white>*<reset>
-<white>*<reset><white>---------------<reset><white>|<reset><white>---------------<reset><white>|<reset><white>---------------<reset><white>*<reset>
-<white>*<reset><white><reset><white>  <reset><red> some text <reset><white>  <reset><white><reset><white>|<reset><white><reset><white>  <reset><blue> more text <reset><white>  <reset><white><reset><white>|<reset><white><reset><white> <reset><green> other text <reset><white>  <reset><white><reset><white>*<reset>
-<white>*<reset><white>---------------<reset><white>|<reset><white>---------------<reset><white>|<reset><white>---------------<reset><white>*<reset>
-<white>*<reset><white><reset><white> <reset><red> little text <reset><white> <reset><white><reset><white>|<reset><white><reset><white> <reset><blue> bigger text <reset><white> <reset><white><reset><white>|<reset><white><reset><white>    <reset><green> text <reset><white>     <reset><white><reset><white>*<reset>
-<white>*************************************************<reset>
-]]
-      local actual = tm:assemble()
-      assert.equals(expected, actual)
-    end)
-
-    it("TableMaker:getCell should return the text and formatter for a specific cell", function()
-      local expectedText = "more text"
-      local expectedFormatter = tm.columns[2]
-      local actualText, actualFormatter = tm:getCell(1, 2)
-      assert.equals(expectedText, actualText)
-      assert.equals(expectedFormatter, actualFormatter)
-      local expectedFormatted = "<white><reset><white>  <reset><blue> more text <reset><white>  <reset><white><reset>"
-      local actualFormatted = actualFormatter:format(actualText)
-      assert.equals(expectedFormatted, actualFormatted)
-    end)
-  end)
-end)
- - -
-
-
-generated by LDoc 1.5.0 -Last updated 2023-05-29 18:41:27 -
-
- - diff --git a/src/resources/MDK/doc/source/gradientmaker.lua.html b/src/resources/MDK/doc/source/gradientmaker.lua.html deleted file mode 100755 index 0205df3..0000000 --- a/src/resources/MDK/doc/source/gradientmaker.lua.html +++ /dev/null @@ -1,441 +0,0 @@ - - - - - Reference - - - - -
- -
- -
-
-
- - -
- - - - - - -
- -

gradientmaker.lua

-
---- Module which provides for creating color gradients for your text.
--- Original functions found on <a href="https://forums.lusternia.com/discussion/3261/anyone-want-text-gradients">the Lusternia Forums</a>
--- <br> I added functions to work with hecho.
--- <br> I also made performance enhancements by storing already calculated gradients after first use for the session and only including the colorcode in the returned string if the color changed.
--- @module GradientMaker
--- @author Sylphas on the Lusternia forums
--- @author Damian Monogue <demonnic@gmail.com>
--- @copyright 2018 Sylphas
--- @copyright 2020 Damian Monogue
-local GradientMaker = {}
-local gradient_table = {}
-
-local function _clamp(num1, num2, num3)
-  local smaller = math.min(num2, num3)
-  local larger = math.max(num2, num3)
-  local minimum = math.max(0, smaller)
-  local maximum = math.min(255, larger)
-  return math.min(maximum, math.max(minimum, num1))
-end
-
-local function _gradient(length, rgb1, rgb2)
-  assert(length > 0)
-  if length == 1 then
-    return {rgb1}
-  elseif length == 2 then
-    return {rgb1, rgb2}
-  else
-    local step = {}
-    for color = 1, 3 do
-      step[color] = (rgb2[color] - rgb1[color]) / (length - 2)
-    end
-    local gradient = {rgb1}
-    for iter = 1, length - 2 do
-      gradient[iter + 1] = {}
-      for color = 1, 3 do
-        gradient[iter + 1][color] = math.ceil(rgb1[color] + (iter * step[color]))
-      end
-    end
-    gradient[length] = rgb2
-    for index, color in ipairs(gradient) do
-      for iter = 1, 3 do
-        gradient[index][iter] = _clamp(color[iter], rgb1[iter], rgb2[iter])
-      end
-    end
-    return gradient
-  end
-end
-
-local function gradient_to_string(gradient)
-  local gradstring = ""
-  for _, grad in ipairs(gradient) do
-    local nodestring = ""
-    for _, col in ipairs(grad) do
-      nodestring = string.format("%s%03d", nodestring, col)
-    end
-    if _ == 1 then
-      gradstring = nodestring
-    else
-      gradstring = gradstring .. "|" .. nodestring
-    end
-  end
-  return gradstring
-end
-
-local function _gradients(length, ...)
-  local arg = {...}
-  local argkey = gradient_to_string(arg)
-  local gradients_for_length = gradient_table[length]
-  if not gradients_for_length then
-    gradient_table[length] = {}
-    gradients_for_length = gradient_table[length]
-  end
-  local grads = gradients_for_length[argkey]
-  if grads then
-    return grads
-  end
-  if #arg == 0 then
-    gradients_for_length[argkey] = {}
-    return {}
-  elseif #arg == 1 then
-    gradients_for_length[argkey] = arg[1]
-    return arg[1]
-  elseif #arg == 2 then
-    gradients_for_length[argkey] = _gradient(length, arg[1], arg[2])
-    return gradients_for_length[argkey]
-  else
-    local quotient = math.floor(length / (#arg - 1))
-    local remainder = length % (#arg - 1)
-    local gradients = {}
-    for section = 1, #arg - 1 do
-      local slength = quotient
-      if section <= remainder then
-        slength = slength + 1
-      end
-      local gradient = _gradient(slength, arg[section], arg[section + 1])
-      for _, rgb in ipairs(gradient) do
-        table.insert(gradients, rgb)
-      end
-    end
-    gradients_for_length[argkey] = gradients
-    return gradients
-  end
-end
-
-local function _color_name(rgb)
-  local least_distance = math.huge
-  local cname = ""
-  for name, color in pairs(color_table) do
-    local color_distance = math.sqrt((color[1] - rgb[1]) ^ 2 + (color[2] - rgb[2]) ^ 2 + (color[3] - rgb[3]) ^ 2)
-    if color_distance < least_distance then
-      least_distance = color_distance
-      cname = name
-    end
-  end
-  return cname
-end
-
-local function errorIfEmpty(text, funcName)
-  assert(#text > 0, string.format("%s: you passed in an empty string, and I cannot make a gradient out of an empty string", funcName))
-end
-
-local function dgradient_table(text, ...)
-  errorIfEmpty(text, "dgradient_table")
-  local gradients = _gradients(#text, ...)
-  local dgrads = {}
-  for character = 1, #text do
-    table.insert(dgrads, {gradients[character], text:sub(character, character)})
-  end
-  return dgrads
-end
-
-local function dgradient(text, ...)
-  errorIfEmpty(text, "dgradient")
-  local gradients = _gradients(#text, ...)
-  local dgrad = ""
-  local current_color = ""
-  for character = 1, #text do
-    local new_color = "<" .. table.concat(gradients[character], ",") .. ">"
-    local char = text:sub(character, character)
-    if new_color == current_color then
-      dgrad = dgrad .. char
-    else
-      dgrad = dgrad .. new_color .. char
-      current_color = new_color
-    end
-  end
-  return dgrad
-end
-
-local function cgradient_table(text, ...)
-  errorIfEmpty(text, "cgradient_table")
-  local gradients = _gradients(#text, ...)
-  local cgrads = {}
-  for character = 1, #text do
-    table.insert(cgrads, {_color_name(gradients[character]), text:sub(character, character)})
-  end
-  return cgrads
-end
-
-local function cgradient(text, ...)
-  errorIfEmpty(text, "cgradient")
-  local gradients = _gradients(#text, ...)
-  local cgrad = ""
-  local current_color = ""
-  for character = 1, #text do
-    local new_color = "<" .. _color_name(gradients[character]) .. ">"
-    local char = text:sub(character, character)
-    if new_color == current_color then
-      cgrad = cgrad .. char
-    else
-      cgrad = cgrad .. new_color .. char
-      current_color = new_color
-    end
-  end
-  return cgrad
-end
-
-local hex = Geyser.Color.hex
-
-local function hgradient_table(text, ...)
-  errorIfEmpty(text, "hgradient_table")
-  local grads = _gradients(#text, ...)
-  local hgrads = {}
-  for character = 1, #text do
-    table.insert(hgrads, {hex(unpack(grads[character])):sub(2, -1), text:sub(character, character)})
-  end
-  return hgrads
-end
-
-local function hgradient(text, ...)
-  errorIfEmpty(text, "hgradient")
-  local grads = _gradients(#text, ...)
-  local hgrads = ""
-  local current_color = ""
-  for character = 1, #text do
-    local new_color = hex(unpack(grads[character]))
-    local char = text:sub(character, character)
-    if new_color == current_color then
-      hgrads = hgrads .. char
-    else
-      hgrads = hgrads .. new_color .. char
-      current_color = new_color
-    end
-  end
-  return hgrads
-end
-
-local function color_name(...)
-  local arg = {...}
-  if #arg == 1 then
-    return _color_name(arg[1])
-  elseif #arg == 3 then
-    return _color_name(arg)
-  else
-    local errmsg =
-      "color_name: You must pass either a table of r,g,b values: color_name({r,g,b})\nor the three r,g,b values separately: color_name(r,g,b)"
-    error(errmsg)
-  end
-end
-
---- Returns the closest color name to a given r,g,b color
--- @param r The red component. Can also pass the full color as a table, IE { 255, 0, 0 }
--- @param g The green component. If you pass the color as a table as noted above, this param should be empty
--- @param b the blue components. If you pass the color as a table as noted above, this param should be empty
--- @usage
--- closest_color = GradientMaker.color_name(128,200,30) -- returns "ansi_149"
--- closest_color = GradientMaker.color_name({128, 200, 30}) -- this is functionally equivalent to the first one
-function GradientMaker.color_name(...)
-  return color_name(...)
-end
-
---- Returns the text, with the defined color gradients applied and formatted for us with decho. Usage example below produces the following text
--- <br><img src="https://demonnic.github.io/mdk/images/dechogradient.png" alt="dgradient example">
--- @tparam string text The text you want to apply the color gradients to
--- @param first_color The color you want it to start at. Table of colors in { r, g, b } format
--- @param second_color The color you want the gradient to transition to first. Table of colors in { r, g, b } format
--- @param next_color Keep repeating if you want it to transition from the second color to a third, then a third to a fourth, etc
--- @see cgradient
--- @see hgradient
--- @usage
--- decho(GradientMaker.dgradient("a luminescent butterly floats about lazily on brillant blue and lilac wings\n", {255,0,0}, {255,128,0}, {255,255,0}, {0,255,0}, {0,255,255}, {0,128,255}, {128,0,255}))
--- decho(GradientMaker.dgradient("a luminescent butterly floats about lazily on brillant blue and lilac wings\n", {255,0,0}, {0,0,255}))
--- decho(GradientMaker.dgradient("a luminescent butterly floats about lazily on brillant blue and lilac wings\n", {50,50,50}, {0,255,0}, {50,50,50}))
-function GradientMaker.dgradient(text, ...)
-  return dgradient(text, ...)
-end
-
---- Returns the text, with the defined color gradients applied and formatted for us with cecho. Usage example below produces the following text
--- <br><img src="https://demonnic.github.io/mdk/images/cechogradient.png" alt="cgradient example">
--- @tparam string text The text you want to apply the color gradients to
--- @param first_color The color you want it to start at. Table of colors in { r, g, b } format
--- @param second_color The color you want the gradient to transition to first. Table of colors in { r, g, b } format
--- @param next_color Keep repeating if you want it to transition from the second color to a third, then a third to a fourth, etc
--- @see dgradient
--- @see hgradient
--- @usage
--- cecho(GradientMaker.cgradient("a luminescent butterly floats about lazily on brillant blue and lilac wings\n", {255,0,0}, {255,128,0}, {255,255,0}, {0,255,0}, {0,255,255}, {0,128,255}, {128,0,255}))
--- cecho(GradientMaker.cgradient("a luminescent butterly floats about lazily on brillant blue and lilac wings\n", {255,0,0}, {0,0,255}))
--- cecho(GradientMaker.cgradient("a luminescent butterly floats about lazily on brillant blue and lilac wings\n", {50,50,50}, {0,255,0}, {50,50,50}))
-function GradientMaker.cgradient(text, ...)
-  return cgradient(text, ...)
-end
-
---- Returns the text, with the defined color gradients applied and formatted for us with hecho. Usage example below produces the following text
--- <br><img src="https://demonnic.github.io/mdk/images/hechogradient.png" alt="hgradient example">
--- @tparam string text The text you want to apply the color gradients to
--- @param first_color The color you want it to start at. Table of colors in { r, g, b } format
--- @param second_color The color you want the gradient to transition to first. Table of colors in { r, g, b } format
--- @param next_color Keep repeating if you want it to transition from the second color to a third, then a third to a fourth, etc
--- @see cgradient
--- @see dgradient
--- @usage
--- hecho(GradientMaker.hgradient("a luminescent butterly floats about lazily on brillant blue and lilac wings\n", {255,0,0}, {255,128,0}, {255,255,0}, {0,255,0}, {0,255,255}, {0,128,255}, {128,0,255}))
--- hecho(GradientMaker.hgradient("a luminescent butterly floats about lazily on brillant blue and lilac wings\n", {255,0,0}, {0,0,255}))
--- hecho(GradientMaker.hgradient("a luminescent butterly floats about lazily on brillant blue and lilac wings\n", {50,50,50}, {0,255,0}, {50,50,50}))
-function GradientMaker.hgradient(text, ...)
-  return hgradient(text, ...)
-end
-
---- Returns a table, each element of which is a table, the first element of which is the color name to use and the character which should be that color
--- @tparam string text The text you want to apply the color gradients to
--- @param first_color The color you want it to start at. Table of colors in { r, g, b } format
--- @param second_color The color you want the gradient to transition to first. Table of colors in { r, g, b } format
--- @param next_color Keep repeating if you want it to transition from the second color to a third, then a third to a fourth, etc
--- @see cgradient
-function GradientMaker.cgradient_table(text, ...)
-  return cgradient_table(text, ...)
-end
-
---- Returns a table, each element of which is a table, the first element of which is the color({r,g,b} format) to use and the character which should be that color
--- @tparam string text The text you want to apply the color gradients to
--- @param first_color The color you want it to start at. Table of colors in { r, g, b } format
--- @param second_color The color you want the gradient to transition to first. Table of colors in { r, g, b } format
--- @param next_color Keep repeating if you want it to transition from the second color to a third, then a third to a fourth, etc
--- @see dgradient
-function GradientMaker.dgradient_table(text, ...)
-  return dgradient_table(text, ...)
-end
-
---- Returns a table, each element of which is a table, the first element of which is the color(in hex) to use and the second element of which is the character which should be that color
--- @tparam string text The text you want to apply the color gradients to
--- @param first_color The color you want it to start at. Table of colors in { r, g, b } format
--- @param second_color The color you want the gradient to transition to first. Table of colors in { r, g, b } format
--- @param next_color Keep repeating if you want it to transition from the second color to a third, then a third to a fourth, etc
--- @see hgradient
-function GradientMaker.hgradient_table(text, ...)
-  return hgradient_table(text, ...)
-end
-
---- Creates global copies of the c/d/hgradient(_table) functions and color_name for use without accessing the module table
--- @usage
--- GradientMaker.install_global()
--- cecho(cgradient(...)) -- use cgradient directly now
-function GradientMaker.install_global()
-  _G["hgradient"] = function(...)
-    return hgradient(...)
-  end
-  _G["dgradient"] = function(...)
-    return dgradient(...)
-  end
-  _G["cgradient"] = function(...)
-    return cgradient(...)
-  end
-  _G["hgradient_table"] = function(...)
-    return hgradient_table(...)
-  end
-  _G["dgradient_table"] = function(...)
-    return dgradient_table(...)
-  end
-  _G["cgradient_table"] = function(...)
-    return cgradient_table(...)
-  end
-  _G["color_name"] = function(...)
-    return color_name(...)
-  end
-end
-
--- function GradientMaker.getGrads()
---   return gradient_table
--- end
-
-return GradientMaker
- - -
-
-
-generated by LDoc 1.5.0 -Last updated 2023-05-29 18:41:27 -
-
- - diff --git a/src/resources/MDK/doc/source/loggingconsole.lua.html b/src/resources/MDK/doc/source/loggingconsole.lua.html deleted file mode 100755 index f8e4016..0000000 --- a/src/resources/MDK/doc/source/loggingconsole.lua.html +++ /dev/null @@ -1,560 +0,0 @@ - - - - - Reference - - - - -
- -
- -
-
-
- - -
- - - - - - -
- -

loggingconsole.lua

-
---- MiniConsole with logging capabilities
--- @classmod LoggingConsole
--- @author Damian Monogue <demonnic@gmail.com>
--- @copyright 2020 Damian Monogue
--- @license MIT, see LICENSE.lua
-local homedir = getMudletHomeDir():gsub("\\", "/")
-local pathOfThisFile = (...):match("(.-)[^%.]+$")
-local dt = require(pathOfThisFile .. "demontools")
-local exists, htmlHeader, htmlHeaderPattern = dt.exists, dt.htmlHeader, dt.htmlHeaderPattern
-
-local LoggingConsole = {log = true, logFormat = "h", path = "|h/log/consoleLogs/|y/|m/|d/", fileName = "|n.|e"}
-
---- Creates and returns a new LoggingConsole.
--- @param cons table of constraints. Includes all the valid Geyser.MiniConsole constraints, plus
--- <table class="tg">
--- <thead>
---   <tr>
---     <th>option name</th>
---     <th>description</th>
---     <th>default</th>
---   </tr>
--- </thead>
--- <tbody>
---   <tr>
---     <td class="tg-1">log</td>
---     <td class="tg-1">Should the miniconsole be logging?</td>
---     <td class="tg-1">true</td>
---   </tr>
---   <tr>
---     <td class="tg-2">logFormat</td>
---     <td class="tg-2">"h" for html, "t" for plaintext, "l" for log (with ansi)</td>
---     <td class="tg-2">h</td>
---   </tr>
---   <tr>
---     <td class="tg-1">path</td>
---     <td class="tg-1">The path the file lives in. It is templated.<br>|h is replaced by the profile homedir.<br>|y by 4 digit year.<br>|m by 2 digit month<br>|d by 2 digit day<br>|n by the name constraint<br>|e by the file extension (html for h logType, log for others)</td>
---     <td class="tg-1">"|h/log/consoleLogs/|y/|m/|d/"</td>
---   </tr>
---   <tr>
---     <td class="tg-2">fileName</td>
---     <td class="tg-2">The name of the log file. It is templated, same as path above</td>
---     <td class="tg-2">"|n.|e"</td>
---   </tr>
--- </tbody>
--- </table>
--- @param container the container for the console
--- @usage
--- local LoggingConsole = require("MDK.loggingconsole")
--- myLoggingConsole = LoggingConsole:new({
--- name = "my logging console",
---   x = 0,
---   y = 0,
---   height = 200,
---   width = 400,
--- }) -- just like making a miniconsole, really
-function LoggingConsole:new(cons, container)
-  cons = cons or {}
-  local consType = type(cons)
-  assert(consType == "table", "LoggingConsole:new(cons, container): cons must be a valid table of constraints. Got: " .. consType)
-  local me = Geyser.MiniConsole:new(cons, container)
-  setmetatable(me, self)
-  self.__index = self
-  return me
-end
-
---- Returns the file extension of the logfile this console will log to
-function LoggingConsole:getExtension()
-  local extension = "log"
-  if table.contains({"h", "html"}, self.logFormat) then
-    extension = "html"
-  end
-  return extension
-end
-
---- Returns a string with all templated items replaced
----@tparam string str The templated string to transform
----@local
-function LoggingConsole:transformTemplate(str)
-  local ttbl = getTime()
-  local year = ttbl.year
-  local month = string.format("%02d", ttbl.month)
-  local day = string.format("%02d", ttbl.day)
-  local name = self.name
-  local extension = self:getExtension()
-  str = str:gsub("|h", homedir)
-  str = str:gsub("|y", year)
-  str = str:gsub("|m", month)
-  str = str:gsub("|d", day)
-  str = str:gsub("|n", name)
-  str = str:gsub("|e", extension)
-  return str
-end
-
---- Returns the path to the logfile for this console
-function LoggingConsole:getPath()
-  local path = self:transformTemplate(self.path)
-  if not path:ends("/") then
-    path = path .. "/"
-  end
-  return path
-end
-
---- Sets the path to use for the log file.
--- @param path the path to put the log file in. It is templated.<br>|h is replaced by the profile homedir.<br>|y by 4 digit year.<br>|m by 2 digit month<br>|d by 2 digit day<br>|n by the name constraint<br>|e by the file extension (html for h logType, log for others)
-function LoggingConsole:setPath(path)
-  self.path = path
-end
-
---- Returns the filename for the logfile for this console
-function LoggingConsole:getFileName()
-  local fileName = self:transformTemplate(self.fileName)
-  fileName = fileName:gsub("[<>:'\"/\\?*]", "_")
-  return fileName
-end
-
---- Sets the fileName to use for the log file.
--- @param fileName the fileName to use for the logfile. It is templated.<br>|h is replaced by the profile homedir.<br>|y by 4 digit year.<br>|m by 2 digit month<br>|d by 2 digit day<br>|n by the name constraint<br>|e by the file extension (html for h logType, log for others)
-function LoggingConsole:setFileName(fileName)
-  self.fileName = fileName
-end
-
---- Returns the pull path and filename for the logfile for this console
-function LoggingConsole:getFullFilename()
-  local path = self:getPath()
-  local fileName = self:getFileName()
-  local fullPath = path .. fileName
-  fullPath = fullPath:gsub("|", "_")
-  return fullPath
-end
-
---- Turns logging for this console on
-function LoggingConsole:enableLogging()
-  self.log = true
-end
-
---- Turns logging for this console off
-function LoggingConsole:disableLogging()
-  self.log = false
-end
-
---- Creates the path for the logfile for this console if necessary
----@local
-function LoggingConsole:createPathIfNotExists()
-  local path = self:transformTemplate(self.path)
-  if not path:ends("/") then
-    path = path .. "/"
-  end
-  if not exists(path) then
-    local ok, err = dt.mkdir_p(path)
-    if not ok then
-      assert(false, "Could not create directory for log files:" .. path .. "\n Reason was: " .. err)
-    end
-  end
-  return true
-end
-
---- Handles actually writing to the log file
----@local
-function LoggingConsole:writeToLog(str)
-  local fileName = self:getFullFilename()
-  self:createPathIfNotExists()
-  if self:getExtension() == "html" then
-    if not io.exists(fileName) then
-      str = htmlHeader .. str
-    end
-    str = str
-  end
-  local file, err = io.open(fileName, "a")
-  if not file then
-    echo(err .. "\n")
-    return
-  end
-  file:write(str)
-  file:close()
-end
-
-local parent = Geyser.MiniConsole
---- Handler function which does the lifting for c/d/h/echo and appendBuffer to provide the logfile writing functionality
----@param str the string to echo. Use "" for appends
----@param etype the type of echo. Valid are "c", "d", "h", "e", and "a"
----@param log Allows you to override the default behaviour defined by the .log property. Pass true to definitely log, false to skip logging.
----@local
-function LoggingConsole:xEcho(str, etype, log)
-  if log == nil then
-    log = self.log
-  end
-  local logStr
-  local logType = self.logFormat
-  if logType:find("h") then
-    logType = "h"
-  elseif logType ~= "t" then
-    logType = "l"
-  end
-  if etype == "d" then -- decho
-    if logType == "h" then
-      logStr = dt.decho2html(str)
-    elseif logType == "t" then
-      logStr = dt.decho2string(str)
-    else
-      logStr = dt.decho2ansi(str)
-    end
-    parent.decho(self, str)
-  elseif etype == "c" then -- cecho
-    if logType == "h" then
-      logStr = dt.cecho2html(str)
-    elseif logType == "t" then
-      logStr = dt.cecho2string(str)
-    else
-      logStr = dt.cecho2ansi(str)
-    end
-    parent.cecho(self, str)
-  elseif etype == "h" then -- hecho
-    if logType == "h" then
-      logStr = dt.hecho2html(str)
-    elseif logType == "t" then
-      logStr = dt.hecho2string(str)
-    else
-      logStr = dt.hecho2ansi(str)
-    end
-    parent.hecho(self, str)
-  elseif etype == "a" then -- append
-    str = dt.append2decho()
-    str = str .. "\n"
-    if logType == "h" then
-      logStr = dt.decho2html(str)
-    elseif logType == "t" then
-      logStr = dt.decho2string(str)
-    else
-      logStr = dt.decho2ansi(str)
-    end
-    parent.appendBuffer(self)
-  elseif etype == "e" then -- echo
-    if logType == "h" then
-      logStr = dt.decho2html(str)
-    else
-      logStr = str
-    end
-    parent.echo(self, str)
-  end
-  if log then
-    self:writeToLog(logStr)
-  end
-end
-
---- Does the actual lifting of echoing links/popups
--- @local
-function LoggingConsole:xEchoLink(text, lType, command, hint, useFormat, log)
-  if log == nil then
-    log = self.log
-  end
-  local logStr = ""
-  if lType:starts("c") then
-    if self.logFormat == "h" then
-      logStr = dt.cecho2html(text)
-    elseif self.logFormat == "l" then
-      logStr = dt.cecho2ansi(text)
-    elseif self.logFormat == "t" then
-      logStr = dt.cecho2string(text)
-    end
-    if lType:ends("p") then
-      parent.cechoPopup(self, text, command, hint, useFormat)
-    else
-      parent.cechoLink(self, text, command, hint, useFormat)
-    end
-  elseif lType:starts("d") then
-    if self.logFormat == "h" then
-      logStr = dt.decho2html(text)
-    elseif self.logFormat == "l" then
-      logStr = dt.decho2ansi(text)
-    elseif self.logFormat == "t" then
-      logStr = dt.decho2string(text)
-    end
-    if lType:ends("p") then
-      parent.dechoPopup(self, text, command, hint, useFormat)
-    else
-      parent.dechoLink(self, text, command, hint, useFormat)
-    end
-  elseif lType:starts("h") then
-    if self.logFormat == "h" then
-      logStr = dt.hecho2html(text)
-    elseif self.logFormat == "l" then
-      logStr = dt.hecho2ansi(text)
-    elseif self.logFormat == "t" then
-      logStr = dt.hecho2string(text)
-    end
-    if lType:ends("p") then
-      parent.hechoPopup(self, text, command, hint, useFormat)
-    else
-      parent.hechoLink(self, text, command, hint, useFormat)
-    end
-  elseif lType:starts("e") then
-    logStr = text
-    if lType:ends("p") then
-      parent.echoPopup(self, text, command, hint, useFormat)
-    else
-      parent.echoLink(self, text, command, hint, useFormat)
-    end
-  end
-  if log then
-    self:writeToLog(logStr)
-  end
-end
-
---- cechoLink for LoggingConsole
--- @param text the text to use for the link
--- @param command the command to send when the link is clicked, as text. IE [[send("sleep")]]
--- @param hint A tooltip which is displayed when the mouse is over the link
--- @param log Should we log this line? Defaults to self.log if not passed.
-function LoggingConsole:cechoLink(text, command, hint, log)
-  self:xEchoLink(text, "c", command, hint, true, log)
-end
-
---- dechoLink for LoggingConsole
--- @param text the text to use for the link
--- @param command the command to send when the link is clicked, as text. IE [[send("sleep")]]
--- @param hint A tooltip which is displayed when the mouse is over the link
--- @param log Should we log this line? Defaults to self.log if not passed.
-function LoggingConsole:dechoLink(text, command, hint, log)
-  self:xEchoLink(text, "d", command, hint, true, log)
-end
-
---- hechoLink for LoggingConsole
--- @param text the text to use for the link
--- @param command the command to send when the link is clicked, as text. IE [[send("sleep")]]
--- @param hint A tooltip which is displayed when the mouse is over the link
--- @param log Should we log this line? Defaults to self.log if not passed.
-function LoggingConsole:hechoLink(text, command, hint, log)
-  self:xEchoLink(text, "h", command, hint, true, log)
-end
-
---- echoLink for LoggingConsole
--- @param text the text to use for the link
--- @param command the command to send when the link is clicked, as text. IE [[send("sleep")]]
--- @param hint A tooltip which is displayed when the mouse is over the link
--- @param useCurrentFormat If set to true, will look like the text around it. If false it will be blue and underline.
--- @param log Should we log this line? Defaults to self.log if not passed. If you want to pass this you must pass in useCurrentFormat
--- @usage myLoggingConsole:echoLink("This is a link!", [[send("sleep")]], "sleep") -- text "This is a link" will send("sleep") when clicked and be blue w/ underline. Defaut log behaviour (self.log)
--- @usage myLoggingConsole:echoLink("This is a link!", [[send("sleep")]], "sleep", false, false) -- same as above, but forces it not to log regardless of self.log setting
--- @usage myLoggingConsole:echoLink("This is a link!", [[send("sleep")]], "sleep", true, true) -- same as above, but forces it to log regardless of self.log setting and the text will look like anything else echoed to the console.
-function LoggingConsole:echoLink(text, command, hint, useCurrentFormat, log)
-  self:xEchoLink(text, "e", command, hint, useCurrentFormat, log)
-end
-
---- cechoPopup for LoggingConsole
--- @param text the text to use for the link
--- @param commands the commands to send when the popup is activated, as table. IE {[[send("sleep")]], [[send("stand")]]}
--- @param hints A tooltip which is displayed when the mouse is over the link. IE {{"sleep", "stand"}}
--- @param log Should we log this line? Defaults to self.log if not passed.
-function LoggingConsole:cechoPopup(text, commands, hints, log)
-  self:xEchoLink(text, "cp", commands, hints, true, log)
-end
-
---- dechoPopup for LoggingConsole
--- @param text the text to use for the link
--- @param commands the commands to send when the popup is activated, as table. IE {[[send("sleep")]], [[send("stand")]]}
--- @param hints A tooltip which is displayed when the mouse is over the link. IE {{"sleep", "stand"}}
--- @param log Should we log this line? Defaults to self.log if not passed.
-function LoggingConsole:dechoPopup(text, commands, hints, log)
-  self:xEchoLink(text, "dp", commands, hints, true, log)
-end
-
---- hechoPopup for LoggingConsole
--- @param text the text to use for the link
--- @param commands the commands to send when the popup is activated, as table. IE {[[send("sleep")]], [[send("stand")]]}
--- @param hints A tooltip which is displayed when the mouse is over the link. IE {{"sleep", "stand"}}
--- @param log Should we log this line? Defaults to self.log if not passed.
-function LoggingConsole:hechoPopup(text, commands, hints, log)
-  self:xEchoLink(text, "hp", commands, hints, true, log)
-end
-
---- echoPopup for LoggingConsole
--- @param text the text to use for the link
--- @param commands the commands to send when the popup is activated, as table. IE {[[send("sleep")]], [[send("stand")]]}
--- @param hints A tooltip which is displayed when the mouse is over the link. IE {{"sleep", "stand"}}
--- @param useCurrentFormat If set to true, will look like the text around it. If false it will be blue and underline.
--- @param log Should we log this line? Defaults to self.log if not passed. If you want to pass this you must pass in useCurrentFormat
--- @usage myLoggingConsole:echoPopup("This is a link!", {[[send("sleep")]], [[send("stand")]], {"sleep", "stand"}) -- text "This is a link" will send("sleep") when clicked and be blue w/ underline. Defaut log behaviour (self.log)
--- @usage myLoggingConsole:echoPopup("This is a link!", {[[send("sleep")]], [[send("stand")]], {"sleep", "stand"}, false, false) -- same as above, but forces it not to log regardless of self.log setting
--- @usage myLoggingConsole:echoPopup("This is a link!", {[[send("sleep")]], [[send("stand")]], {"sleep", "stand"}, true, true) -- same as above, but forces it to log regardless of self.log setting and the text will look like anything else echoed to the console.
-function LoggingConsole:echoPopup(text, commands, hints, useCurrentFormat, log)
-  self:xEchoLink(text, "ep", commands, hints, useCurrentFormat, log)
-end
-
---- Append copy()ed text to the console
--- @param log should we log this?
-function LoggingConsole:appendBuffer(log)
-  self:xEcho("", "a", log)
-end
-
---- Append copy()ed text to the console
--- @param log should we log this?
-function LoggingConsole:append(log)
-  self:xEcho("", "a", log)
-end
-
---- echo's a string to the console.
--- @param str the string to echo
--- @param log should this be logged? Used to override the .log constraint
-function LoggingConsole:echo(str, log)
-  self:xEcho(str, "e", log)
-end
-
---- hecho's a string to the console.
--- @param str the string to hecho
--- @param log should this be logged? Used to override the .log constraint
-function LoggingConsole:hecho(str, log)
-  self:xEcho(str, "h", log)
-end
-
---- decho's a string to the console.
--- @param str the string to decho
--- @param log should this be logged? Used to override the .log constraint
-function LoggingConsole:decho(str, log)
-  self:xEcho(str, "d", log)
-end
-
---- cecho's a string to the console.
--- @param str the string to cecho
--- @param log should this be logged? Used to override the .log constraint
-function LoggingConsole:cecho(str, log)
-  self:xEcho(str, "c", log)
-end
-
---- Replays the last X lines from the console's log file, if it exists
--- @param numberOfLines The number of lines to replay from the end of the file
-function LoggingConsole:replay(numberOfLines)
-  local fileName = self:getFullFilename()
-  if not exists(fileName) then
-    return
-  end
-  local file = io.open(fileName, "r")
-  local lines = file:read("*a")
-  if self:getExtension() == "html" then
-    for _, line in ipairs(htmlHeaderPattern:split("\n")) do
-      if line ~= "" then
-        lines = lines:gsub(line .. "\n", "")
-      end
-    end
-    lines = dt.html2decho(lines)
-  else
-    lines = ansi2decho(lines)
-  end
-  local linesTbl = lines:split("\n")
-  local result
-  if #linesTbl <= numberOfLines then
-    result = lines
-  else
-    result = ""
-    local start = #linesTbl - numberOfLines
-    for index, str in ipairs(linesTbl) do
-      if index >= start then
-        result = string.format("%s\n%s", result, str)
-      end
-    end
-  end
-  self:decho(result, false)
-end
-
-setmetatable(LoggingConsole, parent)
-
-return LoggingConsole
- - -
-
-
-generated by LDoc 1.5.0 -Last updated 2023-05-29 18:41:27 -
-
- - diff --git a/src/resources/MDK/doc/source/loginator.lua.html b/src/resources/MDK/doc/source/loginator.lua.html deleted file mode 100755 index 026a4d6..0000000 --- a/src/resources/MDK/doc/source/loginator.lua.html +++ /dev/null @@ -1,555 +0,0 @@ - - - - - Reference - - - - -
- -
- -
-
-
- - -
- - - - - - -
- -

loginator.lua

-
---- Loginator creates an object which allows you to log things to file at
--- various severity levels, with the ability to only log items above a specific
--- severity to file.
--- @classmod Loginator
--- @author Damian Monogue <demonnic@gmail.com>
--- @copyright 2021 Damian Monogue
--- @license MIT, see LICENSE.lua
-local Loginator = {
-  format = "h",
-  name = "logname",
-  fileNameTemplate = "|p/log/Loginator/|y-|M-|d-|n.|e",
-  entryTemplate = "|y-|M-|d |h:|m:|s.|x [|c|l|r] |t",
-  level = "warn",
-  bgColor = "black",
-  fontSize = 12,
-  fgColor = "white",
-}
-
-local levelColors = {error = "red", warn = "DarkOrange", info = "ForestGreen", debug = "ansi_yellow"}
-local loggerLevels = {error = 1, warn = 2, info = 3, debug = 4}
-
-local function exists(path)
-  local ok, err, code = os.rename(path, path)
-  if not ok and code == 13 then
-    return true
-  end
-  return ok, err
-end
-
-local function isWindows()
-  return package.config:sub(1, 1) == [[\]]
-end
-
-local function mkdir_p(path)
-  path = path:gsub("\\", "/")
-  local pathTbl = path:split("/")
-  local cwd = "/"
-  if isWindows() then
-    cwd = ""
-  end
-  for index, dirName in ipairs(pathTbl) do
-    if index == 1 then
-      cwd = cwd .. dirName
-    else
-      cwd = cwd .. "/" .. dirName
-      cwd = cwd:gsub("//", "/")
-    end
-    if not table.contains({"/", "C:"}, cwd) and not exists(cwd) then
-      local ok, err = lfs.mkdir(cwd)
-      if not ok then
-        return ok, err
-      end
-    end
-  end
-  return true
-end
-
-local htmlHeaderTemplate = [=[  <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-"http://www.w3.org/TR/html4/loose.dtd">
-<html>
-  <head>
-    <meta http-equiv="Content-Type" content="text/html;charset=utf-8" >
-    <link href='http://fonts.googleapis.com/css?family=Droid+Sans+Mono' rel='stylesheet' type='text/css'>
-    <style type="text/css">
-      body {
-        background-color: |b;
-        color: |c;
-        font-family: 'Droid Sans Mono';
-        white-space: pre;
-        font-size: |fpx;
-      }
-    </style>
-  </head>
-<body><span>
-]=]
-
---- Creates a new Loginator object
---@tparam table options table of options for the logger
--- <table class="tg">
--- <thead>
---   <tr>
---     <th>option name</th>
---     <th>description</th>
---     <th>default</th>
---   </tr>
--- </thead>
--- <tbody>
---   <tr>
---     <td class="tg-1">format</td>
---     <td class="tg-1">What format to log in? "h" for html, "a" for ansi, anything else for plaintext.</td>
---     <td class="tg-1">"h"</td>
---   </tr>
---   <tr>
---     <td class="tg-2">name</td>
---     <td class="tg-2">What is the name of the logger? Will replace |n in templates</td>
---     <td class="tg-2">logname</td>
---   </tr>
---   <tr>
---     <td class="tg-1">level</td>
---     <td class="tg-1">What level should the logger operate at? This will control what level the log function defaults to, as well as what logs will actually be written<br>
---                        Only items of an equal or higher severity to this will be written to the log file.</td>
---     <td class="tg-1">"info"</td>
---   </tr>
---   <tr>
---     <td class="tg-2">bgColor</td>
---     <td class="tg-2">What background color to use for html logs</td>
---     <td class="tg-2">"black"</td>
---   </tr>
---   <tr>
---     <td class="tg-1">fgColor</td>
---     <td class="tg-1">What color to use for the main text in html logs</td>
---     <td class="tg-1">"white"</td>
---   </tr>
---   <tr>
---     <td class="tg-2">fontSize</td>
---     <td class="tg-2">What font size to use in html logs</td>
---     <td class="tg-2">12</td>
---   </tr>
---   <tr>
---     <td class="tg-1">levelColors</td>
---     <td class="tg-1">Table with the log level as the key, and the color which corresponds to it as the value</td>
---     <td class="tg-1">{ error = "red", warn = "DarkOrange", info = "ForestGreen", debug = "ansi_yellow" }</td>
---   </tr>
---   <tr>
---     <td class="tg-2">fileNameTemplate</td>
---     <td class="tg-2">A template which will be transformed into the full filename, with path. See template options below for replacements</td>
---     <td class="tg-2">"|p/log/Loginator/|y-|M-|d-|n.|e"</td>
---   </tr>
---   <tr>
---     <td class="tg-1">entryTemplate</td>
---     <td class="tg-1">The template which controls the look of each log entry. See template options below for replacements</td>
---     <td class="tg-1">"|y-|M-|d |h:|m:|s.|x [|c|l|r] |t"</td>
---   </tr>
--- </tbody>
--- </table><br>
--- Table of template options
--- <table class="tg">
--- <thead>
---   <tr>
---     <th>template code</th>
---     <th>what it is replaced with</th>
---     <th>example</th>
---   </tr>
--- </thead>
--- <tbody>
---   <tr>
---     <td class="tg-1">|y</td>
---     <td class="tg-1">the year in 4 digits</td>
---     <td class="tg-1">2021</td>
---   </tr>
---   <tr>
---     <td class="tg-2">|p</td>
---     <td class="tg-2">getMudletHomeDir()</td>
---     <td class="tg-2">/home/demonnic/.config/mudlet/profiles/testprofile</td>
---   </tr>
---   <tr>
---     <td class="tg-1">|M</td>
---     <td class="tg-1">Month as 2 digits</td>
---     <td class="tg-1">05</td>
---   </tr>
---   <tr>
---     <td class="tg-2">|d</td>
---     <td class="tg-2">day, as 2 digits</td>
---     <td class="tg-2">23</td>
---   </tr>
---   <tr>
---     <td class="tg-1">|h</td>
---     <td class="tg-1">hour in 24hr time format, 2 digits</td>
---     <td class="tg-1">03</td>
---   </tr>
---   <tr>
---     <td class="tg-2">|m</td>
---     <td class="tg-2">minute as 2 digits</td>
---     <td class="tg-2">42</td>
---   </tr>
---   <tr>
---     <td class="tg-1">|s</td>
---     <td class="tg-1">seconds as 2 digits</td>
---     <td class="tg-1">34</td>
---   </tr>
---   <tr>
---     <td class="tg-2">|x</td>
---     <td class="tg-2">milliseconds as 3 digits</td>
---     <td class="tg-2">194</td>
---   </tr>
---   <tr>
---     <td class="tg-1">|e</td>
---     <td class="tg-1">Filename extension expected. "html" for html format, "log" for everything else</td>
---     <td class="tg-1">html</td>
---   </tr>
---   <tr>
---     <td class="tg-2">|l</td>
---     <td class="tg-2">The logging level of the entry, in ALLCAPS</td>
---     <td class="tg-2">WARN</td>
---   </tr>
---   <tr>
---     <td class="tg-1">|c</td>
---     <td class="tg-1">The color which corresponds with the logging level. Set via the levelColors table in the options. Example not included.</td>
---     <td class="tg-1"></td>
---   </tr>
---   <tr>
---     <td class="tg-2">|r</td>
---     <td class="tg-2">Reset back to standard color. Used to close |c. Example not included</td>
---     <td class="tg-2"></td>
---   </tr>
---   <tr>
---     <td class="tg-1">|n</td>
---     <td class="tg-1">The name of the logger, set via the options when you have Loginator create it.</td>
---     <td class="tg-1">CoolPackageLog</td>
---   </tr>
---</tbody>
---</table>
---@return newly created logger object
-function Loginator:new(options)
-  options = options or {}
-  local optionsType = type(options)
-  if optionsType ~= "table" then
-    return nil, f "Loginator:new(options) options as table expected, got {optionsType}"
-  end
-  local me = table.deepcopy(options)
-  me.levelColors = me.levelColors or {}
-  local lcType = type(me.levelColors)
-  if lcType ~= "table" then
-    return nil, f "Loginator:new(options) provided options.levelColors must be a table, but you provided a {lcType}"
-  end
-  for lvl,clr in pairs(levelColors) do
-    me.levelColors[lvl] = me.levelColors[lvl] or clr
-  end
-  setmetatable(me, self)
-  self.__index = self
-  return me
-end
-
----@local
-function Loginator:processTemplate(str, level)
-  local lvl = level or self.level
-  local timeTable = getTime()
-  for what, with in pairs({
-    ["|y"] = function()
-      return timeTable.year
-    end,
-    ["|p"] = getMudletHomeDir,
-    ["|M"] = function()
-      return string.format("%02d", timeTable.month)
-    end,
-    ["|d"] = function()
-      return string.format("%02d", timeTable.day)
-    end,
-    ["|h"] = function()
-      return string.format("%02d", timeTable.hour)
-    end,
-    ["|m"] = function()
-      return string.format("%02d", timeTable.min)
-    end,
-    ["|s"] = function()
-      return string.format("%02d", timeTable.sec)
-    end,
-    ["|x"] = function()
-      return string.format("%03d", timeTable.msec)
-    end,
-    ["|e"] = function()
-      return (self.format:starts("h") and "html" or "log")
-    end,
-    ["|l"] = function()
-      return lvl:upper()
-    end,
-    ["|c"] = function()
-      return self:getColor(lvl)
-    end,
-    ["|r"] = function()
-      return self:getReset()
-    end,
-    ["|n"] = function()
-      return self.name
-    end,
-  }) do
-    if str:find(what) then
-      str = str:gsub(what, with())
-    end
-  end
-  return str
-end
-
---- Set the color to associate with a logging level post-creation
---@param color The color to set for the level, as a string. Can be any valid color string for cecho, decho, or hecho.
---@param level The level to set the color for. Must be one of 'error', 'warn', 'info', or 'debug'
---@return true if the color is updated, or nil+error if it could not be updated for some reason.
-function Loginator:setColorForLevel(color, level)
-  if not color then
-    return nil, "You must provide a color to set"
-  end
-  if not level then
-    return nil, "You must provide a level to set the color for"
-  end
-  if not loggerLevels[level] then
-    return nil, "Invalid level. Valid levels are 'error', 'warn', 'info', or 'debug'"
-  end
-  if not Geyser.Color.parse(color) then
-    return nil, "You must provide a color which can be parsed by Geyser.Color.parse. Examples are 'blue' (cecho), '<128,0,0>' (decho), '#aa3388' (hecho), or {128,0,0} (table of r,g,b values)"
-  end
-  self.levelColors[level] = color
-  return true
-end
-
----@local
-function Loginator:getColor(level)
-  if self.format == "t" then
-    return ""
-  end
-  local r, g, b = Geyser.Color.parse((self.levelColors[level] or {128, 128, 128}))
-  if self.format == "h" then
-    return string.format("<span style='color: rgb(%d,%d,%d);'>", r, g, b)
-  elseif self.format == "a" then
-    return string.format("\27[38:2::%d:%d:%dm", r, g, b)
-  end
-  return ""
-end
-
----@local
-function Loginator:getReset()
-  if self.format == "t" then
-    return ""
-  elseif self.format == "h" then
-    return "</span>"
-  elseif self.format == "a" then
-    return "\27[39;49m"
-  end
-  return ""
-end
-
---- Returns the full path and filename to the logfile
-function Loginator:getFullFilename()
-  return self:processTemplate(self.fileNameTemplate)
-end
-
---- Write an error level message to the logfile. Error level messages are always written.
---@param msg the message to log
---@return true if msg written, nil+error if error
-function Loginator:error(msg)
-  return self:log(msg, "error")
-end
-
---- Write a warn level message to the logfile.
--- Msg is only written if the logger level is <= warn
--- From most to least severe the levels are:
--- error > warn > info > debug
---@param msg the message to log
---@return true if msg written, false if skipped due to level, nil+error if error
-function Loginator:warn(msg)
-  return self:log(msg, "warn")
-end
-
---- Write an info level message to the logfile.
--- Msg is only written if the logger level is <= info
--- From most to least severe the levels are:
--- error > warn > info > debug
---@param msg the message to log
---@return true if msg written, false if skipped due to level, nil+error if error
-function Loginator:info(msg)
-  return self:log(msg, "info")
-end
-
---- Write a debug level message to the logfile.
--- Msg is only written if the logger level is debug
--- From most to least severe the levels are:
--- error > warn > info > debug
---@param msg the message to log
---@return true if msg written, false if skipped due to level, nil+error if error
-function Loginator:debug(msg)
-  return self:log(msg, "debug")
-end
-
---- Write a message to the log file and optionally specify the level
---@param msg the message to log
---@param level the level to log the message at. Defaults to the level of the logger itself if not provided.
---@return true if msg written, false if skipped due to level, nil+error if error
-function Loginator:log(msg, level)
-  level = level or self.level
-  local levelNumber = loggerLevels[level]
-  if not levelNumber then
-    return nil, f"Unknown logging level: {level}. Valid levels are 'error', 'warn', 'info', and 'debug'"
-  end
-  local displayLevelNumber = loggerLevels[self.level]
-  if levelNumber > displayLevelNumber then
-    return false
-  end
-  local filename = self:getFullFilename()
-  local filteredMsg = self:processTemplate(self.entryTemplate, level):gsub("|t", msg)
-  local ok, err = self:createPathIfNotExists(filename)
-  if err then
-    debugc(err)
-    return ok, err
-  end
-  if self.format == "h" and not io.exists(filename) then
-    filteredMsg = self:getHtmlHeader() .. filteredMsg
-  end
-  local file, err = io.open(filename, "a")
-  if not file then
-    err = string.format("Logger %s failed to open %s because: %s\n", self.name, filename, err)
-    debugc(err)
-    return nil, err
-  end
-  file:write(filteredMsg .. "\n")
-  file:close()
-  return true
-end
-
---- Uses openUrl() to request your OS open the logfile in the appropriate application. Usually your web browser for html and text editor for all others.
-function Loginator:open()
-  openUrl(self:getFullFilename())
-end
-
---- Uses openUrl() to request your OS open the directory the logfile resides in. This allows for easier browsing if you have more than one file.
-function Loginator:openDir()
-  openUrl(self:getPath())
-end
-
---- Returns the path to the log file (directory in which the file resides) as a string
---@param filename optional filename to return the path of. If not supplied, with use the logger's current filename
-function Loginator:getPath(filename)
-  filename = filename or self:getFullFilename()
-  filename = filename:gsub([[\]], "/")
-  local filenameTable = filename:split("/")
-  filenameTable[#filenameTable] = nil
-  local path = table.concat(filenameTable, "/")
-  return path
-end
-
----@local
-function Loginator:createPathIfNotExists(filename)
-  if exists(filename) then
-    return false
-  end
-  filename = filename:gsub([[\]], "/")
-  local path = self:getPath(filename)
-  if exists(path) then
-    return false
-  end
-  local ok, err = mkdir_p(path)
-  if not ok then
-    err = string.format("Could not create directory for log files: %s\n Reason was: %s", path, err)
-    return nil, err
-  end
-  return true
-end
-
----@local
-function Loginator:getHtmlHeader()
-  local header = htmlHeaderTemplate
-  header = header:gsub("|b", self.bgColor)
-  header = header:gsub("|c", self.fgColor)
-  header = header:gsub("|f", self.fontSize)
-  return header
-end
-
-return Loginator
- - -
-
-
-generated by LDoc 1.5.0 -Last updated 2023-05-29 18:41:27 -
-
- - diff --git a/src/resources/MDK/doc/source/mastermindsolver.lua.html b/src/resources/MDK/doc/source/mastermindsolver.lua.html deleted file mode 100755 index a9f95b2..0000000 --- a/src/resources/MDK/doc/source/mastermindsolver.lua.html +++ /dev/null @@ -1,353 +0,0 @@ - - - - - Reference - - - - -
- -
- -
-
-
- - -
- - - - - - -
- -

mastermindsolver.lua

-
---- Interactive object which helps you solve a Master Mind puzzle.
--- @classmod MasterMindSolver
--- @author Damian Monogue <demonnic@gmail.com>
--- @copyright 2021 Damian Monogue
--- @copyright 2008,2009 Konstantinos Asimakis for code used to turn an index number into a guess (indexToGuess method)
-local MasterMindSolver = {
-  places = 4,
-  items = {"red", "orange", "yellow", "green", "blue", "purple"},
-  template = "|t",
-  autoSend = false,
-  singleCommand = false,
-  separator = " ",
-  allowDuplicates = true,
-}
-local mod, floor, random, randomseed = math.mod, math.floor, math.random, math.randomseed
-local initialGuess = {{1}, {1, 2}, {1, 1, 2}, {1, 1, 2, 2}, {1, 1, 1, 2, 2}, {1, 1, 1, 2, 2, 2}, {1, 1, 1, 1, 2, 2, 2}, {1, 1, 1, 1, 2, 2, 2, 2}}
-
---- Removes duplicate elements from a list
--- @param tbl the table you want to remove dupes from
--- @local
-local function tableUnique(tbl)
-  local used = {}
-  local result = {}
-  for _, item in ipairs(tbl) do
-    if not used[item] then
-      result[#result + 1] = item
-      used[item] = true
-    end
-  end
-  return result
-end
-
---- Creates a new Master Mind solver
--- @tparam table options table of configuration options for the solver
--- <table class="tg">
--- <thead>
---   <tr>
---     <th>option name</th>
---     <th>description</th>
---     <th>default</th>
---   </tr>
--- </thead>
--- <tbody>
---   <tr>
---     <td class="tg-1">places</td>
---     <td class="tg-1">How many spots in the code we're breaking?</td>
---     <td class="tg-1">4</td>
---   </tr>
---   <tr>
---     <td class="tg-2">items</td>
---     <td class="tg-2">The table of colors/gemstones/whatever which can be part of the code</td>
---     <td class="tg-2">{"red", "orange", "yellow", "green", "blue", "purple"}</td>
---   </tr>
---   <tr>
---     <td class="tg-1">template</td>
---     <td class="tg-1">The string template to use for the guess. Within the template, |t is replaced by the item. Used as the command if autoSend is true</td>
---     <td class="tg-1">"|t"</td>
---   </tr>
---   <tr>
---     <td class="tg-2">autoSend</td>
---     <td class="tg-2">Should we send the guess directly to the server?</td>
---     <td class="tg-2">false</td>
---   </tr>
---   <tr>
---     <td class="tg-1">allowDuplicates</td>
---     <td class="tg-1">Can the same item be used more than once in a code?</td>
---     <td class="tg-1">true</td>
---   </tr>
---   <tr>
---     <td class="tg-2">singleCommand</td>
---     <td class="tg-2">If true, combines the guess into a single command, with each one separated by the separator</td>
---     <td class="tg-2">false</td>
---   </tr>
---   <tr>
---     <td class="tg-1">separator</td>
---     <td class="tg-1">If sending the guess as a single command, what should we put between the guesses to separate them?</td>
---     <td class="tg-1">" "</td>
---   </tr>
--- </tbody>
--- </table>
-function MasterMindSolver:new(options)
-  if options == nil then
-    options = {}
-  end
-  local optionsType = type(options)
-  if optionsType ~= "table" then
-    error(f "MasterMindSolver:new(options): options as table expected, got {tostring(options)} of type: {optionsType}")
-  end
-  local me = options
-  setmetatable(me, self)
-  self.__index = self
-  me:populateInitialSet()
-  if not me.allowDuplicates then
-    me.initialGuessMade = true -- skip the preset initial guess, they assume duplicates
-  end
-  return me
-end
-
---- Takes a guess number (4, or 1829, or any number from 1 - <total possible combinations>) and returns the
--- actual guess.
--- @tparam number index which guess to generate
--- @local
-function MasterMindSolver:indexToGuess(index)
-  local guess = {}
-  local options = #self.items
-  for place = 1, self.places do
-    guess[place] = mod(floor((index - 1) / options ^ (place - 1)), options) + 1
-  end
-  return guess
-end
-
---- Compares a guess with the solution and returns the answer
--- @tparam table guess The guess you are checking, as numbers. { 1 , 1, 2, 2 } as an example
--- @tparam table solution the solution you are checking against, as numbers. { 3, 4, 1, 6 } as an example.
--- @local
-function MasterMindSolver:compare(guess, solution)
-  local coloredPins = 0
-  local whitePins = 0
-  local usedGuessPlace = {}
-  local usedSolutionPlace = {}
-  local places = self.places
-  for place = 1, places do
-    if guess[place] == solution[place] then
-      coloredPins = coloredPins + 1
-      usedGuessPlace[place] = true
-      usedSolutionPlace[place] = true
-    end
-  end
-  for guessPlace = 1, places do
-    if not usedGuessPlace[guessPlace] then
-      for solutionPlace = 1, places do
-        if not usedSolutionPlace[solutionPlace] then
-          if guess[guessPlace] == solution[solutionPlace] then
-            whitePins = whitePins + 1
-            usedSolutionPlace[solutionPlace] = true
-            break
-          end
-        end
-      end
-    end
-  end
-  return coloredPins, whitePins
-end
-
---- Generates an initial table of all guesses from 1 to <total possible> that are valid.
--- If allowDuplicates is false, will filter out any of the possible combinations which contain duplicates
--- @local
-function MasterMindSolver:populateInitialSet()
-  local possible = {}
-  local allowDuplicates = self.allowDuplicates
-  local places = self.places
-  local numberOfItems = #self.items
-  local totalCombos = numberOfItems ^ places
-  local numberRemaining = 0
-  for entry = 1, totalCombos do
-    local useItem = true
-    if not allowDuplicates then
-      local guess = self:indexToGuess(entry)
-      local guessUnique = tableUnique(guess)
-      if #guessUnique ~= self.places then
-        useItem = false
-      end
-    end
-    if useItem then
-      possible[entry] = true
-      numberRemaining = numberRemaining + 1
-    end
-  end
-  self.possible = possible
-  self.numberRemaining = numberRemaining
-end
-
---- Function used to reduce the remaining possible answers, given a guess and the answer to that guess. This is not undoable.
--- @tparam table guess guess which the answer belongs to. Uses numbers, rather than item names. IE { 1, 1, 2, 2} rather than { "blue", "blue", "green", "green" }
--- @tparam number coloredPins how many parts of the guess are both the right color and the right place
--- @tparam number whitePins how many parts of the guess are the right color, but in the wrong place
--- @return true if you solved the puzzle (coloredPins == number of positions in the code), or false otherwise
-function MasterMindSolver:reducePossible(guess, coloredPins, whitePins)
-  if coloredPins == #guess then
-    return true
-  end
-  local possible = self.possible
-  local numberRemaining = 0
-  for entry, _ in pairs(possible) do
-    local testColor, testWhite = self:compare(guess, self:indexToGuess(entry))
-    if testColor ~= coloredPins or testWhite ~= whitePins then
-      possible[entry] = nil
-    else
-      numberRemaining = numberRemaining + 1
-    end
-  end
-  self.possible = possible
-  self.numberRemaining = numberRemaining
-  return false
-end
-
---- Function which assumes you used the last suggested guess from the solver, and reduces the number of possible correct solutions based on the answer given
--- @see MasterMindSolver:reducePossible
--- @tparam number coloredPins how many parts of the guess are both the right color and the right place
--- @tparam number whitePins how many parts of the guess are the right color, but in the wrong place
--- @return true if you solved the puzzle (coloredPins == number of positions in the code), or false otherwise
-function MasterMindSolver:checkLastSuggestion(coloredPins, whitePins)
-  return self:reducePossible(self.guess, coloredPins, whitePins)
-end
-
---- Used to get one of the remaining valid possible guesses
--- @tparam boolean useActions if true, will return the guess as the commands which would be sent, rather than the numbered items
-function MasterMindSolver:getValidGuess(useActions)
-  local guess
-  if not self.initialGuessMade then
-    self.initialGuessMade = true
-    guess = initialGuess[self.places]
-  end
-  if not guess then
-    local possible = self.possible
-    local keys = table.keys(possible)
-    randomseed(os.time())
-    guess = self:indexToGuess(keys[random(#keys)])
-  end
-  self.guess = guess
-  if self.autoSend then
-    self:sendGuess(guess)
-  end
-  if useActions then
-    return self:guessToActions(guess)
-  end
-  return guess
-end
-
---- Takes a guess and converts the numbers to commands/actions. IE guessToActions({1, 1, 2, 2}) might return { "blue", "blue", "green", "green" }
--- @tparam table guess the guess to convert as numbers. IE { 1, 1, 2, 2}
--- @return table of commands/actions correlating to the numbers in the guess.
--- @local
-function MasterMindSolver:guessToActions(guess)
-  local actions = {}
-  for index, itemNumber in ipairs(guess) do
-    local item = self.items[itemNumber]
-    actions[index] = self.template:gsub("|t", item)
-  end
-  return actions
-end
-
---- Handles sending the commands to the game for a guess
--- @local
-function MasterMindSolver:sendGuess(guess)
-  local actions = self:guessToActions(guess)
-  if self.singleCommand then
-    send(table.concat(actions, self.separator))
-  else
-    sendAll(unpack(actions))
-  end
-end
-
-return MasterMindSolver
- - -
-
-
-generated by LDoc 1.5.0 -Last updated 2023-05-29 18:41:27 -
-
- - diff --git a/src/resources/MDK/doc/source/revisionator.lua.html b/src/resources/MDK/doc/source/revisionator.lua.html deleted file mode 100755 index 5118d59..0000000 --- a/src/resources/MDK/doc/source/revisionator.lua.html +++ /dev/null @@ -1,240 +0,0 @@ - - - - - Reference - - - - -
- -
- -
-
-
- - -
- - - - - - -
- -

revisionator.lua

-
---- The revisionator provides a standardized way of migrating configurations between revisions
--- for instance, it will track what the currently applied revision number is, and when you tell
--- tell it to migrate, it will apply every individual migration between the currently applied
--- revision and the latest/current revision. This should allow for more seamlessly moving from
--- an older version of a package to a new one.
--- @classmod revisionator
--- @author Damian Monogue <demonnic@gmail.com>
--- @copyright 2023
--- @license MIT, see https://raw.githubusercontent.com/demonnic/MDK/main/src/scripts/LICENSE.lua
-local revisionator = {
-  name = "Revisionator",
-  patches = {},
-}
-revisionator.__index = revisionator
-local dataDir = getMudletHomeDir() .. "/revisionator"
-revisionator.dataDir = dataDir
-if not io.exists(dataDir) then
-  local ok,err = lfs.mkdir(dataDir)
-  if not ok then
-    printDebug(f"Error creating the directory for storing applied revisions: {err}", true)
-  end
-end
-
---- Creates a new revisionator
--- @tparam table options the options to create the revisionator with.
--- <table class="tg">
--- <thead>
---   <tr>
---     <th>option name</th>
---     <th>description</th>
---     <th>default</th>
---   </tr>
--- </thead>
--- <tbody>
---   <tr>
---     <td class="tg-1">name</td>
---     <td class="tg-1">The name of the revisionator. This is absolutely required, as the name is used for tracking the currently applied patch level</td>
---     <td class="tg-1">raises an error if not provided</td>
---   </tr>
---   <tr>
---     <td class="tg-2">patches</td>
---     <td class="tg-2">A table of patch functions. It is traversed using ipairs, so must be in the form of {function1, function2, function3} etc. If you do not provide it, you can add the patches by calling :addPatch for each patch in order.</td>
---     <td class="tg-2">{}</td>
---   </tr>
---</tbody>
---</table>
-function revisionator:new(options)
-  options = options or {}
-  local optionsType = type(options)
-  if optionsType ~= "table" then
-    printError(f"revisionator:new bad argument #1 type, options as table expected, got {optionsType}", true, true)
-  end
-  if not options.name then
-    printError("revisionator:new(options) options must include a 'name' key as this is used as part of tracking the applied patch level.", true, true)
-  end
-  local me = table.deepcopy(options)
-  setmetatable(me, self)
-  return me
-end
-
---- Get the currently applied revision from file
---- @treturn[1] number the revision number currently applied, or 0 if it can't read a current version
---- @treturn[2] nil nil
---- @treturn[2] string error message
-function revisionator:getAppliedPatch()
-  local fileName = f"{self.dataDir}/{self.name}.txt"
-  debugc(fileName)
-  local revision = 0
-  if io.exists(fileName) then
-    local file = io.open(fileName, "r")
-    local fileContents = file:read("*a")
-    file:close()
-    local revNumber = tonumber(fileContents)
-    if revNumber then
-      revision = revNumber
-    else
-      return nil, f"Error while attempting to read current patch version from file: {fileName}\nThe contents of the file are {fileContents} and it was unable to be converted to a revision number"
-    end
-  end
-  return revision
-end
-
---- go through all the patches in order and apply any which are still necessary
---- @treturn boolean true if it successfully applied patches, false if it was already at the latest patch level
---- @error error message
-function revisionator:migrate()
-  local applied,err = self:getAppliedPatch()
-  if not applied then
-    printError(err, true, true)
-  end
-  local patches = self.patches
-  if applied >= #patches then
-    return false
-  end
-  for revision, patch in ipairs(patches) do
-    if applied < revision then
-      local ok, err = pcall(patch)
-      if not ok then
-        self:setAppliedPatch(revision - 1)
-        return nil, f"Error while running patch #{revision}: {err}"
-      end
-    end
-  end
-  self:setAppliedPatch(#patches)
-  return true
-end
-
---- add a patch to the table of patches
---- @tparam function  func the function to run as the patch
---- @number[opt] position which patch to insert it as? If not supplied, inserts it as the last patch. Which is usually what you want.
-function revisionator:addPatch(func, position)
-  if position then
-    table.insert(self.patches, position, func)
-  else
-    table.insert(self.patches, func)
-  end
-end
-
---- Remove a patch from the table of patches
---- this is primarily used for testing
---- @local
---- @number[opt] patchNumber the patch number to remove. Will remove the last item if not provided.
-function revisionator:removePatch(patchNumber)
-  table.remove(self.patches, patchNumber)
-end
-
---- set the currently applied patch number
--- only directly called for testing
---- @local
---- @number patchNumber the patch number to set as the currently applied patch
-function revisionator:setAppliedPatch(patchNumber)
-  local fileName = f"{self.dataDir}/{self.name}.txt"
-  local revFile, err = io.open(fileName, "w+")
-  if not revFile then
-    printError(err, true, true)
-  end
-  revFile:write(patchNumber)
-  revFile:close()
-end
-
-return revisionator
- - -
-
-
-generated by LDoc 1.5.0 -Last updated 2023-05-29 18:41:27 -
-
- - diff --git a/src/resources/MDK/doc/source/schema.lua.html b/src/resources/MDK/doc/source/schema.lua.html deleted file mode 100755 index e06f454..0000000 --- a/src/resources/MDK/doc/source/schema.lua.html +++ /dev/null @@ -1,743 +0,0 @@ - - - - - Reference - - - - -
- -
- -
-
-
- - -
- - - - - - -
- -

schema.lua

-
---[[
-The MIT License (MIT)
-
-Copyright (c) 2014 Sebastian Schoener
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
-]]
-
-local schema = {}
-
--- Checks an object against a schema.
-function schema.CheckSchema(obj, schem, path)
-    if path == nil then
-        path = schema.Path.new()
-        path:setBase(obj)
-    end
-    if type(schem) == "function" then
-        return schem(obj, path)
-    else -- attempt to simply compare the values
-        if schem == obj then
-            return nil
-        end
-        return schema.Error("Invalid value: "..path.." should be "..tostring(schem), path)
-    end
-end
-
-function schema.FormatOutput(output)
-    local format = schema.List()
-    for k,v in ipairs(output) do
-        format:append(v:format())
-    end
-    return table.concat(format, "\n")
-end
-
---
--- Infrastructure
---
-
--- Path class. Represents paths to values in a table (the path's *base*).
-local Path = {}
-function Path.new(...)
-    local arg = {...}
-    local self = setmetatable({}, Path)
-    self.p = {}
-    for k,v in ipairs(arg) do
-        self.p[k] = v
-    end
-    return self
-end
-
--- Sets the base of the path, i.e. the table to which the path is relative.
--- Note that this is the actual *table*, not the table's name.
-function Path:setBase(base)
-    self.base = base
-end
-
--- Gets the base of the path.
-function Path:getBase()
-    return self.base
-end
-
--- Returns the target of the path or 'nil' if the path is invalid.
-function Path:target()
-    if self.base == nil then
-        error("Path:target() called on a path without a base!")
-    end
-    local current = self.base
-    for k,v in ipairs(self.p) do
-        current = current[v]
-        if current == nil then
-            return nil
-        end
-    end
-    return current
-end
-
--- Pushes an entry to the end of the path.
-function Path:push(obj)
-    self.p[#self.p + 1] = obj
-    return self
-end
-
--- Pops an entry from the end of the path.
-function Path:pop()
-    local tmp = self.p[#self.p]
-    self.p[#self.p] = nil
-    return tmp
-end
-
--- Returns the topmost entry of the end of the path.
-function Path:top()
-    return self.p[#self.p]
-end
-
--- Returns the length of the path.
-function Path:length()
-    return #self.p
-end
-
--- Returns the element at the specified index.
-function Path:get(index)
-    return self.p[index]
-end
-
--- Copies the path.
-function Path:copy()
-    local cp = Path.new()
-    cp.base = self.base
-    for k,v in ipairs(self) do
-        cp.p[k] = v
-    end
-    return cp
-end
-
-Path.__index = Path
-Path.__tostring = function(tbl)
-    if #tbl.p == 0 then
-        return '<val>'
-    end
-    return table.concat(tbl.p,".")
-end
-Path.__concat = function(lhs, rhs)
-    if type(lhs) == "table" then
-        return tostring(lhs)..rhs
-    elseif type(rhs) == "table" then
-        return lhs..tostring(rhs)
-    end
-end
-Path.__len = function(self)
-    return #self.p
-end
-
-setmetatable(Path, {
-    __call = function (cls, ...)
-        return Path.new(...)
-    end
-})
-schema.Path = Path
-
--- List class
-local List = {}
-function List.new(...)
-    local self = setmetatable({}, List)
-    local arg = {...}
-    for k,v in ipairs(arg) do
-        self[k] = v
-    end
-    return self
-end
-
-function List:add(obj)
-    self[#self+1] = obj
-    return self
-end
-
-function List:append(list)
-    for k,v in ipairs(list) do
-        self[#self+k] = v
-    end
-    return self
-end
-
-List.__index = List
-List.__tostring = function(self)
-    local tmp = {}
-    for k,v in ipairs(self) do
-        tmp[k] = tostring(v)
-    end
-    return table.concat(tmp, "\n")
-end
-setmetatable(List, {
-    __call = function(cls, ...)
-        return List.new(...)
-    end
-})
-schema.List = List
-
--- Error class. Describes mismatches that occured during the schema-checking.
-local Error = {}
-function Error.new(msg, path, suberrors)
-    local self = setmetatable({}, Error)
-    self.message   = msg
-    self.path      = path:copy()
-    self.suberrors = suberrors
-    return self
-end
-
--- Returns a list of strings which represent the error (with indenttation for
--- suberrors).
-function Error:format()
-    local output = List.new(self.message)
-    if self.suberrors ~= nil then
-        for k,sub in pairs(self.suberrors) do
-            local subout = sub:format()
-            for k1,msg in pairs(subout) do
-                output = output:add("  "..msg)
-            end
-        end
-    end
-    return output
-end
-
-Error.__tostring = function(self)
-    return table.concat(self:format(), "\n")
-end
-Error.__index = Error
-setmetatable(Error, {
-    __call = function(cls, ...)
-        return List(Error.new(...))
-    end
-})
-schema.Error = Error
-
---
--- Schema Building Blocks
--- A schema is a function taking the object to be checked and the path to the
--- current value in the environment.
--- It returns either 'true' if the schema accepted the object or an Error
--- object which describes why it was rejected.
--- The schemata below are just some basic building blocks. Expand them to your
--- liking.
---
-
--- Always accepts.
-function schema.Any(obj, path)
-    return nil
-end
-
--- Always fails.
-function schema.Nothing(obj, path)
-    return schema.Error("Failure: '"..path.."' will always fail.", path)
-end
-
--- Checks a value against a specific type.
-local function TypeSchema(obj, path, typeId)
-    if type(obj) ~= typeId then
-        return schema.Error("Type mismatch: '"..path.."' should be "..typeId..", is "..type(obj), path)
-    else
-        return nil
-    end
-end
-
-function schema.Boolean (obj, path) return TypeSchema(obj, path, "boolean")  end
-function schema.Function(obj, path) return TypeSchema(obj, path, "function") end
-function schema.Nil     (obj, path) return TypeSchema(obj, path, "nil")      end
-function schema.Number  (obj, path) return TypeSchema(obj, path, "number")   end
-function schema.String  (obj, path) return TypeSchema(obj, path, "string")   end
-function schema.Table   (obj, path) return TypeSchema(obj, path, "table")    end
-function schema.UserData(obj, path) return TypeSchema(obj, path, "userdata") end
-
--- Checks that some value is a string matching a given pattern.
-function schema.Pattern(pattern)
-    local userPattern = pattern
-    if not pattern:match("^^") then
-        pattern = "^" .. pattern
-    end
-    if not pattern:match("$$") then
-        pattern = pattern .. "$"
-    end
-    local function CheckPattern(obj, path)
-        local err = schema.String(obj, path)
-        if err then
-            return err
-        end
-        if string.match(obj, pattern) then
-            return nil
-        else
-            return schema.Error("Invalid value: '"..path.."' must match pattern '"..userPattern.."'", path)
-        end
-    end
-    return CheckPattern
-end
-
--- Checks that some number is an integer.
-function schema.Integer(obj, path)
-    local err = schema.Number(obj, path)
-    if err then
-        return err
-    end
-    if math.floor(obj) == obj then
-        return nil
-    end
-    return schema.Error("Invalid value: '"..path.."' must be an integral number", path)
-end
-
--- Checks that some number is >= 0.
-function schema.NonNegativeNumber(obj, path)
-    local err = schema.Number(obj, path)
-    if err then
-        return err
-    end
-    if obj >= 0 then
-        return nil
-    end
-    return schema.Error("Invalid value: '"..path.."' must be >= 0", path)
-end
-
--- Checks that some number is > 0.
-function schema.PositiveNumber(obj, path)
-    local err = schema.Number(obj, path)
-    if err then
-        return err
-    end
-    if obj > 0 then
-        return nil
-    end
-    return schema.Error("Invalid value: '"..path.."' must be > 0", path)
-end
-
--- Checks that some value is a number from the interval [lower, upper].
-function schema.NumberFrom(lower, upper)
-    local function CheckNumberFrom(obj, path)
-        local err = schema.Number(obj, path)
-        if err then
-            return err
-        end
-        if lower <= obj and upper >= obj then
-            return nil
-        else
-            return schema.Error("Invalid value: '"..path.."' must be between "..lower.." and "..upper, path)
-        end
-    end
-    return CheckNumberFrom
-end
-
--- Takes schemata and accepts their disjunction.
-function schema.OneOf(...)
-    local arg = {...}
-    local function CheckOneOf(obj, path)
-        for k,v in ipairs(arg) do
-            local err = schema.CheckSchema(obj, v, path)
-            if not err then return nil end
-        end
-        return schema.Error("No suitable alternative: No schema matches '"..path.."'", path)
-    end
-    return CheckOneOf
-end
-
--- Takes a schema and returns an optional schema.
-function schema.Optional(s)
-    return schema.OneOf(s, schema.Nil)
-end
-
--- Takes schemata and accepts their conjuction.
-function schema.AllOf(...)
-    local arg = {...}
-    local function CheckAllOf(obj, path)
-        local errmsg = nil
-        for k,v in ipairs(arg) do
-            local err = schema.CheckSchema(obj, v, path)
-            if err then
-                if errmsg == nil then
-                    errmsg = err
-                else
-                    errmsg = errmsg:append(err)
-                end
-            end
-        end
-        return errmsg
-    end
-    return CheckAllOf
-end
-
--- Builds a record type schema, i.e. a table with a fixed set of keys (strings)
--- with corresponding values. Use as in
--- Record({
---  name  = schema,
---  name2 = schema2
---  })
-function schema.Record(recordschema, additionalValues)
-    if additionalValues == nil then
-        additionalValues = false
-    end
-    local function CheckRecord(obj, path)
-        if type(obj) ~= "table" then
-            return schema.Error("Type mismatch: '"..path.."' should be a record (table), is "..type(obj), path)
-        end
-
-        local errmsg = nil
-        local function AddError(msg)
-            if errmsg == nil then
-                errmsg = msg
-            else
-                errmsg = errmsg:append(msg)
-            end
-        end
-
-        for k,v in pairs(recordschema) do
-            path:push(k)
-            local err = schema.CheckSchema(obj[k], v, path)
-            if err then
-                AddError(err)
-            end
-            path:pop()
-        end
-
-        for k, v in pairs(obj) do
-            path:push(k)
-            if type(k) ~= "string" then
-                AddError(schema.Error("Invalid key: '"..path.."' must be of type 'string'", path))
-            end
-            if recordschema[k] == nil and not additionalValues then
-                AddError(schema.Error("Superfluous value: '"..path.."' does not appear in the record schema", path))
-            end
-            path:pop()
-        end
-        return errmsg
-    end
-    return CheckRecord
-end
-
-function schema.MixedTable(t_schema, additional_values)
-    local function CheckMixedTable(obj, path)
-        local obj_t = type(obj)
-        if obj_t ~= "table" then
-            local msg = ("Type mismatch: '%s' should be a table, is %s"):format(path, obj_t)
-            return schema.Error(msg, path)
-        end
-
-        local errmsg = nil
-        local function AddError(msg)
-            if errmsg == nil then
-                errmsg = msg
-            else
-                errmsg = errmsg:append(msg)
-            end
-        end
-
-        local checked_keys = {}
-        for k, v in pairs(t_schema) do
-            path:push(k)
-            local err = schema.CheckSchema(obj[k], v, path)
-            if err then
-                AddError(err)
-            end
-            checked_keys[k] = true
-            path:pop()
-        end
-
-        for k, v in pairs(obj) do
-            if not checked_keys[k] then
-                path:push(k)
-                local k_type = type(k)
-                if k_type ~= "string" and k_type ~= "number" then
-                    local msg = ("Invalid key: '%s' must be of type 'string' or 'number'"):format(k_type)
-                    AddError(schema.Error(msg, path))
-                end
-
-                local t_schema_v = t_schema[k]
-                if t_schema_v then
-                    local err = schema.CheckSchema(v, t_schema_v, path)
-                    if err then
-                        AddError(err)
-                    end
-                else
-                    if not additional_values then
-                        local msg = ("Superfluous value: '%s' does not appear in the table schema")
-                                            :format(path)
-                        AddError(schema.Error(msg, path))
-                    end
-                end
-                path:pop()
-            end
-        end
-        return errmsg
-    end
-    return CheckMixedTable
-end
-
--- Builds a map type schema, i.e. a table with an arbitraty number of
--- entries where both all keys (and all vaules) fit a common schema.
-function schema.Map(keyschema, valschema)
-    local function CheckMap(obj, path)
-        if type(obj) ~= "table" then
-            return schema.Error("Type mismatch: '"..path.."' should be a map (table), is "..type(obj), path)
-        end
-
-        local errmsg = nil
-        local function AddError(msg)
-            if errmsg == nil then
-                errmsg = msg
-            else
-                errmsg = errmsg:append(msg)
-            end
-        end
-
-        -- aggregate error message
-        for k, v in pairs(obj) do
-            path:push(k)
-            local keyErr = schema.CheckSchema(k, keyschema, path)
-            if keyErr then
-                AddError(schema.Error("Invalid map key", path, keyErr))
-            end
-
-            local valErr = schema.CheckSchema(v, valschema, path)
-            if valErr then
-                AddError(valErr)
-            end
-            path:pop()
-        end
-        return errmsg
-    end
-    return CheckMap
-end
-
--- Builds a collection type schema, i.e. a table with an arbitrary number of
--- entries where we only care about the type of the values.
-function schema.Collection(valschema)
-    return schema.Map(schema.Any, valschema)
-end
-
--- Builds a tuple type schema, i.e. a table with a fixed number of entries,
--- each indexed by a number and with a fixed type.
-function schema.Tuple(...)
-    local arg = {...}
-
-    local function CheckTuple(obj, path)
-        if type(obj) ~= "table" then
-            return schema.Error("Type mismatch: '"..path.."' should be a map (tuple), is "..type(obj), path)
-        end
-
-        if #obj ~= #arg then
-            return schema.Error("Invalid length: '"..path.." should have exactly "..#arg.." elements", path)
-        end
-
-        local errmsg = nil
-        local function AddError(msg)
-            if errmsg == nil then
-                errmsg = msg
-            else
-                errmsg = errmsg:append(msg)
-            end
-        end
-
-        local min = 1
-        local max = #arg
-        for k, v in pairs(obj) do
-            path:push(k)
-            local err = schema.Integer(k, path)
-            if not err then
-                err = schema.CheckSchema(v, arg[k], path)
-                if err then
-                    AddError(err)
-                end
-            else
-                AddError(schema.Error("Invalid tuple key", path, err))
-            end
-            path:pop()
-        end
-        return errmsg
-    end
-    return CheckTuple
-end
-
--- Builds a conditional type schema, i.e. a schema that depends on the value of
--- another value. The dependence must be *local*, i.e. defined in the same
--- table. Use as in
---   Case("name", {"Peter", schema1}, {"Mary", schema2}, {OneOf(...), schema3})
--- This will check the field "name" against every schema in the first component
--- and will return the second component of the first match.
-function schema.Case(relativePath, ...)
-    if type(relativePath) ~= "table" then
-        relativePath = schema.Path("..", relativePath)
-    end
-    local cases = {...}
-    for k,v in ipairs(cases) do
-        if type(v) ~= "table" then
-            error("Cases expects inputs of the form {conditionSchema, schema}; argument "..v.." is invalid")
-        end
-    end
-
-    local function CheckCase(obj, path)
-        local condPath = path:copy()
-        for k=0, #relativePath do
-            local s = relativePath:get(k)
-            if s == ".." then
-                condPath:pop()
-            else
-                condPath:push(s)
-            end
-        end
-
-        local errmsg = nil
-        local function AddError(msg)
-            if errmsg == nil then
-                errmsg = msg
-            else
-                errmsg = errmsg:append(msg)
-            end
-        end
-
-        local anyCond = false
-        local condObj = condPath:target()
-        for k,v in ipairs(cases) do
-            local condSchema = v[1]
-            local valSchema = v[2]
-            local condErr = schema.CheckSchema(condObj, condSchema, condPath)
-            if not condErr then
-                anyCond = true
-                local err = schema.CheckSchema(obj, valSchema, path)
-                if err then
-                    AddError(schema.Error("Case failed: Condition "..k.." of '"..path.."' holds but the consequence does not", path, err))
-                end
-            end
-        end
-
-        if not anyCond then
-            AddError(schema.Error("Case failed: No condition on '"..path.."' holds"))
-        end
-
-        return errmsg
-    end
-    return CheckCase
-end
-
-function schema.Test(fn, msg)
-    local function CheckTest(obj, path)
-        local pok, ok = pcall(fn, obj)
-        if pok and ok then
-            return nil
-        else
-            return schema.Error("Invalid value: '"..path..(msg and "': "..msg or ""), path)
-        end
-    end
-    return CheckTest
-end
-
-return schema
- - -
-
-
-generated by LDoc 1.5.0 -Last updated 2023-05-29 18:41:27 -
-
- - diff --git a/src/resources/MDK/doc/source/sortbox.lua.html b/src/resources/MDK/doc/source/sortbox.lua.html deleted file mode 100755 index 960e2ed..0000000 --- a/src/resources/MDK/doc/source/sortbox.lua.html +++ /dev/null @@ -1,613 +0,0 @@ - - - - - Reference - - - - -
- -
- -
-
-
- - -
- - - - - - -
- -

sortbox.lua

-
----An H/VBox alternative which can be set to either vertical or horizontal, and will autosort the windows
--- @classmod SortBox
--- @author Damian Monogue <demonnic@gmail.com>
--- @copyright 2020 Damian Monogue
--- @license MIT, see LICENSE.lua
-local SortBox = Geyser.Container:new({
-  name = "SortBoxClass",
-  autoSort = true,
-  timerSort = true,
-  sortInterval = 500,
-  elastic = false,
-  maxHeight = 0,
-  maxWidth = 0,
-  boxType = "v",
-  sortFunction = "gaugeValue",
-})
-local BIGNUMBER = 999999999
-
---- Sorting functions for spairs, should you wish
--- @table SortFunctions
--- @field gaugeValue sorts Geyser gauges by value, ascending
--- @field reverseGaugeValue sorts Geyser gauges by value, descending
--- @field timeLeft sorts TimerGauges by how much time is left, ascending
--- @field reverseTimeLeft sorts TimerGauges by how much time is left, descending.
--- @field name sorts Geyser objects by name, ascending
--- @field reverseName sorts Geyser objects by name, descending
--- @field message sorts Geyser labels and gauges by their echoed text, ascending
--- @field reverseMessage sorts Geyser labels and gauges by their echoed text, descending
-SortBox.SortFunctions = {
-  gaugeValue = function(t, a, b)
-    local avalue = t[a].value or BIGNUMBER
-    local bvalue = t[b].value or BIGNUMBER
-    return avalue < bvalue
-  end,
-  reverseGaugeValue = function(t, a, b)
-    local avalue = t[a].value or BIGNUMBER
-    local bvalue = t[b].value or BIGNUMBER
-    return avalue > bvalue
-  end,
-  timeLeft = function(t, a, b)
-    a = t[a]
-    b = t[b]
-    local avalue = a.getTime and tonumber(a:getTime("S.mm")) or BIGNUMBER
-    local bvalue = b.getTime and tonumber(b:getTime("S.mm")) or BIGNUMBER
-    return avalue < bvalue
-  end,
-  reverseTimeLeft = function(t, a, b)
-    a = t[a]
-    b = t[b]
-    local avalue = a.getTime and tonumber(a:getTime("S.mm")) or BIGNUMBER
-    local bvalue = b.getTime and tonumber(b:getTime("S.mm")) or BIGNUMBER
-    return avalue > bvalue
-  end,
-  name = function(t, a, b)
-    return t[a].name < t[b].name
-  end,
-  reverseName = function(t, a, b)
-    return t[a].name > t[b].name
-  end,
-  message = function(t, a, b)
-    a = t[a]
-    b = t[b]
-    local avalue = a.text and a.text.message or a.message
-    local bvalue = b.text and b.text.message or b.message
-    avalue = avalue or ""
-    bvalue = bvalue or ""
-    return avalue < bvalue
-  end,
-  reverseMessage = function(t, a, b)
-    a = t[a]
-    b = t[b]
-    local avalue = a.text and a.text.message or a.message
-    local bvalue = b.text and b.text.message or b.message
-    avalue = avalue or ""
-    bvalue = bvalue or ""
-    return avalue > bvalue
-  end,
-}
---- Creates a new SortBox
--- @usage
--- local SortBox = require("MDK.sortbox")
--- mySortBox = SortBox:new({
---   name = "mySortBox",
---   x = 400,
---   y = 100,
---   height = 150,
---   width = 300,
---   sortFunction = "timeLeft"
--- })
--- @tparam table options the options to use for the SortBox. See table below for added options
--- @param[opt] container the container to add the SortBox into
--- <br><br>Table of new options
--- <table class="tg">
--- <thead>
---   <tr>
---     <th>option name</th>
---     <th>description</th>
---     <th>default</th>
---   </tr>
--- </thead>
--- <tbody>
---   <tr>
---     <td class="tg-1">autoSort</td>
---     <td class="tg-1">should the SortBox perform function based sorting? If false, will behave like a normal H/VBox</td>
---     <td class="tg-1">true</td>
---   </tr>
---   <tr>
---     <td class="tg-2">timerSort</td>
---     <td class="tg-2">should the SortBox automatically perform sorting on a timer?</td>
---     <td class="tg-2">true</td>
---   </tr>
---   <tr>
---     <td class="tg-1">sortInterval</td>
---     <td class="tg-1">how frequently should we sort on a timer if timerSort is true, in milliseconds</td>
---     <td class="tg-1">500</td>
---   </tr>
---   <tr>
---     <td class="tg-2">boxType</td>
---     <td class="tg-2">Should we stack like an HBox or VBox? use 'h' for hbox and 'v' for vbox</td>
---     <td class="tg-2">v</td>
---   </tr>
---   <tr>
---     <td class="tg-1">sortFunction</td>
---     <td class="tg-1">how should we sort the items in the SortBox? see setSortFunction for valid options</td>
---     <td class="tg-1">gaugeValue</td>
---   </tr>
---   <tr>
---     <td class="tg-2">elastic</td>
---     <td class="tg-2">Should this container stretch to fit its contents? boxType v stretches in height, h stretches in width.</td>
---     <td class="tg-2">false</td>
---   </tr>
---   <tr>
---     <td class="tg-1">maxHeight</td>
---     <td class="tg-1">If elastic, what's the biggest a 'v' style box should grow in height? Use 0 for unlimited</td>
---     <td class="tg-1">0</td>
---   </tr>
---   <tr>
---     <td class="tg-2">maxWidth</td>
---     <td class="tg-2">If elastic, what's the biggest a 'h' style box should grow in width? Use 0 for unlimited</td>
---     <td class="tg-2">0</td>
---   </tr>
--- </tbody>
--- </table>
-function SortBox:new(options, container)
-  options = options or {}
-  options.type = options.type or "SortBox"
-  local me = self.parent:new(options, container)
-  setmetatable(me, self)
-  self.__index = self
-  if me.timerSort then
-    me:enableTimer()
-  end
-  me:setBoxType(me.boxType)
-  return me
-end
-
---- Iterates a key:value pair table in a sorted fashion
--- @local
--- I first found this on https://stackoverflow.com/questions/15706270/sort-a-table-in-lua
--- modified slightly, as Mudlet already has table.keys to collect keys, and I don't want
--- to sort if no function to sort with is given. In this case, I want it to work like pairs.
-local function spairs(t, order)
-  local keys = table.keys(t)
-  if order then
-    table.sort(keys, function(a, b)
-      return order(t, a, b)
-    end)
-  end
-
-  local i = 0
-  return function()
-    i = i + 1
-    if keys[i] then
-      return keys[i], t[keys[i]]
-    end
-  end
-end
-
-function SortBox:add(window, cons)
-  if self.useAdd2 then
-    Geyser.add2(self, window, cons)
-  else
-    Geyser.add(self, window, cons)
-  end
-  if not self.defer_updates then
-    self:organize()
-  end
-end
-
-function SortBox:remove(window)
-  Geyser.remove(self, window)
-  self:organize()
-end
-
---- Calling this will cause the SortBox to reposition/resize everything
-function SortBox:organize()
-  -- make sure we don't divide by zero later
-  if self:get_width() == 0 then
-    self:resize("0.9px", nil)
-  end
-  if self:get_height() == 0 then
-    self:resize(nil, "0.9px")
-  end
-  -- handle the individual boxType organization
-  if self.boxType == "v" then
-    self:vorganize()
-  else
-    self:horganize()
-  end
-  -- shrink/grow if needed
-  self:handleElastic()
-end
-
---- replicates Geyser.HBox functionality, but with the option of sorting
--- @local
-function SortBox:horganize()
-  local window_width = (self:calculate_dynamic_window_size().width / self:get_width()) * 100
-  local start_x = 0
-  local sortFunction = (self.autoSort and self.sortFunction) and SortBox.SortFunctions[self.sortFunction] or nil
-  if sortFunction then
-    for _, window in spairs(self.windowList, sortFunction) do
-      start_x = start_x + self:handleWindow(window, start_x, window_width)
-    end
-  else
-    for _, window_name in ipairs(self.windows) do
-      local window = self.windowList[window_name]
-      start_x = start_x + self:handleWindow(window, start_x, window_width)
-    end
-  end
-end
-
---- replicates Geyser.VBox functionality, but with the option of sorting
--- @local
-function SortBox:vorganize()
-  local window_height = (self:calculate_dynamic_window_size().height / self:get_height()) * 100
-  local start_y = 0
-  local sortFunction = (self.autoSort and self.sortFunction) and SortBox.SortFunctions[self.sortFunction] or nil
-  if sortFunction then
-    for _, window in spairs(self.windowList, sortFunction) do
-      start_y = start_y + self:handleWindow(window, start_y, window_height)
-    end
-  else
-    for _, window_name in ipairs(self.windows) do
-      local window = self.windowList[window_name]
-      start_y = start_y + self:handleWindow(window, start_y, window_height)
-    end
-  end
-end
-
---- handles a single window during the shuffle process
--- @local
-function SortBox:handleWindow(window, start, window_dimension)
-  local width = (window:get_width() / self:get_width()) * 100
-  local height = (window:get_height() / self:get_height()) * 100
-  if window.h_policy == Geyser.Fixed or window.v_policy == Geyser.Fixed then
-    self.contains_fixed = true
-  end
-  if self.boxType == "v" then
-    window:move("0%", start .. "%")
-    if window.h_policy == Geyser.Dynamic then
-      width = 100
-      if window.width ~= width then
-        window:resize(width .. "%", nil)
-      end
-    end
-    if window.v_policy == Geyser.Dynamic then
-      height = window_dimension * window.v_stretch_factor
-      if window.height ~= height then
-        window:resize(nil, height .. "%")
-      end
-    end
-    return height
-  else
-    window:move(start .. "%", "0%")
-    if window.h_policy == Geyser.Dynamic then
-      width = window_dimension * window.h_stretch_factor
-      if window.width ~= width then
-        window:resize(width .. "%", nil)
-      end
-    end
-    if window.v_policy == Geyser.Dynamic then
-      height = 100
-      if window.height ~= height then
-        window:resize(nil, height .. "%")
-      end
-    end
-    return width
-  end
-end
-
----handles actually resizing the window if elastic
--- @local
-function SortBox:handleElastic()
-  if not self.elastic or table.is_empty(self.windows) then
-    return
-  end
-  if self.boxType == "v" then
-    local contentHeight, canElastic = self:getContentHeight()
-    if not canElastic then
-      debugc(string.format("SortBox named %s cannot properly elasticize, as it contains at least one item with a dynamic v_policy", self.name))
-      return
-    end
-    local currentHeight = self:get_height()
-    local maxHeight = self.maxHeight
-    if maxHeight > 0 and contentHeight > maxHeight then
-      contentHeight = maxHeight
-    end
-    if contentHeight ~= currentHeight then
-      self:resize(nil, contentHeight)
-    end
-  else
-    local contentWidth, canElastic = self:getContentWidth()
-    if not canElastic then
-      debugc(string.format("SortBox named %s cannot properly elasticize, as it contains at least one item with a dynamic h_policy", self.name))
-      return
-    end
-    local currentWidth = self:get_width()
-    local maxWidth = self.maxWidth
-    if maxWidth > 0 and contentWidth > maxWidth then
-      contentWidth = maxWidth
-    end
-    if contentWidth ~= currentWidth then
-      self:resize(contentWidth, nil)
-    end
-  end
-end
-
----prevents gaps from forming during resize if it doesn't autoorganize on a timer.
--- @local
-function SortBox:reposition()
-  Geyser.Container.reposition(self)
-  if self.contains_fixed then
-    self:organize()
-  end
-end
-
---- Returns the sum of the heights of the contents, and whether this SortBox can be elastic in height
--- @local
-function SortBox:getContentHeight()
-  if self.boxType ~= "v" then
-    return self:get_height()
-  end
-  local canElastic = true
-  local contentHeight = 0
-  for _, window in pairs(self.windowList) do
-    contentHeight = contentHeight + window:get_height()
-    if window.v_policy == Geyser.Dynamic then
-      canElastic = false
-    end
-  end
-  return contentHeight, canElastic
-end
-
---- Returns the sum of the widths of the contents, and whether this SortBox can be elastic in width.
--- @local
-function SortBox:getContentWidth()
-  if self.boxType == "v" then
-    return self:get_width()
-  end
-  local canElastic = true
-  local contentWidth = 0
-  for _, window in pairs(self.windowList) do
-    contentWidth = contentWidth + window:get_width()
-    if window.h_policy == Geyser.Dynamic then
-      canElastic = false
-    end
-  end
-  return contentWidth, canElastic
-end
-
---- Enables elasticity for the SortBox.
-function SortBox:enableElastic()
-  self:setElastic(true)
-end
-
---- Disables elasticity for the SortBox
-function SortBox:disableElastic()
-  self:setElastic(false)
-end
-
---- Set elasticity specifically
--- @tparam boolean enabled if true, enable elasticity. If false, disable it.
-function SortBox:setElastic(enabled)
-  self.elastic = enabled and true or false
-end
-
---- Set the max width of the SortBox if it's elastic
--- @tparam number maxWidth The maximum width in pixels to resize the SortBox to. Use 0 for unlimited.
-function SortBox:setMaxWidth(maxWidth)
-  local mwtype = type(maxWidth)
-  assert(mwtype == "number", string.format("SortBox:setMaxWidth(maxWidth): SortBox: %s maxWidth as number expected, got %s", self.name, mwtype))
-  assert(maxWidth >= 0, string.format("SortBox:setMaxWidth(maxWidth): SortBox: %s maxWidth must be >= 0, %d", self.name, maxWidth))
-  self.maxWidth = maxWidth
-end
-
---- Set the max height of the SortBox if it's elastic
--- @tparam number maxHeight The maximum height in pixels to resize the SortBox to. Use 0 for unlimited.
-function SortBox:setMaxHeight(maxHeight)
-  local mhtype = type(maxHeight)
-  assert(mhtype == "number", string.format("SortBox:setMaxHeight(maxHeight): SortBox: %s maxHeight as number expected, got %s", self.name, mhtype))
-  assert(maxHeight >= 0, string.format("SortBox:setMaxHeight(maxHeight): SortBox: %s maxHeight must be >= 0, %d", self.name, maxHeight))
-  self.maxHeight = maxHeight
-end
-
---- Starts the SortBox sorting and organizing itself on a timer
-function SortBox:enableTimer()
-  if self.timerID then
-    self:disableTimer()
-  end
-  self.timerSort = true
-  self.timerID = tempTimer(self.sortInterval / 1000, function()
-    self:organize()
-  end, true)
-end
-
---- Stops the SortBox from sorting and organizing itself on a timer
-function SortBox:disableTimer()
-  killTimer(self.timerID)
-  self.timerID = nil
-  self.timerSort = false
-end
-
---- Sets the sortInterval, or amount of time in milliseconds between auto sorting on a timer if timerSort is true
--- @tparam number sortInterval time in milliseconds between auto sorting if timerSort is true
-function SortBox:setSortInterval(sortInterval)
-  local sitype = type(sortInterval)
-  assert(sitype == "number", string.format("SortBox:setSortInterval(sortInterval): sortInterval as number expected, got %s", sitype))
-  assert(sortInterval > 0, string.format("SortBox:setSortInterval(sortInterval): sortInterval must be positive"))
-  self.sortInterval = sortInterval
-  if self.timerSort then
-    self:enableTimer()
-  end
-end
-
---- Enables sorting when items are added/removed, or if timerSort is true, every sortInterval milliseconds
-function SortBox:enableSort()
-  self.autoSort = true
-  self:organize()
-end
-
---- Disables sorting when items are added or removed
-function SortBox:disableSort()
-  self.autoSort = false
-end
-
----Set whether the SortBox acts as a VBox or HBox.
--- @tparam string boxType If you pass 'h' or 'horizontal' it will act like an HBox. Anything else it will act like a VBox.
--- @usage mySortBox:setBoxType("v") -- behave like a VBox
--- mySortBox:setBoxType("h") -- behave like an HBox
--- mySortBox:setBoxType("beeblebrox") -- why?! Why would you do this? It'll behave like a VBox
-function SortBox:setBoxType(boxType)
-  boxType = boxType:lower()
-  if boxType == "h" or boxType == "horizontal" then
-    self.boxType = "h"
-  else
-    self.boxType = "v"
-  end
-end
-
----Sets the type of sorting in use by this SortBox.
--- <br>If an item in the box does not have the appropriate property or function, then 999999999 is used for sorting except as otherwise noted.
--- <br>If an invalid option is given, then existing H/VBox behaviour is maintained, just like if autoSort is false.
--- @usage mySortBox:setSortFunction("gaugeValue")
--- @tparam string functionName what type of sorting should we use? See table below for valid options and their descriptions.
--- <table class="tg">
--- <thead>
---   <tr>
---     <th>sort type</th>
---     <th>description</th>
---   </tr>
--- </thead>
--- <tbody>
---   <tr>
---     <td class="tg-1">gaugeValue</td>
---     <td class="tg-1">sort gauges based on how full the gauge is, from less full to more</td>
---   </tr>
---   <tr>
---     <td class="tg-2">reverseGaugeValue</td>
---     <td class="tg-2">sort gauges based on how full the gauge is, from more full to less</td>
---   </tr>
---   <tr>
---     <td class="tg-1">timeLeft</td>
---     <td class="tg-1">sort TimerGauges based on the total time left in the gauge, from less time to more</td>
---   </tr>
---   <tr>
---     <td class="tg-2">reverseTimeLeft</td>
---     <td class="tg-2">sort TimerGauges based on the total time left in the gauge, from more time to less</td>
---   </tr>
---   <tr>
---     <td class="tg-1">name</td>
---     <td class="tg-1">sort any item (and mixed types) by name, alphabetically.</td>
---   </tr>
---   <tr>
---     <td class="tg-2">reverseName</td>
---     <td class="tg-2">sort any item (and mixed types) by name, reverse alphabetically.</td>
---   </tr>
---   <tr>
---     <td class="tg-1">message</td>
---     <td class="tg-1">sorts Labels based on their echoed message, alphabetically. If not a label, the empty string will be used</td>
---   </tr>
---   <tr>
---     <td class="tg-2">reverseMessage</td>
---     <td class="tg-2">sorts Labels based on their echoed message, reverse alphabetically. If not a label, the empty string will be used</td>
---   </tr>
--- </tbody>
--- </table>
-
-function SortBox:setSortFunction(functionName)
-  self.sortFunction = functionName
-end
-
-SortBox.parent = Geyser.Container
-
-return SortBox
- - -
-
-
-generated by LDoc 1.5.0 -Last updated 2023-05-29 18:41:27 -
-
- - diff --git a/src/resources/MDK/doc/source/spinbox.lua.html b/src/resources/MDK/doc/source/spinbox.lua.html deleted file mode 100755 index e25fc5c..0000000 --- a/src/resources/MDK/doc/source/spinbox.lua.html +++ /dev/null @@ -1,580 +0,0 @@ - - - - - Reference - - - - -
- -
- -
-
-
- - -
- - - - - - -
- -

spinbox.lua

-
---- A Geyser object to create a spinbox for adjusting a number
--- @classmod spinbox
--- @author Damian Monogue <demonnic@gmail.com>
--- @copyright 2023
--- @license MIT, see https://raw.githubusercontent.com/demonnic/MDK/main/src/scripts/LICENSE.lua
-local spinbox = {
-  parent = Geyser.Container,
-  name = 'SpinboxClass',
-  min = 0,
-  max = 10,
-  delta = 1,
-  value = 0,
-  activeButtonColor = "gray",
-  inactiveButtonColor = "DimGray",
-  integer = true,
-  upArrowLocation = "https://demonnic.github.io/image-assets/uparrow.png",
-  downArrowLocation = "https://demonnic.github.io/image-assets/downarrow.png",
-  color = "#202020"
-}
-spinbox.__index = spinbox
-setmetatable(spinbox, spinbox.parent)
-
-local gss = Geyser.StyleSheet
-local directory = getMudletHomeDir() .. "/spinbox/"
-local saveFile = directory .. "fileLocations.lua"
-if not io.exists(directory) then
-  lfs.mkdir(directory)
-end
-
---- Creates a new spinbox.
--- @tparam table cons a table containing the options for this spinbox.
--- <table class="tg">
--- <thead>
---   <tr>
---     <th>option name</th>
---     <th>description</th>
---     <th>default</th>
---   </tr>
--- </thead>
--- <tbody>
---   <tr>
---     <td class="tg-1">min</td>
---     <td class="tg-1">The minimum value for this spinbox</td>
---     <td class="tg-1">0</td>
---   </tr>
---   <tr>
---     <td class="tg-2">max</td>
---     <td class="tg-2">The maximum value for this spinbox</td>
---     <td class="tg-2">10</td>
---   </tr>
---   <tr>
---     <td class="tg-1">activeButtonColor</td>
---     <td class="tg-1">The color the up/down buttons should be when they are active/able to be used</td>
---     <td class="tg-1">gray</td>
---   </tr>
---   <tr>
---     <td class="tg-2">inactiveButtonColor</td>
---     <td class="tg-2">The color the up/down buttons should be when they are inactive/unable to be used</td>
---     <td class="tg-2">dimgray</td>
---   </tr>
---   <tr>
---     <td class="tg-1">integer</td>
---     <td class="tg-1">Boolean value. When true, values must always be integers (no decimal place)</td>
---     <td class="tg-1">true</td>
---   </tr>
---   <tr>
---     <td class="tg-2">delta</td>
---     <td class="tg-2">The amount to change the spinbox's value when the up or down button is pressed.</td>
---     <td class="tg-2">1</td>
---   </tr>
---   <tr>
---     <td class="tg-1">upArrowLocation</td>
---     <td class="tg-1">The location of the up arrow image. Either a web URL where it can be downloaded, or the location on disk to read it from</td>
---     <td class="tg-1">https://demonnic.github.io/image-assets/uparrow.png</td>
---   </tr>
---   <tr>
---     <td class="tg-2">downArrowLocation</td>
---     <td class="tg-2">The location of the down arrow image. Either a web URL where it can be downloaded, or the location on disk to read it from</td>
---     <td class="tg-2">https://demonnic.github.io/image-assets/downarrow.png</td>
---   <tr>
---     <td class="tg-1">callBack</td>
---     <td class="tg-1">The function to run when the spinbox's value is updated. Is called with parameters (self.name, value, oldValue)</td>
---     <td class="tg-1">nil</td>
---   </tr>
---   </tr>
---</tbody>
---</table>
--- @param container The Geyser container for this spinbox
-function spinbox:new(cons, container)
-  cons = cons or {}
-  local consType = type(cons)
-  if consType ~= "table" then
-    printError(f"spinbox:new(cons, container): cons as table of options expected, got {consType}!", true, true)
-  end
-  cons.name = cons.name or Geyser.nameGen("spinbox")
-  local me = self.parent:new(cons, container)
-  setmetatable(me, self)
-  me:createComponents()
-  if me.callBack then
-    me:setCallBack(me.callBack)
-  end
-  me.oldValue = me.value
-  return me
-end
-
---- Creates the components that make up the spinbox UI.
--- @local
--- Obtains the up and down arrow images specified in the spinbox options.
--- Generates styles for the spinbox.
--- Calculates the height of the up/down buttons and any remainder space.
--- Creates:
---   `self.upButton` - A button with an up arrow image for incrementing the value
---   `self.downButton` - A button with a down arrow image for decrementing the value
---   `self.displayLabel` - A label to display the current spinbox value
---   `self.input` - A command line input to allow directly entering a value
--- Hides the input by default.
--- Applies the generated styles.
-function spinbox:createComponents()
-  self:obtainImages()
-  self:generateStyles()
-  self:calculateButtonDimensions()
-
-  self.upButton = self:createButton("up")
-  self.downButton = self:createButton("down")
-
-  self.displayLabel = self:createDisplayLabel()
-
-  self.input = self:createInput()
-  self.input:hide()
-
-  self:applyStyles()
-end
-
---- Calculates the button height. We use square buttons in this house.
--- @local
--- Calculates the height of the up/down buttons by dividing the spinbox height in half.
--- Stores the remainder (if any) in self.remainder.
--- Stores the calculated button height in self.buttonHeight.
-function spinbox:calculateButtonDimensions()
-  self.buttonHeight = math.floor(self.get_height() / 2)
-  self.remainder = self.get_height() % 2
-end
-
---- Creates a button (up or down arrow) for the spinbox.
--- @param type Either "up" or "down" to specify which direction the arrow should point
--- @return The created Geyser.Label button
--- @local
--- Creates a Geyser.Label button with an up or down arrow image.
--- Positions the button at the top or bottom of the spinbox respectively.
--- Sets a click callback on the button to call increment() or decrement() depending on the type.
--- Returns the created button.
-function spinbox:createButton(type)
-  local button = Geyser.Label:new({
-    name = self.name .. "spinbox_"..type.."Arrow",
-    height = self.buttonHeight,
-    width = self.buttonHeight,
-    x = "100%-" .. self.buttonHeight,
-    y = type == "up" and 0 or self.buttonHeight + self.remainder,
-  }, self)
-
-  button:setClickCallback(function()
-    if type == "up" then
-      self:increment()
-    else
-      self:decrement()
-    end
-  end)
-  return button
-end
-
---- Creates the display label for the spinbox value.
--- @return The created Geyser.Label display label
--- @local
--- Creates a Geyser.Label to display the current spinbox value.
--- Centers the text in the label.
--- Sets a double click callback on the label to show the input, put the current
--- value in it, select the text, and hide the label.
--- Returns the created display label.
-function spinbox:createDisplayLabel()
-  local displayLabel = Geyser.Label:new({
-    name = self.name .. "spinbox_displayLabel",
-    x = 0,
-    y = 0,
-    width = "100%-" .. self.buttonHeight,
-    height = "100%",
-    message = self.value
-  }, self)
-  displayLabel:setAlignment("center")
-  displayLabel:setDoubleClickCallback(function()
-    self.input:show()
-    self.input:print(self.value)
-    self.input:selectText()
-    displayLabel:hide()
-  end)
-  return displayLabel
-end
-
---- Creates the input for directly entering a spinbox value.
--- @return The created Geyser.CommandLine input
--- @local
--- Creates a Geyser.CommandLine input.
--- Sets an action on the input to:
---   - Attempt to convert the input text to a number
---   - If successful, call setValue() with the number to set the spinbox value
---   - Hide the input
---   - Show the display label
---   - Put the new spinbox value in the input
--- Returns the created input.
-function spinbox:createInput()
-  local input = Geyser.CommandLine:new({
-    x = 0,
-    y = 0,
-    width = "100%-".. self.buttonHeight,
-    height = "100%",
-  }, self)
-  input:setAction(function(txt)
-    txt = tonumber(txt)
-    if txt then
-      self:setValue(txt)
-      input:hide()
-    end
-    self.displayLabel:show()
-    input:print(self.value)
-  end)
-  return input
-end
-
---- Used to increment the value by the delta amount
--- @local
--- Increments the spinbox value by the delta amount.
--- Checks if the new value would exceed the max, and if so sets it to the max.
--- Updates the display label with the new value.
--- Applies any styles that depend on the value.
-function spinbox:increment()
-  local val = self.value + self.delta
-  if val >= self.max then
-    val = self.max
-  end
-  self.oldValue = self.value
-  self.value = val
-  self.displayLabel:echo(val)
-  self:applyStyles()
-  self:handleCallBacks()
-end
-
---- Used to decrement the value by the delta amount
--- @local
--- Decrements the spinbox value by the delta amount.
--- Checks if the new value would be below the min, and if so sets it to the min.
--- Updates the display label with the new value.
--- Applies any styles that depend on the value.
-function spinbox:decrement()
-  local val = self.value - self.delta
-  if val <= self.min then
-    val = self.min
-  end
-  self.oldValue = self.value
-  self.value = val
-  self.displayLabel:echo(val)
-  self:applyStyles()
-  self:handleCallBacks()
-end
-
---- Used to directly set the value of the spinbox.
--- @param value The new value to set
--- Rounds the value to an integer if the spinbox is integer only.
--- Checks if the new value is within the min/max range and clamps it if not.
--- Updates the display label with the new value.
--- Applies any styles that depend on the value.
-function spinbox:setValue(value)
-  if self.integer then
-    value = math.floor(value)
-  end
-  if value >= self.max then
-    value = self.max
-  elseif value <= self.min then
-    value = self.min
-  end
-  self.oldValue = self.value
-  self.value = value
-  self.displayLabel:echo(value)
-  self:applyStyles()
-  self:handleCallBacks()
-end
-
---- Obtains the up and down arrow images for the spinbox.
--- @local
--- Gets the previously saved file locations.
--- Checks if the up arrow image exists at the upArrowLocation.
--- If not, it will download the image from a URL or copy a local file. It saves
--- the new location.
--- Does the same for the down arrow image and downArrowLocation.
--- Saves any new locations to the save file.
--- Sets self.upArrowFile and self.downArrowFile to the locations of the images.
-function spinbox:obtainImages()
-  local locations = self:getFileLocs()
-  local upURL = self.upArrowLocation
-  local downURL = self.downArrowLocation
-  local upFile = locations[upURL]
-  local downFile = locations[downURL]
-  local locationsChanged = false
-  if not (upFile and io.exists(upFile)) then
-    if not upFile then
-      upFile = directory .. self.name .. "/uparrow.png"
-      locations[upURL] = upFile
-      locationsChanged = true
-    end
-    if upURL:match("^http") then
-      self:downloadFile(upURL, upFile)
-    elseif io.exists(upURL) then
-      upFile = upURL
-      locations[upURL] = upFile
-      locationsChanged = true
-    end
-  end
-  if not (downFile and io.exists(downFile)) then
-    if not downFile then
-      downFile = directory .. self.name .. "/downarrow.png"
-      locations[downURL] = downFile
-      locationsChanged = true
-    end
-    if downURL:match("^http") then
-      self:downloadFile(downURL, downFile)
-    elseif io.exists(downURL) then
-      downFile = downURL
-      locations[downURL] = downFile
-      locationsChanged = true
-    end
-  end
-  self.upArrowFile = upFile
-  self.downArrowFile = downFile
-  if locationsChanged then
-    table.save(saveFile, locations)
-  end
-end
-
---- Handles the actual download of a file from a url
--- @param url The url to download the file from
--- @param fileName The location to save the downloaded file
--- @local
--- Creates any missing directories in the file path.
--- Registers named event handlers to handle the download completing or erroring.
--- The completion handler stops the error handler.
--- The error handler prints an error message and stops the completion handler.
--- Downloads the file from the url to the fileName location.
-function spinbox:downloadFile(url, fileName)
-  local parts = fileName:split("/")
-  parts[#parts] = nil
-  local dirName = table.concat(parts, "/") .. "/"
-  if not io.exists(dirName) then
-    lfs.mkdir(dirName)
-  end
-  local uname = "spinbox"
-  local handlerName = self.name .. url
-  local handler = function(event, ...)
-    local args = {...}
-    local file = #args == 1 and args[1] or args[2]
-    if file ~= fileName then
-      return true
-    end
-    if event == "sysDownloadDone" then
-      debugc(f"INFO:Spinbox successfully downloaded {file}")
-      stopNamedEventHandler(uname, handlerName .. "error")
-      return false
-    end
-    cecho(f"\n<red>ERROR:<reset>Spinbox had an issue downloading an image file to {file}: {args[1]}\n")
-    stopNamedEventHandler(uname, handlerName .. "done")
-  end
-  registerNamedEventHandler(uname, handlerName .. "done", "sysDownloadDone", handler, true)
-  registerNamedEventHandler(uname, handlerName .. "error", "sysDownloadError", handler, true)
-  downloadFile(fileName, url)
-end
-
---- Responsible for reading the file locations from disk and returning them
--- @local
-function spinbox:getFileLocs()
-  local locations = {}
-  if io.exists(saveFile) then
-    table.load(saveFile, locations)
-  end
-  return locations
-end
-
---- (Re)generates the stylesheets for the spinbox
--- Should not need to call but if you change something and it doesn't take effect
--- you can try calling this followed by applyStyles
-function spinbox:generateStyles()
-  self.baseStyle = gss:new([[
-    border-radius: 2px;
-    border-color: black;
-  ]])
-  self.activeStyle = gss:new(f[[
-    background-color: {self.activeButtonColor};
-  ]], self.baseStyle)
-  self.inactiveStyle = gss:new(f[[
-    background-color: {self.inactiveButtonColor};
-  ]], self.baseStyle)
-  self.upStyle = gss:new(f[[
-    border-image: url("{self.upArrowFile}");
-  ]])
-  self.downStyle = gss:new(f[[
-    border-image: url("{self.downArrowFile}");
-  ]])
-  self.displayStyle = gss:new(f[[
-    background-color: {Geyser.Color.hex(self.color)};
-    text-align: center;
-  ]], self.baseStyle)
-end
-
---- Applies updated stylesheets to the components of the spinbox
--- Should not need to call this directly
-function spinbox:applyStyles()
-  if self.value >= self.max then
-    self.upStyle:setParent(self.inactiveStyle)
-  else
-    self.upStyle:setParent(self.activeStyle)
-  end
-  if self.value <= self.min then
-    self.downStyle:setParent(self.inactiveStyle)
-  else
-    self.downStyle:setParent(self.activeStyle)
-  end
-  self.upButton:setStyleSheet(self.upStyle:getCSS())
-  self.downButton:setStyleSheet(self.downStyle:getCSS())
-  self.displayLabel:setStyleSheet(self.displayStyle:getCSS())
-end
-
---- sets the color for active buttons on the spinbox
--- @param color any valid color formatting string, such a "red" or "#880000" or "<128,0,0>" or a table of colors, like {128, 0,0}. See Geyser.Color.parse at https://www.mudlet.org/geyser/files/geyser/GeyserColor.html#Geyser.Color.parse
-function spinbox:setActiveButtonColor(color)
-  local colorType = type(color)
-  local hex
-  if colorType == "table" then
-    hex = Geyser.Color.hex(unpack(color))
-  else
-    hex = Geyser.Color.hex(color)
-  end
-  self.activeButtonColor = hex
-  self.activeStyle:set("background-color", hex)
-  self:applyStyles()
-end
-
---- sets the color for inactive buttons on the spinbox
--- @param color any valid color formatting string, such a "<red>" or "red" or "<128,0,0>" or a table of colors, like {128, 0,0}. See Geyser.Color.parse at https://www.mudlet.org/geyser/files/geyser/GeyserColor.html#Geyser.Color.parse
-function spinbox:setInactiveButtonColor(color)
-  local colorType = type(color)
-  local hex
-  if colorType == "table" then
-    hex = Geyser.Color.hex(unpack(color))
-  else
-    hex = Geyser.Color.hex(color)
-  end
-  self.inactiveButtonColor = hex
-  self.inactiveStyle:set("background-color", hex)
-  self:applyStyles()
-end
-
--- internal function that handles calling a registered callback and raising an event any time the
--- spinbox value is changed, whether using the buttons or the :set function.
-function spinbox:handleCallBacks()
-  raiseEvent("spinbox updated", self.name, self.value, self.oldValue)
-  if self.callBack then
-    local ok, err = pcall(self.callBack, self.name, self.value, self.oldValue)
-    if not ok then
-      printError(f"Had an issue running the callback handler for spinbox named {self.name}: {err}", true, true)
-    end
-  end
-end
-
---- Set a callback function for the spinbox to call any time the value of the spinbox is changed
--- the function will be called as func(self.value, self.name)
-function spinbox:setCallBack(func)
-  local funcType = type(func)
-  if funcType ~= "function" then
-    printError(f"spinbox:setCallBack(func): func as function required, got {funcType}", true, true)
-  end
-  self.callBack = func
-  return true
-end
-
-return spinbox
- - -
-
-
-generated by LDoc 1.5.0 -Last updated 2023-05-29 18:41:27 -
-
- - diff --git a/src/resources/MDK/doc/source/sug.lua.html b/src/resources/MDK/doc/source/sug.lua.html deleted file mode 100755 index 50b2f9a..0000000 --- a/src/resources/MDK/doc/source/sug.lua.html +++ /dev/null @@ -1,354 +0,0 @@ - - - - - Reference - - - - -
- -
- -
-
-
- - -
- - - - - - -
- -

sug.lua

-
---- Self Updating Gauge, extends <a href="https://www.mudlet.org/geyser/files/geyser/GeyserGauge.html">Geyser.Gauge</a>
--- @classmod SUG
--- @author Damian Monogue <demonnic@gmail.com>
--- @copyright 2020 Damian Monogue
--- @license MIT, see LICENSE.lua
-local SUG = {
-  name = "SelfUpdatingGaugeClass",
-  active = true,
-  updateTime = 333,
-  currentVariable = "",
-  maxVariable = "",
-  defaultCurrent = 50,
-  defaultMax = 100,
-  textTemplate = " |c/|m |p%",
-  strict = true,
-}
-
--- Internal function, used to turn a string variable name into a value
-local function getValueAt(accessString)
-  local ok, err = pcall(loadstring("return " .. tostring(accessString)))
-  if ok then return err end
-  return nil, err
-end
-
--- ========== End section copied from demontools.lua
-
---- Creates a new Self Updating Gauge.
--- @tparam table cons table of options which control the Gauge's behaviour. In addition to all valid contraints for Geyser.Gauge, SUG adds:
--- <br>
--- <table class="tg">
--- <tr>
---  <th>name</th>
---  <th>description</th>
---  <th>default</th>
--- </tr>
--- <tr>
---  <td class="tg-1">active</td>
---  <td class="tg-1">boolean, if true starts the timer updating</td>
---  <td class="tg-1">true</td>
--- </tr>
--- <tr>
---  <td class="tg-2">updateTime</td>
---  <td class="tg-2">How often should the gauge autoupdate? Milliseconds. 0 to disable the timer but still allow event updates</td>
---  <td class="tg-2">333</td>
--- </tr>
--- <tr>
---  <td class="tg-1">currentVariable</td>
---  <td class="tg-1">What variable will hold the 'current' value of the gauge? Pass the name as a string, IE "currentHP" or "gmcp.Char.Vitals.hp"</td>
---  <td class="tg-1">""</td>
--- </tr>
--- <tr>
---  <td class="tg-2">maxVariable</td>
---  <td class="tg-2">What variable will hold the 'current' value of the gauge? Pass the name as a string, IE "maxHP" or "gmcp.Char.Vitals.maxhp"</td>
---  <td class="tg-2">""</td>
--- </tr>
--- <tr>
---  <td class="tg-1">textTemplate</td>
---  <td class="tg-1">Template to use for the text on the gauge. "|c" replaced with current value, "|m" replaced with max value, "|p" replaced with the % full the gauge should be</td>
---  <td class="tg-1">" |c/|m |p%"</td>
--- </tr>
--- <tr>
---  <td class="tg-2">defaultCurrent</td>
---  <td class="tg-2">What value to use if the currentVariable points to nil or something which cannot be made a number?</td>
---  <td class="tg-2">50</td>
--- </tr>
--- <tr>
---  <td class="tg-1">defaultMax</td>
---  <td class="tg-1">What value to use if the maxVariable points to nil or something which cannot be made a number?</td>
---  <td class="tg-1">100</td>
--- </tr>
--- <tr>
---  <td class="tg-2">updateEvent</td>
---  <td class="tg-2">The name of an event to listen for to perform an update. Can be run alongside or instead of the timer updates. Empty string to turn off</td>
---  <td class="tg-2">""</td>
--- </tr>
--- <tr>
---  <td class="tg-1">updateHook</td>
---  <td class="tg-1">A function which is run each time the gauge updates. Should take 3 arguments, the gauge itself, current value, and max value. You can return new current and max values to be used, for example `return 34, 120` would cause the gauge to use 34 for current and 120 for max regardless of what the variables it reads say.</td>
---  <td class="tg-1"></td>
--- </tr>
--- </table>
--- @param container The Geyser container for this gauge
--- @usage
--- local SUG = require("MDK.sug") --the following will watch "gmcp.Char.Vitals.hp" and "gmcp.Char.Vitals.maxhp" and update itself every 333 milliseconds
--- myGauge = SUG:new({
---   name = "myGauge",
---   currentVariable = "gmcp.Char.Vitals.hp", --if this is nil, it will use the defaultCurrent of 50
---   maxVariable = "gmcp.Char.Vitals.maxhp",  --if this is nil, it will use the defaultMax of 100.
---   height = 50,
--- })
-function SUG:new(cons, container)
-  local funcName = "SUG:new(cons, container)"
-  cons = cons or {}
-  local consType = type(cons)
-  assert(consType == "table", string.format("%s: cons as table expected, got %s", funcName, consType))
-  local me = SUG.parent:new(cons, container)
-  setmetatable(me, self)
-  self.__index = self
-  -- apply any styling requested
-  if me.cssFront then
-    if not me.cssBack then
-      me.cssBack = me.cssFront .. "background-color: black;"
-    end
-    me:setStyleSheet(me.cssFront, me.cssBack, me.cssText)
-  end
-  if me.active then
-    me:start()
-  end
-  me:update()
-  return me
-end
-
---- Set how often to update the gauge on a timer
--- @tparam number time time in milliseconds. 0 to disable the timer
-function SUG:setUpdateTime(time)
-  if type(time) ~= "number" then
-    debugc("SUG:setUpdateTime(time) time as number expected, got " .. type(time))
-    return
-  end
-  self.updateTime = time
-  if self.active then self:start() end
-end
-
---- Set the event to listen for to update the gauge
--- @tparam string event the name of the event to listen for, use "" to disable events without stopping any existing timers
-function SUG:setUpdateEvent(event)
-  if type(event) ~= string then
-    debugc("SUG:setUpdateEvent(event) event name as string expected, got " .. type(event))
-    return
-  end
-  self.updateEvent = event
-  if self.active then self:start() end
-end
-
---- Set the name of the variable the Self Updating Gauge watches for the 'current' value of the gauge
--- @tparam string variableName The name of the variable to get the current value for the gauge. For instance "currentHP", "gmcp.Char.Vitals.hp" etc
-function SUG:setCurrentVariable(variableName)
-  local nameType = type(variableName)
-  local funcName = "SUG:setCurrentVariable(variableName)"
-  assert(nameType == "string", string.format("%s: variableName as string expected, got: %s", funcName, nameType))
-  local val = getValueAt(variableName)
-  local valType = type(tonumber(val))
-  assert(valType == "number",
-         string.format("%s: variableName must point to a variable which is a number or coercable into one. %s points to a %s", funcName, variableName,
-                       type(val)))
-  self.currentVariable = variableName
-  self:update()
-end
-
---- Set the name of the variable the Self Updating Gauge watches for the 'max' value of the gauge
--- @tparam string variableName The name of the variable to get the max value for the gauge. For instance "maxHP", "gmcp.Char.Vitals.maxhp" etc. Set to "" to only check the current value
-function SUG:setMaxVariable(variableName)
-  if variableName == "" then
-    self.maxVariable = variableName
-    self:update()
-    return
-  end
-  local nameType = type(variableName)
-  local funcName = "SUG:setMaxVariable(variableName)"
-  assert(nameType == "string", string.format("%s: variableName as string expected, got: %s", funcName, nameType))
-  local val = getValueAt(variableName)
-  local valType = type(tonumber(val))
-  assert(valType == "number",
-         string.format("%s: variableName must point to a variable which is a number or coercable into one. %s points to a %s", funcName, variableName,
-                       type(val)))
-  self.maxVariable = variableName
-  self:update()
-end
-
---- Set the template for the Self Updating Gauge to set the text with. "|c" is replaced by the current value, "|m" is replaced by the max value, and "|p" is replaced by the percentage current/max
--- @tparam string template The template to use for the text on the gauge. If the max value is 200 and current is 68, then |c will be replace by 68, |m replaced by 200, and |p replaced by 34.
-function SUG:setTextTemplate(template)
-  local templateType = type(template)
-  local funcName = "SUG:setTextTemplate(template)"
-  assert(templateType == "string", string.format("%s: template as string expected, got %s", funcName, templateType))
-  self.textTemplate = template
-  self:update()
-end
-
---- Set the updateHook function which is run just prior to the gauge updating
--- @tparam function func The function which will be called when the gauge updates. It should take 3 arguments, the gauge itself, the current value, and the max value. If you wish to override the current or max values used for the gauge, you can return new current and max values, like `return newCurrent newMax`
-function SUG:setUpdateHook(func)
-  local funcType = type(func)
-  if funcType ~= "function" then
-    return nil, "setUpdateHook only takes functions, no strings or anything like that. You passed in: " .. funcType
-  end
-  self.updateHook = func
-end
-
---- Stops the Self Updating Gauge from updating
-function SUG:stop()
-  self.active = false
-  if self.timer then
-    killTimer(self.timer)
-    self.timer = nil
-  end
-  if self.eventHandler then
-    killAnonymousEventHandler(self.eventHandler)
-    self.eventHandler = nil
-  end
-end
-
---- Starts the Self Updating Gauge updating. If it is already updating, it will restart it.
-function SUG:start()
-  self:stop()
-  self.active = true
-  local update = function() self:update() end
-  if self.updateTime > 0 then
-    self.timer = tempTimer(self.updateTime / 1000, update, true)
-  end
-  local updateEvent = self.updateEvent
-  if updateEvent and updateEvent ~= "" and updateEvent ~= "*" then
-    self.eventHandler = registerAnonymousEventHandler(self.updateEvent, update)
-  end
-end
-
---- Reads the values from currentVariable and maxVariable, and updates the gauge's value and text.
-function SUG:update()
-  local current = getValueAt(self.currentVariable)
-  local max = getValueAt(self.maxVariable)
-  current = tonumber(current)
-  max = tonumber(max)
-  if current == nil then
-    current = self.defaultCurrent
-    debugc(string.format(
-             "Self Updating Gauge named %s is trying to update with an invalid current value. Using the defaultCurrent instead. currentVariable: '%s' maxVariable: '%s'",
-             self.name, self.currentVariable, self.maxVariable))
-  end
-  if max == nil then
-    max = self.defaultMax
-    if self.maxVariable ~= "" then
-      debugc(string.format(
-               "Self Updating Gauge named %s is trying to update with an invalid max value. Using the defaultCurrent instead. currentVariable: '%s' maxVariable: '%s'",
-               self.name, self.currentVariable, self.maxVariable))
-    end
-  end
-  if self.updateHook and type(self.updateHook) == "function" then
-    local ok, newcur, newmax = pcall(self.updateHook, self, current, max)
-    if ok and newcur then
-      current = newcur
-      max = newmax and newmax or self.defaultMax
-    end
-  end
-  local text = self.textTemplate
-  local percent = math.floor((current / max * 100) + 0.5)
-  text = text:gsub("|c", current)
-  text = text:gsub("|m", max)
-  text = text:gsub("|p", percent)
-  self:setValue(current, max, text)
-end
-
-SUG.parent = Geyser.Gauge
-setmetatable(SUG, Geyser.Gauge)
-
-return SUG
- - -
-
-
-generated by LDoc 1.5.0 -Last updated 2023-05-29 18:41:27 -
-
- - diff --git a/src/resources/MDK/doc/source/textgauge.lua.html b/src/resources/MDK/doc/source/textgauge.lua.html deleted file mode 100755 index b921c98..0000000 --- a/src/resources/MDK/doc/source/textgauge.lua.html +++ /dev/null @@ -1,434 +0,0 @@ - - - - - Reference - - - - -
- -
- -
-
-
- - -
- - - - - - -
- -

textgauge.lua

-
---- Creates a text based gauge, for use in miniconsoles and the like.
--- @classmod TextGauge
--- @author Damian Monogue <demonnic@gmail.com>
--- @copyright 2020 Damian Monogue
--- @copyright 2021 Damian Monogue
--- @license MIT, see LICENSE.lua
-local TextGauge = {width = 24, fillCharacter = ":", emptyCharacter = "-", showPercent = true, showPercentSymbol = true, format = "c", value = 50}
-
---- Creates a new TextGauge.
--- @tparam[opt] table options The table of options you would like the TextGauge to start with.
--- <br><br>Table of new options
--- <table class="tg">
--- <thead>
---   <tr>
---     <th>option name</th>
---     <th>description</th>
---     <th>default</th>
---   </tr>
--- </thead>
--- <tbody>
---   <tr>
---     <td class="tg-1">width</td>
---     <td class="tg-1">How many characters wide to make the gauge</td>
---     <td class="tg-1">24</td>
---   </tr>
---   <tr>
---     <td class="tg-2">fillCharacter</td>
---     <td class="tg-2">What character to use for the 'full' part of the gauge</td>
---     <td class="tg-2">:</td>
---   </tr>
---   <tr>
---     <td class="tg-1">overflowCharacter</td>
---     <td class="tg-1">What character to use for >100% part of the gauge</td>
---     <td class="tg-1">if not set, it uses whatever you set fillCharacter to</td>
---   </tr>
---   <tr>
---     <td class="tg-2">emptyCharacter</td>
---     <td class="tg-2">What character to use for the 'empty' part of the gauge</td>
---     <td class="tg-2">-</td>
---   </tr>
---   <tr>
---     <td class="tg-1">showPercentSymbol</td>
---     <td class="tg-1">Should we show the % sign itself?</td>
---     <td class="tg-1">true</td>
---   </tr>
---   <tr>
---     <td class="tg-2">showPercent</td>
---     <td class="tg-2">Should we show what % of the gauge is filled?</td>
---     <td class="tg-2">true</td>
---   </tr>
---   <tr>
---     <td class="tg-1">value</td>
---     <td class="tg-1">How much of the gauge should be filled</td>
---     <td class="tg-1">50</td>
---   </tr>
---   <tr>
---     <td class="tg-2">format</td>
---     <td class="tg-2">What type of color formatting to use? 'c' for cecho, 'd' for decho, 'h' for hecho</td>
---     <td class="tg-2">c</td>
---   </tr>
---   <tr>
---     <td class="tg-1">fillColor</td>
---     <td class="tg-1">What color to make the full part of the bar?</td>
---     <td class="tg-1">"DarkOrange" or equivalent for your format type</td>
---   </tr>
---   <tr>
---     <td class="tg-2">emptyColor</td>
---     <td class="tg-2">what color to use for the empty part of the bar?</td>
---     <td class="tg-2">"white" or format appropriate equivalent</td>
---   </tr>
---   <tr>
---     <td class="tg-1">percentColor</td>
---     <td class="tg-1">What color to print the percentage numvers in, if shown?</td>
---     <td class="tg-1">"white" or fortmat appropriate equivalent</td>
---   </tr>
---   <tr>
---     <td class="tg-2">percentSymbolColor</td>
---     <td class="tg-2">What color to make the % if shown?</td>
---     <td class="tg-2">If not set, uses what percentColor is set to.</td>
---   </tr>
---   <tr>
---     <td class="tg-1">overflowColor</td>
---     <td class="tg-1">What color to make the >100% portion of the bar?</td>
---     <td class="tg-1">If not set, will use the same color as fillColor</td>
---   </tr>
--- </tbody>
--- </table>
--- @usage
--- local TextGauge = require("MDK.textgauge")
--- myTextGauge = TextGauge:new()
--- gaugeText = myTextGauge:setValue(382, 830)
-function TextGauge:new(options)
-  options = options or {}
-  local optionsType = type(options)
-  assert(optionsType == "table" or optionsType == "nil", "TextGauge:new(options): options expected as table, got " .. optionsType)
-  local me = table.deepcopy(options)
-  setmetatable(me, self)
-  self.__index = self
-  me:setDefaultColors()
-  return me
-end
-
---- Sets the width in characters of the gauge
--- @tparam number width number of characters wide to make the gauge
-function TextGauge:setWidth(width)
-  local widthType = type(width)
-  assert(widthType == "number", string.format("TextGauge:setWidth(width): width as number expected, got %s", widthType))
-  self.width = width
-end
-
-function TextGauge:setFormat(format)
-  self.format = self:getColorType(format)
-  self:setDefaultColors()
-end
-
---- Sets the character to use for the 'full' part of the gauge
--- @tparam string character the character to use.
-function TextGauge:setFillCharacter(character)
-  assert(character ~= nil, "TextGauge:setFillCharacter(character): character required, got nil")
-  assert(utf8.len(character) == 1, "TextGauge:setFillCharacter(character): character must be a single character")
-  self.fillCharacter = character
-end
-
---- Sets the character to use for the 'overflow' (>100%) part of the gauge
--- @tparam string character the character to use.
-function TextGauge:setOverflowCharacter(character)
-  assert(character ~= nil, "TextGauge:setOverflowCharacter(character): character required, got nil")
-  assert(utf8.len(character) == 1, "TextGauge:setOverflowCharacter(character): character must be a single character")
-  self.overflowCharacter = character
-end
-
---- Sets the character to use for the 'full' part of the gauge
--- @tparam string character the character to use.
-function TextGauge:setEmptyCharacter(character)
-  assert(character ~= nil, "TextGauge:setEmptyCharacter(character): character required, got nil")
-  assert(utf8.len(character) == 1, "TextGauge:setEmptyCharacter(character): character must be a single character")
-  self.emptyCharacter = character
-end
-
---- Sets the fill color for the gauge.
--- @tparam string color the color to use for the full portion of the gauge. Will be run through Geyser.Golor
-function TextGauge:setFillColor(color)
-  assert(color ~= nil, "TextGauge:setFillColor(color): color required, got nil")
-  self.fillColor = color
-end
-
---- Sets the overflow color for the gauge.
--- @tparam string color the color to use for the full portion of the gauge. Will be run through Geyser.Golor
-function TextGauge:setOverflowColor(color)
-  assert(color ~= nil, "TextGauge:setOverflowColor(color): color required, got nil")
-  self.overflowColor = color
-end
-
---- Sets the empty color for the gauge.
--- @tparam string color the color to use for the empty portion of the gauge. Will be run through Geyser.Golor
-function TextGauge:setEmptyColor(color)
-  assert(color ~= nil, "TextGauge:setEmptyColor(color): color required, got nil")
-  self.emptyColor = color
-end
-
---- Sets the fill color for the gauge.
--- @tparam string color the color to use for the numeric value. Will be run through Geyser.Golor
-function TextGauge:setPercentColor(color)
-  assert(color ~= nil, "TextGauge:setPercentColor(color): color required, got nil")
-  self.percentColor = color
-end
---- Sets the fill color for the gauge.
--- @tparam string color the color to use for the numeric value. Will be run through Geyser.Golor
-function TextGauge:setPercentSymbolColor(color)
-  assert(color ~= nil, "TextGauge:setPercentSymbolColor(color): color required, got nil")
-  self.percentSymbolColor = color
-end
-
---- Enables reversing the fill direction (right to left instead of the usual left to right)
-function TextGauge:enableReverse()
-  self.reverse = true
-end
-
---- Disables reversing the fill direction (go back to the usual left to right)
-function TextGauge:disableReverse()
-  self.reverse = false
-end
-
---- Enables showing the percent value of the gauge
-function TextGauge:enableShowPercent()
-  self.showPercent = true
-end
-
---- Disables showing the percent value of the gauge
-function TextGauge:disableShowPercent()
-  self.showPercent = false
-end
-
---- Enables showing the percent symbol (appears after the value)
-function TextGauge:enableShowPercentSymbol()
-  self.showPercentSymbol = true
-end
-
---- Enables showing the percent symbol (appears after the value)
-function TextGauge:disableShowPercentSymbol()
-  self.showPercentSymbol = false
-end
-
-function TextGauge:getColorType(format)
-  format = format or self.format
-  local dec = {"d", "decimal", "dec", "decho"}
-  local hex = {"h", "hexidecimal", "hex", "hecho"}
-  local col = {"c", "color", "colour", "col", "name", "cecho"}
-  if table.contains(col, format) then
-    return "c"
-  elseif table.contains(dec, format) then
-    return "d"
-  elseif table.contains(hex, format) then
-    return "h"
-  else
-    return ""
-  end
-end
-
--- internal function, used at instantiation to ensure some colors are set
-function TextGauge:setDefaultColors()
-  local colorType = self:getColorType()
-  if colorType == "c" then
-    self.percentColor = self.percentColor or "white"
-    self.percentSymbolColor = self.percentSymbolColor or self.percentColor
-    self.fillColor = self.fillColor or "DarkOrange"
-    self.emptyColor = self.emptyColor or "white"
-    self.resetColor = "<reset>"
-  elseif colorType == "d" then
-    self.percentColor = self.percentColor or "<255,255,255>"
-    self.percentSymbolColor = self.percentSymbolColor or self.percentColor
-    self.fillColor = self.fillColor or "<255,140,0>"
-    self.emptyColor = self.emptyColor or "<255,255,255>"
-    self.resetColor = "<r>"
-  elseif colorType == "h" then
-    self.percentColor = self.percentColor or "#ffffff"
-    self.percentSymbolColor = self.percentSymbolColor or self.percentColor
-    self.fillColor = self.fillColor or "#ff8c00"
-    self.emptyColor = self.emptyColor or "#ffffff"
-    self.resetColor = "#r"
-  else
-    self.percentColor = self.percentColor or ""
-    self.percentSymbolColor = self.percentSymbolColor or self.percentColor
-    self.fillColor = self.fillColor or ""
-    self.emptyColor = self.emptyColor or ""
-    self.resetColor = ""
-  end
-  self.overflowColor = self.overflowColor or self.fillColor
-end
-
--- Internal function used to route Geyser.Color based on internally stored format
-function TextGauge:getColor(color)
-  local colorType = self:getColorType()
-  if colorType == "c" then
-    return string.format("<%s>", color) -- pass the color back in <> for cecho
-  elseif colorType == "d" then
-    return Geyser.Color.hdec(color) -- return it in decho format
-  elseif colorType == "h" then
-    return Geyser.Color.hex(color) -- return it in hex format
-  else
-    return "" -- return an empty string for noncolored output
-  end
-end
-
---- Used to set the gauge's value and return the string representation of the gauge
--- @tparam[opt] number current current value. If no value is passed it will use the stored value. Defaults to 50 to prevent errors.
--- @tparam[opt] number max maximum value. If not passed, the internally stored one will be used. Defaults to 100 so that it can be used with single values as a percent
--- @usage myGauge:setValue(55) -- sets the gauge to 55% full
--- @usage myGauge:setValue(2345, 2780) -- will figure out what the percentage fill is based on the given current/max values
-function TextGauge:setValue(current, max)
-  current = current or self.value
-  assert(type(current) == "number", "TextGauge:setValue(current,max) current as number expected, got " .. type(current))
-  assert(max == nil or type(max) == "number", "TextGauge:setValue(current, max) option max as number expected, got " .. type(max))
-  if current < 0 then
-    current = 0
-  end
-  max = max or 100
-  local value = math.floor(current / max * 100)
-  self.value = value
-  local width = self.width
-  local percentString = ""
-  local percentSymbolString = ""
-  local fillCharacter = self.fillCharacter
-  local overflowCharacter = self.overflowCharacter or fillCharacter
-  local emptyCharacter = self.emptyCharacter
-  local fillColor = self:getColor(self.fillColor)
-  local overflowColor = self:getColor(self.overflowColor)
-  local emptyColor = self:getColor(self.emptyColor)
-  local percentColor = self:getColor(self.percentColor)
-  local percentSymbolColor = self:getColor(self.percentSymbolColor)
-  local resetColor = self.resetColor
-  if self.showPercent then
-    percentString = string.format("%s%02d%s", percentColor, value, resetColor)
-    width = width - 2
-  end
-  if self.showPercentSymbol then
-    percentSymbolString = string.format("%s%s%s", percentSymbolColor, "%", resetColor)
-    width = width - 1
-  end
-  local perc = value / 100
-  local overflow = perc - 1
-  if overflow < 0 then
-    overflow = 0
-  end
-  if overflow > 1 then
-    perc = 2
-    overflow = 1
-  end
-  local overflowWidth = math.floor(overflow * width)
-  local fillWidth = math.floor((perc - overflow) * width)
-  local emptyWidth = width - fillWidth
-  fillWidth = fillWidth - overflowWidth
-  if value >= 100 and self.showPercent then
-    fillWidth = fillWidth - 1
-  end
-  if value >= 200 and self.showPercent then
-    overflowWidth = overflowWidth - 1
-  end
-  local result = ""
-  if self.reverse then
-    result = string.format("%s%s%s%s%s%s%s%s%s%s%s", emptyColor, string.rep(emptyCharacter, emptyWidth), resetColor,fillColor, string.rep(fillCharacter, fillWidth), resetColor, overflowColor, string.rep(overflowCharacter, overflowWidth), resetColor, percentString, percentSymbolString, resetColor)
-  else
-    result = string.format("%s%s%s%s%s%s%s%s%s%s%s", overflowColor, string.rep(overflowCharacter, overflowWidth), fillColor,
-                  string.rep(fillCharacter, fillWidth), resetColor, emptyColor, string.rep(emptyCharacter, emptyWidth), resetColor,
-                  percentString, percentSymbolString, resetColor)
-  end
-  return result
-end
-
---- Synonym for setValue
-function TextGauge:print(...)
-  self:setValue(...)
-end
-
-return TextGauge
- - -
-
-
-generated by LDoc 1.5.0 -Last updated 2023-05-29 18:41:27 -
-
- - diff --git a/src/resources/MDK/doc/source/timergauge.lua.html b/src/resources/MDK/doc/source/timergauge.lua.html deleted file mode 100755 index 1372b2c..0000000 --- a/src/resources/MDK/doc/source/timergauge.lua.html +++ /dev/null @@ -1,628 +0,0 @@ - - - - - Reference - - - - -
- -
- -
-
-
- - -
- - - - - - -
- -

timergauge.lua

-
---- Animated countdown timer, extends <a href="https://www.mudlet.org/geyser/files/geyser/GeyserGauge.html">Geyser.Gauge</a>
--- @classmod TimerGauge
--- @author Damian Monogue <demonnic@gmail.com>
--- @copyright 2020 Damian Monogue
--- @license MIT, see LICENSE.lua
-local TimerGauge = {
-  name = "TimerGaugeClass",
-  active = true,
-  showTime = true,
-  prefix = "",
-  timeFormat = "S.t",
-  suffix = "",
-  updateTime = "10",
-  autoHide = true,
-  autoShow = true,
-  manageContainer = false,
-}
-
-function TimerGauge:setStyleSheet(cssFront, cssBack, cssText)
-  cssFront = cssFront or self.cssFront
-  cssBack = cssBack or self.cssBack
-  cssBack = cssBack or self.cssFront .. "background-color: black;"
-  cssText = cssText or self.cssText
-  if cssFront then
-    self.front:setStyleSheet(cssFront)
-  end
-  if cssBack then
-    self.back:setStyleSheet(cssBack)
-  end
-  if cssText then
-    self.text:setStyleSheet(cssText)
-  end
-  -- self.gauge:setStyleSheet(cssFront, cssBack, cssText)
-  self.cssFront = cssFront
-  self.cssBack = cssBack
-  self.cssText = cssText
-end
-
---- Shows the TimerGauge. If the manageContainer property is true, then will add it back to its container
-function TimerGauge:show2()
-  if self.manageContainer and self.savedContainer then
-    self.savedContainer:add(self)
-    self.savedContainer = nil
-  end
-  self:show()
-end
-
---- Hides the TimerGauge. If manageContainer property is true, then it will remove it from its container and if the container is an HBox or VBox it will initiate size/position management
-function TimerGauge:hide2()
-  if self.manageContainer and self.container.name ~= Geyser.name then
-    self.savedContainer = self.container
-    Geyser:add(self)
-    self.savedContainer:remove(self)
-    if self.savedContainer.type == "VBox" or self.savedContainer.type == "HBox" then
-      if self.savedContainer.organize then
-        self.savedContainer:organize()
-      else
-        self.savedContainer:reposition()
-      end
-    end
-  end
-  self:hide()
-end
-
---- Starts the timergauge. Works whether the timer is stopped or not. Does not start a timer which is already at 0
--- @tparam[opt] boolean show override the autoShow property. True will always show, false will never show.
--- @usage myTimerGauge:start() --starts the timer, will show or not based on autoShow property
--- myTimerGauge:start(false) --starts the timer, will not change hidden status, regardless of autoShow property
--- myTimerGauge:start(true) --starts the timer, will show it regardless of autoShow property
-function TimerGauge:start(show)
-  if show == nil then
-    show = self.autoShow
-  end
-  self.active = true
-  if self.timer then
-    killTimer(self.timer)
-    self.timer = nil
-  end
-  startStopWatch(self.stopWatchName)
-  self:update()
-  self.timer = tempTimer(self.updateTime / 1000, function()
-    self:update()
-  end, true)
-  if show then
-    self:show2()
-  end
-end
-
---- Stops the timergauge. Works whether the timer is started or not.
--- @tparam[opt] boolean hide override the autoHide property. True will always hide, false will never hide.
--- @usage myTimerGauge:stop() --stops the timer, will hide or not based on autoHide property
--- myTimerGauge:stop(false) --stops the timer, will not change hidden status, regardless of autoHide property
--- myTimerGauge:stop(true) --stops the timer, will hide it regardless of autoHide property
-function TimerGauge:stop(hide)
-  if hide == nil then
-    hide = self.autoHide
-  end
-  self.active = false
-  if self.timer then
-    killTimer(self.timer)
-    self.timer = nil
-  end
-  stopStopWatch(self.stopWatchName)
-  if hide then
-    self:hide2()
-  end
-end
-
---- Alias for stop.
--- @tparam[opt] boolean hide override the autoHide property. True will always hide, false will never hide.
-function TimerGauge:pause(hide)
-  self:stop(hide)
-end
-
---- Resets the time on the timergauge to its original value. Does not alter the running state of the timer
-function TimerGauge:reset()
-  resetStopWatch(self.stopWatchName)
-  adjustStopWatch(self.stopWatchName, self.time * -1)
-  self:update()
-end
-
---- Resets and starts the timergauge.
--- @tparam[opt] boolean show override the autoShow property. true will always show, false will never show
--- @usage myTimerGauge:restart() --restarts the timer, will show or not based on autoShow property
--- myTimerGauge:restart(false) --restarts the timer, will not change hidden status, regardless of autoShow property
--- myTimerGauge:restart(true) --restarts the timer, will show it regardless of autoShow property
-function TimerGauge:restart(show)
-  self:reset()
-  self:start(show)
-end
-
---- Get the amount of time remaining on the timer, in seconds
--- @tparam string format Format string for how to return the time. If not provided defaults to self.timeFormat(which defaults to "S.t").<br>
---                      If "" is passed will return "" as the time. See below table for formatting codes<br>
--- <table class="tg">
--- <tr>
---  <th>format code</th>
---  <th>what it is replaced with</th>
--- </tr>
--- <tr>
---  <td class="tg-1">S</td>
---  <td class="tg-1">Time left in seconds, unbroken down. Does not include milliseconds.<br>
---      IE a timer with 2 minutes left it would replace S with 120
---  </td>
--- </tr>
--- <tr>
---  <td class="tg-2">dd</td>
---  <td class="tg-2">Days, with 1 leading 0 (0, 01, 02-...)</td>
--- </tr>
--- <tr>
---  <td class="tg-1">d</td>
---  <td class="tg-1">Days, with no leading 0 (1,2,3-...)</td>
--- </tr>
--- <tr>
---  <td class="tg-2">hh</td>
---  <td class="tg-2">hours, with leading 0 (00-24)</td>
--- </tr>
--- <tr>
---  <td class="tg-1">h</td>
---  <td class="tg-1">hours, without leading 0 (0-24)</td>
--- </tr>
--- <tr>
---  <td class="tg-2">MM</td>
---  <td class="tg-2">minutes, with a leading 0 (00-59)</td>
--- </tr>
--- <tr>
---  <td class="tg-1">M</td>
---  <td class="tg-1">minutes, no leading 0 (0-59)</td>
--- </tr>
--- <tr>
---  <td class="tg-2">ss</td>
---  <td class="tg-2">seconds, with leading 0 (00-59)</td>
--- </tr>
--- <tr>
---  <td class="tg-1">s</td>
---  <td class="tg-1">seconds, no leading 0 (0-59)</td>
--- </tr>
--- <tr>
---  <td class="tg-2">t</td>
---  <td class="tg-2">tenths of a second<br>
---      timer with 12.345 seconds left, t would<br>
---      br replaced by 3.
---  </td>
--- </tr>
--- <tr>
---  <td class="tg-1">mm</td>
---  <td class="tg-1">milliseconds with leadings 0s (000-999)</td>
--- </tr>
--- <tr>
---  <td class="tg-2">m</td>
---  <td class="tg-2">milliseconds with no leading 0s (0-999)</td>
--- </tr>
--- </table><br>
--- @usage myTimerGauge:getTime() --returns the time using myTimerGauge.format
--- myTimerGauge:getTime("hh:MM:ss") --returns the time as hours, minutes, and seconds, with leading 0s (01:23:04)
--- myTimerGauge:getTime("S.mm") --returns the time as the total number of seconds, including milliseconds (114.004)
-function TimerGauge:getTime(format)
-  format = format or self.timeFormat
-  local time = getStopWatchTime(self.stopWatchName)
-  local timerTable = getStopWatchBrokenDownTime(self.stopWatchName)
-  if time > 0 then
-    self:stop(self.autoHide)
-    resetStopWatch(self.stopWatchName)
-    time = getStopWatchTime(self.stopWatchName)
-    timerTable = getStopWatchBrokenDownTime(self.stopWatchName)
-    self.active = false
-  end
-  if format == "" then
-    return format
-  end
-  local totalSeconds = string.split(math.abs(time), "%.")[1]
-  local tenths = string.sub(string.format("%03d", timerTable.milliSeconds), 1, 1)
-  format = format:gsub("S", totalSeconds)
-  format = format:gsub("t", tenths)
-  format = format:gsub("mm", string.format("%03d", timerTable.milliSeconds))
-  format = format:gsub("m", timerTable.milliSeconds)
-  format = format:gsub("MM", string.format("%02d", timerTable.minutes))
-  format = format:gsub("M", timerTable.minutes)
-  format = format:gsub("dd", string.format("%02d", timerTable.days))
-  format = format:gsub("d", timerTable.days)
-  format = format:gsub("ss", string.format("%02d", timerTable.seconds))
-  format = format:gsub("s", timerTable.seconds)
-  format = format:gsub("hh", string.format("%02d", timerTable.hours))
-  format = format:gsub("h", timerTable.hours)
-  return format
-end
-
--- Execute the timer's hook, if there is one. Internal function
-function TimerGauge:executeHook()
-  local hook = self.hook
-  if not hook then
-    return
-  end
-  local hooktype = type(hook)
-  if hooktype == "string" then
-    local f, e = loadstring("return " .. hook)
-    if not f then
-      f, e = loadstring(hook)
-    end
-    if not f then
-      debugc(string.format("TimerGauge encountered an error while executing the hook for TimerGauge with name: %s error: %s", self.name, tostring(e)))
-      return
-    end
-    hook = f
-  end
-  hooktype = type(hook)
-  if hooktype ~= "function" then
-    debugc(string.format(
-             "TimerGauge with name: %s was given a hook which is neither a function nor a string which can be made into one. Provided type was %s",
-             self.name, hooktype))
-    return
-  end
-  local worked, err = pcall(hook)
-  if not worked then
-    debugc(string.format("TimerGauge named %s encountered the following error while executing its hook: %s", self.name, err))
-  end
-end
-
---- Sets the timer's remaining time to 0, stops it, and executes the hook if one exists.
--- @tparam[opt] boolean skipHook use true to have it set the timer to 0 and stop, but not execute the hook.
--- @usage myTimerGauge:finish() --executes the hook if it has one
--- myTimerGauge:finish(false) --will not execute the hook
-function TimerGauge:finish(skipHook)
-  resetStopWatch(self.stopWatchName)
-  self:update(skipHook)
-end
-
--- Internal function, no ldoc
--- Updates the gauge based on time remaining.
--- @tparam[opt] boolean skipHook use true if you do not want to execute the hook if the timer is at 0.
-function TimerGauge:update(skipHook)
-  local time = self.showTime and self:getTime(self.timeFormat) or ""
-  local current = tonumber(self:getTime("S.mm"))
-  local suffix = self.suffix or ""
-  local prefix = self.prefix or ""
-  local text = string.format("%s%s%s", prefix, time, suffix)
-  self:setValue(current, self.time, text)
-  if current == 0 then
-    if self.timer then
-      killTimer(self.timer)
-      self.timer = nil
-    end
-    if not skipHook then
-      self:executeHook()
-    end
-  end
-end
-
---- Sets the amount of time the timer will run for. Make sure to call :reset() or :restart()
--- if you want to cause the timer to run for that amount of time. If you set it to a time lower
--- than the time left on the timer currently, it will reset the current time, otherwise it is left alone
--- @tparam number time how long in seconds the timer should run for
--- @usage myTimerGauge:setTime(50) -- sets myTimerGauge's max time to 50.
-function TimerGauge:setTime(time)
-  local timetype = type(time)
-  if timetype ~= "number" then
-    local err = string.format("TimerGauge:setTime(time): time as number expected, got %s", timetype)
-    debugc(err)
-    return nil, err
-  end
-  time = math.abs(time)
-  if time == 0 then
-    local err = "TimerGauge:setTime(time): you cannot pass in 0 as the max time for the timer"
-    debugc(err)
-    return nil, err
-  end
-  local currentTime = tonumber(self:getTime("S.t"))
-  self.time = time
-  if time < currentTime then
-    self:reset()
-  else
-    self:update(currentTime == 0)
-  end
-end
-
---- Changes the time between gauge updates.
--- @tparam number updateTime amount of time in milliseconds between gauge updates. Must be a positive number.
-function TimerGauge:setUpdateTime(updateTime)
-  local updateTimeType = type(updateTime)
-  assert(updateTimeType == "number",
-         string.format("TimerGauge:setUpdateTime(updateTime): name: %s updateTime as number expected, got %s", self.name, updateTimeType))
-  assert(updateTime > 0,
-         string.format("TimerGauge:setUpdateTime(updateTime): name: %s updateTime must be a positive number. You gave %d", self.name, updateTime))
-  self.updateTime = updateTime
-  if self.timer then
-    killTimer(self.timer)
-    self.timer = nil
-  end
-  if self.active then
-    self.timer = tempTimer(updateTime / 1000, function()
-      self:update()
-    end, true)
-  end
-end
-
-TimerGauge.parent = Geyser.Gauge
-setmetatable(TimerGauge, Geyser.Gauge)
---- Creates a new TimerGauge instance.
--- @tparam table cons a table of options (or constraints) for how the TimerGauge will behave. Valid options include:
--- <br>
--- <table class="tg">
--- <tr>
---  <th>name</th>
---  <th>description</th>
---  <th>default</th>
--- </tr>
--- <tr>
---  <td class="tg-1">time</td>
---  <td class="tg-1">how long the timer should run for</td>
---  <td class="tg-1"></td>
--- </tr>
--- <tr>
---  <td class="tg-2">active</td>
---  <td class="tg-2">whether the timer should run or not</td>
---  <td class="tg-2">true</td>
--- </tr>
--- <tr>
---  <td class="tg-1">showTime</td>
---  <td class="tg-1">should we show the time remaining on the gauge?</td>
---  <td class="tg-1">true</td>
--- </tr>
--- <tr>
---  <td class="tg-2">prefix</td>
---  <td class="tg-2">text you want shown before the time.</td>
---  <td class="tg-2">""</td>
--- </tr>
--- <tr>
---  <td class="tg-1">suffix</td>
---  <td class="tg-1">text you want shown after the time.</td>
---  <td class="tg-1">""</td>
--- </tr>
--- <tr>
---  <td class="tg-2">timerCaption</td>
---  <td class="tg-2">Alias for suffix. Deprecated and may be remove in the future</td>
---  <td class="tg-2"/>
--- </tr>
--- <tr>
---  <td class="tg-1">updateTime</td>
---  <td class="tg-1">number of milliseconds between gauge updates.</td>
---  <td class="tg-1">10</td>
--- </tr>
--- <tr>
---  <td class="tg-2">autoHide</td>
---  <td class="tg-2">should the timer :hide() itself when it runs out/you stop it?</td>
---  <td class="tg-2">true</td>
--- </tr>
--- <tr>
---  <td class="tg-1">autoShow</td>
---  <td class="tg-1">should the timer :show() itself when you start it?</td>
---  <td class="tg-1">true</td>
--- </tr>
--- <tr>
---  <td class="tg-2">manageContainer</td>
---  <td class="tg-2">should the timer remove itself from its container when you call <br>:hide() and add itself back when you call :show()?</td>
---  <td class="tg-2">false</td>
--- </tr>
--- <tr>
---  <td class="tg-1">timeFormat</td>
---  <td class="tg-1">how should the time be displayed/returned if you call :getTime()? <br>See table below for more information</td>
---  <td class="tg-1">"S.t"</td>
--- </tr>
--- </table>
--- <br>Table of time format options
--- <table class="tg">
--- <tr>
---  <th>format code</th>
---  <th>what it is replaced with</th>
--- </tr>
--- <tr>
---  <td class="tg-1">S</td>
---  <td class="tg-1">Time left in seconds, unbroken down. Does not include milliseconds.<br>
---      IE a timer with 2 minutes left it would replace S with 120
---  </td>
--- </tr>
--- <tr>
---  <td class="tg-2">dd</td>
---  <td class="tg-2">Days, with 1 leading 0 (0, 01, 02-...)</td>
--- </tr>
--- <tr>
---  <td class="tg-1">d</td>
---  <td class="tg-1">Days, with no leading 0 (1,2,3-...)</td>
--- </tr>
--- <tr>
---  <td class="tg-2">hh</td>
---  <td class="tg-2">hours, with leading 0 (00-24)</td>
--- </tr>
--- <tr>
---  <td class="tg-1">h</td>
---  <td class="tg-1">hours, without leading 0 (0-24)</td>
--- </tr>
--- <tr>
---  <td class="tg-2">MM</td>
---  <td class="tg-2">minutes, with a leading 0 (00-59)</td>
--- </tr>
--- <tr>
---  <td class="tg-1">M</td>
---  <td class="tg-1">minutes, no leading 0 (0-59)</td>
--- </tr>
--- <tr>
---  <td class="tg-2">ss</td>
---  <td class="tg-2">seconds, with leading 0 (00-59)</td>
--- </tr>
--- <tr>
---  <td class="tg-1">s</td>
---  <td class="tg-1">seconds, no leading 0 (0-59)</td>
--- </tr>
--- <tr>
---  <td class="tg-2">t</td>
---  <td class="tg-2">tenths of a second<br>
---      timer with 12.345 seconds left, t would<br>
---      br replaced by 3.
---  </td>
--- </tr>
--- <tr>
---  <td class="tg-1">mm</td>
---  <td class="tg-1">milliseconds with leadings 0s (000-999)</td>
--- </tr>
--- <tr>
---  <td class="tg-2">m</td>
---  <td class="tg-2">milliseconds with no leading 0s (0-999)</td>
--- </tr>
--- </table><br>
--- @param parent The Geyser parent for this TimerGauge
--- @usage
--- local TimerGauge = require("MDK.timergauge")
--- myTimerGauge = TimerGauge:new({
---   name = "testGauge",
---   x = 100,
---   y = 100,
---   height = 40,
---   width = 200,
---   time = 10
--- })
-function TimerGauge:new(cons, parent)
-  -- type checking and error handling
-  local consType = type(cons)
-  if consType ~= "table" then
-    local err = string.format("TimerGauge:new(options, parent): options must be provided as a table, received: %s", consType)
-    debugc(err)
-    return nil, err
-  end
-  local timetype = type(cons.time)
-  local time = tonumber(cons.time)
-  if not time then
-    local err = string.format(
-                  "TimerGauge:new(options, parent): options table must include a time entry, which must be a number. We received: %s which is type: %s",
-                  cons.time or tostring(cons.time), timetype)
-    debugc(err)
-    return nil, err
-  end
-  cons.time = math.abs(time)
-  if cons.time == 0 then
-    local err = "TimerGauge:new(options, parent): time entry in options table must be non-0"
-    debugc(err)
-    return nil, err
-  end
-
-  if cons.timerCaption and (not cons.suffix) then
-    cons.suffix = cons.timerCaption
-  end
-  cons.type = cons.type or "timergauge"
-  -- call parent constructor
-  local me = self.parent:new(cons, parent)
-  -- add TimerGauge as the metatable/index
-  setmetatable(me, self)
-  self.__index = self
-
-  -- apply any styling requested
-  if me.cssFront then
-    if not me.cssBack then
-      me.cssBack = me.cssFront .. "background-color: black;"
-    end
-    me:setStyleSheet(me.cssFront, me.cssBack, me.cssText)
-  end
-
-  -- create and reset the driving stopwatch
-  me.stopWatchName = me.name .. "_timergauge"
-  createStopWatch(me.stopWatchName)
-  me:reset()
-
-  -- start it up?
-  if me.active then
-    me:start()
-  end
-  me:update()
-  return me
-end
-
-return TimerGauge
- - -
-
-
-generated by LDoc 1.5.0 -Last updated 2023-05-29 18:41:27 -
-
- - diff --git a/src/resources/MDK/figlet.lua b/src/resources/MDK/figlet.lua deleted file mode 100755 index d07b4cf..0000000 --- a/src/resources/MDK/figlet.lua +++ /dev/null @@ -1,267 +0,0 @@ ---- Figlet --- A module to read figlet fonts and produce figlet ascii art from text --- @module figlet --- @copyright 2010,2011 Nick Gammon --- @copyright 2022 Damian Monogue -local Figlet = {} - ---[[ - Based on figlet. - - FIGlet Copyright 1991, 1993, 1994 Glenn Chappell and Ian Chai - FIGlet Copyright 1996, 1997 John Cowan - Portions written by Paul Burton - Internet: - FIGlet, along with the various FIGlet fonts and documentation, is - copyrighted under the provisions of the Artistic License (as listed - in the file "artistic.license" which is included in this package. - ---]] - ---[[ - Latin-1 codes for German letters, respectively: - LATIN CAPITAL LETTER A WITH DIAERESIS = A-umlaut - LATIN CAPITAL LETTER O WITH DIAERESIS = O-umlaut - LATIN CAPITAL LETTER U WITH DIAERESIS = U-umlaut - LATIN SMALL LETTER A WITH DIAERESIS = a-umlaut - LATIN SMALL LETTER O WITH DIAERESIS = o-umlaut - LATIN SMALL LETTER U WITH DIAERESIS = u-umlaut - LATIN SMALL LETTER SHARP S = ess-zed ---]] - -local deutsch = {196, 214, 220, 228, 246, 252, 223} -local fcharlist = {} -local magic, hardblank, charheight, maxlen, smush, cmtlines, ffright2left, smush2 - -local function readfontchar(fontfile, theord) - - local t = {} - fcharlist[theord] = t - - -- read each character line - - --[[ - - eg. - - __ __ @ - | \/ |@ - | \ / |@ - | |\/| |@ - | | | |@ - |_| |_|@ - @ - @@ ---]] - - for i = 1, charheight do - local line = assert(fontfile:read("*l"), "Not enough character lines for character " .. theord) - local line = string.gsub(line, "%s+$", "") -- remove trailing spaces - assert(line ~= "", "Unexpected empty line") - - -- find the last character (eg. @) - local endchar = line:sub(-1) -- last character - - -- trim one or more of the last character from the end - while line:sub(-1) == endchar do - line = line:sub(1, #line - 1) - end -- while line ends with endchar - - table.insert(t, line) - - end -- for each line - -end -- readfontchar - ---- Reads a figlet font file (.flf) into memory and readies it for use by the next figlet --- These files are cached in memory so that future calls to load a font just read from there. --- @param filename the full path to the file to read the font from -function Figlet.readfont(filename) - local fontfile = assert(io.open(filename, "r")) - local s - - fcharlist = {} - - -- header line - s = assert(fontfile:read("*l"), "Empty FIGlet file") - - -- eg. flf2a$ 8 6 59 15 10 0 24463 153 - -- magic charheight maxlen smush cmtlines ffright2left smush2 ?? - - -- configuration line - magic, hardblank, charheight, maxlen, smush, cmtlines, ffright2left, smush2 = string.match(s, - "^(flf2).(.) (%d+) %d+ (%d+) (%-?%d+) (%d+) ?(%d*) ?(%d*) ?(%-?%d*)") - - assert(magic, "Not a FIGlet 2 font file") - - -- convert to numbers - charheight = tonumber(charheight) - maxlen = tonumber(maxlen) - smush = tonumber(smush) - cmtlines = tonumber(cmtlines) - - -- sanity check - if charheight < 1 then - charheight = 1 - end -- if - - -- skip comment lines - for i = 1, cmtlines do - assert(fontfile:read("*l"), "Not enough comment lines") - end -- for - - -- get characters space to tilde - for theord = string.byte(' '), string.byte('~') do - readfontchar(fontfile, theord) - end -- for - - -- get 7 German characters - for theord = 1, 7 do - readfontchar(fontfile, deutsch[theord]) - end -- for - - -- get extra ones like: - -- 0x0395 GREEK CAPITAL LETTER EPSILON - -- 246 LATIN SMALL LETTER O WITH DIAERESIS - - repeat - local extra = fontfile:read("*l") - if not extra then - break - end -- if eof - - local negative, theord = string.match(extra, "^(%-?)0[xX](%x+)") - if theord then - theord = tonumber(theord, 16) - if negative == "-" then - theord = -theord - end -- if negative - else - theord = string.match(extra, "^%d+") - assert(theord, "Unexpected line:" .. extra) - theord = tonumber(theord) - end -- if - - readfontchar(fontfile, theord) - - until false - - fontfile:close() - - -- remove leading/trailing spaces - - for k, v in pairs(fcharlist) do - - -- first see if all lines have a leading space or a trailing space - local leading_space = true - local trailing_space = true - for _, line in ipairs(v) do - if line:sub(1, 1) ~= " " then - leading_space = false - end -- if - if line:sub(-1, -1) ~= " " then - trailing_space = false - end -- if - end -- for each line - - -- now remove them if necessary - for i, line in ipairs(v) do - if leading_space then - v[i] = line:sub(2) - end -- removing leading space - if trailing_space then - v[i] = line:sub(1, -2) - end -- removing trailing space - end -- for each line - end -- for each character -end -- readfont - --- add one character to output lines -local function addchar(which, output, kern, smush) - local c = fcharlist[string.byte(which)] - if not c then - return - end -- if doesn't exist - - for i = 1, charheight do - - if smush and output[i] ~= "" and which ~= " " then - local lhc = output[i]:sub(-1) - local rhc = c[i]:sub(1, 1) - output[i] = output[i]:sub(1, -2) -- remove last character - if rhc ~= " " then - output[i] = output[i] .. rhc - else - output[i] = output[i] .. lhc - end - output[i] = output[i] .. c[i]:sub(2) - - else - output[i] = output[i] .. c[i] - end -- if - - if not (kern or smush) or which == " " then - output[i] = output[i] .. " " - end -- if - end -- for - -end -- addchar - ---- Returns a table of lines representing a string as figlet --- @tparam string s the text to make into a figlet --- @tparam boolean kern should we reduce spacing --- @tparam boolean smush causes the letters to share edges, condensing it even further -function Figlet.ascii_art(s, kern, smush) - assert(fcharlist) - assert(charheight > 0) - - -- make table of output lines - local output = {} - for i = 1, charheight do - output[i] = "" - end -- for - - for i = 1, #s do - local c = s:sub(i, i) - - if c >= " " and c < "\127" then - addchar(c, output, kern, smush) - end -- if in range - - end -- for - - -- fix up blank character so we can do a string.gsub on it - local fixedblank = string.gsub(hardblank, "[%%%]%^%-$().[*+?]", "%%%1") - - for i, line in ipairs(output) do - output[i] = string.gsub(line, fixedblank, " ") - end -- for - - return output -end -- function ascii_art - ---- Returns the figlet as a string, rather than a table --- @tparam string str the string the make into a figlet --- @tparam boolean kern should we reduce the space between letters? --- @tparam boolean smush should the letters share edges, further condensing the output? --- @see ascii_art -function Figlet.getString(str, kern, smush) - local tbl = Figlet.ascii_art(str, kern, smush) - return table.concat(tbl, "\n") -end - ---- Returns a figlet as a string, with kern set to true. --- @tparam string str The string to turn into a figlet --- @see getString -function Figlet.getKern(str) - return Figlet.getString(str, true) -end - ---- Returns a figlet as a string, with smush set to true. --- @tparam string str The string to turn into a figlet --- @see getString -function Figlet.getSmush(str) - return Figlet.getString(str, true, true) -end - -return Figlet diff --git a/src/scripts/slayn/scripts.json b/src/scripts/slayn/scripts.json new file mode 100644 index 0000000..3dfb75e --- /dev/null +++ b/src/scripts/slayn/scripts.json @@ -0,0 +1,5 @@ +[ + { + "name": "slaynBase" + } +] \ No newline at end of file diff --git a/src/scripts/slayn/slaynBase.lua b/src/scripts/slayn/slaynBase.lua new file mode 100644 index 0000000..49043cd --- /dev/null +++ b/src/scripts/slayn/slaynBase.lua @@ -0,0 +1,35 @@ +slayn = slayn or {} +slayn.events = slayn.events or {} +slayn.engineering = slayn.engineering or {} +slayn.combat = slayn.combat or {} + +function slayn.setup() +end + +function slayn.tearDown() + + for _, pid in ipairs(slayn.events) do + killAnonymousEventHandler(pid) + end + + slayn = nil + +end + +function slayn.installed() +end + +table.insert( + slayn.events, + registerAnonymousEventHandler("sysLoadEvent", "slayn.setup") +) + +table.insert( + slayn.events, + registerAnonymousEventHandler("sysInstallPackage", "slayn.installed") +) + +table.insert( + slayn.events, + registerAnonymousEventHandler("sysUninstallPackage", "slayn.tearDown") +) \ No newline at end of file diff --git a/src/triggers/autostudy/triggers.json b/src/triggers/autostudy/triggers.json index acf81c8..9bf2a8b 100644 --- a/src/triggers/autostudy/triggers.json +++ b/src/triggers/autostudy/triggers.json @@ -1,7 +1,7 @@ [ { "name": "study", - "isActive": "yes", + "isActive": "no", "patterns": [ { "pattern": "You study it for some time,", @@ -15,7 +15,7 @@ }, { "name": "study.next", - "isActive": "yes", + "isActive": "no", "patterns": [ { "pattern": "^You are now an adept of (?!study)", @@ -25,7 +25,7 @@ }, { "name": "study.botStart", - "isActive": "yes", + "isActive": "no", "patterns": [ { "pattern": "You may now bot again.", @@ -35,7 +35,7 @@ }, { "name": "study.nextMove", - "isActive": "yes", + "isActive": "no", "patterns": [ { "pattern": "You don't see anything like that nearby to study.", @@ -45,7 +45,7 @@ }, { "name": "study.copyOver", - "isActive": "yes", + "isActive": "no", "patterns": [ { "pattern": "Copyover recovery complete.", diff --git a/src/triggers/combat/antidisarm.lua b/src/triggers/combat/antidisarm.lua new file mode 100644 index 0000000..5970843 --- /dev/null +++ b/src/triggers/combat/antidisarm.lua @@ -0,0 +1,3 @@ +send("get all") +send("wield pistol") +send("wield pistol") \ No newline at end of file diff --git a/src/triggers/combat/triggers.json b/src/triggers/combat/triggers.json new file mode 100644 index 0000000..bba4927 --- /dev/null +++ b/src/triggers/combat/triggers.json @@ -0,0 +1,23 @@ +[ + { + "name": "antidisarm", + "isActive": "yes", + "patterns": [ + { + "pattern": "DISARMS you!", + "type": "substring" + } + ] + }, + { + "name": "antigrapple", + "isActive": "yes", + "patterns": [ + { + "pattern": "grabs ahold of you!", + "type": "substring" + } + ], + "command": "struggle" + } +] \ No newline at end of file diff --git a/src/triggers/skill-training/PickShipLock/CloseHatch.lua b/src/triggers/skill-training/PickShipLock/CloseHatch.lua new file mode 100644 index 0000000..81f0889 --- /dev/null +++ b/src/triggers/skill-training/PickShipLock/CloseHatch.lua @@ -0,0 +1,2 @@ +send("close " .. pickShip) +send("pick " .. pickShip) \ No newline at end of file diff --git a/src/triggers/skill-training/PickShipLock/PickLock.lua b/src/triggers/skill-training/PickShipLock/PickLock.lua new file mode 100644 index 0000000..7f607cc --- /dev/null +++ b/src/triggers/skill-training/PickShipLock/PickLock.lua @@ -0,0 +1 @@ +send("pick " .. pickShip) \ No newline at end of file diff --git a/src/triggers/skill-training/SliceSecure/DecryptFile.lua b/src/triggers/skill-training/SliceSecure/DecryptFile.lua new file mode 100644 index 0000000..87ed5fc --- /dev/null +++ b/src/triggers/skill-training/SliceSecure/DecryptFile.lua @@ -0,0 +1,2 @@ +edStage = "decrypt_file self" +send(edStage) \ No newline at end of file diff --git a/src/triggers/skill-training/SliceSecure/EncryptFile.lua b/src/triggers/skill-training/SliceSecure/EncryptFile.lua new file mode 100644 index 0000000..d2ffa88 --- /dev/null +++ b/src/triggers/skill-training/SliceSecure/EncryptFile.lua @@ -0,0 +1,2 @@ +edStage = "encrypt_file self" +send(edStage) \ No newline at end of file diff --git a/src/triggers/skill-training/SliceSecure/Recharge.lua b/src/triggers/skill-training/SliceSecure/Recharge.lua new file mode 100644 index 0000000..64e8664 --- /dev/null +++ b/src/triggers/skill-training/SliceSecure/Recharge.lua @@ -0,0 +1,2 @@ +send("rem datapad") +send("energize datapad battery") \ No newline at end of file diff --git a/src/triggers/skill-training/SliceSecure/Recharged.lua b/src/triggers/skill-training/SliceSecure/Recharged.lua new file mode 100644 index 0000000..3364a9e --- /dev/null +++ b/src/triggers/skill-training/SliceSecure/Recharged.lua @@ -0,0 +1,2 @@ +send("hold datapad") +send(edStage) \ No newline at end of file diff --git a/src/triggers/skill-training/SliceSecure/SkillFailure.lua b/src/triggers/skill-training/SliceSecure/SkillFailure.lua new file mode 100644 index 0000000..03493a7 --- /dev/null +++ b/src/triggers/skill-training/SliceSecure/SkillFailure.lua @@ -0,0 +1 @@ +send(edStage) \ No newline at end of file diff --git a/src/triggers/skill-training/triggers.json b/src/triggers/skill-training/triggers.json new file mode 100644 index 0000000..7a1204f --- /dev/null +++ b/src/triggers/skill-training/triggers.json @@ -0,0 +1,94 @@ +[ + { + "name": "SliceSecure", + "isActive": "no", + "isFolder": "yes", + "children": [ + { + "name": "SkillFailure", + "isActive": "yes", + "patterns": [ + { + "pattern": "You fail to call up the right info on the datapad.", + "type": "startOfLine" + } + ] + }, + { + "name": "DecryptFile", + "isActive": "yes", + "patterns": [ + { + "pattern": "File encrypted to rating", + "type": "startOfLine" + }, + { + "pattern": "After all that, you fail to decrypt the file.", + "type": "exactMatch" + } + ] + }, + { + "name": "EncryptFile", + "isActive": "yes", + "patterns": [ + { + "pattern": "File Decrypted", + "type": "startOfLine" + }, + { + "pattern": "After all that, you fail to encrypt the file.", + "type": "exactMatch" + } + ] + }, + { + "name": "Recharge", + "isActive": "yes", + "patterns": [ + { + "pattern": "Your datapad is out of charge.", + "type": "exactMatch" + } + ] + }, + { + "name": "Recharged", + "isActive": "yes", + "patterns": [ + { + "pattern": "You successfully recharge your datapad", + "type": "startOfLine" + } + ] + } + ] + }, + { + "name": "PickShipLock", + "isActive": "no", + "isFolder": "yes", + "children": [ + { + "name": "PickLock", + "isActive": "yes", + "patterns": [ + { + "pattern": "You failed to pick the lock.", + "type": "exactMatch" + } + ] + }, + { + "name": "CloseHatch", + "isActive": "yes", + "patterns": [ + { + "pattern": "You pick the lock and open the hatch", + "type": "startOfLine" + } + ] + } + ] + } +] \ No newline at end of file