Skip to content

Commit 1cbe7d4

Browse files
committed
Bundle @lua and @help like @chan
Instead of an explosion of similarly named commands, we'll bundle these topical management commands together as switches.
1 parent 696658d commit 1cbe7d4

22 files changed

Lines changed: 340 additions & 63 deletions

File tree

docs/content/en/docs/concepts/help-system.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,13 +70,13 @@ minimal plain-text format, not a general Markdown-to-ANSI renderer.
7070

7171
## Reindexing
7272

73-
`@helpreload` (Wizard-only) rebuilds the entire index from scratch - this is
73+
`@help/reload` (Wizard-only) rebuilds the entire index from scratch - this is
7474
also what happens once at server startup. Both paths log errors and a
75-
summary to the server log; `@helpreload` also reports them to the invoking
75+
summary to the server log; `@help/reload` also reports them to the invoking
7676
player. Frontmatter is parsed with a vendored `tomlc17`.
7777

7878
## Configuration
7979

8080
The `help_directory` mudconf directive (God-settable) points at the article
8181
root, relative to the server's working directory. Changing it does not
82-
reindex automatically - run `@helpreload` afterward.
82+
reindex automatically - run `@help/reload` afterward.

docs/content/en/docs/scripting/flows.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ Only string and number values round-trip; anything else assigned to
115115
`ctx.flow` (a table, a function, a boolean) is dropped with a logged warning.
116116
This is a deliberate trade-off: `ctx.flow` is backed by a small store of plain
117117
values on the descriptor, not a reference into the Lua state, specifically so
118-
a flow survives `@luareload` rebuilding the entire state out from under it. A
118+
a flow survives `@lua/reload` rebuilding the entire state out from under it. A
119119
step that no longer exists after a reload still fails the same way any other
120120
removed API would.
121121

docs/content/en/docs/scripting/global-commands.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ weight: 20
77

88
Global Lua logic modules live under `game/lua/global_logic`. Every
99
`.lua` file in that tree is discovered recursively during startup and
10-
`@luareload`. Files are loaded in lexical relative-path order, so use
10+
`@lua/reload`. Files are loaded in lexical relative-path order, so use
1111
domain-oriented paths such as `player/help.lua`, `world/travel.lua`, and
1212
`wizard/maintenance.lua`. Use numeric prefixes only when deliberate
1313
cross-domain priority is necessary.
14-
Use [`@luacheck`](validating-and-reloading/) to validate every Lua module before reloading.
14+
Use [`@lua/check`](validating-and-reloading/) to validate every Lua module before reloading.
1515

1616
Each global module returns a table containing `commands`:
1717

docs/content/en/docs/scripting/overview.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ LuaJIT modules live under `game/lua` in three separate roots:
99

1010
```text
1111
lua/
12-
object_logic/ # @luaparent modules and their private helpers
12+
object_logic/ # @lua/parent modules and their private helpers
1313
global_logic/ # globally matched command and scheduled modules
1414
packages/ # shared require-only helpers
1515
```
1616

1717
## Object and global logic
1818

19-
Attach a module to an object with the wizard-only `@luaparent
19+
Attach a module to an object with the wizard-only `@lua/parent
2020
<object>=<path>.lua`; the path is relative to `object_logic`, and omitting it
2121
clears the attachment. The closest attachment in the object's ordinary MUX
2222
parent chain is active. See [Object scripting](scripting-objects/) for the
@@ -49,7 +49,7 @@ five-field UTC cron expressions. Object schedules run once for every object
4949
that effectively inherits the Lua parent; global schedules run once per
5050
matching module entry. Scheduled jobs receive deterministic jitter and do not
5151
replay missed minutes. Inspect active schedules with the wizard-only
52-
`@luaschedule` command.
52+
`@lua/schedule` command.
5353

5454
## Imports
5555

@@ -75,8 +75,8 @@ callback has an instruction cap.
7575

7676
## Validating and reloading
7777

78-
Use the wizard-only `@luacheck` to verify every module before putting
79-
changes into service, then `@luareload` to atomically rebuild the Lua state
78+
Use the wizard-only `@lua/check` to verify every module before putting
79+
changes into service, then `@lua/reload` to atomically rebuild the Lua state
8080
from every attached module, every global logic module, and their
8181
dependencies. If a file or dependency fails to load, the current state
8282
remains active. See [Validating and reloading](validating-and-reloading/).
@@ -88,8 +88,8 @@ it to an object, then enter `hello` while that object is in the normal
8888
command-match scope:
8989

9090
```text
91-
@luaparent #123=example.lua
92-
@luareload
91+
@lua/parent #123=example.lua
92+
@lua/reload
9393
```
9494

9595
`game/lua/object_logic/counter.lua` demonstrates durable state. Its `count`
@@ -100,8 +100,8 @@ survives Lua reloads and server restarts.
100100
replacement:
101101

102102
```text
103-
@luaparent #456=events/enter_notice.lua
104-
@luareload
103+
@lua/parent #456=events/enter_notice.lua
104+
@lua/reload
105105
```
106106

107107
Its `aenter` function runs whenever the existing action-attribute path would

docs/content/en/docs/scripting/packages/mux.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ mux.attr_set(ctx.object, "LuaCount", "42")
3333
```
3434

3535
`object` must be a valid dbref. Lua cannot use this function to set
36-
`Luaparent`; use the wizard-only `@luaparent` command instead.
36+
`Luaparent`; use the wizard-only `@lua/parent` command instead.
3737

