-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathsample.js
52 lines (46 loc) · 1.37 KB
/
sample.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// This example script has no copyright and may be used freely by anyone.
try {
const rtfm = require("rtfm/library");
/* Lone pages, good for small mods */
// Page is stored in manuals/Epic file page
rtfm.addPage("Epic file page");
rtfm.addPage("How to play [coral]mindustry", [
"# Steps",
"1. stop chaining routers",
"2. done"
]);
/* Sections for bigger mods.
Files have content as null.
Sections have content as an object, not an array. */
rtfm.addSection("OP Walls", {
"$op-walls.epic-bundle": [
"# Bundle page",
"This page is [coral]sick[] and uses a bundle in its title.",
],
"Page 2 from a file": null
});
/* Custom elements with the default builder.
Cannot be done with a file.
Needs to be run when client loads as
Label constructor needs Core.scene */
rtfm.addPage("hack zone", [
"You are now hack",
() => new Label(prov(() => Mathf.random(0, 10) + ""))
]);
/* Entirely custom page! */
rtfm.addPage("s p a c e", {
build(page) {
page.table.table(t => {
t.button("[yellow]egg", Icon.trash, () => {
print("Execute router 66");
}).center().size(500, 40);
}).size(4000);
}
});
// Still here? Check out RTFM Docs / API or scripts/library.js and get your hands real dirty.
} catch (e) {
if (!Vars.headless) {
// Message here
Log.warn("Please install [#00aaff]DeltaNedas/rtfm[] to view OP Walls's manual pages.");
}
}