help
What the help gump needs from the server: the wait and the pause of the I am stuck button, the starting city nearest to a character, and the queue of the requests for the game masters (create, list, take, answer, close). The module does not check who calls it: a script that is for the staff checks world.is_staff first.
Source: src/Moongate.Server.Ultima/Modules/HelpModule.cs
Functions
Section titled “Functions”answer
Section titled “answer”help.answer(id, staff, text) -> booleanAnswers the request in the name of the game master and closes it: the player reads the answer at once, or at its next login when it is offline (cut at 128 characters). False for an unknown or closed request, an empty answer, and a staff not in the world.
| Parameter | Type | Default |
|---|---|---|
id | integer | |
staff | integer | |
text | string |
Returns boolean.
can_page
Section titled “can_page”help.can_page(player) -> tableWhether the player may ask for a game master now, as { ok } when it may, or { ok = false, reason, seconds } when it may not: reason is open (it has a request open or taken) or wait (it asked too soon; seconds is how long to wait), and reason is gone for a player not in the world.
| Parameter | Type | Default |
|---|---|---|
player | integer |
Returns table.
help.close(id, staff) -> booleanCloses the request with no answer, in the name of the game master. False for an unknown or closed request and for a staff not in the world.
| Parameter | Type | Default |
|---|---|---|
id | integer | |
staff | integer |
Returns boolean.
create_page
Section titled “create_page”help.create_page(player, kind, text) -> tableMakes a request for the game masters in the name of the player, of a HelpPageKindType and with a line of text (cut at 128 characters), and tells the game masters in the world. It gives { id } with the number of the request, or { reason, seconds } when none was made: reason is open (the player has a request open or taken), wait (it asked too soon; seconds is how long to wait), text (the text is empty or the kind is none of the four) or gone (the player is not in the world).
| Parameter | Type | Default |
|---|---|---|
player | integer | |
kind | number | |
text | string |
Returns table.
nearest_city
Section titled “nearest_city”help.nearest_city(serial) -> table?The starting city of data/starting_cities.toml nearest to the character, on the map it stands on, as { town, x, y, z, map } (map is the MapType number, for mobile.teleport). When no city is on that map it is the first city of the file. Nil when the mobile is not in the world or the file has no city.
| Parameter | Type | Default |
|---|---|---|
serial | integer |
Returns table?.
help.page(id) -> table?One request for the game masters by its number, in the shape of help.pages, closed ones included; nil when there is none.
| Parameter | Type | Default |
|---|---|---|
id | integer |
Returns table?.
help.pages() -> tableThe requests for the game masters that are open or taken, the oldest first, as an array of { id, player, name, account, kind, status, text, taken_by, answer, age_seconds, map, x, y, z, online }: kind is a HelpPageKindType, status a HelpPageStatusType, map the MapType number where the player asked, online whether the player is in the world.
Returns table.
settings
Section titled “settings”help.settings() -> tableThe settings of ultima.help as { wait_seconds, cooldown_minutes }: the seconds a character must stand still before I am stuck moves it, and the minutes before it can ask again (0 for no pause).
Returns table.
help.take(id, staff) -> booleanMarks the request as taken by the game master, whose name it keeps; a request taken by another can be taken over. False for an unknown or closed request, and for a staff not in the world.
| Parameter | Type | Default |
|---|---|---|
id | integer | |
staff | integer |
Returns boolean.
waiting
Section titled “waiting”help.waiting() -> integerHow many requests for the game masters are open or taken.
Returns integer.
Made with ❤️ by Tom