3838
## `mux.notify(object, message)`
3939

docs/content/en/docs/scripting/scripting-objects.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,27 +9,27 @@ Object Lua modules live under `game/lua/object_logic`. Attach one to an
99
object with the wizard-only command:
1010

1111
```text
12-
@luaparent <object>=<path>.lua
12+
@lua/parent <object>=<path>.lua
1313
```
1414

1515
The path is relative to `object_logic`; for example,
16-
`@luaparent #123=hello.lua` selects
16+
`@lua/parent #123=hello.lua` selects
1717
`game/lua/object_logic/hello.lua`. Paths must be relative `.lua` files and
1818
cannot escape into `global_logic` or `packages`. Omit the path to clear an
1919
attachment.
2020

2121
The closest `Luaparent` in an object's normal MUX parent chain supplies the
2222
active module. Reload all attached modules and their dependencies atomically
23-
with `@luareload`; a failed reload leaves the current Lua state running.
24-
Use [`@luacheck`](validating-and-reloading/) to validate every Lua module
23+
with `@lua/reload`; a failed reload leaves the current Lua state running.
24+
Use [`@lua/check`](validating-and-reloading/) to validate every Lua module
2525
before reloading.
2626

2727
If an attached file is deleted or otherwise cannot load, startup logs the
2828
object, configured path, and load error but continues. The attachment remains
2929
in place; command matching and action events for that object log the load error
3030
and are treated as handled, so legacy softcode does not run unexpectedly.
31-
Restore the file or update `Luaparent`, then use `@luareload` to activate the
32-
repair. `@luareload` itself remains atomic and rejects a missing attachment.
31+
Restore the file or update `Luaparent`, then use `@lua/reload` to activate the
32+
repair. `@lua/reload` itself remains atomic and rejects a missing attachment.
3333

3434
## Module contract
3535

@@ -140,5 +140,5 @@ schedules = {
140140
```
141141

142142
A shared `Luaparent` runs each matching schedule once for every object that
143-
inherits it. Use the wizard-only `@luaschedule` command to inspect active
143+
inherits it. Use the wizard-only `@lua/schedule` command to inspect active
144144
schedules and their effective objects.

docs/content/en/docs/scripting/validating-and-reloading.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ You can validate and reload your game's Lua files from within the game without a
1212
To check your Lua scripts for validity, run the following from in-game with a Wizard character:
1313

1414
```text
15-
@luacheck
15+
@lua/check
1616
```
1717

18-
`@luacheck` recursively verifies every `.lua` file below
18+
`@lua/check` recursively verifies every `.lua` file below
1919
`game/lua/object_logic`, `game/lua/global_logic`, and
2020
`game/lua/packages`. It checks module syntax, top-level imports, and the
2121
module return contract, including cron schedules. Global logic modules must
@@ -31,12 +31,12 @@ move any `mux` calls into a handler or event function before checking it.
3131

3232
## Reloading Lua at runtime
3333

34-
Use `@luareload` after a successful check to atomically put changed attached
34+
Use `@lua/reload` after a successful check to atomically put changed attached
3535
and global logic modules into service.
3636

3737
## Inspecting schedules
3838

39-
Wizards can use `@luaschedule` to list scheduled object modules with their
39+
Wizards can use `@lua/schedule` to list scheduled object modules with their
4040
effective-object counts and scheduled global logic modules. Pass an object to
4141
show its effective Lua parent, a relative `object_logic` path to show its
4242
schedules and inheriting objects, or `global_logic/<path>.lua` to inspect one

game/help/wizard_commands/help.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
+++
2+
title = "@help"
3+
description = "Administer the help index"
4+
keywords = ["@help", "help administration"]
5+
article_tags = ["wizard_commands"]
6+
wizard_only = true
7+
8+
show_index_for_article_tags = ["help_switches"]
9+
index_style = "list_with_description"
10+
+++
11+
12+
# @help
13+
14+
`@help` groups the Wizard-only help administration commands under one command.
15+
Type `@help` by itself to see a short list of switches, or use one of the forms
16+
indexed below.
17+
18+
The public `help [topic]` command continues to display help articles.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
+++
2+
title = "@help/reload"
3+
description = "Rebuild the help index"
4+
keywords = ["@help/reload"]
5+
article_tags = ["help_switches"]
6+
weight = 10
7+
wizard_only = true
8+
+++
9+
10+
# @help/reload
11+
12+
Rebuild the complete help index from the configured help directory:
13+
14+
```text
15+
@help/reload
16+
```
17+
18+
This performs the same indexing operation used during server startup. Errors,
19+
duplicate-keyword warnings, and the indexing summary are written to the server
20+
log and reported to the invoking Wizard.

game/help/wizard_commands/lua.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
+++
2+
title = "@lua"
3+
description = "Administer the Lua scripting runtime"
4+
keywords = ["@lua", "lua administration"]
5+
article_tags = ["wizard_commands"]
6+
wizard_only = true
7+
8+
show_index_for_article_tags = ["lua_switches"]
9+
index_style = "list_with_description"
10+
+++
11+
12+
# @lua
13+
14+
`@lua` groups the Wizard-only Lua administration commands under one command.
15+
Type `@lua` by itself to see a short list of switches, or use one of the forms
16+
indexed below.

0 commit comments

Comments
 (0)