Difference between revisions of "Area 51"

From Mudlet
Jump to navigation Jump to search
(→‎Area 51 documentation: - created page to house prototype documentation for Lua API functions under development or merely being proposed)
 
(37 intermediate revisions by 5 users not shown)
Line 1: Line 1:
This page is for the development of documentation for Lua API functions that are currently being worked on. Ideally the entries here can be created in the same format as will be eventually used in [[Manual:Lua_Functions|Lua Functions]]. There is a heavily commented (as Lua comments that won't work on a Wiki page!) ''template'' included here as a HTML comment that can be copied and pasted and used as a framework for a new entry;  it probably does not cover every eventuality but I guess we can discuss revisions on the discussion page. --[[User:Slysven|slysven]] ([[User talk:Slysven|talk]]) 22:32, 12 May 2021 (UTC)
+
{{TOC right}}
  
<!-- You can copy the following, remembering to generally strip out the explanatory comments put in here!
+
This page is for the development of documentation for Lua API functions that are currently being worked on. Ideally the entries here can be created in the same format as will be eventually used in [[Manual:Lua_Functions|Lua Functions]] and its sub-sites.  
==function==
 
;function(argument1[, optional argument 2])
 
-- the above first line will get scraped to form the auto completion text in the editor - so it should, ideally show all the arguments in all their form - though this may be awkward to do and a better method when there are significant alternative forms is still to be found.
 
  
:Description of what this function will do.
+
Please use the [[Area_51/Template]] to add new entries in the sections below.
 +
 
 +
The following headings reflect those present in the main Wiki area of the Lua API functions. It is suggested that new entries are added so as to maintain a sorted alphabetical order under the appropriate heading.
 +
 
 +
 
 +
=Basic Essential Functions=
 +
:These functions are generic functions used in normal scripting. These deal with mainly everyday things, like sending stuff and echoing to the screen.
 +
 
 +
=Database Functions=
 +
:A collection of functions for helping deal with the database.
 +
 
 +
=Date/Time Functions=
 +
: A collection of functions for handling date & time.
 +
 
 +
=File System Functions=
 +
: A collection of functions for interacting with the file system.
 +
 
 +
=Mapper Functions=
 +
: A collection of functions that manipulate the mapper and its related features.
 +
 
 +
==mapSymbolFontInfo==
 +
;mapSymbolFontInfo()
 +
: See also: [[#setupMapSymbolFont|setupMapSymbolFont()]]
 +
 
 +
{{note}} pending, not yet available. See https://github.com/Mudlet/Mudlet/pull/4038
 +
 
 +
;returns
 +
* either a table of information about the configuration of the font used for symbols in the (2D) map, the elements are:
 +
:* ''fontName'' - a string of the family name of the font specified
 +
:* ''onlyUseThisFont'' - a boolean indicating whether glyphs from just the ''fontName'' font are to be used or if there is not a ''glyph'' for the required ''grapheme'' (''character'') then a ''glyph'' from the most suitable different font will be substituted instead. Should this be ''true'' and the specified font does not have the required glyph then the replacement character (typically something like ''�'') could be used instead. Note that this may not affect the use of Color Emoji glyphs that are automatically used in some OSes but that behavior does vary across the range of operating systems that Mudlet can be run on.
 +
:* ''scalingFactor'' - a floating point number between 0.50 and 2.00 which modifies the size of the symbols somewhat though the extremes are likely to be unsatisfactory because some of the particular symbols may be too small (and be less visible at smaller zoom levels) or too large (and be clipped by the edges of the room rectangle or circle).
 +
* or ''nil'' and an error message on failure.
 +
 
 +
::As the symbol font details are stored in the (binary) map file rather than the profile then this function will not work until a map is loaded (or initialized, by activating a map window).
 +
 
 +
 
 +
==setupMapSymbolFont==
 +
;setupMapSymbolFont(fontName[, onlyUseThisFont[, scalingFactor]])
 +
:configures the font used for symbols in the (2D) map.
 +
: See also: [[#mapSymbolFontInfo|mapSymbolFontInfo()]]
 +
 
 +
{{note}} pending, not yet available. See https://github.com/Mudlet/Mudlet/pull/4038
  
 
;Parameters
 
;Parameters
* ''argument1:''
+
* ''fontName'' one of:
: Type and description of this argument.
+
:* - a string that is the family name of the font to use;
* ''arguement2:''
+
:* - the empty string ''""'' to reset to the default {which is '''"Bitstream Vera Sans Mono"'''};
: Type and description of this argument..
+
:* - a Lua ''nil'' as a placeholder to not change this parameter but still allow a following one to be modified.
* ''toID:''
+
* ''onlyUseThisFont'' (optional) one of:
 +
:* - a Lua boolean ''true'' to require Mudlet to use graphemes (''character'') '''only''' from the selected font. Should a requested grapheme not be included in the selected font then the font replacement character (�) might be used instead; note that under some circumstances it is possible that the OS (or Mudlet) provided color Emoji Font may still be used but that cannot be guaranteed across all OS platforms that Mudlet might be run on;
 +
:* - a Lua boolean ''false'' to allow Mudlet to get a different ''glyph'' for a particular ''grapheme'' from the most suitable other font found in the system should there not be a ''glyph'' for it in the requested font. This is the default unless previously changed by this function or by the corresponding checkbox in the Profile Preferences dialogue for the profile concerned;
 +
:* - a Lua ''nil'' as a placeholder to not change this parameter but still allow the following one to be modified.
 +
* ''scalingFactor'' (optional): a floating point value in the range ''0.5'' to ''2.0'' (default ''1.0'') that can be used to tweak the rectangular space that each different room symbol is scaled to fit inside; this might be useful should the range of characters used to make the room symbols be consistently under- or over-sized.
 +
 
 +
;Returns
 +
* ''true'' on success
 +
* ''nil'' and an error message on failure. As the symbol font details are stored in the (binary) map file rather than the profile then this function will not work until a map is loaded (or initialised, by activating a map window).
 +
 
 +
=Miscellaneous Functions=
 +
: Miscellaneous functions.
 +
 
 +
==getCharacterName==
 +
;getCharacterName()
 +
 
 +
:Returns the name entered into the "Character name" field on the Connection Preferences form. Can be used to find out the name that might need to be handled specially in scripts or anything that needs to be personalized to the player. If there is nothing set in that entry will return an empty string.
 +
Introduced along with four other functions to enable game server log-in to be scripted with the simultaneous movement of that functionality from the Mudlet application core code to a predefined ''doLogin()'' function that may be replaced for more sophisticated requirements.
 +
 
 +
:See also: [[#sendCharacterName|sendCharacterName()]], [[#sendCharacterPassword|sendCharacterPassword()]], [[#sendCustomLoginText|sendCustomLoginText()]], [[#getCustomLoginTextId|getCustomLoginTextId()]].
 +
 
 +
{{note}} Not available yet. See https://github.com/Mudlet/Mudlet/pull/3952
 +
 
 +
;Example
 +
<syntaxhighlight lang="lua">
 +
lua send("cast 'glamor' " .. getCharacterName())
 +
 
 +
You get a warm feeling passing from your core to the tips of your hands, feet and other body parts.
 +
A small twittering bird settles on your shoulder and starts to look adoringly at you.
 +
A light brown faun gambles around you and then nuzzles your hand.
 +
A tawny long-haired cat saunters over and start to rub itself against your ankles.
 +
A small twittering bird settles on your shoulder and starts to look adoringly at you.
 +
A light brown faun gambles around you and then nuzzles your hand.
 +
A small twittering bird settles on your shoulder and starts to look adoringly at you.
 +
A mangy dog trots up to you and proceeds to mark the bottom of your leggings.
 +
</syntaxhighlight>
 +
 
 +
==getCustomLoginTextId==
 +
;getCustomLoginTextId()
 +
 
 +
Returns the Id number of the custom login text setting from the profile's preferences. Returns ''0'' if the option is disabled or a number greater than that for the item in the table; note it is possible if using an old saved profile in the future that the number might be higher than expected. As a design policy decision it is not permitted for a script to change the setting, this function is intended to allow a script or package to check that the setting is what it expects.
 +
 
 +
Introduced along with four other functions to enable game server log-in to be scripted with the simultaneous movement of that functionality from the Mudlet application core code to a predefined ''doLogin()'' function, a replacement for which is shown below.
 +
:See also: [[#getCharacterName|getCharacterName()]], [[#sendCharacterName|sendCharacterName()]], [[#sendCustomLoginText|sendCustomLoginText()]], [[#sendPassword|sendPassword()]].
 +
 
 +
{{note}} Not available yet. See https://github.com/Mudlet/Mudlet/pull/3952
 +
 
 +
Only one custom login text has been defined initially:
 +
{| class="wikitable"
 +
|+ Predefined custom login texts
 +
|-
 +
! Id !! Custom text !! Introduced in Mudlet version
 +
|-
 +
| 1 || "connect {character name} {password}" || TBD
 +
|}
  
: See also: [[#internalLinkWithNoSpacesToOtherRelatedFunction1|displayed name of related function1 with braces but no indication of arguments()]], [[#internalLinkToOtherRelatedFunction2|displayed name of related function2()]]
+
The addition of further texts would be subject to negotiation with the Mudlet Makers.
  
 
;Example
 
;Example
 
<syntaxhighlight lang="lua">
 
<syntaxhighlight lang="lua">
-- a comment explaining what is going on, if there is multiple functionalities (or optional arguments) the examples should start simple and progress in complexity if needed!
+
-- A replacement for the default function placed into LuaGlobal.lua to reproduce the previous behavior of the Mudlet application:
local something = function(argument1)
+
function doLogin()
if something then
+
  if getCustomLoginTextId() ~= 1 then
  -- do something with something (assuming there is a meaningful return value)
+
    -- We need this particular option but it is not permitted for a script to change the setting, it can only check what it is
 +
    echo("\nUnable to login - please select the 'connect {character name} {password}` custom login option in the profile preferences.\n")
 +
  else
 +
    tempTime(2.0, [[sendCustomLoginText()]], 1)
 +
  end
 
end
 
end
 
</syntaxhighlight>
 
</syntaxhighlight>
  
-- If the version when the functionality is to be introduced is know it should be given using this (assuming a major.minor.patch version number - though a major.minor format may be sufficient:
 
{{MudletVersion|0.0.1}}
 
  
=== Additional development notes ===
+
==sendCharacterName==
-- not for inclusion when item transferred to final location, could include revisions or input from others - it would be a good idea to use the ''signature with timestamp'' if commenting on other peoples stuff - i.e two hyphens '-' followed by four tildes '~'...
+
;sendCharacterName()
-->
+
 
 +
Sends the name entered into the "Character name" field on the Connection Preferences form directly to the game server. Returns ''true'' unless there is nothing set in that entry in which case a ''nil'' and an error message will be returned instead.
 +
 
 +
Introduced along with four other functions to enable game server log-in to be scripted with the simultaneous movement of that functionality from the Mudlet application core code to a predefined ''doLogin()'' function that may be replaced for more sophisticated requirements.
 +
:See also: [[#getCharacterName|getCharacterName()]], [[#sendCharacterPassword|sendCharacterPassword()]], [[#sendCustomLoginText|sendCustomLoginText()]], [[#getCustomLoginTextId|getCustomLoginTextId()]].
 +
 
 +
{{note}} Not available yet. See https://github.com/Mudlet/Mudlet/pull/3952
 +
 
 +
 
 +
==sendCharacterPassword==
 +
;sendCharacterPassword()
 +
 
 +
Sends the password entered into the "Password" field on the Connection Preferences form directly to the game server. Returns ''true'' unless there is nothing set in that entry or it is too long after (or before) a connection was successfully made in which case a ''nil'' and an error message will be returned instead.
 +
 
 +
Introduced along with four other functions to enable game server log-in to be scripted with the simultaneous movement of that functionality from the Mudlet application core code to a predefined ''doLogin()'' function, reproduced below, that may be replaced for more sophisticated requirements.
 +
:See also: [[#getCharacterName|getCharacterName()]], [[#sendCustomLoginText|sendCustomLoginText()]], [[#getCustomLoginTextId|getCustomLoginTextId()]], [[#sendCharacterName|sendCharacterName()]].
 +
 
 +
{{note}} Not available yet. See https://github.com/Mudlet/Mudlet/pull/3952
 +
 
 +
;Example
 +
<syntaxhighlight lang="lua">
 +
-- The default function placed into LuaGlobal.lua to reproduce the previous behavior of the Mudlet application:
 +
function doLogin()
 +
  if getCharacterName() ~= "" then
 +
    tempTime(2.0, [[sendCharacterName()]], 1)
 +
    tempTime(3.0, [[sendCharacterPassword()]], 1)
 +
  end
 +
end
 +
</syntaxhighlight>
 +
 
  
The following headings (under the following ''table of contents'') reflect those present in the main Wiki area of the Lua API functions, it is suggested that new entries are added so as to maintain a sorted alphabetical order under the appropriate heading.
+
==sendCustomLoginText==
 +
;sendCustomLoginText()
  
===Basic Essential Functions===
+
Sends the custom login text (which does NOT depend on the user's choice of GUI language) selected in the preferences for this profile. The {password} (and {character name} if present) fields will be replaced with the values entered into the "Password" and "Character name" fields on the Connection Preferences form and then sent directly to the game server. Returns ''true'' unless there is nothing set in either of those entries (though only if required for the character name) or it is too long after (or before) a connection was successfully made or if the custom login feature is disabled, in which case a ''nil'' and an error message will be returned instead.
:These functions are generic functions used in normal scripting. These deal with mainly everyday things, like sending stuff and echoing to the screen.
 
  
===Database Functions===
+
Introduced along with four other functions to enable game server log-in to be scripted with the simultaneous movement of that functionality from the Mudlet application core code to a predefined ''doLogin()'' function, a replacement for which is shown below.
:A collection of functions for helping deal with the database.
+
:See also: [[#getCharacterName|getCharacterName()]], [[#sendCharacterName|sendCharacterName()]], [[#sendPassword|sendPassword()]], [[#getCustomLoginTextId|getCustomLoginTextId()]].
  
===Date/Time Functions===
+
{{note}} Not available yet. See https://github.com/Mudlet/Mudlet/pull/3952
: A collection of functions for handling date & time.
 
  
===File System Functions===
+
Only one custom login text has been defined initially:
: A collection of functions for interacting with the file system.
+
{| class="wikitable"
 +
|+ Predefined custom login texts
 +
|-
 +
! Id !! Custom text !! Introduced in Mudlet version
 +
|-
 +
| 1 || "connect {character name} {password}" || TBD
 +
|}
  
===Mapper Functions===
+
The addition of further texts would be subject to negotiation with the Mudlet Makers.
: A collection of functions that manipulate the mapper and its related features.
 
  
===Miscellaneous Functions===
+
;Example
: Miscellaneous functions.
+
<syntaxhighlight lang="lua">
 +
-- A replacement for the default function placed into LuaGlobal.lua to reproduce the previous behavior of the Mudlet application:
 +
function doLogin()
 +
  if getCustomLoginTextId() ~= 1 then
 +
    -- We need this particular option but it is not permitted for a script to change the setting, it can only check what it is
 +
    echo("\nUnable to login - please select the 'connect {character name} {password}` custom login option in the profile preferences.\n")
 +
  else
 +
    tempTime(2.0, [[sendCustomLoginText()]], 1)
 +
  end
 +
end
 +
</syntaxhighlight>
  
===Scripting Object Functions===
+
=Scripting Object Functions=
: A collection of arrows that manipulate Mudlets scripting objects - triggers, aliases, and so forth.
+
: A collection of functions that manipulate Mudlets scripting objects - triggers, aliases, and so forth.
  
===Networking Functions===
+
=Networking Functions=
 
: A collection of functions for managing networking.
 
: A collection of functions for managing networking.
  
===String Functions===
+
=String Functions=
 
: These functions are used to manipulate strings.
 
: These functions are used to manipulate strings.
  
===Table Functions===
+
=Table Functions=
 
: These functions are used to manipulate tables. Through them you can add to tables, remove values, check if a value is present in the table, check the size of a table, and more.
 
: These functions are used to manipulate tables. Through them you can add to tables, remove values, check if a value is present in the table, check the size of a table, and more.
  
===Text to Speech Functions===
+
=Text to Speech Functions=
 
: These functions are used to create sound from written words. Check out our [[Special:MyLanguage/Manual:Text-to-Speech|Text-To-Speech Manual]] for more detail on how this all works together.
 
: These functions are used to create sound from written words. Check out our [[Special:MyLanguage/Manual:Text-to-Speech|Text-To-Speech Manual]] for more detail on how this all works together.
  
===UI Functions===
+
=UI Functions=
 
: These functions are used to construct custom user GUIs. They deal mainly with miniconsole/label/gauge creation and manipulation as well as displaying or formatting information on the screen.
 
: These functions are used to construct custom user GUIs. They deal mainly with miniconsole/label/gauge creation and manipulation as well as displaying or formatting information on the screen.

Revision as of 04:04, 22 September 2021

This page is for the development of documentation for Lua API functions that are currently being worked on. Ideally the entries here can be created in the same format as will be eventually used in Lua Functions and its sub-sites.

Please use the Area_51/Template to add new entries in the sections below.

The following headings reflect those present in the main Wiki area of the Lua API functions. It is suggested that new entries are added so as to maintain a sorted alphabetical order under the appropriate heading.


Basic Essential Functions

These functions are generic functions used in normal scripting. These deal with mainly everyday things, like sending stuff and echoing to the screen.

Database Functions

A collection of functions for helping deal with the database.

Date/Time Functions

A collection of functions for handling date & time.

File System Functions

A collection of functions for interacting with the file system.

Mapper Functions

A collection of functions that manipulate the mapper and its related features.

mapSymbolFontInfo

mapSymbolFontInfo()
See also: setupMapSymbolFont()

Note Note: pending, not yet available. See https://github.com/Mudlet/Mudlet/pull/4038

returns
  • either a table of information about the configuration of the font used for symbols in the (2D) map, the elements are:
  • fontName - a string of the family name of the font specified
  • onlyUseThisFont - a boolean indicating whether glyphs from just the fontName font are to be used or if there is not a glyph for the required grapheme (character) then a glyph from the most suitable different font will be substituted instead. Should this be true and the specified font does not have the required glyph then the replacement character (typically something like ) could be used instead. Note that this may not affect the use of Color Emoji glyphs that are automatically used in some OSes but that behavior does vary across the range of operating systems that Mudlet can be run on.
  • scalingFactor - a floating point number between 0.50 and 2.00 which modifies the size of the symbols somewhat though the extremes are likely to be unsatisfactory because some of the particular symbols may be too small (and be less visible at smaller zoom levels) or too large (and be clipped by the edges of the room rectangle or circle).
  • or nil and an error message on failure.
As the symbol font details are stored in the (binary) map file rather than the profile then this function will not work until a map is loaded (or initialized, by activating a map window).


setupMapSymbolFont

setupMapSymbolFont(fontName[, onlyUseThisFont[, scalingFactor]])
configures the font used for symbols in the (2D) map.
See also: mapSymbolFontInfo()

Note Note: pending, not yet available. See https://github.com/Mudlet/Mudlet/pull/4038

Parameters
  • fontName one of:
  • - a string that is the family name of the font to use;
  • - the empty string "" to reset to the default {which is "Bitstream Vera Sans Mono"};
  • - a Lua nil as a placeholder to not change this parameter but still allow a following one to be modified.
  • onlyUseThisFont (optional) one of:
  • - a Lua boolean true to require Mudlet to use graphemes (character) only from the selected font. Should a requested grapheme not be included in the selected font then the font replacement character (�) might be used instead; note that under some circumstances it is possible that the OS (or Mudlet) provided color Emoji Font may still be used but that cannot be guaranteed across all OS platforms that Mudlet might be run on;
  • - a Lua boolean false to allow Mudlet to get a different glyph for a particular grapheme from the most suitable other font found in the system should there not be a glyph for it in the requested font. This is the default unless previously changed by this function or by the corresponding checkbox in the Profile Preferences dialogue for the profile concerned;
  • - a Lua nil as a placeholder to not change this parameter but still allow the following one to be modified.
  • scalingFactor (optional): a floating point value in the range 0.5 to 2.0 (default 1.0) that can be used to tweak the rectangular space that each different room symbol is scaled to fit inside; this might be useful should the range of characters used to make the room symbols be consistently under- or over-sized.
Returns
  • true on success
  • nil and an error message on failure. As the symbol font details are stored in the (binary) map file rather than the profile then this function will not work until a map is loaded (or initialised, by activating a map window).

Miscellaneous Functions

Miscellaneous functions.

getCharacterName

getCharacterName()
Returns the name entered into the "Character name" field on the Connection Preferences form. Can be used to find out the name that might need to be handled specially in scripts or anything that needs to be personalized to the player. If there is nothing set in that entry will return an empty string.

Introduced along with four other functions to enable game server log-in to be scripted with the simultaneous movement of that functionality from the Mudlet application core code to a predefined doLogin() function that may be replaced for more sophisticated requirements.

See also: sendCharacterName(), sendCharacterPassword(), sendCustomLoginText(), getCustomLoginTextId().

Note Note: Not available yet. See https://github.com/Mudlet/Mudlet/pull/3952

Example
lua send("cast 'glamor' " .. getCharacterName())

You get a warm feeling passing from your core to the tips of your hands, feet and other body parts.
A small twittering bird settles on your shoulder and starts to look adoringly at you.
A light brown faun gambles around you and then nuzzles your hand.
A tawny long-haired cat saunters over and start to rub itself against your ankles.
A small twittering bird settles on your shoulder and starts to look adoringly at you.
A light brown faun gambles around you and then nuzzles your hand.
A small twittering bird settles on your shoulder and starts to look adoringly at you.
A mangy dog trots up to you and proceeds to mark the bottom of your leggings.

getCustomLoginTextId

getCustomLoginTextId()

Returns the Id number of the custom login text setting from the profile's preferences. Returns 0 if the option is disabled or a number greater than that for the item in the table; note it is possible if using an old saved profile in the future that the number might be higher than expected. As a design policy decision it is not permitted for a script to change the setting, this function is intended to allow a script or package to check that the setting is what it expects.

Introduced along with four other functions to enable game server log-in to be scripted with the simultaneous movement of that functionality from the Mudlet application core code to a predefined doLogin() function, a replacement for which is shown below.

See also: getCharacterName(), sendCharacterName(), sendCustomLoginText(), sendPassword().

Note Note: Not available yet. See https://github.com/Mudlet/Mudlet/pull/3952

Only one custom login text has been defined initially:

Predefined custom login texts
Id Custom text Introduced in Mudlet version
1 "connect {character name} {password}" TBD

The addition of further texts would be subject to negotiation with the Mudlet Makers.

Example
-- A replacement for the default function placed into LuaGlobal.lua to reproduce the previous behavior of the Mudlet application:
function doLogin()
  if getCustomLoginTextId() ~= 1 then
    -- We need this particular option but it is not permitted for a script to change the setting, it can only check what it is
    echo("\nUnable to login - please select the 'connect {character name} {password}` custom login option in the profile preferences.\n")
  else
    tempTime(2.0, [[sendCustomLoginText()]], 1)
  end
end


sendCharacterName

sendCharacterName()

Sends the name entered into the "Character name" field on the Connection Preferences form directly to the game server. Returns true unless there is nothing set in that entry in which case a nil and an error message will be returned instead.

Introduced along with four other functions to enable game server log-in to be scripted with the simultaneous movement of that functionality from the Mudlet application core code to a predefined doLogin() function that may be replaced for more sophisticated requirements.

See also: getCharacterName(), sendCharacterPassword(), sendCustomLoginText(), getCustomLoginTextId().

Note Note: Not available yet. See https://github.com/Mudlet/Mudlet/pull/3952


sendCharacterPassword

sendCharacterPassword()

Sends the password entered into the "Password" field on the Connection Preferences form directly to the game server. Returns true unless there is nothing set in that entry or it is too long after (or before) a connection was successfully made in which case a nil and an error message will be returned instead.

Introduced along with four other functions to enable game server log-in to be scripted with the simultaneous movement of that functionality from the Mudlet application core code to a predefined doLogin() function, reproduced below, that may be replaced for more sophisticated requirements.

See also: getCharacterName(), sendCustomLoginText(), getCustomLoginTextId(), sendCharacterName().

Note Note: Not available yet. See https://github.com/Mudlet/Mudlet/pull/3952

Example
-- The default function placed into LuaGlobal.lua to reproduce the previous behavior of the Mudlet application:
function doLogin()
  if getCharacterName() ~= "" then
    tempTime(2.0, [[sendCharacterName()]], 1)
    tempTime(3.0, [[sendCharacterPassword()]], 1)
  end
end


sendCustomLoginText

sendCustomLoginText()

Sends the custom login text (which does NOT depend on the user's choice of GUI language) selected in the preferences for this profile. The {password} (and {character name} if present) fields will be replaced with the values entered into the "Password" and "Character name" fields on the Connection Preferences form and then sent directly to the game server. Returns true unless there is nothing set in either of those entries (though only if required for the character name) or it is too long after (or before) a connection was successfully made or if the custom login feature is disabled, in which case a nil and an error message will be returned instead.

Introduced along with four other functions to enable game server log-in to be scripted with the simultaneous movement of that functionality from the Mudlet application core code to a predefined doLogin() function, a replacement for which is shown below.

See also: getCharacterName(), sendCharacterName(), sendPassword(), getCustomLoginTextId().

Note Note: Not available yet. See https://github.com/Mudlet/Mudlet/pull/3952

Only one custom login text has been defined initially:

Predefined custom login texts
Id Custom text Introduced in Mudlet version
1 "connect {character name} {password}" TBD

The addition of further texts would be subject to negotiation with the Mudlet Makers.

Example
-- A replacement for the default function placed into LuaGlobal.lua to reproduce the previous behavior of the Mudlet application:
function doLogin()
  if getCustomLoginTextId() ~= 1 then
    -- We need this particular option but it is not permitted for a script to change the setting, it can only check what it is
    echo("\nUnable to login - please select the 'connect {character name} {password}` custom login option in the profile preferences.\n")
  else
    tempTime(2.0, [[sendCustomLoginText()]], 1)
  end
end

Scripting Object Functions

A collection of functions that manipulate Mudlets scripting objects - triggers, aliases, and so forth.

Networking Functions

A collection of functions for managing networking.

String Functions

These functions are used to manipulate strings.

Table Functions

These functions are used to manipulate tables. Through them you can add to tables, remove values, check if a value is present in the table, check the size of a table, and more.

Text to Speech Functions

These functions are used to create sound from written words. Check out our Text-To-Speech Manual for more detail on how this all works together.

UI Functions

These functions are used to construct custom user GUIs. They deal mainly with miniconsole/label/gauge creation and manipulation as well as displaying or formatting information on the screen.