├── .prettierrc ├── static ├── .nojekyll ├── favicon.ico └── images │ └── marks_protocol_example.png ├── .devcontainer ├── env-setup.sh └── devcontainer.json ├── .vscode ├── extensions.json └── settings.json ├── docs ├── concepts │ ├── resources │ │ ├── .gc.mdx │ │ ├── .bits.mdx │ │ ├── .qubits.mdx │ │ └── .upgrades.mdx │ ├── resources.mdx │ └── systems │ │ └── priv_store.mdx ├── create_a_page.mdx ├── upgrades │ ├── architect │ │ ├── script_slot_v1.mdx │ │ ├── public_script_v1.mdx │ │ ├── script_slot_v2.mdx │ │ ├── public_script_v2.mdx │ │ ├── char_count_v1.mdx │ │ ├── char_count_v2.mdx │ │ ├── cron_bot_v2.mdx │ │ └── cron_bot_v1.mdx │ ├── locks │ │ ├── w4rn_er.mdx │ │ ├── w4rn.mdx │ │ ├── CON_TELL.mdx │ │ ├── ez_21.mdx │ │ ├── magnara.mdx │ │ ├── l0ckbox.mdx │ │ ├── l0cket.mdx │ │ ├── c001.mdx │ │ ├── ez_40.mdx │ │ ├── CON_SPEC.mdx │ │ ├── ez_35.mdx │ │ └── sn_w_glock.mdx │ ├── other │ │ └── w4rn_message.mdx │ ├── infiltrator │ │ ├── k3y_v2.mdx │ │ ├── k3y_v1.mdx │ │ ├── log_writer_v1.mdx │ │ ├── log_writer_v2.mdx │ │ ├── expose_access_log_v1.mdx │ │ └── expose_access_log_v2.mdx │ └── executive │ │ ├── channel_count_v1.mdx │ │ └── channel_count_v2.mdx ├── scripting │ ├── scripts.lib │ │ ├── one_day_ms.mdx │ │ ├── corruptions.mdx │ │ ├── date.mdx │ │ ├── get_date.mdx │ │ ├── security_level_names.mdx │ │ ├── get_date_utcsecs.mdx │ │ ├── is_def.mdx │ │ ├── is_int.mdx │ │ ├── is_num.mdx │ │ ├── hash_code.mdx │ │ ├── is_str.mdx │ │ ├── is_obj.mdx │ │ ├── ok.mdx │ │ ├── is_arr.mdx │ │ ├── is_neg.mdx │ │ ├── num_sort_asc.mdx │ │ ├── is_valid_name.mdx │ │ ├── num_sort_desc.mdx │ │ ├── get_log.mdx │ │ ├── is_bool.mdx │ │ ├── is_func.mdx │ │ ├── shuffle.mdx │ │ ├── sample.mdx │ │ ├── LCG.mdx │ │ ├── not_impl.mdx │ │ ├── JSF.mdx │ │ ├── to_gc_str.mdx │ │ ├── colors.mdx │ │ ├── corruption_chars.mdx │ │ ├── mulberry32.mdx │ │ ├── get_values.mdx │ │ ├── id_to_str.mdx │ │ ├── log.mdx │ │ ├── caller_is_owner.mdx │ │ ├── add_time.mdx │ │ ├── get_security_level_name.mdx │ │ ├── sort_asc.mdx │ │ ├── sort_desc.mdx │ │ ├── utc_days_ago_str.mdx │ │ ├── get_user_from_script.mdx │ │ ├── can_continue_execution.mdx │ │ ├── utc_day_diff.mdx │ │ ├── cap_str_len.mdx │ │ ├── create_rand_string.mdx │ │ ├── dump.mdx │ │ ├── get_scriptname_from_script.mdx │ │ ├── to_game_timestr.mdx │ │ ├── u_sort_num_array_desc.mdx │ │ ├── merge.mdx │ │ ├── side_by_side.mdx │ │ ├── clone.mdx │ │ ├── columnize.mdx │ │ ├── clamp.mdx │ │ ├── max_val_index.mdx │ │ ├── uniq.mdx │ │ ├── count.mdx │ │ ├── is_not_today.mdx │ │ ├── map.mdx │ │ ├── rjust.mdx │ │ ├── sfc32.mdx │ │ ├── to_gc_num.mdx │ │ ├── each.mdx │ │ ├── xoshiro128ss.mdx │ │ ├── corrupt.mdx │ │ ├── dbir_result_failed.mdx │ │ ├── dbu_result_failed.mdx │ │ ├── select_one.mdx │ │ ├── lerp.mdx │ │ ├── select.mdx │ │ ├── is_script.mdx │ │ ├── pick.mdx │ │ ├── are_ids_eq.mdx │ │ ├── rand_int.mdx │ │ ├── xmur3.mdx │ │ └── can_continue_execution_error.mdx │ ├── trust_scripts │ │ ├── trust.me.mdx │ │ ├── sys.loc.mdx │ │ ├── autos.reset.mdx │ │ ├── users.active.mdx │ │ ├── chats.channels.mdx │ │ ├── accts.balance.mdx │ │ ├── corps.hire.mdx │ │ ├── sys.status.mdx │ │ ├── corps.quit.mdx │ │ ├── market.stats.mdx │ │ ├── chats.join.mdx │ │ ├── chats.leave.mdx │ │ ├── accts.balance_of_owner.mdx │ │ ├── gui.vol.mdx │ │ ├── scripts.user.mdx │ │ ├── gui.size.mdx │ │ ├── scripts.get_level.mdx │ │ ├── marks.available.mdx │ │ ├── marks.sync.mdx │ │ ├── users.last_action.mdx │ │ ├── chats.active.mdx │ │ ├── corps.create.mdx │ │ ├── chats.tell.mdx │ │ ├── chats.users.mdx │ │ ├── escrow.stats.mdx │ │ ├── scripts.sys.mdx │ │ ├── corps.manage.mdx │ │ ├── kernel.hardline.mdx │ │ ├── sys.breach.mdx │ │ ├── scripts.quine.mdx │ │ ├── chats.send.mdx │ │ ├── gui.chats.mdx │ │ ├── chats.create.mdx │ │ ├── sys.cull.mdx │ │ ├── sys.manage.mdx │ │ ├── escrow.confirm.mdx │ │ ├── scripts.midsec.mdx │ │ ├── scripts.lowsec.mdx │ │ ├── scripts.fullsec.mdx │ │ ├── scripts.highsec.mdx │ │ ├── scripts.get_access_level.mdx │ │ ├── scripts.nullsec.mdx │ │ ├── corps.offers.mdx │ │ ├── sys.specs.mdx │ │ ├── marks.protocol.mdx │ │ ├── gui.vfx.mdx │ │ ├── accts.xfer_gc_to_caller.mdx │ │ ├── sys.init.mdx │ │ ├── gui.quiet.mdx │ │ ├── market.buy.mdx │ │ ├── sys.xfer_upgrade_to_caller.mdx │ │ ├── accts.xfer_gc_to.mdx │ │ ├── sys.xfer_upgrade_to.mdx │ │ ├── sys.upgrades_of_owner.mdx │ │ ├── sys.upgrade_log.mdx │ │ └── market.sell.mdx │ ├── extensions │ │ ├── start.mdx │ │ ├── run_id.mdx │ │ ├── end.mdx │ │ ├── json.mdx │ │ ├── timeout.mdx │ │ ├── deep_freeze.mdx │ │ ├── g.mdx │ │ ├── d.mdx │ │ ├── fmcl.mdx │ │ └── script_call.mdx │ ├── trust_scripts.mdx │ ├── syntax │ │ ├── simple_input.mdx │ │ └── return_object.mdx │ └── db │ │ ├── db.objectid.mdx │ │ └── db.r.mdx ├── autocolor_demo.mdx ├── guides │ ├── misc │ │ ├── autoretirement.mdx │ │ └── supporter_benefits.mdx │ ├── advanced │ │ └── launch-options.mdx │ └── new_players │ │ └── chat_window_tips.mdx ├── index.mdx └── lore │ └── characters │ └── robovac_catesby.mdx ├── assets ├── whiterabbit-webfont.ttf ├── whiterabbit-webfont.woff └── whiterabbit-webfont.woff2 ├── .prettierignore ├── .gitignore ├── jest.config.js ├── CODEOWNERS ├── src ├── plugins │ └── pluginContentDocsWrapper.test.ts ├── components │ └── NavbarItem │ │ └── AccessibilityOptions.js └── theme │ └── NavbarItem │ └── ComponentTypes.js ├── templates ├── biography.mdx ├── upgrade.mdx ├── documentation.mdx ├── event.mdx └── lock.mdx ├── tsconfig.json ├── CONTRIBUTING.md ├── package.json └── .github └── workflows ├── push-deploy.yml └── pr-checks.yml /.prettierrc: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /static/.nojekyll: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.devcontainer/env-setup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -eux 3 | 4 | pnpm install 5 | -------------------------------------------------------------------------------- /static/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/comcode-org/hackmud_wiki/HEAD/static/favicon.ico -------------------------------------------------------------------------------- /.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": ["esbenp.prettier-vscode", "unifiedjs.vscode-mdx"] 3 | } 4 | -------------------------------------------------------------------------------- /docs/concepts/resources/.gc.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: gc 3 | description: "page description" 4 | unlisted: true 5 | --- 6 | -------------------------------------------------------------------------------- /assets/whiterabbit-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/comcode-org/hackmud_wiki/HEAD/assets/whiterabbit-webfont.ttf -------------------------------------------------------------------------------- /assets/whiterabbit-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/comcode-org/hackmud_wiki/HEAD/assets/whiterabbit-webfont.woff -------------------------------------------------------------------------------- /docs/concepts/resources/.bits.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: bits 3 | description: "page description" 4 | unlisted: true 5 | --- 6 | -------------------------------------------------------------------------------- /assets/whiterabbit-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/comcode-org/hackmud_wiki/HEAD/assets/whiterabbit-webfont.woff2 -------------------------------------------------------------------------------- /docs/concepts/resources/.qubits.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: qubits 3 | description: "page description" 4 | unlisted: true 5 | --- 6 | -------------------------------------------------------------------------------- /docs/concepts/resources/.upgrades.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: upgrades 3 | description: "page description" 4 | unlisted: true 5 | --- 6 | -------------------------------------------------------------------------------- /static/images/marks_protocol_example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/comcode-org/hackmud_wiki/HEAD/static/images/marks_protocol_example.png -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | # Production 2 | /build 3 | 4 | # Generated files 5 | .docusaurus 6 | .cache-loader 7 | 8 | # Lockfile 9 | pnpm-lock.yaml 10 | -------------------------------------------------------------------------------- /docs/create_a_page.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Create a Page 3 | unlisted: true 4 | --- 5 | 6 | Create a page [here](https://github.com/comcode-org/hackmud_wiki). 7 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Dependencies 2 | /node_modules 3 | 4 | # Production 5 | /build 6 | 7 | # Generated files 8 | .docusaurus 9 | .cache-loader 10 | 11 | # Jest Coverage Report 12 | /coverage 13 | -------------------------------------------------------------------------------- /docs/concepts/resources.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Resources" 3 | --- 4 | 5 | There are various resources in hackmud, which the pages in this section will describe. 6 | 7 | This section is currently under active development, hence the lack of pages. 8 | -------------------------------------------------------------------------------- /jest.config.js: -------------------------------------------------------------------------------- 1 | /** @type {import('ts-jest').JestConfigWithTsJest} */ 2 | module.exports = { 3 | preset: "ts-jest/presets/js-with-ts-esm", 4 | testEnvironment: "node", 5 | // tests must be within /src, with .spec or .test before file extension 6 | testMatch: ["/src/**/*(*.)+(spec|test).{[jt]s?(x),mjs}"], 7 | }; 8 | -------------------------------------------------------------------------------- /CODEOWNERS: -------------------------------------------------------------------------------- 1 | # protected files and paths need to be added to this section as they are created 2 | .devcontainer @comcode-org/reviewers 3 | .github @comcode-org/reviewers 4 | CODEOWNERS @comcode-org/reviewers 5 | LICENSE @comcode-org/reviewers 6 | pnpm-lock.yaml @comcode-org/reviewers 7 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "editor.formatOnSave": true, 3 | "files.insertFinalNewline": true, 4 | "editor.renderFinalNewline": "dimmed", 5 | "editor.defaultFormatter": "esbenp.prettier-vscode", 6 | "files.autoSave": "off", 7 | "editor.insertSpaces": true, 8 | "editor.tabSize": 2, 9 | "mdx.server.enable": false 10 | } 11 | -------------------------------------------------------------------------------- /docs/upgrades/architect/script_slot_v1.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: script_slot_v1 3 | --- 4 | 5 | > script_slot allows you to increase your script slots. 6 | 7 | script_slot_v1 is a tier 1 upgrade. It spawns at ((%0noob%)), ((%1kiddie%)), and ((%2h4x0r%)) rarities. 8 | 9 | ## Stats 10 | 11 | ### slots 12 | 13 | Displays the number of script slots the upgrade will add. 14 | -------------------------------------------------------------------------------- /docs/upgrades/architect/public_script_v1.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: public_script_v1 3 | --- 4 | 5 | > public_script_slot allows you to mark scripts as public. 6 | 7 | public_script_v1 is a tier 1 upgrade. It spawns at ((%0noob%)), ((%1kiddie%)), and ((%2h4x0r%)) rarities. 8 | 9 | ## Stats 10 | 11 | ### slots 12 | 13 | Displays the number of additional scripts a user can make public. 14 | -------------------------------------------------------------------------------- /docs/upgrades/architect/script_slot_v2.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: script_slot_v2 3 | --- 4 | 5 | > script_slot allows you to increase your script slots. 6 | 7 | script_slot_v2 is a tier 2 upgrade. It spawns at ((%0noob%)), ((%1kiddie%)), ((%2h4x0r%)) and ((%3h4rdc0r3%)) rarities. 8 | 9 | ## Stats 10 | 11 | ### slots 12 | 13 | Displays the number of script slots the upgrade will add. 14 | -------------------------------------------------------------------------------- /docs/upgrades/architect/public_script_v2.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: public_script_v2 3 | --- 4 | 5 | > public_script_slot allows you to mark scripts as public. 6 | 7 | public_script_v2 is a tier 2 upgrade. It spawns at ((%0noob%)), ((%1kiddie%)), ((%2h4x0r%)) and ((%3h4rdc0r3%)) rarities. 8 | 9 | ## Stats 10 | 11 | ### slots 12 | 13 | Displays the number of additional scripts a user can make public. 14 | -------------------------------------------------------------------------------- /docs/upgrades/locks/w4rn_er.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: w4rn_er 3 | --- 4 | 5 | > ??? 6 | 7 | w4rn is a tier 1 [lock](/upgrades/locks). 8 | 9 | ### Stats 10 | 11 | w4rn_er has no additional stats and only spawns at ((%1kiddie%)) rarity. 12 | 13 | ## Behavior 14 | 15 | w4rn_er sets an attacker's w4rn_message to one of several pre-set w4rn_messages. 16 | 17 | ## Solving 18 | 19 | This lock does not require solving. 20 | -------------------------------------------------------------------------------- /src/plugins/pluginContentDocsWrapper.test.ts: -------------------------------------------------------------------------------- 1 | import { describe, expect, it } from "@jest/globals"; 2 | import { getSlug } from "./pluginContentDocsWrapper"; 3 | 4 | describe("pluginContentDocsWrapper", () => { 5 | it("converts basic strings to slugs", () => { 6 | expect(getSlug("foo")).toBe("/foo"); 7 | expect(getSlug("/foo")).toBe("/foo"); 8 | expect(getSlug("foo bar")).toBe("/foo_bar"); 9 | }); 10 | }); 11 | -------------------------------------------------------------------------------- /templates/biography.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title:biography template 3 | --- 4 | 5 | > quote from the character, if applicable 6 | 7 | One or two-sentence, non-spoilery character description. 8 | 9 | ## Character Summary 10 | 11 | More detailed summary of the character and their interactions. Can get spoilery if wrapped in spoiler-blocks. 12 | 13 | ## Appears in 14 | 15 | List of events, channels, or places the character has appeared in 16 | -------------------------------------------------------------------------------- /docs/scripting/scripts.lib/one_day_ms.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: .one_day_ms 3 | --- 4 | 5 | The number of milliseconds equal to 24 hours. 6 | 7 | ## Syntax 8 | 9 | ```js 10 | #fs.scripts.lib().one_day_ms; 11 | ``` 12 | 13 | ### Value 14 | 15 | This property is the literal number: 16 | `86400000` 17 | 18 | ## Example 19 | 20 | ```js 21 | function(context, args) { 22 | const l = #fs.scripts.lib(); 23 | 24 | return l.one_day_ms; 25 | } 26 | ``` 27 | -------------------------------------------------------------------------------- /docs/scripting/trust_scripts/trust.me.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: trust.me 3 | description: "" 4 | --- 5 | 6 | ### Security Level 7 | 8 | NULLSEC 9 | 10 | ## Syntax 11 | 12 | ### CLI 13 | 14 | ``` 15 | trust.me 16 | ``` 17 | 18 | ### Script 19 | 20 | ``` 21 | #ns.trust.me() 22 | ``` 23 | 24 | ### Parameters 25 | 26 | No known parameters. 27 | 28 | ## Example 29 | 30 | ```js 31 | function(context, args) 32 | { 33 | return #ns.trust.me() 34 | } 35 | ``` 36 | -------------------------------------------------------------------------------- /docs/scripting/scripts.lib/corruptions.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: .corruptions 3 | --- 4 | 5 | The common corruption frequencies used in-game. 6 | 7 | ## Syntax 8 | 9 | ```js 10 | #fs.scripts.lib().corruptions; 11 | ``` 12 | 13 | ### Value 14 | 15 | This property is the literal array: 16 | `[0, 1, 1.5, 2.5, 5]` 17 | 18 | ## Example 19 | 20 | ```js 21 | function(context, args) { 22 | const l = #fs.scripts.lib(); 23 | 24 | return l.corruptions; 25 | } 26 | ``` 27 | -------------------------------------------------------------------------------- /docs/scripting/scripts.lib/date.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: .date() 3 | --- 4 | 5 | A safe internal `Date()` constructor. 6 | 7 | ## Syntax 8 | 9 | ```js 10 | #fs.scripts.lib().date(); 11 | ``` 12 | 13 | ### Parameters 14 | 15 | Same as JavaScript's `Date()` constructor. 16 | 17 | ### Return 18 | 19 | Returns a `Date` object. 20 | 21 | ## Example 22 | 23 | ```js 24 | function(context, args) { 25 | const l = #fs.scripts.lib(); 26 | 27 | return l.date(); 28 | } 29 | ``` 30 | -------------------------------------------------------------------------------- /docs/scripting/scripts.lib/get_date.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: .get_date() 3 | --- 4 | 5 | A safe internal `new Date()` invocation. 6 | 7 | ## Syntax 8 | 9 | ```js 10 | #fs.scripts.lib().get_date(); 11 | ``` 12 | 13 | ### Parameters 14 | 15 | Same as JavaScript's `new Date()`. 16 | 17 | ### Return 18 | 19 | Returns a `Date` object. 20 | 21 | ## Example 22 | 23 | ```js 24 | function(context, args) { 25 | const l = #fs.scripts.lib(); 26 | 27 | return l.get_date(); 28 | } 29 | ``` 30 | -------------------------------------------------------------------------------- /docs/upgrades/architect/char_count_v1.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: char_count_v1 3 | alias: char_count 4 | --- 5 | 6 | > char_count adds space for additional characters in every script. 7 | 8 | char_count_v1 is a tier 1 upgrade. It spawns at ((%0noob%)), ((%1kiddie%)), and ((%2h4x0r%)) rarities. 9 | 10 | ## Stats 11 | 12 | ### chars 13 | 14 | Displays the number of characters this upgrade adds. 15 | 16 | ## Behavior 17 | 18 | Loading this upgrade increases the number of characters available for writing scripts. 19 | -------------------------------------------------------------------------------- /.devcontainer/devcontainer.json: -------------------------------------------------------------------------------- 1 | // For format details, see https://aka.ms/devcontainer.json. For config options, see the 2 | // README at: https://github.com/devcontainers/templates/tree/main/src/universal 3 | { 4 | "name": "Default Linux Universal", 5 | "image": "mcr.microsoft.com/devcontainers/universal", 6 | "customizations": { 7 | "vscode": { 8 | "extensions": ["esbenp.prettier-vscode", "unifiedjs.vscode-mdx"] 9 | } 10 | }, 11 | "postCreateCommand": "bash .devcontainer/env-setup.sh" 12 | } 13 | -------------------------------------------------------------------------------- /docs/upgrades/architect/char_count_v2.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: char_count_v2 3 | alias: char_count 4 | --- 5 | 6 | > char_count adds space for additional characters in every script. 7 | 8 | char_count_v2 is a tier 2 upgrade. It spawns at ((%0noob%)), ((%1kiddie%)), ((%2h4x0r%)) and ((%3h4rdc0r3%)) rarities. 9 | 10 | ## Stats 11 | 12 | ### chars 13 | 14 | Displays the number of characters this upgrade adds. 15 | 16 | ## Behavior 17 | 18 | Loading this upgrade increases the number of characters available for writing scripts. 19 | -------------------------------------------------------------------------------- /docs/scripting/scripts.lib/security_level_names.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: .security_level_names 3 | --- 4 | 5 | A predefined list of security level names. 6 | 7 | ## Syntax 8 | 9 | ```js 10 | #fs.scripts.lib().security_level_names; 11 | ``` 12 | 13 | ### Value 14 | 15 | This property is the literal array: 16 | `["NULLSEC", "LOWSEC", "MIDSEC", "HIGHSEC", "FULLSEC"]` 17 | 18 | ## Example 19 | 20 | ```js 21 | function(context, args) { 22 | const l = #fs.scripts.lib(); 23 | 24 | return l.security_level_names; 25 | } 26 | ``` 27 | -------------------------------------------------------------------------------- /docs/upgrades/other/w4rn_message.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: w4rn_message 3 | --- 4 | 5 | > sys.w4rn_message allows you to change the message in Archaic Labs' w4rn upgrade. 6 | 7 | w4rn_message is a tier 1 upgrade. It spawns at ((%0noob%)), ((%1kiddie%)) and ((%2h4x0r%)) rarities. 8 | 9 | ## Behavior 10 | 11 | When a w4rn_message is loaded on a user's system, sys.w4rn_message can be executed to change the message of the [[w4rn]] lock. 12 | 13 | Syntax: 14 | 15 | ``` 16 | Usage: sys.w4rn_message { msg: "" } 17 | ``` 18 | -------------------------------------------------------------------------------- /docs/scripting/scripts.lib/get_date_utcsecs.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: .get_date_utcsecs() 3 | --- 4 | 5 | A safe internal invocation of `new Date().getTime()` 6 | 7 | ## Syntax 8 | 9 | ```js 10 | #fs.scripts.lib().get_date_utcsecs(); 11 | ``` 12 | 13 | ### Parameters 14 | 15 | No known parameters. 16 | 17 | ### Return 18 | 19 | Returns a `Date` object with current date and time. 20 | 21 | ## Example 22 | 23 | ```js 24 | function(context, args) { 25 | const l = #fs.scripts.lib(); 26 | 27 | return l.get_date_utcsecs(); 28 | } 29 | ``` 30 | -------------------------------------------------------------------------------- /docs/scripting/scripts.lib/is_def.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: .is_def() 3 | --- 4 | 5 | A function to test whether the input type is defined. 6 | 7 | ## Syntax 8 | 9 | ```js 10 | #fs.scripts.lib().is_def(i); 11 | ``` 12 | 13 | ### Parameters 14 | 15 | #### i 16 | 17 | The input to be evaluated. 18 | 19 | ### Return 20 | 21 | Returns a boolean. 22 | 23 | ## Example 24 | 25 | ```js 26 | function(context, args) { 27 | const l = #fs.scripts.lib(); 28 | const my_obj = {}; 29 | 30 | return l.is_def(my_obj.undefined_prop); 31 | } 32 | ``` 33 | -------------------------------------------------------------------------------- /docs/scripting/scripts.lib/is_int.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: .is_int() 3 | --- 4 | 5 | A function to test whether the input is an integer. 6 | 7 | ## Syntax 8 | 9 | ```js 10 | #fs.scripts.lib().is_int(i); 11 | ``` 12 | 13 | ### Parameters 14 | 15 | #### i 16 | 17 | "i" is the input to be tested. 18 | 19 | ### Return 20 | 21 | Returns a boolean. 22 | 23 | ## Example 24 | 25 | ```js 26 | function(context, args) { 27 | const l = #fs.scripts.lib(); 28 | const my_test_input = -1; 29 | 30 | return l.is_int(my_test_input); 31 | } 32 | ``` 33 | -------------------------------------------------------------------------------- /docs/scripting/scripts.lib/is_num.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: .is_num() 3 | --- 4 | 5 | A function to test whether the input is a number. 6 | 7 | ## Syntax 8 | 9 | ```js 10 | #fs.scripts.lib().is_num(i); 11 | ``` 12 | 13 | ### Parameters 14 | 15 | #### i 16 | 17 | "i" is the input to be tested. 18 | 19 | ### Return 20 | 21 | Returns a boolean. 22 | 23 | ## Example 24 | 25 | ```js 26 | function(context, args) { 27 | const l = #fs.scripts.lib(); 28 | const my_test_input = 1337; 29 | 30 | return l.is_num(my_test_input); 31 | } 32 | ``` 33 | -------------------------------------------------------------------------------- /docs/scripting/scripts.lib/hash_code.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: .hash_code() 3 | --- 4 | 5 | A function which creates a hash code out of an input string. 6 | 7 | ## Syntax 8 | 9 | ```js 10 | #fs.scripts.lib().hash_code(str) 11 | ``` 12 | 13 | ### Parameters 14 | 15 | #### str 16 | 17 | The string to be hashed. 18 | 19 | ### Return 20 | 21 | Returns a number. 22 | 23 | ## Example 24 | 25 | ```js 26 | function(context, args) { 27 | const l = #fs.scripts.lib(); 28 | const my_string; 29 | 30 | return l.hash_code(my_string); 31 | } 32 | ``` 33 | -------------------------------------------------------------------------------- /docs/scripting/scripts.lib/is_str.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: .is_str() 3 | --- 4 | 5 | A function to test whether input is a string. 6 | 7 | ## Syntax 8 | 9 | ```js 10 | #fs.scripts.lib().is_str(i); 11 | ``` 12 | 13 | ### Parameters 14 | 15 | #### i 16 | 17 | "i" is the input to be tested. 18 | 19 | ### Return 20 | 21 | Returns a boolean. 22 | 23 | ## Example 24 | 25 | ```js 26 | function(context, args) { 27 | const l = #fs.scripts.lib(); 28 | const my_test_input = "I am a string."; 29 | 30 | return l.is_str(my_test_input); 31 | } 32 | ``` 33 | -------------------------------------------------------------------------------- /docs/scripting/scripts.lib/is_obj.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: .is_obj() 3 | --- 4 | 5 | A function to test whether the input is an object. 6 | 7 | ## Syntax 8 | 9 | ```js 10 | #fs.scripts.lib().is_obj(i); 11 | ``` 12 | 13 | ### Parameters 14 | 15 | #### i 16 | 17 | "i" is the input to be tested. 18 | 19 | ### Return 20 | 21 | Returns a boolean. 22 | 23 | ## Example 24 | 25 | ```js 26 | function(context, args) { 27 | const l = #fs.scripts.lib(); 28 | const my_test_input = { i_am: "an object" }; 29 | 30 | return l.is_obj(my_test_input); 31 | } 32 | ``` 33 | -------------------------------------------------------------------------------- /docs/scripting/scripts.lib/ok.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: .ok() 3 | --- 4 | 5 | Helper function that creates a formatted ((%LSuccess%)) object. 6 | 7 | ## Syntax 8 | 9 | ```js 10 | return scripts.lib().ok(); 11 | ``` 12 | 13 | ### Parameters 14 | 15 | No known parameters. 16 | 17 | ### Return 18 | 19 | ## CLI 20 | 21 | ``` 22 | Success 23 | ``` 24 | 25 | ## Script 26 | 27 | ``` 28 | { 29 | ok: true 30 | } 31 | ``` 32 | 33 | ## Example 34 | 35 | ```js 36 | function(context, args) { 37 | const l = #fs.scripts.lib(); 38 | return l.ok(); 39 | } 40 | ``` 41 | -------------------------------------------------------------------------------- /docs/scripting/scripts.lib/is_arr.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: .is_arr() 3 | --- 4 | 5 | A function to test whether the input is an array. 6 | 7 | ## Syntax 8 | 9 | ```js 10 | #fs.scripts.lib().is_arr(i); 11 | ``` 12 | 13 | ### Parameters 14 | 15 | #### i 16 | 17 | "i" is the input to be tested. 18 | 19 | ### Return 20 | 21 | Returns a boolean. 22 | 23 | ## Example 24 | 25 | ```js 26 | function(context, args) { 27 | const l = #fs.scripts.lib(); 28 | const my_test_input = ["apples", "bananas", "oranges"]; 29 | 30 | return l.is_arr(my_test_input); 31 | } 32 | ``` 33 | -------------------------------------------------------------------------------- /templates/upgrade.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: upgrade template 3 | --- 4 | 5 | > In-game description of the upgrade, typically from sys.upgrades \{ full: true } 6 | 7 | _upgrade_ is a tier _N_ upgrade. 8 | 9 | ## Stats 10 | 11 | Unique stats that are included in the upgrades's statistics. Include the range of rarities that the lock spawns at. 12 | 13 | ### Stat 1 14 | 15 | Detailed information about stat. 16 | 17 | ## Behavior 18 | 19 | A less spoilery description of the upgrade's behavior. 20 | 21 | Example outputs, etc... 22 | 23 | ``` 24 | Success: True 25 | ``` 26 | -------------------------------------------------------------------------------- /docs/scripting/scripts.lib/is_neg.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: .is_neg() 3 | --- 4 | 5 | A function to test whether the input is a number, and if so, if it has a negative value. 6 | 7 | ## Syntax 8 | 9 | ```js 10 | #fs.scripts.lib().is_neg(i); 11 | ``` 12 | 13 | ### Parameters 14 | 15 | #### i 16 | 17 | "i" is the input to be tested. 18 | 19 | ### Return 20 | 21 | Returns a boolean. 22 | 23 | ## Example 24 | 25 | ```js 26 | function(context, args) { 27 | const l = #fs.scripts.lib(); 28 | const my_test_input = -1; 29 | 30 | return l.is_neg(my_test_input); 31 | } 32 | ``` 33 | -------------------------------------------------------------------------------- /docs/scripting/scripts.lib/num_sort_asc.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: .num_sort_asc 3 | --- 4 | 5 | Arguments for `.sort()` that sort an array of numbers in ascending order. 6 | 7 | ## Syntax 8 | 9 | ```js 10 | array.sort(#fs.scripts.lib().num_sort_asc); 11 | ``` 12 | 13 | ### Parameters 14 | 15 | No known parameters. 16 | 17 | ### Return 18 | 19 | Returns an array. 20 | 21 | ## Example 22 | 23 | ```js 24 | function(context, args) { 25 | const l = #fs.scripts.lib(); 26 | const my_array = [3006, 2001, 7, 42, 38]; 27 | 28 | return my_array.sort(l.num_sort_asc); 29 | } 30 | ``` 31 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | // This file is not used in compilation. It is here just for a nice editor experience. 3 | "extends": "@docusaurus/tsconfig/tsconfig.json", 4 | "compilerOptions": { 5 | "baseUrl": ".", 6 | // Fixes local lint error when importing JS files into TS modules (docusaurus already allows this.) 7 | "allowJs": true, 8 | // Allows including an explicit file extension in an import, in case it is being inferred incorrectly. 9 | // - Use this when webpack is warning about a caching error. 10 | "allowImportingTsExtensions": true 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /docs/scripting/scripts.lib/is_valid_name.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: .is_valid_name() 3 | --- 4 | 5 | A function to test whether the input is a valid hackmud username. 6 | 7 | ## Syntax 8 | 9 | ```js 10 | #fs.scripts.lib().is_valid_name(i); 11 | ``` 12 | 13 | ### Parameters 14 | 15 | #### i 16 | 17 | The input to be evaluated. 18 | 19 | ### Return 20 | 21 | Returns a boolean. 22 | 23 | ## Example 24 | 25 | ```js 26 | function(context, args) { 27 | const l = #fs.scripts.lib(); 28 | const my_test_input = "yrollam"; 29 | 30 | return l.is_valid_name(my_test_input); 31 | } 32 | ``` 33 | -------------------------------------------------------------------------------- /docs/scripting/scripts.lib/num_sort_desc.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: .num_sort_desc 3 | --- 4 | 5 | Arguments for `.sort()` that sort an array of numbers in descending order. 6 | 7 | ## Syntax 8 | 9 | ```js 10 | array.sort(#fs.scripts.lib().num_sort_desc); 11 | ``` 12 | 13 | ### Parameters 14 | 15 | No known parameters. 16 | 17 | ### Return 18 | 19 | Returns an array. 20 | 21 | ## Example 22 | 23 | ```js 24 | function(context, args) { 25 | const l = #fs.scripts.lib(); 26 | const my_array = [3006, 2001, 7, 42, 38]; 27 | 28 | return my_array.sort(l.num_sort_desc); 29 | } 30 | ``` 31 | -------------------------------------------------------------------------------- /docs/scripting/scripts.lib/get_log.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: .get_log() 3 | --- 4 | 5 | Returns array of logged strings from [[.log()]] 6 | 7 | ## Syntax 8 | 9 | ```js 10 | return #fs.scripts.lib().get_log(); 11 | ``` 12 | 13 | ### Parameters 14 | 15 | There are no known parameters. 16 | 17 | ### Return 18 | 19 | Returns an array of strings. In the example below, returns: 20 | 21 | ``` 22 | "hello world" 23 | ``` 24 | 25 | ## Example 26 | 27 | ```js 28 | function(context, args) { 29 | const l = #fs.scripts.lib(); 30 | l.log('hello world'); 31 | return l.get_log(); 32 | } 33 | ``` 34 | -------------------------------------------------------------------------------- /docs/scripting/scripts.lib/is_bool.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: .is_bool() 3 | --- 4 | 5 | A function to test whether the input is a boolean. 6 | 7 | ## Syntax 8 | 9 | ```js 10 | #fs.scripts.lib().is_bool(value); 11 | ``` 12 | 13 | ### Parameters 14 | 15 | #### value 16 | 17 | The variable to be tested. 18 | 19 | ### Return 20 | 21 | Returns true if the variable is a boolean, false otherwise. 22 | 23 | ## Example 24 | 25 | ```js 26 | function(context, args) { 27 | const l = #fs.scripts.lib(); 28 | const my_test_input = true; 29 | 30 | return l.is_bool(my_test_input); 31 | } 32 | ``` 33 | -------------------------------------------------------------------------------- /docs/scripting/scripts.lib/is_func.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: .is_func() 3 | --- 4 | 5 | Checks whether input is a function. 6 | 7 | ## Syntax 8 | 9 | ```js 10 | #fs.scripts.lib().is_func(func); 11 | ``` 12 | 13 | ### Parameters 14 | 15 | #### func 16 | 17 | The input to be evaluated. 18 | 19 | ### Return 20 | 21 | Returns a boolean. 22 | 23 | ## Example 24 | 25 | ```js 26 | function(context, args) { 27 | const l = #fs.scripts.lib(); 28 | function my_func () { 29 | return "I am a function"; 30 | }; 31 | let func = my_func; 32 | 33 | return l.is_func(my_func); 34 | } 35 | ``` 36 | -------------------------------------------------------------------------------- /docs/scripting/scripts.lib/shuffle.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: .shuffle() 3 | --- 4 | 5 | A function that takes an array and shuffles the elements into a random order. 6 | 7 | ## Syntax 8 | 9 | ```js 10 | #fs.scripts.lib().shuffle(array); 11 | ``` 12 | 13 | ### Parameters 14 | 15 | #### array 16 | 17 | The array to be shuffled. 18 | 19 | ### Return 20 | 21 | Returns an array. 22 | 23 | ## Example 24 | 25 | ```js 26 | function(context, args) { 27 | const l = #fs.scripts.lib(); 28 | const my_array = ["apples", "bananas", "oranges"]; 29 | 30 | return l.shuffle(my_array); 31 | } 32 | ``` 33 | -------------------------------------------------------------------------------- /docs/scripting/scripts.lib/sample.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: .sample() 3 | --- 4 | 5 | Sample randomly selects one element from an array to return. 6 | 7 | ## Syntax 8 | 9 | ```js 10 | return #fs.scripts.lib().sample(arr); 11 | ``` 12 | 13 | ### Parameters 14 | 15 | #### arr 16 | 17 | The array to be sampled. 18 | 19 | ### Return 20 | 21 | Returns the data type of the element sampled. 22 | 23 | ``` 24 | "banana" 25 | ``` 26 | 27 | ## Example 28 | 29 | ```js 30 | function(context, args) { 31 | let arr = ["apple", "banana", "strawberry"]; 32 | return #fs.scripts.lib().sample(arr); 33 | } 34 | ``` 35 | -------------------------------------------------------------------------------- /docs/scripting/scripts.lib/LCG.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: .LCG() 3 | --- 4 | 5 | Takes a numerical seed and returns a function that generates PRNG based on the LCG algorithm. 6 | 7 | ## Syntax 8 | 9 | ```js 10 | #fs.scripts.lib().LCG(seed); 11 | ``` 12 | 13 | ### Parameters 14 | 15 | #### seed 16 | 17 | The number to serve as the seed for RNG. 18 | 19 | ### Return 20 | 21 | Returns a function. 22 | 23 | ## Example 24 | 25 | ```js 26 | function(context, args) { 27 | const l = #fs.scripts.lib(); 28 | const my_seed = 12345; 29 | const rng = l.LCG(my_seed); 30 | 31 | return rng(); 32 | } 33 | ``` 34 | -------------------------------------------------------------------------------- /docs/scripting/scripts.lib/not_impl.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: .not_impl() 3 | --- 4 | 5 | Returns a ((%DFailure%)) object with error message: "Not Implemented". 6 | 7 | ## Syntax 8 | 9 | ```js 10 | return scripts.lib().not_impl(); 11 | ``` 12 | 13 | ### Parameters 14 | 15 | No parameters. 16 | 17 | ### Return 18 | 19 | ```js 20 | Failure 21 | Not Implemented. 22 | ``` 23 | 24 | Same as: 25 | 26 | ```js 27 | { ok: false, msg: "Not Implemented." } 28 | ``` 29 | 30 | ## Example 31 | 32 | ```js 33 | function(context, args) { 34 | const l = #fs.scripts.lib(); 35 | 36 | return l.not_impl(); 37 | } 38 | ``` 39 | -------------------------------------------------------------------------------- /docs/upgrades/locks/w4rn.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: w4rn 3 | --- 4 | 5 | > Archaic Labs' warning lock. Displays a message to connected users. Message can be changed with w4rn_message. 6 | 7 | w4rn is a tier 1 [lock](/upgrades/locks) created by the ARCHAIC LABS corporation. 8 | 9 | ## Stats 10 | 11 | This upgrade has no additional stats and only spawns at ((%1kiddie%)) rarity. 12 | 13 | ## Behavior 14 | 15 | When encountered, the w4rn will display a message set by the user. Users may set a custom w4rn message by utilizing the w4rn_message upgrade. 16 | 17 | ## Solving 18 | 19 | Solving is not required for this lock. 20 | -------------------------------------------------------------------------------- /docs/scripting/scripts.lib/JSF.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: .JSF() 3 | --- 4 | 5 | A function that takes a numerical seed and returns a function that can be used to generate prng based on the JSF algorithm. 6 | 7 | ## Syntax 8 | 9 | ```js 10 | #fs.scripts.lib().JSF(seed); 11 | ``` 12 | 13 | ### Parameters 14 | 15 | #### seed 16 | 17 | Numerical seed for the RNG. 18 | 19 | ### Return 20 | 21 | Returns a function. 22 | 23 | ## Example 24 | 25 | ```js 26 | function(context, args) { 27 | const l = #fs.scripts.lib(); 28 | const my_seed = 1234; 29 | const rng = l.JSF(my_seed); 30 | 31 | return rng(); 32 | } 33 | ``` 34 | -------------------------------------------------------------------------------- /docs/scripting/scripts.lib/to_gc_str.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: .to_gc_str() 3 | --- 4 | 5 | Takes a number and turns it into a formatted GC string. 6 | 7 | ## Syntax 8 | 9 | ```js 10 | #fs.scripts.lib().to_gc_str(num); 11 | ``` 12 | 13 | ### Parameters 14 | 15 | #### num 16 | 17 | The number to turn into a formatted GC string. 18 | 19 | ### Return 20 | 21 | Returns a GC string. 22 | 23 | ```js 24 | 100M200K300GC 25 | ``` 26 | 27 | ## Example 28 | 29 | ```js 30 | function(context, args) { 31 | const l = #fs.scripts.lib(); 32 | const my_gc_number = 100200300; 33 | 34 | return l.to_gc_str(my_gc_number); 35 | } 36 | ``` 37 | -------------------------------------------------------------------------------- /docs/scripting/scripts.lib/colors.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: .colors 3 | --- 4 | 5 | A string containing the lowercase alphabet, followed by the uppercase alphabet. This is a helper property for coloring strings. It is also used for corruption character functionality in scripts.lib. 6 | 7 | ## Syntax 8 | 9 | ```js 10 | #fs.scripts.lib().colors; 11 | ``` 12 | 13 | ### Value 14 | 15 | This property is the literal string: 16 | `"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"` 17 | 18 | ## Example 19 | 20 | ```js 21 | function(context, args) { 22 | const l = #fs.scripts.lib(); 23 | 24 | return l.colors; 25 | } 26 | ``` 27 | -------------------------------------------------------------------------------- /docs/scripting/scripts.lib/corruption_chars.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: .corruption_chars 3 | --- 4 | 5 | The possible corruption characters. 6 | 7 | ## Syntax 8 | 9 | ```js 10 | #fs.scripts.lib().corruption_chars; 11 | ``` 12 | 13 | ### Value 14 | 15 | This property is the literal string: 16 | `"¡¢Á¤Ã¦§¨©ª"` 17 | 18 | :::note 19 | These characters appear different in non-hackmud fonts, but will render as corruption characters when used inside the game: "¡¢Á¤Ã¦§¨©ª". 20 | ::: 21 | 22 | ## Example 23 | 24 | ```js 25 | function(context, args) { 26 | const l = #fs.scripts.lib(); 27 | 28 | return l.corruption_chars; 29 | } 30 | ``` 31 | -------------------------------------------------------------------------------- /docs/scripting/scripts.lib/mulberry32.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: .mulberry32() 3 | --- 4 | 5 | A function that returns a PRNG function from a numerical seed based on the mulberry32 algorithm. 6 | 7 | ## Syntax 8 | 9 | ```js 10 | #fs.scripts.lib().mulberry32(num); 11 | ``` 12 | 13 | ### Parameters 14 | 15 | #### num 16 | 17 | The number to serve as the seed for RNG. 18 | 19 | ### Return 20 | 21 | Returns a function. 22 | 23 | ## Example 24 | 25 | ```js 26 | function(context, args) { 27 | const l = #fs.scripts.lib(); 28 | const my_number = 1337; 29 | const rng = l.mulberry32(my_number); 30 | 31 | return rng(); 32 | } 33 | ``` 34 | -------------------------------------------------------------------------------- /docs/scripting/scripts.lib/get_values.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: .get_values() 3 | --- 4 | 5 | A function that extracts the values from all properties of an object. 6 | 7 | ## Syntax 8 | 9 | ```js 10 | #fs.scripts.lib().get_values(obj); 11 | ``` 12 | 13 | ### Parameters 14 | 15 | #### obj 16 | 17 | The object from which to extract properties. 18 | 19 | ### Return 20 | 21 | Returns an array. 22 | 23 | ## Example 24 | 25 | ```js 26 | function(context, args) { 27 | const l = #fs.scripts.lib(); 28 | const my_obj = { 29 | prop_1: "value_1", 30 | prop_2: "value_2" 31 | }; 32 | 33 | return l.get_values(my_obj); 34 | } 35 | ``` 36 | -------------------------------------------------------------------------------- /docs/scripting/scripts.lib/id_to_str.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: .id_to_str() 3 | --- 4 | 5 | A function that converts a MongoDB ObjectID to its string representation. 6 | 7 | ## Syntax 8 | 9 | ```js 10 | #fs.scripts.lib().id_to_str(i); 11 | ``` 12 | 13 | ### Parameters 14 | 15 | #### i 16 | 17 | "i" is a MongoDB ObjectID. 18 | 19 | ### Return 20 | 21 | Returns a string. 22 | 23 | ``` 24 | 65d576dd9edd1f997cbe7129 25 | ``` 26 | 27 | ## Example 28 | 29 | ```js 30 | function(context, args) { 31 | const l = #fs.scripts.lib(); 32 | const dat = #db.f({ my_db_article: { $exists: true } }).first(); 33 | return l.id_to_str(dat._id); 34 | } 35 | ``` 36 | -------------------------------------------------------------------------------- /docs/scripting/scripts.lib/log.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: .log() 3 | --- 4 | 5 | Pushes strings into an array that can be returned later for logging/debugging. 6 | 7 | ## Syntax 8 | 9 | ```js 10 | #fs.scripts.lib().log(logging_data); 11 | ``` 12 | 13 | ### Parameters 14 | 15 | #### logging_data 16 | 17 | Data you wish to log to the logging array. Can be of any data type. 18 | 19 | ### Return 20 | 21 | Does not return. In order to return the logged array, use [[.get_log()]] 22 | 23 | ## Example 24 | 25 | ```js 26 | function(context, args) { 27 | const l = #fs.scripts.lib(); 28 | l.log("hello world"); 29 | return l.get_log(); 30 | } 31 | ``` 32 | -------------------------------------------------------------------------------- /docs/scripting/scripts.lib/caller_is_owner.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: .caller_is_owner() 3 | --- 4 | 5 | A function that checks whether the caller of the script being called is the owner of that script by comparing the scriptname to the caller from the [[context]] object. 6 | 7 | ## Syntax 8 | 9 | ```js 10 | #fs.scripts.lib().caller_is_owner(context); 11 | ``` 12 | 13 | ### Parameters 14 | 15 | #### context 16 | 17 | The [[context]] object. 18 | 19 | ### Return 20 | 21 | Returns a boolean. 22 | 23 | ## Example 24 | 25 | ```js 26 | function(context, args) { 27 | const l = #fs.scripts.lib(); 28 | 29 | return l.caller_is_owner(context); 30 | } 31 | ``` 32 | -------------------------------------------------------------------------------- /docs/scripting/scripts.lib/add_time.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: .add_time() 3 | --- 4 | 5 | A function that adds a specified number of milliseconds to a given `Date()` object. 6 | 7 | ## Syntax 8 | 9 | ```js 10 | #fs.scripts.lib().add_time(Date, number); 11 | ``` 12 | 13 | ### Parameters 14 | 15 | #### date 16 | 17 | A date object. 18 | 19 | #### number 20 | 21 | The number of milliseconds to add. 22 | 23 | ### Return 24 | 25 | Returns a new `Date()` object. 26 | 27 | ## Example 28 | 29 | ```js 30 | function(context, args) { 31 | const l = #fs.scripts.lib(); 32 | const my_date = new Date(); 33 | 34 | return l.add_time(my_date, 1000); 35 | } 36 | ``` 37 | -------------------------------------------------------------------------------- /docs/scripting/scripts.lib/get_security_level_name.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: .get_security_level_name() 3 | --- 4 | 5 | A function that takes a number between 0 and 4 (inclusive) and returns the associated security level name. 6 | 7 | ## Syntax 8 | 9 | ```js 10 | #fs.scripts.lib().get_security_level_name(level); 11 | ``` 12 | 13 | ### Parameters 14 | 15 | #### level 16 | 17 | A numerical representation of a security level. (0 - 4 inclusive) 18 | 19 | ### Return 20 | 21 | Returns a string. 22 | 23 | ## Example 24 | 25 | ```js 26 | function(context, args) { 27 | const l = #fs.scripts.lib(); 28 | 29 | return l.get_security_level_name(4); 30 | } 31 | ``` 32 | -------------------------------------------------------------------------------- /docs/scripting/scripts.lib/sort_asc.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: .sort_asc 3 | --- 4 | 5 | Arguments for `.sort()` that sort an array of strings in ascending order. This is intended for use with alphabetical strings. Numbers will sort by string precedence. 6 | 7 | ## Syntax 8 | 9 | ```js 10 | array.sort(#fs.scripts.lib().sort_asc); 11 | ``` 12 | 13 | ### Parameters 14 | 15 | No known parameters. 16 | 17 | ### Return 18 | 19 | Returns an array. 20 | 21 | ## Example 22 | 23 | ```js 24 | function(context, args) { 25 | const l = #fs.scripts.lib(); 26 | const my_array = ["bananas", "apples", "oranges"]; 27 | 28 | return my_array.sort(l.sort_asc); 29 | } 30 | ``` 31 | -------------------------------------------------------------------------------- /docs/scripting/scripts.lib/sort_desc.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: .sort_desc 3 | --- 4 | 5 | Arguments for `.sort()` that sort an array of strings in descending order. This is intended for use with alphabetical strings. Numbers will sort by string precedence. 6 | 7 | ## Syntax 8 | 9 | ```js 10 | array.sort(#fs.scripts.lib().sort_desc); 11 | ``` 12 | 13 | ### Parameters 14 | 15 | No known parameters. 16 | 17 | ### Return 18 | 19 | Returns an array. 20 | 21 | ## Example 22 | 23 | ```js 24 | function(context, args) { 25 | const l = #fs.scripts.lib(); 26 | const my_array = ["bananas", "apples", "oranges"]; 27 | 28 | return my_array.sort(l.sort_desc); 29 | } 30 | ``` 31 | -------------------------------------------------------------------------------- /docs/scripting/scripts.lib/utc_days_ago_str.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: .utc_days_ago_str() 3 | --- 4 | 5 | A function that calculates the time elapsed in days from a past `Date` object to the current date. 6 | 7 | ## Syntax 8 | 9 | ```js 10 | #fs.scripts.lib().utc_days_ago_str(date); 11 | ``` 12 | 13 | ### Parameters 14 | 15 | #### date 16 | 17 | The `Date` object to be compared. 18 | 19 | ### Return 20 | 21 | Returns the number of elapsed days as a string (`"[x] days"`). 22 | 23 | ## Example 24 | 25 | ```js 26 | function(context, args) { 27 | const l = #fs.scripts.lib(); 28 | const date = new Date('1970-01-01'); 29 | 30 | return l.utc_days_ago_str(date); 31 | } 32 | ``` 33 | -------------------------------------------------------------------------------- /docs/scripting/extensions/start.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: _START 3 | 4 | alias: 5 | - _ST 6 | - START 7 | --- 8 | 9 | Timestamp of the beginning of the top-level script run. 10 | 11 | \_START (along with \_ST) are global variables that provide a timestamp, in milliseconds since the [Unix epoch](https://en.wikipedia.org/wiki/Unix_time), of when the script execution began. 12 | 13 | ## Syntax 14 | 15 | ```js 16 | _START; 17 | _ST; 18 | ``` 19 | 20 | ## Example 21 | 22 | A script that wants to track how long their own execution has taken can use \_START: 23 | 24 | ```js 25 | function(context, args) { 26 | // do stuff 27 | 28 | return "Ran for " + (Date.now() - _START) + " ms" 29 | } 30 | ``` 31 | -------------------------------------------------------------------------------- /docs/scripting/scripts.lib/get_user_from_script.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: .get_user_from_script() 3 | --- 4 | 5 | A function that extracts the user name of a script owner based on the full formatted script name. 6 | 7 | ## Syntax 8 | 9 | ```js 10 | #fs.scripts.lib().get_user_from_script(scriptname); 11 | ``` 12 | 13 | ### Parameters 14 | 15 | #### scriptname 16 | 17 | The string representation of a script name, e.g. "scripts.trust". 18 | 19 | ### Return 20 | 21 | Returns a string. 22 | 23 | ## Example 24 | 25 | ```js 26 | function(context, args) { 27 | const l = #fs.scripts.lib(); 28 | const scriptname = "scripts.trust"; 29 | 30 | return l.get_user_from_script(scriptname); 31 | } 32 | ``` 33 | -------------------------------------------------------------------------------- /docs/scripting/scripts.lib/can_continue_execution.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: .can_continue_execution() 3 | --- 4 | 5 | A function that checks whether a specified number of milliseconds are available for execution. 6 | 7 | ## Syntax 8 | 9 | ```js 10 | #fs.scripts.lib().can_continue_execution(remain_threshold); 11 | ``` 12 | 13 | ### Parameters 14 | 15 | #### remain_threshold 16 | 17 | A number in milliseconds. Player scripts must execute in under 5000 milliseconds or they will time out. 18 | 19 | ### Return 20 | 21 | Returns a boolean. 22 | 23 | ## Example 24 | 25 | ```js 26 | function(context, args) { 27 | const l = #fs.scripts.lib(); 28 | 29 | return l.can_continue_execution(4000); 30 | } 31 | ``` 32 | -------------------------------------------------------------------------------- /docs/scripting/scripts.lib/utc_day_diff.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: .utc_day_diff() 3 | --- 4 | 5 | A function that calculates the difference in days from 2 `Date` objects. 6 | 7 | ## Syntax 8 | 9 | ```js 10 | #fs.scripts.lib().utc_day_diff(date_1, date_2); 11 | ``` 12 | 13 | ### Parameters 14 | 15 | #### date_1 16 | 17 | The first UTC timestamp. 18 | 19 | #### date_2 20 | 21 | The second UTC timestamp. 22 | 23 | ### Return 24 | 25 | Returns a number of days. 26 | 27 | ## Example 28 | 29 | ```js 30 | function(context, args) { 31 | const l = #fs.scripts.lib(); 32 | const date_1 = new Date(); 33 | const date_2 = new Date('1970-01-01'); 34 | 35 | return l.utc_day_diff(date_1, date_2); 36 | } 37 | ``` 38 | -------------------------------------------------------------------------------- /docs/scripting/trust_scripts/sys.loc.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: sys.loc 3 | description: "Returns the calling system's loc" 4 | --- 5 | 6 | ((sys.loc)) displays the calling system's [[loc]]. 7 | 8 | ### Security Level 9 | 10 | LOWSEC 11 | 12 | ## Syntax 13 | 14 | ### CLI 15 | 16 | ``` 17 | sys.loc 18 | ``` 19 | 20 | ### Script 21 | 22 | ``` 23 | #ls.sys.loc() 24 | ``` 25 | 26 | ### Parameters 27 | 28 | No known parameters. 29 | 30 | ### Return 31 | 32 | Returns a string. 33 | 34 | #### CLI 35 | 36 | ``` 37 | >>sys.loc 38 | user.loc 39 | ``` 40 | 41 | #### Script 42 | 43 | Same as CLI. 44 | 45 | ## Example 46 | 47 | ```js 48 | function(context, args) 49 | { 50 | return #ls.sys.loc() 51 | } 52 | ``` 53 | -------------------------------------------------------------------------------- /docs/scripting/scripts.lib/cap_str_len.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: .cap_str_len() 3 | --- 4 | 5 | A function to shorten or cap a string to a specified length. 6 | 7 | ## Syntax 8 | 9 | ```js 10 | #fs.scripts.lib().cap_str_len(str, length); 11 | ``` 12 | 13 | ### Parameters 14 | 15 | #### str 16 | 17 | The string to be length capped. 18 | 19 | #### length 20 | 21 | The numerical length the string should be shorted or capped to. 22 | 23 | ### Return 24 | 25 | Returns a string. 26 | 27 | ## Example 28 | 29 | ```js 30 | function(context, args) { 31 | const l = #fs.scripts.lib(); 32 | const my_string = "I am a string whose length will be capped."; 33 | 34 | return l.cap_str_len(my_string, 13); 35 | } 36 | ``` 37 | -------------------------------------------------------------------------------- /docs/scripting/scripts.lib/create_rand_string.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: .create_rand_string() 3 | --- 4 | 5 | A function that generates a string of random lowercase alphanumeric characters. 6 | 7 | ## Syntax 8 | 9 | ```js 10 | #fs.scripts.lib().create_rand_string(count, rand); 11 | ``` 12 | 13 | ### Parameters 14 | 15 | #### count 16 | 17 | The number of characters that the random string should contain. 18 | 19 | #### rand (optional) 20 | 21 | A random number generator function. Defaults to Math.random. 22 | 23 | ### Return 24 | 25 | Returns a string. 26 | 27 | ## Example 28 | 29 | ```js 30 | function(context, args) { 31 | const l = #fs.scripts.lib(); 32 | 33 | return l.create_rand_string(7); 34 | } 35 | ``` 36 | -------------------------------------------------------------------------------- /docs/scripting/scripts.lib/dump.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: .dump() 3 | --- 4 | 5 | A function that formats the input for debugging output. 6 | If the input is a string, the function surrounds it with `"`. Otherwise, the function converts it to a string by calling `toString()`. 7 | 8 | ## Syntax 9 | 10 | ```js 11 | #fs.scripts.lib().dump(i); 12 | ``` 13 | 14 | ### Parameters 15 | 16 | #### i 17 | 18 | The input to be evaluated. 19 | 20 | ### Return 21 | 22 | Returns a string representation of the input value. 23 | 24 | ## Example 25 | 26 | ```js 27 | function(context, args) { 28 | const l = #fs.scripts.lib(); 29 | const my_test_input = "This is a string!"; 30 | 31 | return l.dump(my_test_input); 32 | } 33 | ``` 34 | -------------------------------------------------------------------------------- /docs/scripting/scripts.lib/get_scriptname_from_script.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: .get_scriptname_from_script() 3 | --- 4 | 5 | A function that extracts the scriptname of a script based on the full formatted script name. 6 | 7 | ## Syntax 8 | 9 | ```js 10 | #fs.scripts.lib().get_scriptname_from_script(scriptname); 11 | ``` 12 | 13 | ### Parameters 14 | 15 | #### scriptname 16 | 17 | The string representation of a script name, e.g. "scripts.trust". 18 | 19 | ### Return 20 | 21 | Returns a string. 22 | 23 | ## Example 24 | 25 | ```js 26 | function(context, args) { 27 | const l = #fs.scripts.lib(); 28 | const scriptname = "scripts.trust"; 29 | 30 | return l.get_scriptname_from_script(scriptname); 31 | } 32 | ``` 33 | -------------------------------------------------------------------------------- /docs/scripting/scripts.lib/to_game_timestr.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: .to_game_timestr() 3 | --- 4 | 5 | Takes a JavaScript `new Date()` object and converts it into a time string in the `YYMMDD.HHmm` format. 6 | 7 | ## Syntax 8 | 9 | ```js 10 | #fs.scripts.lib().to_game_timestr(date); 11 | ``` 12 | 13 | ### Parameters 14 | 15 | #### date 16 | 17 | Takes a JavaScript `new Date()` object as its parameter. 18 | 19 | ### Return 20 | 21 | Returns a string. 22 | 23 | ``` 24 | 240227.0044 25 | ``` 26 | 27 | ## Example 28 | 29 | ```js 30 | function(context, args) { 31 | const l = #fs.scripts.lib(); 32 | const current_time_and_date = new Date(); 33 | 34 | return l.to_game_timestr(current_time_and_date); 35 | } 36 | ``` 37 | -------------------------------------------------------------------------------- /docs/scripting/scripts.lib/u_sort_num_array_desc.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: .u_sort_num_array_desc() 3 | --- 4 | 5 | A function that deduplicates an array of numbers and sorts the deduplicated array in descending order. 6 | 7 | ## Syntax 8 | 9 | ```js 10 | #fs.scripts.lib().u_sort_num_array_desc(array); 11 | ``` 12 | 13 | ### Parameters 14 | 15 | #### array 16 | 17 | The array of numbers to be deduplicated and sorted in descending order. 18 | 19 | ### Return 20 | 21 | Returns an array. 22 | 23 | ## Example 24 | 25 | ```js 26 | function(context, args) { 27 | const l = #fs.scripts.lib(); 28 | const my_array = [3, 5, 7, 1337, 1337, 1337, 10151060]; 29 | 30 | return l.u_sort_num_array_desc(my_array); 31 | } 32 | ``` 33 | -------------------------------------------------------------------------------- /docs/upgrades/locks/CON_TELL.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: CON_TELL 3 | --- 4 | 5 | > CON_TELL attempts to send a tell to the owner of the lock 6 | 7 | CON_TELL is a tier 1 [lock](/upgrades/locks) created by the CONTEXT corporation. 8 | 9 | ## Stats 10 | 11 | CON_TELL has no additional stats. The upgrade only spawns at ((%1kiddie%)) rarity. 12 | 13 | ## Behavior 14 | 15 | CON_TELL does not take in any user input, and will be immediately activated upon encountering it. The lock sends a chats.tell message to the targeted user, then allows the attacker to proceed to the next lock. Every subsequent call will send another chats.tell message to the targeted user. 16 | 17 | ## Solving 18 | 19 | Solving is not required for this lock. 20 | -------------------------------------------------------------------------------- /docs/scripting/trust_scripts/autos.reset.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: autos.reset 3 | description: "Resets the caller's autocompletes" 4 | --- 5 | 6 | ((autos.reset)) clears out all of the caller's autocompletes. 7 | 8 | ### Security level 9 | 10 | MIDSEC 11 | 12 | ## Syntax 13 | 14 | ### CLI 15 | 16 | ``` 17 | autos.reset 18 | ``` 19 | 20 | ### Script 21 | 22 | ``` 23 | #ms.autos.reset() 24 | ``` 25 | 26 | ### Parameters 27 | 28 | No known parameters. 29 | 30 | ### Return 31 | 32 | #### CLI 33 | 34 | ``` 35 | Success 36 | 37 | -autocompletes reset- 38 | ``` 39 | 40 | #### Script 41 | 42 | Same as CLI. 43 | 44 | ## Example 45 | 46 | ```js 47 | function(context, args) 48 | { 49 | return #ms.autos.reset() 50 | } 51 | ``` 52 | -------------------------------------------------------------------------------- /docs/scripting/scripts.lib/merge.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: .merge() 3 | --- 4 | 5 | A function that merges the properties of two objects into one object. 6 | 7 | ## Syntax 8 | 9 | ```js 10 | #fs.scripts.lib().merge(obj1, obj2); 11 | ``` 12 | 13 | ### Parameters 14 | 15 | #### obj1 16 | 17 | The object which will be merged into. 18 | 19 | #### obj2 20 | 21 | The object to be merged into the other. 22 | 23 | ### Return 24 | 25 | Returns the new combined object with merged properties. 26 | 27 | ## Example 28 | 29 | ```js 30 | function(context, args) { 31 | const l = #fs.scripts.lib(); 32 | const obj_1 = { prop_1: "value_1" }; 33 | const obj_2 = { prop_2: "value_2" }; 34 | 35 | return l.merge(obj_1, obj_2); 36 | } 37 | ``` 38 | -------------------------------------------------------------------------------- /templates/documentation.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: documentation template 3 | --- 4 | 5 | > In-game description of the script or function 6 | 7 | ### Security Level 8 | 9 | The security level of the script 10 | 11 | ## Syntax 12 | 13 | A description of the scripts or functions behavior 14 | 15 | ### CLI 16 | 17 | Example CLI syntax 18 | 19 | ### Script 20 | 21 | Example script syntax 22 | 23 | ### Parameters 24 | 25 | A list of parameters and their descriptions if applicable 26 | 27 | ### Return 28 | 29 | What the function or script returns 30 | 31 | #### CLI 32 | 33 | return here 34 | 35 | #### Script 36 | 37 | return here 38 | 39 | ## Example 40 | 41 | An example use of the function, in code, or script, in client and code 42 | -------------------------------------------------------------------------------- /docs/autocolor_demo.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Autocolor Demo 3 | unlisted: true 4 | --- 5 | 6 | ### simple 7 | 8 | (( user.script ))\ 9 | (( scripts.trust ))\ 10 | (( trust.me ))\ 11 | (( risk.it ))\ 12 | (( marks.init ))\ 13 | (( marks.protocol )) 14 | 15 | ### color 16 | 17 | (( %5foo% )) 18 | 19 | ### key-value 20 | 21 | (( key: "value" )) 22 | 23 | ### GC 24 | 25 | (( 2Q45T251B1K5GC )) 26 | 27 | ### complex 28 | 29 | (( %X>>trust.me \{key: "value", key: \{}, key: #s.mallory.starchart, amount: "2B1KGC"}% )) 30 | 31 | ### In a paragraph 32 | 33 | Raw markup, followed by resulting HTML: 34 | `hackmud.com should not be colored, but (( %3THIS SHOULD BE BLUE% ))` 35 | hackmud.com should not be colored, but (( %3THIS SHOULD BE BLUE% )) 36 | -------------------------------------------------------------------------------- /docs/upgrades/infiltrator/k3y_v2.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: k3y_v2 3 | --- 4 | 5 | > Keep your nuutec l0cket safe with a security k3y 6 | 7 | k3y_v2 is a tier 2 upgrade. It spawns at ((%0noob%)), ((%1kiddie%)), ((%2h4x0r%)) and ((%3h4rdc0r3%))rarities. 8 | 9 | ## Stats 10 | 11 | ### k3y 12 | 13 | The 'k3y' property for k3y_v2 has 16 known values. These are used for the [[l0ckbox]] lock. k3y_v2's also have use at higher tiers. 14 | 15 |
16 | Spoilers 17 | 18 | List of known k3y_v2 values: 19 | 20 | ``` 21 | hc3b69 22 | 5c7e1r 23 | nfijix 24 | 4jitu5 25 | vthf6e 26 | lq09tg 27 | voon2h 28 | nyi5u2 29 | j1aa4n 30 | d9j270 31 | vzdt6m 32 | cy70mo 33 | 8izsag 34 | hzqgw6 35 | qvgtnt 36 | ooilt2 37 | ``` 38 | 39 |
40 | -------------------------------------------------------------------------------- /docs/upgrades/infiltrator/k3y_v1.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: k3y_v1 3 | --- 4 | 5 | > Keep your nuutec l0cket safe with a security k3y 6 | 7 | k3y_v1 is a tier 1 upgrade. It spawns at ((%0noob%)), ((%1kiddie%)) and ((%2h4x0r%)) rarities. 8 | 9 | ## Stats 10 | 11 | ### k3y 12 | 13 | The 'k3y' property for k3y_v1 has 16 known values. These values serve as possible solutions for the [[l0cket]] lock. k3y_v1's also have use at higher tiers. 14 | 15 |
16 | Spoilers 17 | 18 | List of known k3y_v1 values: 19 | 20 | ``` 21 | 6hh8xw 22 | cmppiq 23 | sa23uw 24 | tvfkyq 25 | uphlaw 26 | vc2c7q 27 | xwz7ja 28 | 72umy0 29 | 9p65cu 30 | ellux0 31 | eoq6de 32 | i874y3 33 | pmvr1q 34 | fr8ibu 35 | xfnkqe 36 | y111qa 37 | ``` 38 | 39 |
40 | -------------------------------------------------------------------------------- /docs/scripting/scripts.lib/side_by_side.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: .side_by_side() 3 | --- 4 | 5 | A function that takes 2 strings and formats them to display side-by-side. 6 | 7 | ## Syntax 8 | 9 | ```js 10 | #fs.scripts.lib().side_by_side(str1, str2); 11 | ``` 12 | 13 | ### Parameters 14 | 15 | #### str1 16 | 17 | The string that will appear on the left side. 18 | 19 | #### str2 20 | 21 | The string that will display on the right side. 22 | 23 | ### Return 24 | 25 | Returns a string. 26 | 27 | ## Example 28 | 29 | ```js 30 | function(context, args) { 31 | const l = #fs.scripts.lib(); 32 | const left_side = "Line 1 left\nLine 2 left"; 33 | const right_side = "Line 1 right\nLine 2 right"; 34 | 35 | return l.side_by_side(left_side, right_side); 36 | } 37 | ``` 38 | -------------------------------------------------------------------------------- /docs/scripting/trust_scripts.mdx: -------------------------------------------------------------------------------- 1 | Trust scripts are scripts provided by Trust herself, and thus can be trusted to act as-described. Probably. ((%D:)%)) 2 | 3 | In the hackmud shell, trust scripts are rendered with a "((%Fsafety orange%))" username, like "[((sys.upgrades))](/scripting/trust_scripts/sys.upgrades)". It is advised to verify this before pressing enter! 4 | 5 | Public Trust scripts can be listed in-game using [((scripts.trust))](/scripting/trust_scripts/scripts.trust). Trust scripts will also show "TRUST" in [((scripts.get_access_level))](/scripting/trust_scripts/scripts.get_access_level) (or ((trust: true)) when subscripted) 6 | 7 | {/* auto-generated list of category doc links: */} 8 | import DocCardList from "@theme/DocCardList"; 9 | 10 | 11 | -------------------------------------------------------------------------------- /docs/scripting/extensions/run_id.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: "_RUN_ID" 3 | 4 | alias: 5 | - RunID 6 | - RUN_ID 7 | - RUNID 8 | --- 9 | 10 | ID of the top-level script execution. 11 | 12 | \_RUN_ID is a global variable that contains a MongoDB [[ObjectId]] generated at the beginning of the top-level script run. This ID is used for [[sys.access_log:((sys.access_log))]] and other game functions, but is also accessible to users at any security level through this variable. 13 | 14 | ## Syntax 15 | 16 | ```js 17 | _RUN_ID; 18 | ``` 19 | 20 | ## Example 21 | 22 | A script that wants to check the Run ID of the current top-level script execution can do so with \_RUN_ID: 23 | 24 | ```js 25 | function(context, args) { 26 | return _RUN_ID // 660f983a3c341078abe70ba2 27 | } 28 | ``` 29 | -------------------------------------------------------------------------------- /templates/event.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: event template 3 | --- 4 | 5 | > memorable quote from the event 6 | 7 | event_name_here was an_event in hackmud. It was released on date_here. 8 | 9 | ## Plot Summary 10 | 11 | Summary of the plot. Use spoiler tags for lore revelations beyond trailheads - particularly if the content is still playable, or is only brought up here. 12 | 13 | ## Gameplay 14 | 15 | Summary of the puzzle's gameplay loop. It doesn't have to be a complete play-by-play, but descriptions of major scripts are helpful. Spoiler tags abound. 16 | 17 | ## Characters 18 | 19 | - List 20 | - of 21 | - characters 22 | 23 | ## Notable Rewards 24 | 25 | Lists of notable rewards from the event (rare upgrades, glams, game-wide outcomes of events like user decay/sectors etc) 26 | -------------------------------------------------------------------------------- /docs/scripting/scripts.lib/clone.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: .clone() 3 | --- 4 | 5 | A function that returns a clone of a value. Any type of value may be cloned, including `undefined`. 6 | 7 | ## Syntax 8 | 9 | ```js 10 | #fs.scripts.lib().clone(i); 11 | ``` 12 | 13 | ### Parameters 14 | 15 | #### i 16 | 17 | The input to be cloned. 18 | 19 | ### Return 20 | 21 | Returns a duplicated copy of the input value. If the input is an object, the return value will have the same keys with cloned values for the keys. The returned value may be modified separately from the original. 22 | 23 | ## Example 24 | 25 | ```js 26 | function(context, args) { 27 | const l = #fs.scripts.lib(); 28 | const my_obj = { 29 | property: "value" 30 | }; 31 | 32 | return l.clone(my_obj); 33 | } 34 | ``` 35 | -------------------------------------------------------------------------------- /docs/scripting/trust_scripts/users.active.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: users.active 3 | description: "Displays the number of currently active users" 4 | --- 5 | 6 | ((users.active)) displays the number of currently active users. 7 | 8 | ### Security Level 9 | 10 | FULLSEC 11 | 12 | ## Syntax 13 | 14 | ### CLI 15 | 16 | ``` 17 | users.active 18 | ``` 19 | 20 | ### Script 21 | 22 | ``` 23 | #fs.users.active() 24 | ``` 25 | 26 | ### Parameters 27 | 28 | No known parameters. 29 | 30 | ### Return 31 | 32 | Returns a number. 33 | 34 | #### CLI 35 | 36 | ``` 37 | >>users.active 38 | current users: 293 39 | 40 | ``` 41 | 42 | #### Script 43 | 44 | ``` 45 | 293 46 | ``` 47 | 48 | ## Example 49 | 50 | ```js 51 | function(context, args) 52 | { 53 | return #fs.users.active() 54 | } 55 | ``` 56 | -------------------------------------------------------------------------------- /docs/scripting/scripts.lib/columnize.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: .columnize() 3 | --- 4 | 5 | A function that will format an array of strings into columns based on the width of the client that is displaying them. 6 | 7 | ## Syntax 8 | 9 | ```js 10 | #fs.scripts.lib().columnize(array); 11 | ``` 12 | 13 | ### Parameters 14 | 15 | #### array 16 | 17 | The array of strings to be columnized. 18 | 19 | ### Return 20 | 21 | Returns a string 22 | 23 | ## Example 24 | 25 | ```js 26 | function(context, args) { 27 | const l = #fs.scripts.lib(); 28 | const my_array = [ 29 | "Dog", 30 | "Cat", 31 | "Elephant", 32 | "Lion", 33 | "Tiger", 34 | "Giraffe", 35 | "Monkey", 36 | "Zebra", 37 | "Kangaroo" 38 | ]; 39 | 40 | return l.columnize(my_array); 41 | } 42 | ``` 43 | -------------------------------------------------------------------------------- /docs/scripting/scripts.lib/clamp.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: .clamp() 3 | --- 4 | 5 | A function that constrains a value within a specified range, ensuring that a value stays within a minimum and maximimum value (inclusive). 6 | 7 | ### Syntax 8 | 9 | ```js 10 | return #fs.scripts.lib().clamp(0, 5, 10); 11 | ``` 12 | 13 | ### Parameters 14 | 15 | #### Value 16 | 17 | The value to be constrained. 18 | 19 | #### Min 20 | 21 | The minimum number the value should be constrained to. 22 | 23 | #### Max 24 | 25 | The maximimum number the value should be constrained to. 26 | 27 | ### Return 28 | 29 | Returns a number. 30 | 31 | ``` 32 | 5 33 | ``` 34 | 35 | ## Example 36 | 37 | ```js 38 | function(context, args) { 39 | const l = #fs.scripts.lib(); 40 | return l.clamp(0, 5, 10); 41 | } 42 | ``` 43 | -------------------------------------------------------------------------------- /docs/scripting/scripts.lib/max_val_index.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: .max_val_index() 3 | --- 4 | 5 | A function that finds the maximimum value in an array and returns both the maximimum value and its index in the array. If multiple elements in the array are the maximum value, the index of the first maximum value will be used. 6 | 7 | ## Syntax 8 | 9 | ```js 10 | #fs.scripts.lib().max_val_index(array); 11 | ``` 12 | 13 | ### Parameters 14 | 15 | #### array 16 | 17 | The array from which the maximimum value index should be extracted. 18 | 19 | ### Return 20 | 21 | Returns an array. 22 | 23 | ## Example 24 | 25 | ```js 26 | function(context, args) { 27 | const l = #fs.scripts.lib(); 28 | const my_array = [2001, 3006, 1337, 42, 7]; 29 | 30 | return l.max_val_index(my_array); 31 | } 32 | ``` 33 | -------------------------------------------------------------------------------- /docs/scripting/trust_scripts/chats.channels.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: chats.channels 3 | description: "Gets all of the channels the caller is in" 4 | --- 5 | 6 | ((chats.channels)) returns all the channels a user is in currently. 7 | 8 | ### Security level 9 | 10 | MIDSEC 11 | 12 | ## Syntax 13 | 14 | ### CLI 15 | 16 | ``` 17 | chats.channels 18 | ``` 19 | 20 | ### Script 21 | 22 | ``` 23 | #ms.chats.channels() 24 | ``` 25 | 26 | ### Parameters 27 | 28 | No known parameters. 29 | 30 | ### Return 31 | 32 | Returns an array. 33 | 34 | #### CLI 35 | 36 | ``` 37 | >>chats.channels 38 | 0000 39 | 0001 40 | example_channel 41 | ``` 42 | 43 | #### Script 44 | 45 | Same as CLI 46 | 47 | ## Example 48 | 49 | ```js 50 | function(context, args) 51 | { 52 | return #ms.chats.channels() 53 | } 54 | ``` 55 | -------------------------------------------------------------------------------- /docs/scripting/scripts.lib/uniq.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: .uniq() 3 | --- 4 | 5 | A function that deduplicates adjacent elements from an array, while preserving the order of the remaining elements. 6 | 7 | Similar to the \*nix `uniq` command, duplicate values that are not adjacent are _not_ removed. 8 | 9 | ## Syntax 10 | 11 | ```js 12 | #fs.scripts.lib().uniq(array); 13 | ``` 14 | 15 | ### Parameters 16 | 17 | #### array 18 | 19 | The array to be deduplicated. 20 | 21 | ### Return 22 | 23 | Returns an array. 24 | 25 | ## Example 26 | 27 | ```js 28 | function(context, args) { 29 | const l = #fs.scripts.lib(); 30 | const my_array = ["apples", "apples", "bananas", "oranges", "apples", "limes"]; 31 | 32 | return l.uniq(my_array); // => ["apples", "bananas", "oranges", "apples", "limes"] 33 | } 34 | ``` 35 | -------------------------------------------------------------------------------- /docs/scripting/scripts.lib/count.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: .count() 3 | --- 4 | 5 | A function that counts the number of elements in a given array that satisfy the condition of a specified function. 6 | 7 | ## Syntax 8 | 9 | ```js 10 | #fs.scripts.lib().count(array, func); 11 | ``` 12 | 13 | ### Parameters 14 | 15 | #### array 16 | 17 | The array of elements to be evaluated. 18 | 19 | #### func 20 | 21 | The function to be executed. This function should return a boolean. 22 | 23 | ### Return 24 | 25 | Returns a number. 26 | 27 | ## Example 28 | 29 | ```js 30 | function(context, args) { 31 | const l = #fs.scripts.lib(); 32 | const my_array = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; 33 | 34 | function is_even(index, value) { 35 | return value % 2 === 0; 36 | }; 37 | 38 | return l.count(my_array, is_even); 39 | } 40 | ``` 41 | -------------------------------------------------------------------------------- /docs/scripting/scripts.lib/is_not_today.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: .is_not_today() 3 | --- 4 | 5 | A function that checks if a specified date is in the past compared to today's date. 6 | 7 | ## Syntax 8 | 9 | ```js 10 | #fs.scripts.lib().is_not_today(date); 11 | ``` 12 | 13 | ### Parameters 14 | 15 | #### date 16 | 17 | A JavaScript `Date` object. This date must be in the past. 18 | 19 | ### Return 20 | 21 | Returns a boolean. 22 | 23 | ## Example 24 | 25 | ```js 26 | function(context, args) { 27 | const l = #fs.scripts.lib(); 28 | const past_date = new Date('1970-01-01'); 29 | 30 | if(l.is_not_today(past_date)) { 31 | // evaluates as true 32 | return "This date is in the past" 33 | 34 | } else if(l.is_not_today(new Date())){ 35 | // evaluates as false 36 | return "Today's date, try again tomorrow." 37 | } 38 | } 39 | ``` 40 | -------------------------------------------------------------------------------- /docs/scripting/scripts.lib/map.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: .map() 3 | --- 4 | 5 | A function that iterates over a given array and executes a specified function on each element, and then returns an array of the results. 6 | 7 | ## Syntax 8 | 9 | ```js 10 | #fs.scripts.lib().map(array, func); 11 | ``` 12 | 13 | ### Parameters 14 | 15 | #### array 16 | 17 | The array to iterate over and execute a function on each element. 18 | 19 | #### func 20 | 21 | The function to execute on each element. 22 | 23 | ### Return 24 | 25 | Returns an array. 26 | 27 | ## Example 28 | 29 | ```js 30 | function(context, args) { 31 | const l = #fs.scripts.lib(); 32 | const my_array = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; 33 | 34 | function square(index, value) { 35 | return value * value; 36 | }; 37 | 38 | return l.map(my_array, square); 39 | } 40 | ``` 41 | -------------------------------------------------------------------------------- /docs/scripting/scripts.lib/rjust.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: .rjust() 3 | --- 4 | 5 | A function that right-justifies a string within a given width by padding it with a specified character, or space by default. 6 | 7 | ## Syntax 8 | 9 | ```js 10 | #fs.scripts.lib().rjust(string, width, character); 11 | ``` 12 | 13 | ### Parameters 14 | 15 | #### string 16 | 17 | The string to be right-justified. 18 | 19 | #### width 20 | 21 | The width of the field. 22 | 23 | #### character (optional) 24 | 25 | The character used for padding. If not provided, it defaults to a space. 26 | 27 | ### Return 28 | 29 | Returns a string. 30 | 31 | ## Example 32 | 33 | ```js 34 | function(context, args) { 35 | const l = #fs.scripts.lib(); 36 | const my_string = "hello"; 37 | const padding = "-"; 38 | 39 | return l.rjust(my_string, 10, padding); 40 | } 41 | ``` 42 | -------------------------------------------------------------------------------- /docs/scripting/scripts.lib/sfc32.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: .sfc32() 3 | --- 4 | 5 | A function that takes 4 seed parameters and returns a PRNG function based on the sfc32 algorithm. 6 | 7 | ## Syntax 8 | 9 | ```js 10 | #fs.scripts.lib().sfc32(a, b, c, d); 11 | ``` 12 | 13 | ### Parameters 14 | 15 | #### a 16 | 17 | First seed number. 18 | 19 | #### b 20 | 21 | Second seed number. 22 | 23 | #### c 24 | 25 | Third seed number. 26 | 27 | #### d 28 | 29 | Fourth seed number. 30 | 31 | ### Return 32 | 33 | Returns a number. 34 | 35 | ## Example 36 | 37 | ```js 38 | function(context, args) { 39 | const l = #fs.scripts.lib(); 40 | const seed_1 = 3554674; 41 | const seed_2 = 4865874; 42 | const seed_3 = 4242356; 43 | const seed_4 = 9674544; 44 | const rng = l.sfc32(seed_1, seed_2, seed_3, seed_4); 45 | 46 | return rng(); 47 | } 48 | ``` 49 | -------------------------------------------------------------------------------- /docs/scripting/scripts.lib/to_gc_num.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: .to_gc_num() 3 | --- 4 | 5 | Takes a GC string and turns it into a number. 6 | 7 | ## Syntax 8 | 9 | ```js 10 | #fs.scripts.lib().to_gc_num(gc_string); 11 | ``` 12 | 13 | ### Parameters 14 | 15 | #### gc_string 16 | 17 | The formatted GC string to be turned into a number. 18 | 19 | ### Return 20 | 21 | Returns a number. 22 | 23 | For invalid `gc_string` values, the following object is returned: 24 | 25 | ```js 26 | { 27 | ok: false, 28 | msg: "GC string \"" + gc_string + "\" is not in correct format. Example GC strings: \"1M234K567GC\", \"1B5KGC\", \"2MGC\", \"9GC\"." 29 | } 30 | ``` 31 | 32 | ## Example 33 | 34 | ```js 35 | function(context, args) { 36 | const l = #fs.scripts.lib(); 37 | const my_gc_string = "100M200K300GC"; 38 | 39 | return l.to_gc_num(my_gc_string); 40 | } 41 | ``` 42 | -------------------------------------------------------------------------------- /docs/scripting/scripts.lib/each.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: .each() 3 | --- 4 | 5 | A helper function that allows execution of a specified function for each element of an array. 6 | 7 | ## Syntax 8 | 9 | ```js 10 | #fs.scripts.lib().each(array, func); 11 | ``` 12 | 13 | ### Parameters 14 | 15 | #### array 16 | 17 | The array to be iterated over, and its elements to have a function executed on. 18 | 19 | #### func 20 | 21 | The function to excute on each element of the array. 22 | 23 | ### Return 24 | 25 | Returns an array. 26 | 27 | ## Example 28 | 29 | ```js 30 | function(context, args) { 31 | const l = #fs.scripts.lib(); 32 | const my_array = [1, 2, 3, 4, 5]; 33 | 34 | function my_func (index) { 35 | const output = []; 36 | output.push(index); 37 | return output; 38 | }; 39 | 40 | return l.each(my_array, my_func); 41 | } 42 | ``` 43 | -------------------------------------------------------------------------------- /docs/scripting/scripts.lib/xoshiro128ss.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: .xoshiro128ss() 3 | --- 4 | 5 | A function that returns a PRNG function from 4 numerical seeds based on the xoshiro128ss RNG. 6 | 7 | ## Syntax 8 | 9 | ```js 10 | #fs.scripts.lib().xoshiro128ss(a, b, c, d); 11 | ``` 12 | 13 | ### Parameters 14 | 15 | #### a 16 | 17 | First seed number. 18 | 19 | #### b 20 | 21 | Second seed number. 22 | 23 | #### c 24 | 25 | Third seed number. 26 | 27 | #### d 28 | 29 | Fourth seed number. 30 | 31 | ### Return 32 | 33 | Returns a function. 34 | 35 | ## Example 36 | 37 | ```js 38 | function(context, args) { 39 | const l = #fs.scripts.lib(); 40 | const seed_1 = 35484; 41 | const seed_2 = 97456; 42 | const seed_3 = 35241; 43 | const seed_4 = 85746; 44 | const rng = l.xoshiro128ss(seed_1, seed_2, seed_3, seed_4); 45 | 46 | return rng() 47 | } 48 | ``` 49 | -------------------------------------------------------------------------------- /docs/scripting/scripts.lib/corrupt.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: .corrupt() 3 | --- 4 | 5 | Applies corruption throughout a given string, in the specified frequency. 6 | 7 | ## Syntax 8 | 9 | ```js 10 | #fs.scripts.lib().corrupt(str, corruption); 11 | ``` 12 | 13 | ### Parameters 14 | 15 | #### str 16 | 17 | The string to be corrupted. 18 | 19 | #### corruption 20 | 21 | An integer specifying the "level" of corruption. The actual frequency of corruption (in corrupted characters per 80 characters of input) is given by using this integer as an index into [[.corruptions]]. Invalid indexes result in no corruption. 22 | 23 | ### Return 24 | 25 | Returns a string. 26 | 27 | ## Example 28 | 29 | ```js 30 | function(context, args) { 31 | const l = #fs.scripts.lib(); 32 | const my_string = "I am a string to be corrupted."; 33 | 34 | return l.corrupt(my_string, 3); 35 | } 36 | ``` 37 | -------------------------------------------------------------------------------- /docs/scripting/scripts.lib/dbir_result_failed.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: .dbir_result_failed() 3 | --- 4 | 5 | A function that takes a number and the result of a MongoDB insertion (array) and returns a boolean to check if the insertion was successful or not. (true indicates a Failure) 6 | 7 | ## Syntax 8 | 9 | ```js 10 | #fs.scripts.lib().dbir_result_failed(result, num); 11 | ``` 12 | 13 | ### Parameters 14 | 15 | #### result 16 | 17 | The result of a MongoDB insertion. (array) 18 | 19 | #### num 20 | 21 | The number of inserted documents. If no number is passed, the parameter will default to 1. 22 | 23 | ### Return 24 | 25 | Returns a boolean. 26 | 27 | ## Example 28 | 29 | ```js 30 | function(context, args) { 31 | const l = #fs.scripts.lib(); 32 | const update = #db.i({ my_db_article: "is awesome"}); 33 | 34 | return l.dbir_result_failed(update, 1); 35 | } 36 | ``` 37 | -------------------------------------------------------------------------------- /docs/scripting/trust_scripts/accts.balance.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: accts.balance 3 | description: "Returns the user's current GC balance" 4 | --- 5 | 6 | ((accts.balance)) returns the user's current ((%CGC%)) balance 7 | 8 | ### Security Level 9 | 10 | HIGHSEC 11 | 12 | ## Syntax 13 | 14 | ### CLI 15 | 16 | ``` 17 | accts.balance 18 | ``` 19 | 20 | ### Script 21 | 22 | ``` 23 | #hs.accts.balance() 24 | ``` 25 | 26 | ### Parameters 27 | 28 | No known parameters. 29 | 30 | ### Return 31 | 32 | #### CLI 33 | 34 | On the CLI ((accts.balance)) returns a ((%CGC%)) string 35 | 36 | ``` 37 | >>accts.balance 38 | 1M234K567GC 39 | ``` 40 | 41 | #### Script 42 | 43 | In a script, #hs.accts.balance() returns a number 44 | 45 | ``` 46 | 1234567 47 | ``` 48 | 49 | ## Example 50 | 51 | ```js 52 | function(context, args) 53 | { 54 | let bal = #hs.accts.balance() 55 | return bal 56 | } 57 | ``` 58 | -------------------------------------------------------------------------------- /docs/scripting/scripts.lib/dbu_result_failed.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: .dbu_result_failed() 3 | --- 4 | 5 | A function that takes a number and the result of a MongoDB operation (array) and returns a boolean to check if the operation was successful or not. (true indicates a Failure) 6 | 7 | ## Syntax 8 | 9 | ```js 10 | #fs.scripts.lib().dbu_result_failed(result, num); 11 | ``` 12 | 13 | ### Parameters 14 | 15 | #### result 16 | 17 | The result of a MongoDB operaton. (array) 18 | 19 | #### num 20 | 21 | The number of modified documents. If no number is passed, the parameter will default to 1. 22 | 23 | ### Return 24 | 25 | Returns a boolean. 26 | 27 | ## Example 28 | 29 | ```js 30 | function(context, args) { 31 | const l = #fs.scripts.lib(); 32 | const update = #db.u({ my_db_article: { $exists:true }}, { $set: { new_property: 123 } }); 33 | 34 | return l.dbu_result_failed(update, 1); 35 | } 36 | ``` 37 | -------------------------------------------------------------------------------- /docs/scripting/trust_scripts/corps.hire.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: corps.hire 3 | description: "Hires another user to a player corporation" 4 | --- 5 | 6 | ((corps.hire)) allows a player corporation owner or admin to hire another user. 7 | 8 | ### Security level 9 | 10 | NULLSEC 11 | 12 | ## Syntax 13 | 14 | ### CLI 15 | 16 | ``` 17 | corps.hire { name: "example_user" } 18 | ``` 19 | 20 | ### Script 21 | 22 | ``` 23 | #ns.corps.hire() 24 | ``` 25 | 26 | ### Parameters 27 | 28 | #### name (required) 29 | 30 | The '((%Nname%))' argument specifies the user to be hired. 31 | 32 | ### Return 33 | 34 | Returns an object. 35 | 36 | #### CLI 37 | 38 | ``` 39 | >>corps.hire{name: "example_user"} 40 | Success 41 | 42 | ``` 43 | 44 | #### Script 45 | 46 | Same as CLI. 47 | 48 | ## Example 49 | 50 | ```js 51 | function(context, args) 52 | { 53 | return #ns.corps.hire({ name: "example_user" }) 54 | } 55 | ``` 56 | -------------------------------------------------------------------------------- /docs/scripting/trust_scripts/sys.status.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: sys.status 3 | description: "Returns the user's system status" 4 | --- 5 | 6 | ((sys.status)) returns the status of the user that runs it. 7 | 8 | ### Security Level 9 | 10 | HIGHSEC 11 | 12 | ## Syntax 13 | 14 | ### CLI 15 | 16 | ``` 17 | sys.status 18 | ``` 19 | 20 | ### Script 21 | 22 | ``` 23 | #hs.sys.status() 24 | ``` 25 | 26 | ### Parameters 27 | 28 | There are no known parameters. 29 | 30 | ### Return 31 | 32 | ### CLI 33 | 34 | Returns a string. 35 | 36 | ``` 37 | >>sys.status 38 | -system status nominal- 39 | ``` 40 | 41 | or 42 | 43 | ``` 44 | >>sys.status 45 | -system is breached- 46 | ``` 47 | 48 | ### Script 49 | 50 | ``` 51 | { 52 | hardline: 0, 53 | tutorial: "", 54 | breach: false 55 | } 56 | ``` 57 | 58 | ## Example 59 | 60 | ```js 61 | function(context, args) 62 | { 63 | return #hs.sys.status() 64 | } 65 | ``` 66 | -------------------------------------------------------------------------------- /docs/scripting/trust_scripts/corps.quit.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: corps.quit 3 | description: "Leave a player corporation" 4 | --- 5 | 6 | ((corps.quit)) allows a player corporation member remove themselves from the player corporation. 7 | 8 | ### Security level 9 | 10 | NULLSEC 11 | 12 | ## Syntax 13 | 14 | ### CLI 15 | 16 | ``` 17 | corps.quit { confirm: true } 18 | ``` 19 | 20 | ### Script 21 | 22 | ``` 23 | #ns.corps.quit({ confirm: true }) 24 | ``` 25 | 26 | ### Parameters 27 | 28 | #### confirm (required) 29 | 30 | The '((%Nconfirm%))' argument confirms quitting the player corporation. 31 | 32 | ### Return 33 | 34 | Returns an object. 35 | 36 | #### CLI 37 | 38 | ``` 39 | >>corps.quit { confirm: true } 40 | Success 41 | ``` 42 | 43 | #### Script 44 | 45 | Same as CLI. 46 | 47 | ## Example 48 | 49 | ```js 50 | function (context,args) 51 | { 52 | return #ns.corps.quit({ confirm: true }) 53 | } 54 | ``` 55 | -------------------------------------------------------------------------------- /docs/scripting/scripts.lib/select_one.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: .select_one() 3 | --- 4 | 5 | A function that selects the first element of a given array that satisfies the condition of a specified function. 6 | 7 | ## Syntax 8 | 9 | ```js 10 | #fs.scripts.lib().select_one(array, func); 11 | ``` 12 | 13 | ### Parameters 14 | 15 | #### array 16 | 17 | The array of elements to be evaluated. 18 | 19 | #### func 20 | 21 | The function to execute on each element. This function should return a boolean. 22 | 23 | ### Return 24 | 25 | Returns the first element in the array that satisfies the condition specified by the function. 26 | 27 | ## Example 28 | 29 | ```js 30 | function(context, args) { 31 | const l = #fs.scripts.lib(); 32 | const my_array = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; 33 | 34 | function is_even (index, value) { 35 | return value % 2 === 0; 36 | } 37 | 38 | return l.select_one(my_array, is_even); 39 | } 40 | ``` 41 | -------------------------------------------------------------------------------- /docs/scripting/trust_scripts/market.stats.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: market.stats 3 | description: "Returns info about the caller's market sales" 4 | --- 5 | 6 | ((market.stats)) returns an object containing statistical information about items listed and sold on the market, as well as ((%CGC%)) earned from marketplace sales. 7 | 8 | ### Security Level 9 | 10 | MIDSEC 11 | 12 | ## Syntax 13 | 14 | ### CLI 15 | 16 | ``` 17 | market.stats 18 | ``` 19 | 20 | ### Script 21 | 22 | ``` 23 | #ms.market.stats() 24 | ``` 25 | 26 | ### Parameters 27 | 28 | No known parameters. 29 | 30 | ### Return 31 | 32 | Returns an object. 33 | 34 | #### CLI 35 | 36 | ``` 37 | >>market.stats 38 | { 39 | total: "0GC", 40 | outstanding: "0GC", 41 | listed: 1, 42 | sold: 0 43 | } 44 | ``` 45 | 46 | #### Script 47 | 48 | Same as CLI. 49 | 50 | ## Example 51 | 52 | ```js 53 | function(context, args) 54 | { 55 | return #ms.market.stats() 56 | } 57 | ``` 58 | -------------------------------------------------------------------------------- /docs/scripting/extensions/end.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: "_END" 3 | 4 | alias: END 5 | --- 6 | 7 | Timestamp of the latest possible end of the top-level script execution. 8 | 9 | \_END is a global variable that provides a timestamp, in milliseconds since the [Unix epoch](https://en.wikipedia.org/wiki/Unix_time), of when the script execution is guaranteed to end due to a timeout. This number is effectively [[_START]] + [[_TIMEOUT]]. 10 | 11 | ## Syntax 12 | 13 | ```js 14 | _END; 15 | ``` 16 | 17 | ## Example 18 | 19 | A script that wants to check how close it is to timing out can use \_END instead of \_START + \_TIMEOUT or [((scripts.lib))](../scripts_lib)'s [[can_continue_execution]]: 20 | 21 | ```js 22 | function(context, args) { 23 | // do stuff 24 | 25 | if(_END - Date.now() < 500){ 26 | return "Less than 500ms left! Bailing!" 27 | } 28 | 29 | // do more stuff 30 | 31 | return "Script completed without timing out" 32 | } 33 | ``` 34 | -------------------------------------------------------------------------------- /docs/scripting/scripts.lib/lerp.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: .lerp() 3 | --- 4 | 5 | LERP stands for Linear Interpolation; a mathematical function in which a value interpolates between 'start' and 'end' values. 6 | Formula: start + (end - start) \* t 7 | 8 | ## Syntax 9 | 10 | ```js 11 | return #fs.scripts.lib().lerp(/* t: */ 0.5, /* start: */ 0, /* end: */ 10); 12 | ``` 13 | 14 | ### Parameters 15 | 16 | #### t 17 | 18 | The interpolation factor, usually between 0 and 1. If t is 0 the result is equal to Start. When the value is 1, the result is equal to End. Values between 0 and 1 will interpolate between Start and End. 19 | 20 | #### Start 21 | 22 | The starting value. 23 | 24 | #### End 25 | 26 | The ending value. 27 | 28 | ### Return 29 | 30 | Returns a number. 31 | 32 | ``` 33 | 5 34 | ``` 35 | 36 | ## Example 37 | 38 | ```js 39 | function(context, args) { 40 | const l = #fs.scripts.lib(); 41 | return l.lerp(0.5, 0, 10); 42 | } 43 | ``` 44 | -------------------------------------------------------------------------------- /docs/scripting/scripts.lib/select.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: .select() 3 | --- 4 | 5 | The select function behaves similarly to `filter` in JavaScript. The function iterates over an array and applies a specified function to the array. Each element of the array that is evaluated as `true` by the specified function will be returned. 6 | 7 | ## Syntax 8 | 9 | ```js 10 | #fs.scripts.lib().select(array, func); 11 | ``` 12 | 13 | ### Parameters 14 | 15 | #### array 16 | 17 | The array to be selected from. 18 | 19 | #### func 20 | 21 | The function that should be applied. This function should return a boolean. 22 | 23 | ### Return 24 | 25 | Returns an array. 26 | 27 | ## Example 28 | 29 | ```js 30 | function(context, args) { 31 | const l = #fs.scripts.lib(); 32 | const my_array = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; 33 | 34 | function is_even (index, value) { 35 | return value % 2 === 0; 36 | }; 37 | 38 | return l.select(my_array, is_even); 39 | } 40 | ``` 41 | -------------------------------------------------------------------------------- /docs/scripting/scripts.lib/is_script.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: .is_script() 3 | --- 4 | 5 | A function that checks if a script is being ran as a subscript, given context and args parameters. Useful for differentiating behavior in a script between calls on the CLI vs in subscripts 6 | 7 | ## Syntax 8 | 9 | ```js 10 | #fs.scripts.lib().is_script(context, args); 11 | ``` 12 | 13 | ### Parameters 14 | 15 | #### context 16 | 17 | A context object - typically the one received by your own script. 18 | 19 | #### args 20 | 21 | An arguments object - typically the one received by your own script. Used to make `{is_script:true}` on the CLI behave identically to a subscripted output. 22 | 23 | ### Return 24 | 25 | Returns a boolean. 26 | 27 | ## Example 28 | 29 | ```js 30 | function(context, args) { 31 | const l = #fs.scripts.lib(); 32 | 33 | return l.is_script(context, arg) ? "this was called with is_script:true or was called as a subscript" : "neither"; 34 | } 35 | ``` 36 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | This document builds on the [default contributing.md](https://github.com/comcode-org/.github/blob/main/CONTRIBUTING.md). Please read that before this document. 4 | 5 | ## How to create an article 6 | 7 | ## How to review an article PR 8 | 9 | Article PRs should be reviewed using the [PR review process here](https://github.com/comcode-org/.github/blob/main/CONTRIBUTING.md#reviewing-pull-requests). Additionally, `Correct` content changes must adhere to the [content guide](https://github.com/comcode-org/hackmud_wiki?tab=readme-ov-file#content-guide). 10 | 11 | ## How to make changes to code 12 | 13 | ### Creating tests 14 | 15 | Test files must be within `/src`, with a file name ending in `.test.`, where `` is one of `js` `mjs` `jsx` `ts` `tsx`. 16 | 17 | ## How to review a code change 18 | 19 | [Use the standard review process](https://github.com/comcode-org/.github/blob/main/CONTRIBUTING.md#reviewing-pull-requests). 20 | -------------------------------------------------------------------------------- /docs/scripting/scripts.lib/pick.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: .pick() 3 | --- 4 | 5 | A function that takes an object and creates a new object containing only the specified keys from the original object. 6 | 7 | ## Syntax 8 | 9 | ```js 10 | #fs.scripts.lib().pick(obj, keys); 11 | ``` 12 | 13 | ### Parameters 14 | 15 | #### obj 16 | 17 | The original object. 18 | 19 | #### keys 20 | 21 | The keys from the original object that we should create the new object with. 22 | 23 | ### Return 24 | 25 | Returns an object. 26 | 27 | ## Example 28 | 29 | ```js 30 | function(context, args) { 31 | const l = #fs.scripts.lib(); 32 | const my_obj = { 33 | vehicles: ["train", "plane", "automobile"], 34 | places: ["diner", "hotel", "concert venue"], 35 | payment_types: ["GC", "bits", "I.O.U."], 36 | favorite_food: ["key", "char_count_v1", "lime"] 37 | }; 38 | const keys_to_pick = ["payment_types", "favorite_food"]; 39 | 40 | return l.pick(my_obj, keys_to_pick); 41 | } 42 | ``` 43 | -------------------------------------------------------------------------------- /docs/scripting/trust_scripts/chats.join.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: chats.join 3 | description: "Joins a specified channel" 4 | --- 5 | 6 | ((chats.join)) allows a user to join a specified channel. 7 | 8 | ### Security level 9 | 10 | MIDSEC 11 | 12 | ## Syntax 13 | 14 | ### CLI 15 | 16 | ``` 17 | chats.join { channel: "example_channel" } 18 | ``` 19 | 20 | ### Script 21 | 22 | ``` 23 | #ms.chats.join({ channel: "example_channel" }) 24 | ``` 25 | 26 | ### Parameters 27 | 28 | #### channel (required) 29 | 30 | The '((%Nchannel%))' argument specifies which channel to join. 31 | 32 | ### Return 33 | 34 | Returns an object. 35 | 36 | #### CLI 37 | 38 | ``` 39 | >>chats.join { channel: "example_channel" } 40 | Success 41 | 42 | 1555 example_channel :::user joined channel::: 43 | ``` 44 | 45 | #### Script 46 | 47 | Same as CLI. 48 | 49 | ## Example 50 | 51 | ```js 52 | function(context, args) 53 | { 54 | return #ms.chats.join({ channel: "example_channel" }) 55 | } 56 | ``` 57 | -------------------------------------------------------------------------------- /docs/scripting/trust_scripts/chats.leave.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: chats.leave 3 | description: "Leaves a specified channel" 4 | --- 5 | 6 | ((chats.leave)) allows a user to leave a specified channel. 7 | 8 | ### Security level 9 | 10 | MIDSEC 11 | 12 | ## Syntax 13 | 14 | ### CLI 15 | 16 | ``` 17 | chats.leave { channel: "example_channel" } 18 | ``` 19 | 20 | ### Script 21 | 22 | ``` 23 | #ms.chats.leave({ channel: "example_channel" }) 24 | ``` 25 | 26 | ### Parameters 27 | 28 | #### channel (required) 29 | 30 | The '((%Nchannel%))' argument specifies which chat channel to leave. 31 | 32 | ### Return 33 | 34 | Returns an object. 35 | 36 | #### CLI 37 | 38 | ``` 39 | >>chats.leave {channel: "example_channel"} 40 | Success 41 | 42 | 1613 example_channel :::user left channel::: 43 | ``` 44 | 45 | #### Script 46 | 47 | Same as CLI. 48 | 49 | ## Example 50 | 51 | ```js 52 | function(context, args) 53 | { 54 | return #ms.chats.leave({ channel: "example_channel" }) 55 | } 56 | ``` 57 | -------------------------------------------------------------------------------- /docs/scripting/syntax/simple_input.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Simple Input 3 | --- 4 | 5 | > input: "simplified" 6 | 7 | _- The author of this page._ 8 | 9 | ## Syntax 10 | 11 | Simple input is when a script is called in the CLI, but instead of an object being given, the script is just followed by text: 12 | 13 | ``` 14 | user.script wow, such input 15 | ``` 16 | 17 | Simple input is passed into the called script's args object as a string with the key ((%Ninput%)). 18 | 19 | ## Examples 20 | 21 | If a script is run with the following simple input; 22 | 23 | ``` 24 | user.script simple Input 25 | ``` 26 | 27 | The contents of that script's args would be: 28 | 29 | ``` 30 | {input: "simple Input"} 31 | ``` 32 | 33 | A script that takes a simple input and returns that simple input would contain the following code: 34 | 35 | ```js 36 | function(context, args) { 37 | 38 | return args.input 39 | 40 | } 41 | ``` 42 | 43 | And with the above input, the output would be: 44 | 45 | ``` 46 | simple Input 47 | ``` 48 | -------------------------------------------------------------------------------- /docs/scripting/scripts.lib/are_ids_eq.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: .are_ids_eq() 3 | --- 4 | 5 | Compares two strings or ObjectIDs and evaluates if they are equal. Useful for comparing MongoDB documents by IDs. 6 | 7 | ## Syntax 8 | 9 | ```js 10 | return #fs.scripts.lib().are_ids_eq(id1, id2); 11 | ``` 12 | 13 | ### Parameters 14 | 15 | #### id1 16 | 17 | The first string or ObjectID value. 18 | 19 | #### id2 20 | 21 | The second string or ObjectID value. 22 | 23 | ### Return 24 | 25 | Returns a boolean. 26 | 27 | ``` 28 | False 29 | ``` 30 | 31 | ## Example 32 | 33 | ```js 34 | function(context, args) { 35 | let l = #fs.scripts.lib(); 36 | let id1 = "65c982ee9edd1f997c9806ac"; 37 | let id2 = "65c982ee9edd1f997c9806a0"; 38 | return l.are_ids_eq(id1, id2); 39 | } 40 | ``` 41 | 42 | ```js 43 | function(context, args) { 44 | let l = #fs.scripts.lib(); 45 | let id1 = { $oid: "65c982ee9edd1f997c9806ac" }; 46 | let id2 = { $oid: "65c982ee9edd1f997c9806a0" }; 47 | return l.are_ids_eq(id1, id2); 48 | } 49 | ``` 50 | -------------------------------------------------------------------------------- /docs/scripting/extensions/json.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: JSON 3 | description: JSON extensions. 4 | --- 5 | 6 | The functions [`JSON.stringify`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify) and [`JSON.parse`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse) are extended as follows: 7 | 8 | An additional argument is inserted in the second position, turning the signatures into: 9 | 10 | ``` 11 | JSON.stringify(value, [, error[, replacer[, space]]]) 12 | JSON.parse(text, [, error[, reviver]]) 13 | ``` 14 | 15 | The `error` argument behaves as follows: 16 | If an object is passed and an error occurs, the function sets `error.ok` to `false` and `error.msg` to the error message, then returns `null`. 17 | 18 | For `JSON.stringify`, only `TypeError`s are caught. If a different error occurs, it is thrown as normal. 19 | 20 | The original `JSON.stringify` and `JSON.parse` functions are available under `JSON.ostringify` and `JSON.oparse` respectively. 21 | -------------------------------------------------------------------------------- /docs/scripting/trust_scripts/accts.balance_of_owner.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: accts.balance_of_owner 3 | description: "Returns the script owner's GC balance" 4 | --- 5 | 6 | When called as a subscript in a script that is hosted by one player, ((accts.balance_of_owner)) allows the balance of the script owner to be seen by a different user running the script. 7 | 8 | ### Security Level 9 | 10 | FULLSEC 11 | 12 | ## Syntax 13 | 14 | ### CLI 15 | 16 | ``` 17 | accts.balance_of_owner 18 | ``` 19 | 20 | ### Script 21 | 22 | ``` 23 | #fs.accts.balance_of_owner() 24 | ``` 25 | 26 | ### Parameters 27 | 28 | No known parameters. 29 | 30 | ### Return 31 | 32 | #### CLI 33 | 34 | ``` 35 | >>accts.balance_of_owner 36 | Usage: (in subscript) #fs.accts.balance_of_owner() 37 | ``` 38 | 39 | #### Script 40 | 41 | accts.balance_of_owner returns a number: 42 | 43 | ``` 44 | 1234567 45 | ``` 46 | 47 | ## Example 48 | 49 | ```js 50 | function(context, args) 51 | { 52 | let bal_of_owner = #fs.accts.balance_of_owner() 53 | return bal_of_owner 54 | } 55 | ``` 56 | -------------------------------------------------------------------------------- /docs/scripting/trust_scripts/gui.vol.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: gui.vol 3 | description: "Controls the game volume" 4 | --- 5 | 6 | ((gui.vol)) controls the game volume. 7 | 8 | ### Security Level 9 | 10 | FULLSEC 11 | 12 | ## Syntax 13 | 14 | ### CLI 15 | 16 | ``` 17 | gui.vol { bgm: 5, sfx: 5 } 18 | ``` 19 | 20 | ### Script 21 | 22 | Cannot be called as a subscript. 23 | 24 | ### Parameters 25 | 26 | At least one argument is required. If no arguments are provided, ((gui.vol)) will return a ((%DFailure%)) object and usage instructions. All argument values are numbers ranging from ((%V0%)) to ((%V11%)). The default values are ((%V11%)). 27 | 28 | #### bgm 29 | 30 | The '((%Nbgm%))' argument specifies the music volume. 31 | 32 | #### sfx 33 | 34 | The '((%Nsfx%))' argument specifies the sound effects volume. 35 | 36 | ### Return 37 | 38 | Returns a ((%LSuccess%)) or ((%DFailure%)) object. 39 | 40 | #### CLI 41 | 42 | ``` 43 | >>gui.vol { bgm: 5, sfx: 5 } 44 | Success 45 | ``` 46 | 47 | #### Script 48 | 49 | Cannot be called as a subscript. 50 | -------------------------------------------------------------------------------- /docs/upgrades/locks/ez_21.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: ez_21 3 | --- 4 | 5 | > From the Halperyon Systems' EZ line comes the 21. A very unexceptional lock, unless you count the price: dirt-cheap. 6 | 7 | ez_21 is a tier 1 [lock](/upgrades/locks) created by the HALPERYON SYSTEMS corporation. 8 | 9 | ### Stats 10 | 11 | ez_21 has no additional stats. The upgrade only spawns at ((%0noob%)) rarity. 12 | 13 | ## Behavior 14 | 15 | When encountered, the lock expects a string as its parameter, and will return an error if a different data type is input. 16 | 17 | ## Solving 18 | 19 | ### Example unlock 20 | 21 |
22 | Spoilers 23 | ``` 24 | >>user.loc { ez_21: "open" } 25 | WARNING: BINMAT security shell inactive. Intelligent defense system offline. 26 | LOCK_UNLOCKED 27 | System breached. 28 | Connection terminated. 29 | ``` 30 |
31 | 32 | ### ez_21 33 | 34 |
35 | Spoilers 36 | 37 | The possible strings to solve an ez_21 are, "open", "unlock", and "release". 38 | 39 |
40 | -------------------------------------------------------------------------------- /docs/scripting/trust_scripts/scripts.user.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: scripts.user 3 | description: "Returns the scripts currently hosted on a user" 4 | --- 5 | 6 | ((scripts.user)) lists the player-made scripts that are currently hosted (((%C#up%))) on a user. 7 | 8 | ### Security Level 9 | 10 | MIDSEC 11 | 12 | ## Syntax 13 | 14 | ### CLI 15 | 16 | ``` 17 | scripts.user 18 | ``` 19 | 20 | ### Script 21 | 22 | ``` 23 | #ms.scripts.user() 24 | ``` 25 | 26 | ### Parameters 27 | 28 | No known parameters. 29 | 30 | ### Return 31 | 32 | Returns an array. 33 | 34 | #### CLI 35 | 36 | On the CLI, the array of script names will be formatted in 4 columns. 37 | 38 | ``` 39 | users.example_script_1 users.example_script_2 40 | ``` 41 | 42 | #### Script 43 | 44 | Called as a subscript, the array of script names will be formatted in a single column by default. 45 | 46 | ``` 47 | users.example_script_1 48 | users.example_script_2 49 | ``` 50 | 51 | ## Example 52 | 53 | ```js 54 | function(context, args) 55 | { 56 | return #ms.scripts.user() 57 | } 58 | ``` 59 | -------------------------------------------------------------------------------- /docs/scripting/trust_scripts/gui.size.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: gui.size 3 | description: "Changes text size" 4 | --- 5 | 6 | ((gui.size)) specifies text size in the terminal window. 7 | 8 | ### Security Level 9 | 10 | FULLSEC 11 | 12 | ## Syntax 13 | 14 | ### CLI 15 | 16 | ``` 17 | gui.size { i: 0 } 18 | ``` 19 | 20 | ### Script 21 | 22 | Cannot be called as a subscript. 23 | 24 | ### Parameters 25 | 26 | #### i (required) 27 | 28 | the '((%Ni%))' argument specifies the text size, as a number from ((%V-20%)) to ((%V20%)). The default value is set to ((%V0%)). 29 | 30 | ### Return 31 | 32 | Returns a ((%LSuccess%)) or ((%DFailure%)) object. 33 | 34 | #### CLI 35 | 36 | No arguments or invalid arguments: 37 | 38 | ``` 39 | >>gui.size 40 | Failure 41 | Usage: gui.size { i:<-20 to 20> } 42 | change your gui size settings. negative numbers reduce size positive increases. 43 | current size: 0 44 | ``` 45 | 46 | Valid arguments: 47 | 48 | ``` 49 | >>gui.size { i: 0 } 50 | Success 51 | ``` 52 | 53 | #### Script 54 | 55 | Cannot be called as a subscript. 56 | -------------------------------------------------------------------------------- /docs/scripting/scripts.lib/rand_int.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: .rand_int() 3 | --- 4 | 5 | A function that returns a random number (integer) between two integer parameters. 6 | 7 | ## Syntax 8 | 9 | ```js 10 | #fs.scripts.lib().rand_int(min, max, rng); 11 | ``` 12 | 13 | ### Parameters 14 | 15 | #### min 16 | 17 | The minimum number to generate (inclusive). This minimum number may show up in the returned random number. 18 | 19 | #### max 20 | 21 | The maximum number to generate (exclusive). The maximum number the function will generate will be one less than this number. 22 | 23 | #### rng (optional) 24 | 25 | A random number generator function. Defaults to Math.random. 26 | 27 | ### Return 28 | 29 | Returns a number (integer) between the min (inclusive) and max (exclusive). 30 | 31 | ## Example 32 | 33 | This example chooses a number between 0 and 99 and returns it. The function could be used for picking a number for a guessing game. 34 | 35 | ```js 36 | function(context, args) { 37 | const l = #fs.scripts.lib(); 38 | return l.rand_int(0, 100); 39 | } 40 | ``` 41 | -------------------------------------------------------------------------------- /docs/scripting/trust_scripts/scripts.get_level.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: scripts.get_level 3 | description: "Gets the security level of a script" 4 | --- 5 | 6 | ((scripts.get_level)) shows a script's security level. 7 | 8 | ### Security Level 9 | 10 | FULLSEC 11 | 12 | ## Syntax 13 | 14 | ### CLI 15 | 16 | ``` 17 | scripts.get_level { name: "accts.balance" } 18 | ``` 19 | 20 | ### Script 21 | 22 | ``` 23 | #fs.scripts.get_level({ name: "accts.balance" }) 24 | ``` 25 | 26 | ### Parameters 27 | 28 | #### name (required) 29 | 30 | The '((%Nname%))' argument specifies which scripts' security level shall be checked. 31 | 32 | ### Return 33 | 34 | #### CLI 35 | 36 | On the CLI, ((scripts.get_level)) returns a string. 37 | 38 | ``` 39 | >>scripts.get_level { name: "accts.balance" } 40 | HIGHSEC 41 | ``` 42 | 43 | #### Script 44 | 45 | Called as a subscript, ((scripts.get_level)) returns a number. 46 | 47 | ``` 48 | 3 49 | ``` 50 | 51 | ## Example 52 | 53 | ```js 54 | function(context, args) 55 | { 56 | return #fs.scripts.get_level({ name: "accts.balance" }) 57 | } 58 | ``` 59 | -------------------------------------------------------------------------------- /docs/scripting/trust_scripts/marks.available.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: marks.available 3 | description: "Displays recommended Marks the caller can achieve" 4 | --- 5 | 6 | ((marks.available)) displays all currently-available [[marks:((%Qmarks%))]] for the user to achieve. This initially consists of Required Marks, but can become Suggested Marks and eventually Optional Marks. 7 | 8 | ### Security Level 9 | 10 | HIGHSEC 11 | 12 | ## Syntax 13 | 14 | ### CLI 15 | 16 | ``` 17 | marks.available 18 | ``` 19 | 20 | ### Script 21 | 22 | ``` 23 | #hs.marks.available() 24 | ``` 25 | 26 | ### Parameters 27 | 28 | No known parameters. 29 | 30 | ### Return 31 | 32 | Returns a string. 33 | 34 | #### CLI 35 | 36 | ``` 37 | >>marks.available 38 | Top level marks are available to earn now, run marks. to begin a mark 39 | To view progress see marks.protocol 40 | 41 | > marks.input 42 | | 43 | \---- kiddie_pool 44 | ``` 45 | 46 | #### Script 47 | 48 | Same as CLI. 49 | 50 | ## Example 51 | 52 | ```js 53 | function(context, args) 54 | { 55 | return #hs.marks.available() 56 | } 57 | ``` 58 | -------------------------------------------------------------------------------- /docs/scripting/trust_scripts/marks.sync.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: marks.sync 3 | description: "Skips all Required Marks" 4 | --- 5 | 6 | ((marks.sync)) skips all required/tutorial [[marks:((%Qmarks%))]] for the user - functioning as an equivalent to ((sys.migrate)) for the Marks System. 7 | 8 | ### Security Level 9 | 10 | NULLSEC 11 | 12 | ## Syntax 13 | 14 | ### CLI 15 | 16 | ``` 17 | marks.sync {confirm:true} 18 | ``` 19 | 20 | ### Script 21 | 22 | Cannot be called as a subscript. 23 | 24 | ### Parameters 25 | 26 | #### confirm (required) 27 | 28 | The '((%Nconfirm%))' parameter confirms syncing of your marks to the end of the required marks. 29 | 30 | ### Return 31 | 32 | Returns a string. 33 | 34 | #### CLI 35 | 36 | ``` 37 | >>marks.sync 38 | Your `Qprotocol` has been fast-forwarded to the end of Trust's required `Qmarks`. 39 | 40 | Mark :::not_yet_obtained_required_mark::: earned - view further training with marks.available 41 | 42 | Mark :::not_yet_obtained_required_mark::: earned - view further training with marks.available 43 | ``` 44 | 45 | #### Script 46 | 47 | Cannot be called as a subscript. 48 | -------------------------------------------------------------------------------- /docs/scripting/scripts.lib/xmur3.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: .xmur3() 3 | --- 4 | 5 | A function that takes a string and returns a function that creates a numerical value based on the xmur3 algorithm. The returned function can be called multiple times to produce multiple seeds. Intended to be used with [JSF](https://wiki.hackmud.com/scripting/scripts.lib/JSF), [LCG](https://wiki.hackmud.com/scripting/scripts.lib/LCG), [mulberry32](https://wiki.hackmud.com/scripting/scripts.lib/mulberry32), [sfc32](https://wiki.hackmud.com/scripting/scripts.lib/sfc32), and [xoshiro128ss](https://wiki.hackmud.com/scripting/scripts.lib/xoshiro128ss). 6 | 7 | ## Syntax 8 | 9 | ```js 10 | #fs.scripts.lib().xmur3(str); 11 | ``` 12 | 13 | ### Parameters 14 | 15 | #### str 16 | 17 | The string that will serve as the seed for RNG. 18 | 19 | ### Return 20 | 21 | Returns a function that generates numerical seeds. 22 | 23 | ## Example 24 | 25 | ```js 26 | function(context, args) { 27 | const l = #fs.scripts.lib(); 28 | const my_string = "i_am_a_string_to_be_hashed"; 29 | const seed = l.xmur3(my_string); 30 | 31 | return seed(); 32 | } 33 | ``` 34 | -------------------------------------------------------------------------------- /docs/scripting/trust_scripts/users.last_action.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: users.last_action 3 | description: "Displays the time of a specified user's last action" 4 | --- 5 | 6 | ((users.last_action)) displays a timestamp from a specified user's most recent action. 7 | 8 | ### Security Level 9 | 10 | FULLSEC 11 | 12 | ## Syntax 13 | 14 | ### CLI 15 | 16 | ``` 17 | users.last_action { name: "trust" } 18 | ``` 19 | 20 | ### Script 21 | 22 | ``` 23 | #fs.users.last_action({ name: "trust" }) 24 | ``` 25 | 26 | ### Parameters 27 | 28 | #### name (required) 29 | 30 | The '((%Nname%))' argument takes a string and specifies which user's last action shall be checked. 31 | 32 | ### Return 33 | 34 | Returns an object. 35 | 36 | #### CLI 37 | 38 | ``` 39 | >>users.last_action { name: "trust" } 40 | { 41 | n: "trust", 42 | t: "2024-01-16T21:43:11.439Z" 43 | } 44 | ``` 45 | 46 | #### Script 47 | 48 | ``` 49 | { 50 | n: "trust", 51 | t: "2024-01-16T21:43:11.439Z" 52 | } 53 | ``` 54 | 55 | ## Example 56 | 57 | ```js 58 | function(context, args) 59 | { 60 | return #fs.users.last_action({ name: "trust" }) 61 | } 62 | ``` 63 | -------------------------------------------------------------------------------- /docs/upgrades/executive/channel_count_v1.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: channel_count_v1 3 | --- 4 | 5 | > channel_count allows you to connect to more chat channels. 6 | 7 | channel_count_v1 is a tier 1 upgrade. It spawns at ((%0noob%)), ((%1kiddie%)), and ((%2h4x0r%)) rarities. 8 | 9 | ## Stats 10 | 11 | ### count 12 | 13 | The 'count' stat displays the number of additional channels gained by loading a channel_count_v1. 14 | 15 | ## Behavior 16 | 17 | Users are able to join 5 chat channels by default. The current max [[channel_count]] is displayed by running [[sys.specs]]. Upon attempting to join a channel after reaching the allowed maximum, an error will display to the screen. 18 | 19 | ``` 20 | >>chats.join { channel:"0001" } 21 | Success 22 | 23 | >>chats.join { channel:"0001" } 24 | Success 25 | 26 | >>chats.join { channel:"0002" } 27 | Success 28 | 29 | >>chats.join { channel:"0003" } 30 | Success 31 | 32 | >>chats.join { channel:"0004" } 33 | Success 34 | 35 | >>chats.join { channel:"0004" } 36 | Failure 37 | ``` 38 | 39 | Channels that are currently inhabited by a user are displayed by running [[chats.channels]]. 40 | -------------------------------------------------------------------------------- /docs/upgrades/executive/channel_count_v2.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: channel_count_v2 3 | --- 4 | 5 | > channel_count allows you to connect to more chat channels. 6 | 7 | channel_count_v2 is a tier 2 upgrade. It spawns at ((%0noob%)), ((%1kiddie%)), ((%2h4x0r%)) and ((%3h4rdc0r3%)) rarities. 8 | 9 | ## Stats 10 | 11 | ### count 12 | 13 | The 'count' stat displays the number of additional channels gained by loading a channel_count_v2. 14 | 15 | ## Behavior 16 | 17 | Users are able to join 5 chat channels by default. The current max [[channel_count]] is displayed by running [[sys.specs]]. Upon attempting to join a channel after reaching the allowed maximum, an error will display to the screen. 18 | 19 | ``` 20 | >>chats.join { channel:"0001" } 21 | Success 22 | 23 | >>chats.join { channel:"0001" } 24 | Success 25 | 26 | >>chats.join { channel:"0002" } 27 | Success 28 | 29 | >>chats.join { channel:"0003" } 30 | Success 31 | 32 | >>chats.join { channel:"0004" } 33 | Success 34 | 35 | >>chats.join { channel:"0004" } 36 | Failure 37 | ``` 38 | 39 | Channels that are currently inhabited by a user are displayed by running [[chats.channels]]. 40 | -------------------------------------------------------------------------------- /docs/scripting/extensions/timeout.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: _TIMEOUT 3 | 4 | alias: 5 | - _TO 6 | - TIMEOUT 7 | --- 8 | 9 | How long, in milliseconds, a script may run for before timing out. 10 | 11 | \_TIMEOUT (along with \_TO) are global variables that provide the length of time, in milliseconds, that a top-level script execution is allowed to run for before being terminated. It is currently `5000`. 12 | 13 | ## Syntax 14 | 15 | ```js 16 | _TIMEOUT; 17 | _TO; 18 | ``` 19 | 20 | ## Example 21 | 22 | A script that wants to check how close it is to timing out can use \_TIMEOUT along with [[_START]], [[_END]], [Date.now()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/now) or [((scripts.lib))](../scripts_lib)'s [[can_continue_execution]]: 23 | 24 | ```js 25 | function(context, args) { 26 | // allow for at least 500ms of runtime 27 | let bail_after_ms = (_TIMEOUT - 500) 28 | 29 | // do stuff 30 | 31 | if((Date.now() - _START) > bail_after_ms){ 32 | return "Less than 500ms left! Bailing!" 33 | } 34 | 35 | // do more stuff 36 | 37 | return "Script completed without timing out" 38 | } 39 | ``` 40 | -------------------------------------------------------------------------------- /docs/scripting/trust_scripts/chats.active.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: chats.active 3 | description: "Gets the usernames of recent tells the caller was involved in." 4 | --- 5 | 6 | ((chats.active)) returns the 5 most recent users the caller sent and received via [[chats.tell:((chats.tell))]], as well as the 5 most recent channels where messages have been sent via [[chats.send:((chats.send))]]. 7 | 8 | ### Security level 9 | 10 | MIDSEC 11 | 12 | ## Syntax 13 | 14 | ### CLI 15 | 16 | ``` 17 | chats.active 18 | ``` 19 | 20 | ### Script 21 | 22 | ``` 23 | #ms.chats.active() 24 | ``` 25 | 26 | ### Parameters 27 | 28 | No known parameters. 29 | 30 | ### Return 31 | 32 | Returns an object. 33 | 34 | #### CLI 35 | 36 | ``` 37 | >>chats.active 38 | --Sent-- 39 | 40 | trust 41 | 0000 42 | example_user 43 | 44 | --Received-- 45 | 46 | example_user 47 | boo7_str4p 48 | ``` 49 | 50 | #### Script 51 | 52 | ``` 53 | {"sent":[{"user":"trust"},{"channel":"0000"},{"user":"example_user"}],"received":[{"user":"example_user"},{"user":"boo7_str4p"}]} 54 | ``` 55 | 56 | ## Example 57 | 58 | ```js 59 | function(context, args) 60 | { 61 | return #ms.chats.active() 62 | } 63 | ``` 64 | -------------------------------------------------------------------------------- /docs/scripting/trust_scripts/corps.create.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: corps.create 3 | description: "Creates a player corporation, for 1BGC" 4 | --- 5 | 6 | ((corps.create)) allows a user to create a player corporation for the cost of ((1BGC)). 7 | 8 | ### Security level 9 | 10 | NULLSEC 11 | 12 | ## Syntax 13 | 14 | ### CLI 15 | 16 | ``` 17 | corps.create { name: "example_corp", confirm: true } 18 | ``` 19 | 20 | ### Script 21 | 22 | ``` 23 | #ns.corps.create({ name: "example_corp", confirm: true }) 24 | ``` 25 | 26 | ### Parameters 27 | 28 | #### name (required) 29 | 30 | The '((%Nname%))' argument specifies the name of the new player corporation. 31 | 32 | #### confirm (required) 33 | 34 | The '((%Nconfirm%))' argument confirms creation of new player corporation. 35 | 36 | ### Return 37 | 38 | Returns an object. 39 | 40 | #### CLI 41 | 42 | ``` 43 | >>corps.create { name: "example_corp", confirm: true } 44 | Success 45 | 46 | Transferred 1BGC to trust 47 | ``` 48 | 49 | #### Script 50 | 51 | Same as CLI. 52 | 53 | ## Example 54 | 55 | ```js 56 | function(context, args) 57 | { 58 | return #ns.corps.create({ name: "example_corp", confirm: true }) 59 | } 60 | ``` 61 | -------------------------------------------------------------------------------- /docs/scripting/trust_scripts/chats.tell.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: chats.tell 3 | description: "Sends a private message to a specified user" 4 | --- 5 | 6 | ((chats.tell)) allows a user to send a private message to another user. 7 | 8 | ### Security level 9 | 10 | FULLSEC 11 | 12 | ## Syntax 13 | 14 | ### CLI 15 | 16 | ``` 17 | chats.tell { to: "user", msg: "this is a private message" } 18 | ``` 19 | 20 | ### Script 21 | 22 | ``` 23 | #fs.chats.tell({ to: "user", msg: "this is a private message" }) 24 | ``` 25 | 26 | ### Parameters 27 | 28 | #### to (required) 29 | 30 | The '((%Nto%))' argument specifies the user to send a message to. 31 | 32 | #### msg (required) 33 | 34 | The '((%Nmsg%))' argument specifies the private message to be sent. 35 | 36 | ### Return 37 | 38 | Returns an object. 39 | 40 | #### CLI 41 | 42 | ``` 43 | >>chats.tell { to: "user", msg: "this is a private message" } 44 | Msg Sent 45 | 46 | 1555 to user :::this is a private message::: 47 | ``` 48 | 49 | #### Script 50 | 51 | Same as CLI. 52 | 53 | ## Example 54 | 55 | ```js 56 | function(context, args) 57 | { 58 | return #fs.chats.tell({ to: "user", msg: "this is a private message" }) 59 | } 60 | ``` 61 | -------------------------------------------------------------------------------- /docs/scripting/trust_scripts/chats.users.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: chats.users 3 | description: "Shows which users are present in a specified channel" 4 | --- 5 | 6 | ((chats.users)) allows a user to see which users are present in a specified channel. Users in the channel with recent activity are indicated by an asterisk. 7 | 8 | ### Security level 9 | 10 | MIDSEC 11 | 12 | ## Syntax 13 | 14 | ### CLI 15 | 16 | ``` 17 | chats.users { channel: "example_channel" } 18 | ``` 19 | 20 | ### Script 21 | 22 | ``` 23 | #ms.chats.users({ channel: "example_channel" }) 24 | ``` 25 | 26 | ### Parameters 27 | 28 | #### channel (required) 29 | 30 | The '((%Nchannel%))' argument specifies the channel to be checked. 31 | 32 | Note: a user must be in the specified channel in order to see user details of the channel. 33 | 34 | ### Return 35 | 36 | Returns an array. 37 | 38 | #### CLI 39 | 40 | ``` 41 | >>chats.users { channel: "example_channel" } 42 | * 43 | *trust 44 | inactive_user_123 45 | ``` 46 | 47 | #### Script 48 | 49 | Same as CLI. 50 | 51 | ## Example 52 | 53 | ```js 54 | function(context, args) 55 | { 56 | return #ms.chats.users({ channel: "example_channel" }) 57 | } 58 | ``` 59 | -------------------------------------------------------------------------------- /docs/upgrades/locks/magnara.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: magnara 3 | --- 4 | 5 | > mi ton sreu ohw tish skowr 6 | 7 | magnara is a tier 2 [lock](/upgrades/locks) created by the #FUTUREtech corporation. 8 | 9 | ## Stats 10 | 11 | magnara includes one additional stat called "magnara_len" which determines the length a solution can be. The lock spawns at rarities ((%1kiddie%)), ((%2h4x0r%)), and ((%3h4rdc0r3%)). 12 | 13 | ## Behavior 14 | 15 | When encountered, magnara will return a string that looks like gibberish. 16 | 17 | ``` 18 | user.loc {magnara:"randomstuffhere"} 19 | recinroct magnara ulotnois orf: unit 20 | ``` 21 | 22 | ## Solving 23 | 24 | ### Example unlock 25 | 26 |
27 | Spoilers for magnara's solutions 28 | 29 | ``` 30 | >>user.loc {magnara:"rung"} 31 | WARNING: BINMAT security shell inactive. Intelligent defense system offline. 32 | LOCK_UNLOCKED 33 | System breached. 34 | Connection terminated. 35 | 36 | ``` 37 | 38 |
39 | 40 | ### magnara 41 | 42 |
43 | Spoilers for magnara's solutions 44 | 45 | Unscramble the last word in the string and put the word as the solution to this parameter. 46 | 47 |
48 | -------------------------------------------------------------------------------- /docs/scripting/trust_scripts/escrow.stats.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: escrow.stats 3 | description: "Returns the caller's escrow sales stats" 4 | --- 5 | 6 | ((escrow.stats)) returns an information object with stats regarding [[escrow.charge:((escrow.charge))]] inclusive scripts. 7 | 8 | ### Security Level 9 | 10 | MIDSEC 11 | 12 | ## Syntax 13 | 14 | ### CLI 15 | 16 | ``` 17 | escrow.stats 18 | ``` 19 | 20 | ### Script 21 | 22 | ``` 23 | #ms.escrow.stats() 24 | ``` 25 | 26 | ### Parameters 27 | 28 | No known parameters. 29 | 30 | ### Return 31 | 32 | Returns an object. 33 | 34 | #### CLI 35 | 36 | ``` 37 | >>escrow.stats 38 | { 39 | scripts: [ 40 | "users.smiley_face" 41 | ], 42 | total: "0GC", 43 | outstanding: "0GC", 44 | open_escrow_count: 1 45 | } 46 | ``` 47 | 48 | #### Script 49 | 50 | ``` 51 | { 52 | scripts: [ 53 | "users.smiley_face" 54 | ], 55 | total: "0GC", 56 | outstanding: "0GC", 57 | open_escrow_count: 1 58 | } 59 | ``` 60 | 61 | ## Example 62 | 63 | Using ((escrow.stats)) in a script allows access to the objects' individual properties, such as `scripts`. 64 | 65 | ```js 66 | function(context, args) 67 | { 68 | return #ms.escrow.stats().scripts 69 | } 70 | ``` 71 | -------------------------------------------------------------------------------- /docs/guides/misc/autoretirement.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Auto-retirement for Inactive Users 3 | --- 4 | 5 | Documentation for hackmud's automatic inactive account retirement. 6 | 7 | ## Accounts with no activity for a duration of 60 days will automatically retire all users 8 | 9 | In order to preserve performance of the Multi-User Domain over time, it is necessary to remove users and records from the database. Users that belong to accounts which have gone inactive for 60 days will automatically retire. 10 | 11 | To avoid auto-retirement, it is sufficent to log into the account, once you do so the timer will be reset for all users associated with that account. 12 | 13 | ## Email Reminders 14 | 15 | Players who wish to be notified of retirement can sign up for reminder emails by linking your steam account to the [hackmud forums](https://hackmud.com/forums). 16 | 17 | ## No Auto-retirement for Elite Supporters 18 | 19 | [Click here to check out our Supporter Model](https://givebutter.com/QncoAxxT2tdWf3UfJ2x95z25n1HNizxI) 20 | 21 | Players who are actively subscribed to our Elite Support tier (or above) will _not_ automatically retire until their Support Subscription ends, or drops below the Elite Tier monthly donation amount. 22 | -------------------------------------------------------------------------------- /docs/scripting/extensions/deep_freeze.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: DEEP_FREEZE() 3 | --- 4 | 5 | Recursive Object.freeze. 6 | 7 | DEEP_FREEZE is a global function accessible to all hackmud scripts. DEEP_FREEZE performs a recursive [Object.freeze](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/freeze) on a given JavaScript object. Frozen objects are unable to be written to or modified in any way. This function returns the same object that was passed in. 8 | 9 | ## Syntax 10 | 11 | ```js 12 | DEEP_FREEZE(object); 13 | ``` 14 | 15 | ## Arguments 16 | 17 | ### object 18 | 19 | The object to freeze. 20 | 21 | ## Example 22 | 23 | Let ((user.deepfreeze)) be a hypothetical user script, using DEEP_FREEZE to return an object that cannot be tampered with. 24 | 25 | ```js 26 | function(context, args) { 27 | let obj = {} 28 | 29 | obj.foo = "bar" 30 | obj.baz = {quz:"quux"} 31 | 32 | return DEEP_FREEZE(obj) 33 | } 34 | ``` 35 | 36 | When subscripting ((user.deepfreeze)), the object returned is immutable. 37 | 38 | ```js 39 | function(context, args) { 40 | let obj = #fs.user.deepfreeze() 41 | 42 | obj.baz = true // :::TRUST COMMUNICATION::: TypeError: "baz" is read-only 43 | } 44 | ``` 45 | -------------------------------------------------------------------------------- /docs/upgrades/infiltrator/log_writer_v1.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: log_writer_v1 3 | --- 4 | 5 | > sys.write_log allows you to write a log to a compromised system. 6 | 7 | log_writer_v1 is a tier 1 upgrade. It spawns at ((%0noob%)), ((%1kiddie%)) and ((%2h4x0r%)) rarities. 8 | 9 | ## Stats 10 | 11 | ### Cooldown 12 | 13 | The 'cooldown' stat, which is displayed in seconds, determines how much time must pass after use before the log_writer_v1 can be executed again. 14 | 15 | ## Behavior 16 | 17 | Once a log_writer_v1 upgrade has been loaded, [[sys.write_log]] can be run against a breached system for a cost of 500KGC, which allows the breacher to leave a message in the target's [[access_log]]. The amount of [[GC]] required is displayed upon execution attempt. If the specific log_writer_v1 upgrade is on cooldown, an error containing the remaining cooldown time will be displayed upon execution attempt. For syntax information see [[sys.write_log]]. 18 | 19 | ``` 20 | >>sys.write_log { target: "user.loc", msg: "you got hacked" } 21 | Success 22 | 23 | Transferred 500KGC to trust 24 | ``` 25 | 26 | A message left in logs: 27 | 28 | ``` 29 | 240130.1829 you got hacked 30 | 240130.1829 sys.write_log execution from user.fakeloc234 31 | ``` 32 | -------------------------------------------------------------------------------- /docs/upgrades/infiltrator/log_writer_v2.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: log_writer_v2 3 | --- 4 | 5 | > sys.write_log allows you to write a log to a compromised system. 6 | 7 | log_writer_v2 is a tier 1 upgrade. It spawns at ((%1kiddie%)), ((%2h4x0r%)) and ((%3h4rdc0r3%)) rarities. 8 | 9 | ## Stats 10 | 11 | ### Cooldown 12 | 13 | The 'cooldown' stat, which is displayed in seconds, determines how much time must pass after use before the log_writer_v2 can be executed again. 14 | 15 | ## Behavior 16 | 17 | Once a log_writer_v2 upgrade has been loaded, [[sys.write_log]] can be run against a breached system for a cost of 500KGC, which allows the breacher to leave a message in the target's [[access_log]]. The amount of [[GC]] required is displayed upon execution attempt. If the specific log_writer_v2 upgrade is on cooldown, an error containing the remaining cooldown time will be displayed upon execution attempt. For syntax information see [[sys.write_log]]. 18 | 19 | ``` 20 | >>sys.write_log { target: "user.loc", msg: "you got hacked" } 21 | Success 22 | 23 | Transferred 500KGC to trust 24 | ``` 25 | 26 | A message left in logs: 27 | 28 | ``` 29 | 240130.1829 you got hacked 30 | 240130.1829 sys.write_log execution from user.fakeloc234 31 | ``` 32 | -------------------------------------------------------------------------------- /docs/scripting/trust_scripts/scripts.sys.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: scripts.sys 3 | description: "Lists the caller's accessible system scripts" 4 | --- 5 | 6 | ((scripts.sys)) lists the available system scripts that can currently be accessed, based on upgrades loaded. 7 | 8 | ### Security Level 9 | 10 | HIGHSEC 11 | 12 | ## Syntax 13 | 14 | ### CLI 15 | 16 | ``` 17 | scripts.sys 18 | ``` 19 | 20 | ### Script 21 | 22 | ``` 23 | #hs.scripts.sys() 24 | ``` 25 | 26 | ### Parameters 27 | 28 | No known parameters. 29 | 30 | ### Return 31 | 32 | Returns an array. 33 | 34 | #### CLI 35 | 36 | On the CLI, ((scripts.sys)) returns strings formatted in columns. 37 | 38 | ``` 39 | >>scripts.sys 40 | sys.expose_access_log sys.expose_upgrades 41 | sys.expose_balance sys.write_log 42 | sys.expose_transactions sys.xfer_upgrade_from 43 | sys.expose_upgrade_log 44 | ``` 45 | 46 | #### Script 47 | 48 | Returns an array of strings. 49 | 50 | ``` 51 | sys.expose_access_log 52 | sys.expose_balance 53 | sys.expose_upgrades 54 | sys.expose_transactions 55 | sys.expose_upgrade_log 56 | sys.write_log 57 | sys.xfer_upgrade_from 58 | ``` 59 | 60 | ## Example 61 | 62 | ```js 63 | function(context, args) 64 | { 65 | return #hs.scripts.sys() 66 | } 67 | ``` 68 | -------------------------------------------------------------------------------- /docs/scripting/trust_scripts/corps.manage.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: corps.manage 3 | description: "Manage various administrative aspects of a corp" 4 | --- 5 | 6 | ((corps.manage)) allows a player corporation owner or admin to manage corp members with actions including promoting members to admin, demoting members from admin, and firing members. 7 | 8 | ### Security level 9 | 10 | NULLSEC 11 | 12 | ## Syntax 13 | 14 | ### CLI 15 | 16 | ``` 17 | corps.manage { command: "list" } 18 | ``` 19 | 20 | ### Script 21 | 22 | ``` 23 | #ns.corps.manage({ command: "list" }) 24 | ``` 25 | 26 | ### Parameters 27 | 28 | #### command (required) 29 | 30 | The '((%Ncommand%))' key takes several values which will be returned to the screen using ((corps.manage)) with no arguments. The possible values include: 31 | 32 | - ((%Vlist%)) 33 | - ((%Vdemote%)) 34 | - ((%Vpromote%)) 35 | - ((%Vfire%)) 36 | 37 | ### Return 38 | 39 | Returns an object. 40 | 41 | #### CLI 42 | 43 | ``` 44 | >>corps.manage { command: "list" } 45 | { 46 | name: "", 47 | is_admin: false 48 | } 49 | ``` 50 | 51 | #### Script 52 | 53 | Same as CLI. 54 | 55 | ## Example 56 | 57 | ```js 58 | function(context,args) 59 | { 60 | return #ns.corps.manage({ command: "list" }) 61 | } 62 | ``` 63 | -------------------------------------------------------------------------------- /docs/scripting/trust_scripts/kernel.hardline.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: kernel.hardline 3 | description: "Engages hardline mode" 4 | --- 5 | 6 | ((kernel.hardline)) enters hardline mode and allows connection attempts between systems. 7 | 8 | ### Security Level 9 | 10 | MIDSEC 11 | 12 | ## Syntax 13 | 14 | ### CLI 15 | 16 | ``` 17 | kernel.hardline 18 | ``` 19 | 20 | ### Script 21 | 22 | :::note 23 | ((kernel.hardline)) can only be called as a subscript by [[bot_brains]]. 24 | ::: 25 | 26 | ``` 27 | #ms.kernel.hardline({ activate: true }) 28 | ``` 29 | 30 | ### Parameters 31 | 32 | #### dc (optional) 33 | 34 | The '((%Ndc%))' argument disconnects from hardline mode when its value is set to ((%Vtrue%)). 35 | 36 | #### activate 37 | 38 | The '((%Nactivate%))' argument is required for [[bot_brains]] to hardline. 39 | 40 | ### Return 41 | 42 | Returns a ((%LSuccess%)) or ((%DFailure%)) object. 43 | 44 | #### CLI 45 | 46 | ``` 47 | >>kernel.hardline 48 | -activating hardline- 49 | ``` 50 | 51 | #### Script 52 | 53 | Can only be called as a subscript by [[bot_brains]]. 54 | 55 | ## Example 56 | 57 | In a script named `bot_brain`: 58 | 59 | ```js 60 | function(context, args) 61 | { 62 | return #ms.kernel.hardline({ activate: true }) 63 | } 64 | ``` 65 | -------------------------------------------------------------------------------- /docs/scripting/trust_scripts/sys.breach.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: sys.breach 3 | description: "Breaches the caller's system" 4 | --- 5 | 6 | ((sys.breach)) breaches the caller's system. 7 | 8 | ### Security Level 9 | 10 | NULLSEC 11 | 12 | ## Syntax 13 | 14 | ### CLI 15 | 16 | ``` 17 | sys.breach { confirm: true } 18 | ``` 19 | 20 | ### Script 21 | 22 | ``` 23 | #ns.sys.breach({ confirm: true }) 24 | ``` 25 | 26 | ### Parameters 27 | 28 | #### confirm (required) 29 | 30 | The '((%Nconfirm%))' parameter confirms execution of ((sys.breach)). 31 | 32 | ### Return 33 | 34 | Returns an object. 35 | 36 | #### CLI 37 | 38 | No parameters or invalid parameters: 39 | 40 | ``` 41 | >>sys.breach 42 | Usage: sys.breach { confirm: true } 43 | breaches sys 44 | ``` 45 | 46 | With confirm parameter: 47 | 48 | ``` 49 | >>sys.breach{ confirm: true } 50 | Success 51 | 52 | System has been breached. 53 | ``` 54 | 55 | On uninitialized system: 56 | 57 | ``` 58 | >>sys.breach{ confirm: true } 59 | Failure 60 | sys not initialized 61 | ``` 62 | 63 | #### Script 64 | 65 | ``` 66 | Success 67 | 68 | System has been breached. 69 | ``` 70 | 71 | ## Example 72 | 73 | ```js 74 | function(context, args) 75 | { 76 | return #ns.sys.breach({ confirm: true }) 77 | } 78 | ``` 79 | -------------------------------------------------------------------------------- /docs/scripting/trust_scripts/scripts.quine.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: scripts.quine 3 | description: "Outputs the source code of a script" 4 | --- 5 | 6 | ((scripts.quine)) outputs the source code of a player-made script. 7 | 8 | ### Security Level 9 | 10 | FULLSEC 11 | 12 | ## Syntax 13 | 14 | ### CLI 15 | 16 | On the CLI, ((scripts.quine)) returns a ((%DFailure%)) object and usage information. 17 | 18 | ``` 19 | >>scripts.quine 20 | Failure 21 | Use scripts.quine to output the source code of your script. Place the following into your script: 22 | return #fs.scripts.quine() 23 | ``` 24 | 25 | ### Script 26 | 27 | ``` 28 | #fs.scripts.quine() 29 | ``` 30 | 31 | ### Parameters 32 | 33 | No known parameters. 34 | 35 | ### Return 36 | 37 | #### CLI 38 | 39 | On the CLI, ((scripts.quine)) returns an object. 40 | 41 | #### Script 42 | 43 | Called as a subscript, ((scripts.quine)) returns a string, consisting of the source code of the calling script. 44 | 45 | ``` 46 | :) 47 | function(context, args) 48 | { 49 | let smiley_face = ":)" 50 | return [ smiley_face, #fs.scripts.quine() ] 51 | } 52 | ``` 53 | 54 | ## Example 55 | 56 | ```js 57 | function(context, args) 58 | { 59 | let smiley_face = ":)" 60 | return [ smiley_face, #fs.scripts.quine() ] 61 | } 62 | ``` 63 | -------------------------------------------------------------------------------- /docs/scripting/trust_scripts/chats.send.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: chats.send 3 | description: "Sends a message to a specified channel" 4 | --- 5 | 6 | ((chats.send)) allows a user to send a message to a specified channel. 7 | 8 | ### Security level 9 | 10 | FULLSEC 11 | 12 | ## Syntax 13 | 14 | ### CLI 15 | 16 | ``` 17 | chats.send { channel: "example_channel", msg: "this is a message" } 18 | ``` 19 | 20 | ### Script 21 | 22 | ``` 23 | #fs.chats.send({ channel: "example_channel", msg: "this is a message" }) 24 | ``` 25 | 26 | ### Parameters 27 | 28 | #### channel (required) 29 | 30 | The '((%Nchannel%))' argument specifies the channel in which to send a message. 31 | 32 | #### message (required) 33 | 34 | The '((%Nmessage%))' argument specifies the message to be sent, up to 1000 characters and 10 lines. 35 | 36 | ### Return 37 | 38 | Returns an object. 39 | 40 | #### CLI 41 | 42 | ``` 43 | >>chats.send { channel: "example_channel", msg: "this is a message" } 44 | Msg Sent 45 | 46 | 1621 example_channel :::this is a message::: 47 | ``` 48 | 49 | #### Script 50 | 51 | Same as CLI. 52 | 53 | ## Example 54 | 55 | ```js 56 | function(context, args) 57 | { 58 | return #fs.chats.send({ channel: "example_channel", msg: "this is a message" }) 59 | } 60 | 61 | ``` 62 | -------------------------------------------------------------------------------- /docs/scripting/trust_scripts/gui.chats.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: gui.chats 3 | description: "Dictates the behavior of chat in the main terminal/chat window" 4 | --- 5 | 6 | ((gui.chats)) dictates the behavior of chat in the main terminal window, and/or, in the chat window. 7 | 8 | ### Security Level 9 | 10 | FULLSEC 11 | 12 | ## Syntax 13 | 14 | ### CLI 15 | 16 | ``` 17 | >>gui.chats { shell: false, chat: true } 18 | Success 19 | ``` 20 | 21 | ### Script 22 | 23 | Cannot be called as a subscript. 24 | 25 | ### Parameters 26 | 27 | One argument is required, either ((%Nshell%)) or ((%Nchat%)). If no arguments are provided, the script will return a ((%DFailure%)) and usage information. The default values are both set to ((%Vtrue%)). 28 | 29 | #### shell 30 | 31 | The '((%Nshell%))' argument dictates if chat appears in the main terminal window or not using a boolean (((%Vtrue%))/((%Vfalse%))). 32 | 33 | #### chat 34 | 35 | The '((%Nchat%))' argument dictates if chat appears in the chat window or not using a boolean (((%Vtrue%))/((%Vfalse%))). 36 | 37 | ### Return 38 | 39 | Returns a ((%LSuccess%)) or ((%DFailure%)) object. 40 | 41 | #### CLI 42 | 43 | ``` 44 | >>gui.chats { shell: true, chat: true } 45 | Success 46 | ``` 47 | 48 | #### Script 49 | 50 | Cannot be called as a subscript. 51 | -------------------------------------------------------------------------------- /docs/upgrades/architect/cron_bot_v2.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: cron_bot_v2 3 | alias: cron_bot 4 | --- 5 | 6 | > bot_brain upgrades will call your bot_brain script based on the upgrade's cooldown interval, allowing you to automate your user. 7 | 8 | cron_bot_v2 is a tier 2 upgrade. It spawns at ((%0noob%)), ((%1kiddie%)), ((%2h4x0r%)) and ((%3h4rdc0r3%)) rarities. 9 | 10 | ## Stats 11 | 12 | ### cooldown 13 | 14 | The 'cooldown' stat displays the number of seconds between each bot_brain execution. 15 | 16 | ### cost 17 | 18 | The 'cost' stat displays the amount of [[GC]] required to pay for bot_brain execution. 19 | 20 | ### retries 21 | 22 | The 'retries' stat displays the number of execution errors allowed before the cron_bot_v2 unloads itself due to execution failure. 23 | 24 | ## Behavior 25 | 26 | When a script called `bot_brain` is loaded on a user's system, a cron_bot_v2 is loaded, and the user is inactive, the cron_bot_v2 will attempt to execute the `bot_brain` script. If not enough [[GC]] is present on the system, or the number of retries has been exceeded, the cron_bot_v2 will unload itself. If user activity is detected, the cron_bot_v2's execution attempt will be delayed until the user is inactive again. 27 | 28 | ``` 29 | Success 30 | 31 | Transferred 18KGC to trust : 32 | ``` 33 | -------------------------------------------------------------------------------- /docs/scripting/trust_scripts/chats.create.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: chats.create 3 | description: "Creates a custom chat channel" 4 | --- 5 | 6 | ((chats.create)) allows a user to create a custom chat channel. This channel can optionally be password protected. The channel will delete automatically when all users leave. 7 | 8 | ### Security level 9 | 10 | FULLSEC 11 | 12 | ## Syntax 13 | 14 | ### CLI 15 | 16 | ``` 17 | chats.create { name: "example_channel", password: "examplepass" } 18 | ``` 19 | 20 | ### Script 21 | 22 | ``` 23 | #fs.chats.create({ name: "example_channel", password: "examplepass" }) 24 | ``` 25 | 26 | ### Parameters 27 | 28 | #### name (required) 29 | 30 | The '((%Nname%))' argument specifies the name of the channel up to 50 characters long. 31 | 32 | #### password (optional) 33 | 34 | The '((%Npassword%))' argument specifies the channel password. 35 | 36 | ### Return 37 | 38 | Returns an object. 39 | 40 | #### CLI 41 | 42 | ``` 43 | >>chats.create { name: "example_channel" } 44 | Success 45 | 46 | 1555 example_channel :::user joined channel::: 47 | ``` 48 | 49 | #### Script 50 | 51 | Same as CLI. 52 | 53 | ## Example 54 | 55 | ```js 56 | function(context, args) 57 | { 58 | return #fs.chats.create({ name: "example_channel", password: "examplepass" }) 59 | } 60 | ``` 61 | -------------------------------------------------------------------------------- /src/components/NavbarItem/AccessibilityOptions.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | 3 | export default function AccessibilityOptions({ mobile }) { 4 | if (mobile) { 5 | return null; 6 | } 7 | 8 | let accessibilityMode = null; 9 | 10 | if (typeof window !== "undefined") { 11 | const storedMode = window.localStorage.getItem("accessibilityMode"); 12 | setAccessibilityMode(storedMode === "true" ? "true" : "false"); 13 | } 14 | 15 | function setAccessibilityMode(value) { 16 | accessibilityMode = value; 17 | window.localStorage.setItem("accessibilityMode", accessibilityMode); 18 | 19 | document.documentElement.setAttribute("data-accessible", accessibilityMode); 20 | for (let elem of document.getElementsByClassName("main-wrapper")) { 21 | elem.setAttribute("data-accessible", accessibilityMode); 22 | } 23 | } 24 | 25 | const toggleAccessibilityMode = () => { 26 | setAccessibilityMode(accessibilityMode === "true" ? "false" : "true"); 27 | }; 28 | 29 | function handleClick() { 30 | toggleAccessibilityMode(); 31 | } 32 | 33 | return ( 34 | 40 | ); 41 | } 42 | -------------------------------------------------------------------------------- /src/theme/NavbarItem/ComponentTypes.js: -------------------------------------------------------------------------------- 1 | import DefaultNavbarItem from "@theme/NavbarItem/DefaultNavbarItem"; 2 | import DropdownNavbarItem from "@theme/NavbarItem/DropdownNavbarItem"; 3 | import LocaleDropdownNavbarItem from "@theme/NavbarItem/LocaleDropdownNavbarItem"; 4 | import SearchNavbarItem from "@theme/NavbarItem/SearchNavbarItem"; 5 | import HtmlNavbarItem from "@theme/NavbarItem/HtmlNavbarItem"; 6 | import DocNavbarItem from "@theme/NavbarItem/DocNavbarItem"; 7 | import DocSidebarNavbarItem from "@theme/NavbarItem/DocSidebarNavbarItem"; 8 | import DocsVersionNavbarItem from "@theme/NavbarItem/DocsVersionNavbarItem"; 9 | import DocsVersionDropdownNavbarItem from "@theme/NavbarItem/DocsVersionDropdownNavbarItem"; 10 | import AccessibilityOptions from "@site/src/components/NavbarItem/AccessibilityOptions"; 11 | 12 | const ComponentTypes = { 13 | default: DefaultNavbarItem, 14 | localeDropdown: LocaleDropdownNavbarItem, 15 | search: SearchNavbarItem, 16 | dropdown: DropdownNavbarItem, 17 | html: HtmlNavbarItem, 18 | doc: DocNavbarItem, 19 | docSidebar: DocSidebarNavbarItem, 20 | docsVersion: DocsVersionNavbarItem, 21 | docsVersionDropdown: DocsVersionDropdownNavbarItem, 22 | }; 23 | export default { 24 | ...ComponentTypes, 25 | "custom-AccessibilityOptions": AccessibilityOptions, 26 | }; 27 | -------------------------------------------------------------------------------- /docs/upgrades/architect/cron_bot_v1.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: cron_bot_v1 3 | alias: 4 | - cron_bot 5 | - bot_brain 6 | - bot_brains 7 | --- 8 | 9 | > bot_brain upgrades will call your bot_brain script based on the upgrade's cooldown interval, allowing you to automate your user. 10 | 11 | cron_bot_v1 is a tier 1 upgrade. It spawns at ((%0noob%)), ((%1kiddie%)), and ((%2h4x0r%)) rarities. 12 | 13 | ## Stats 14 | 15 | ### cooldown 16 | 17 | The 'cooldown' stat displays the number of seconds between each bot_brain execution. 18 | 19 | ### cost 20 | 21 | The 'cost' stat displays the amount of [[GC]] required to pay for bot_brain execution. 22 | 23 | ### retries 24 | 25 | The 'retries' stat displays the number of execution errors allowed before the cron_bot_v1 unloads itself due to execution failure. 26 | 27 | ## Behavior 28 | 29 | When a script called `bot_brain` is loaded on a user's system, a cron_bot_v1 is loaded, and the user is inactive, the cron_bot_v1 will attempt to execute the `bot_brain` script. If not enough [[GC]] is present on the system, or the number of retries has been exceeded, the cron_bot_v1 will unload itself. If user activity is detected, the cron_bot_v1's execution attempt will be delayed until the user is inactive again. 30 | 31 | ``` 32 | Success 33 | 34 | Transferred 18KGC to trust : 35 | ``` 36 | -------------------------------------------------------------------------------- /docs/scripting/trust_scripts/sys.cull.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: sys.cull 3 | description: "Destroys specified upgrades" 4 | --- 5 | 6 | ((sys.cull)) allows a user to destroy an upgrade specified by the `i` argument. 7 | 8 | ### Security Level 9 | 10 | LOWSEC 11 | 12 | ## Syntax 13 | 14 | Index values are input as a number, or array of numbers with no leading 0s. 15 | 16 | ### CLI 17 | 18 | Single upgrade: 19 | 20 | ``` 21 | sys.cull { i: 0 } 22 | ``` 23 | 24 | Multiple upgrades: 25 | 26 | ``` 27 | sys.cull { i: [ 0, 1, 2 ], confirm: true } 28 | ``` 29 | 30 | ### Script 31 | 32 | ``` 33 | #ls.sys.cull({ i: [ 0, 1, 2 ], confirm: true }) 34 | ``` 35 | 36 | ### Parameters 37 | 38 | #### i (required) 39 | 40 | The '((%Ni%))' parameter specifies the upgrade(s) to be culled. 41 | 42 | ### Return 43 | 44 | Returns an object. 45 | 46 | #### CLI 47 | 48 | No parameters or invalid parameters 49 | 50 | ``` 51 | >>sys.cull 52 | Usage: sys.cull { i: } 53 | destroys upgrade at i 54 | ``` 55 | 56 | Correct parameters: 57 | 58 | ``` 59 | >>sys.cull { i:244, confirm: true } 60 | Success 61 | 62 | -expose_access_log_v1- destroyed 63 | ``` 64 | 65 | #### Script 66 | 67 | Same as CLI. 68 | 69 | ## Example 70 | 71 | ```js 72 | function(context, args) 73 | { 74 | return #ls.sys.cull({ i: 55, confirm: true }) 75 | } 76 | ``` 77 | -------------------------------------------------------------------------------- /docs/scripting/trust_scripts/sys.manage.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: sys.manage 3 | description: "Loads, unloads or reorders upgrades" 4 | --- 5 | 6 | ((sys.manage)) allows loading, unloading or reordering upgrades. 7 | 8 | ### Security Level 9 | 10 | MIDSEC 11 | 12 | ## Syntax 13 | 14 | ### CLI 15 | 16 | ``` 17 | sys.manage 18 | ``` 19 | 20 | ### Script 21 | 22 | ``` 23 | #ms.sys.manage() 24 | ``` 25 | 26 | ### Parameters 27 | 28 | #### unload 29 | 30 | The '((%Nunload%))' argument takes an upgrade index as a number, or an array of numbers with no leading 0s. 31 | 32 | #### load 33 | 34 | The '((%Nload%))' argument takes an upgrade index as a number, or an array of numbers with no leading 0s. 35 | 36 | #### reorder 37 | 38 | The '((%Nreorder%))' argument takes reorder pairs as objects, or arrays. 39 | 40 | ``` 41 | sys.manage { reorder: { from: 0, to: 1 } } 42 | ``` 43 | 44 | ``` 45 | sys.manage { reorder: [ [ 0, 1 ], [ 2, 3 ] ] } 46 | ``` 47 | 48 | ### Return 49 | 50 | Returns an object. 51 | 52 | #### CLI 53 | 54 | ``` 55 | >>sys.manage { reorder: { from: 0, to: 1 } } 56 | 000 tier_3 script_space char_count_v3 57 | 001 tier_3 chat channel_count_v3 58 | ``` 59 | 60 | #### Script 61 | 62 | Same as CLI. 63 | 64 | ## Example 65 | 66 | ```js 67 | function(context, args) 68 | { 69 | return #ms.sys.manage({ reorder: [ [ 1, 0 ] ] }) 70 | } 71 | ``` 72 | -------------------------------------------------------------------------------- /docs/scripting/scripts.lib/can_continue_execution_error.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: .can_continue_execution_error() 3 | --- 4 | 5 | A function wrapping [.can_continue_execution()](can_continue_execution) that checks if there is enough time remaining for execution based on a specified number of milliseconds. If not enough time remains, the function returns a user-friendly error message. 6 | 7 | ## Syntax 8 | 9 | ```js 10 | #fs.scripts.lib().can_continue_execution_error(remain_threshold, name); 11 | ``` 12 | 13 | ### Parameters 14 | 15 | #### remain_threshold 16 | 17 | A number in milliseconds. 18 | 19 | #### name 20 | 21 | The name of a script / function to return if execution cannot continue. 22 | 23 | ### Return 24 | 25 | If there is not enough time remaining the function returns an object: 26 | 27 | `{ok: false, msg: name + " could not continue executing because " + remain_threshold + "ms are not available for execution."}` 28 | 29 | Otherwise, it will return `null`. 30 | 31 | ## Example 32 | 33 | ```js 34 | function(context, args) { 35 | const l = #fs.scripts.lib(); 36 | 37 | const timeout_error = l.can_continue_execution_error(1000, "my_script_name"); 38 | 39 | if (timeout_error) { 40 | 41 | return timeout_error.msg; 42 | 43 | } else { 44 | // Proceed with execution 45 | return "I have executed with no timeout error!"; 46 | } 47 | } 48 | ``` 49 | -------------------------------------------------------------------------------- /docs/scripting/trust_scripts/escrow.confirm.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: escrow.confirm 3 | description: "Validates an escrow.charge payment" 4 | --- 5 | 6 | ((escrow.confirm)) validates an [[escrow.charge:((escrow.charge))]] payment using the token provided. 7 | 8 | ### Security Level 9 | 10 | FULLSEC 11 | 12 | ## Syntax 13 | 14 | ### CLI 15 | 16 | ``` 17 | escrow.confirm { i: "token5", confirm: true } 18 | ``` 19 | 20 | ### Script 21 | 22 | Cannot be called as a subscript. 23 | 24 | ### Parameters 25 | 26 | #### i (required) 27 | 28 | The '((%Ni%))' argument specifies the token 29 | 30 | #### confirm (required) 31 | 32 | The '((%Nconfirm%))' argument is a boolean confirmation of the escrow validation. 33 | 34 | ### Return 35 | 36 | Returns an object. 37 | 38 | #### CLI 39 | 40 | ``` 41 | >>escrow.confirm 42 | Failure 43 | invalid token. specify valid token with i:"" 44 | ``` 45 | 46 | Valid token, no confirmation: 47 | 48 | ``` 49 | >>escrow.confirm { i: "token5" } 50 | Failure 51 | Confirm escrow account of 1GC for each use of user.script with confirm:true 52 | ``` 53 | 54 | Valid token and confirmation: 55 | 56 | ``` 57 | >>escrow.confirm { i: "token5", confirm: true } 58 | Success 59 | Escrow confirmed. You may now use user.script. You will need to reconfirm in 30 days or if the cost changes 60 | ``` 61 | 62 | #### Script 63 | 64 | Cannot be called as a subscript. 65 | -------------------------------------------------------------------------------- /docs/scripting/extensions/g.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: "#G" 3 | --- 4 | 5 | Global object that persists across a top-level script execution. 6 | 7 | #G - or 'Global' - is a global object unique for every script. It starts empty `{}` and can have any properties added to it over time that the script owner desires. If the script is called multiple times in a single top-level script execution, the contents of #G will persist. 8 | 9 | Each script only sees its own #G object and cannot interact with other #G's. 10 | 11 | ## Syntax 12 | 13 | ```js 14 | #G // {} 15 | #G.foo = "bar" 16 | #G // {foo:"bar"} 17 | ``` 18 | 19 | ## Arguments 20 | 21 | #G behaves like any other JavaScript object. The [builtins which apply to JS objects](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object) similarly apply to #G 22 | 23 | ## Example 24 | 25 | This script wants to cache a [[db.f:database lookup]] that is reused when called multiple times. It is written like so: 26 | 27 | ```js 28 | function(context, args) { 29 | if(!#G.data){ 30 | #G.data = #db.f({type:"my_data"}).first() 31 | } 32 | 33 | if(#G.data.foo == "bar") return "baz" 34 | else return "quz" 35 | } 36 | ``` 37 | 38 | When first called in a top level script run, the script will spend time performing a database lookup with [[db.f:#db.f]], then in subsequent calls the lookup will be skipped, saving precious runtime. 39 | -------------------------------------------------------------------------------- /docs/scripting/syntax/return_object.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Return Object 3 | alias: 4 | - success object 5 | - failure object 6 | --- 7 | 8 | An object returned to the CLI from a script may be automatically formatted, depending on its contents. These types of objects are often referred to as ((%LSuccess%)) or ((%DFailure%)) objects. 9 | 10 | ## Syntax 11 | 12 | A ((%LSuccess%)) or ((%DFailure%)) object can only contain two keys. The `ok` key is required, and determines whether ((%LSuccess%)) or ((%DFailure%)) is displayed in the terminal. You may also attach a `msg` key, which will append that value, after being converted to a string. 13 | 14 | ## Example 15 | 16 | ```js 17 | function(context, args) { 18 | //Explains the guessing game when the script is run without a guess. 19 | if (!args.guess) { 20 | return "Let's play a guessing game! Guess a number between 1 and 10!" 21 | } 22 | 23 | //Return a success object if they guess they right number. 24 | if (args.guess == Math.floor(Math.random() * 10)) { 25 | return { 26 | ok: true, 27 | msg: args.guess + " was the right number!" 28 | } 29 | } 30 | 31 | //In all other cases, return a failure object. 32 | return { 33 | ok: false, 34 | msg: "Sorry, please guess again!" 35 | } 36 | } 37 | ``` 38 | 39 | ## See Also 40 | 41 | - [[ok]] 42 | - [[not_impl]] 43 | -------------------------------------------------------------------------------- /docs/index.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | slug: / 3 | title: Home 4 | --- 5 | 6 | # hackmud wiki 7 | 8 | Welcome to the hackmud wiki! 9 | 10 | hackmud is a retro cyberpunk RPG where you play a digital persona in a chaotic, unpredictable, and often goofy abandoned internet. Enter a 90s hacker movie filled with scripts, scams, and sabotage. Explore the world of digital secrets and forge your legacy through cunning, creativity, or disruption. 11 | 12 | ### Looking for help? 13 | 14 | Use the nav bar at the top of the page to browse to the content you are looking for. 15 | 16 | #### Recommended new player guides 17 | 18 | - [[marks:Intro to the Marks System]] 19 | - [[getting_started:Getting Started]] 20 | 21 | ### Other Helpful Resources 22 | 23 | Here's [a link to the official Discord](https://discord.gg/HtSdWsT). 24 | 25 | Here's [a link to the official forums](https://www.hackmud.com/forums), which hosts its own [beginner user guide](https://www.hackmud.com/forums/new_players/new_player_guides___reference), and [advanced user guide](https://www.hackmud.com/forums/general_discussion/reference___guides). 26 | 27 | ### Trying to update some information? 28 | 29 | This wiki is served out of github pages and is built with the docusaurus documentation framework. You can browse to a page to edit and use the 'edit this page' link at the bottom or you can [go straight to the code on github!](https://github.com/comcode-org/hackmud_wiki/) 30 | -------------------------------------------------------------------------------- /docs/scripting/db/db.objectid.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: "#db.ObjectId()" 3 | alias: 4 | - ObjectId 5 | - objectid 6 | - oid 7 | --- 8 | 9 | Generates a MongoDB ObjectId. 10 | 11 | [MongoDB ObjectIds](https://www.mongodb.com/docs/manual/reference/method/ObjectId/) are a 12-byte, unique value primarily used for marking unique documents in the db. #db.ObjectId() can be used to generate arbitrary, unique ObjectIds. 12 | 13 | ## Syntax 14 | 15 | ```js 16 | #db.ObjectId() 17 | ``` 18 | 19 | ## Breakdown 20 | 21 | ObjectIds convey a variety of information, consisting of: 22 | 23 | - A 4-byte timestamp, measured in seconds since the Unix epoch. This timestamp marks the time the ObjectId was generated 24 | - A 5-byte value denoting the worker ID the ObjectId was generated on (static across hackmud's workers), as well as the thread ID it was generated on 25 | - A 3-byte incrementing counter 26 | 27 | "65eaa4657b97fd26dd0c5305" 28 | 29 | ## Example 30 | 31 | ```js 32 | function(context, args) { 33 | return #db.ObjectId() // {"$oid":"65eaa4657b97fd26dd0c5305"} 34 | } 35 | ``` 36 | -------------------------------------------------------------------------------- /docs/upgrades/locks/l0ckbox.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: l0ckbox 3 | --- 4 | 5 | > The nuutec l0ckbox secures you and your cuddlyone from prying eyes 6 | 7 | l0ckbox is a tier 2 [lock](/upgrades/locks) created by the NUUTEC corporation. 8 | 9 | ## Stats 10 | 11 | l0ckbox includes one additional stat called 'count' which determines the range of solutions a given l0ckbox will accept. The lock spawns at rarities ((%1kiddie%)), ((%2h4x0r%)), and ((%3h4rdc0r3%)). 12 | 13 | ## Behavior 14 | 15 | l0ckbox expects one of several [[k3y_v1]] or [[k3y_v2]] upgrades to be loaded. 16 | When no k3y or the incorrect k3y is loaded, the lock will present the following error information: 17 | 18 | ``` 19 | user.loc {} 20 | To unlock, please load the appropriate k3y: tvfkyq 21 | ``` 22 | 23 | ## Solving 24 | 25 | ### Example unlock 26 | 27 |
28 | Spoilers for l0ckbox's solutions 29 | 30 | ``` 31 | >>user.loc {} 32 | To unlock, please load the appropriate k3y: tvfkyq 33 | 34 | >>sys.upgrades 35 | ... 36 | 017 tier_1 tool k3y_v1 37 | ... 38 | 39 | >>sys.upgrades {i:17, full:true} 40 | { 41 | ... 42 | k3y: "tvfkyqv" 43 | ... 44 | } 45 | 46 | >>sys.manage {load:17} 47 | Success 48 | 49 | >>user.loc {} 50 | WARNING: BINMAT security shell inactive. Intelligent defense system offline. 51 | LOCK_UNLOCKED 52 | System breached. 53 | Connection terminated. 54 | 55 | ``` 56 | 57 |
58 | -------------------------------------------------------------------------------- /docs/scripting/extensions/d.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: "#D" 3 | --- 4 | 5 | Debugging output function. 6 | 7 | #D - or 'Debug' - is a function that will take any content you input to it and add it to a debug log. At the end of the script run - if you are the script owner - all of the debug logs will be returned instead of the regular output. This output will be returned even if the script hits an uncaught error or ((%D:::TRUST COMMUNICATION:::%)) 8 | 9 | :::info 10 | 11 | #D will suppress regular script output for the script owner. 12 | 13 | Only the script owner sees the output of #D - it is not a substitute for `return`ing regular output for any other user. 14 | ::: 15 | 16 | ## Syntax 17 | 18 | ```js 19 | #D(input) 20 | ``` 21 | 22 | ## Arguments 23 | 24 | ### input 25 | 26 | The input to be added to the debug log output. If this value is not a string, #D will attempt to turn it into a string. #D will also return its input as an output. 27 | 28 | ## Example 29 | 30 | This script uses #D to debug the flow of the script run 31 | 32 | ```js 33 | function(context, args) { 34 | #D("started") 35 | 36 | let x = 2 37 | #D(x) 38 | let y = 3 39 | #D(y) 40 | 41 | return #D(x + y) 42 | } 43 | ``` 44 | 45 | Anybody who is not the script owner will see the following output: 46 | 47 | ``` 48 | 5 49 | ``` 50 | 51 | The script owner will see the following output: 52 | 53 | ``` 54 | started 55 | 2 56 | 3 57 | 5 58 | ``` 59 | -------------------------------------------------------------------------------- /docs/scripting/trust_scripts/scripts.midsec.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: scripts.midsec 3 | description: "Lists MIDSEC sectors and scripts" 4 | --- 5 | 6 | ((scripts.midsec)) lists the MIDSEC sectors. 7 | 8 | ### Security Level 9 | 10 | FULLSEC 11 | 12 | ## Syntax 13 | 14 | ### CLI 15 | 16 | ``` 17 | scripts.midsec 18 | ``` 19 | 20 | ### Script 21 | 22 | ``` 23 | #fs.scripts.midsec() 24 | ``` 25 | 26 | ### Parameters 27 | 28 | #### sector 29 | 30 | The '((%Nsector%))' argument specifies the MIDSEC sector to be shown. 31 | 32 | ### Return 33 | 34 | Returns an array. 35 | 36 | #### CLI 37 | 38 | No arguments: 39 | 40 | ``` 41 | >>scripts.midsec 42 | specify & join a sector to see a list of the scripts in that sector. 43 | ``` 44 | 45 | The listed sectors are dynamic and will change over time. Running ((scripts.midsec)) on the CLI will return 4 columns of sector names. Specifiying a sector will return the scripts which are currently in that sector. 46 | 47 | #### Script 48 | 49 | The listed sectors are dynamic and will change over time. Calling ((scripts.midsec)) as a subscript will list one column of sector names by default. Specifiying a sector will return the scripts which are currently in that sector. 50 | 51 | ## Example 52 | 53 | :::note 54 | The example sector may not be a valid sector. 55 | ::: 56 | 57 | ```js 58 | function(context, args) 59 | { 60 | return #fs.scripts.midsec({ sector: "KIN_THETA_7" }) 61 | } 62 | ``` 63 | -------------------------------------------------------------------------------- /docs/scripting/trust_scripts/scripts.lowsec.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: scripts.lowsec 3 | description: "Lists LOWSEC sectors and scripts" 4 | --- 5 | 6 | ((scripts.lowsec)) lists the LOWSEC sectors. 7 | 8 | ### Security Level 9 | 10 | FULLSEC 11 | 12 | ## Syntax 13 | 14 | ### CLI 15 | 16 | ``` 17 | scripts.lowsec 18 | ``` 19 | 20 | ### Script 21 | 22 | ``` 23 | #fs.scripts.lowsec() 24 | ``` 25 | 26 | ### Parameters 27 | 28 | #### sector 29 | 30 | The '((%Nsector%))' argument specifies the LOWSEC sector to be shown. 31 | 32 | ### Return 33 | 34 | Returns an array. 35 | 36 | #### CLI 37 | 38 | No arguments: 39 | 40 | ``` 41 | >>scripts.lowsec 42 | specify & join a sector to see a list of the scripts in that sector. 43 | ``` 44 | 45 | The listed sectors are dynamic and will change over time. Running ((scripts.lowsec)) on the CLI will return 4 columns of sector names. Specifiying a sector will return the scripts which are currently in that sector. 46 | 47 | #### Script 48 | 49 | The listed sectors are dynamic and will change over time. Calling ((scripts.lowsec)) as a subscript will list one column of sector names by default. Specifiying a sector will return the scripts which are currently in that sector. 50 | 51 | ## Example 52 | 53 | :::note 54 | The example sector may not be a valid sector. 55 | ::: 56 | 57 | ```js 58 | function(context, args) 59 | { 60 | return #fs.scripts.lowsec({ sector: "CHAOS_LAMBDA_1" }) 61 | } 62 | ``` 63 | -------------------------------------------------------------------------------- /docs/scripting/trust_scripts/scripts.fullsec.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: scripts.fullsec 3 | description: "Lists FULLSEC sectors and scripts" 4 | --- 5 | 6 | ((scripts.fullsec)) lists the FULLSEC sectors. 7 | 8 | ### Security Level 9 | 10 | FULLSEC 11 | 12 | ## Syntax 13 | 14 | ### CLI 15 | 16 | ``` 17 | scripts.fullsec 18 | ``` 19 | 20 | ### Script 21 | 22 | ``` 23 | #fs.scripts.fullsec() 24 | ``` 25 | 26 | ### Parameters 27 | 28 | #### sector 29 | 30 | The '((%Nsector%))' argument specifies the fullsec sector to be shown. 31 | 32 | ### Return 33 | 34 | Returns an array. 35 | 36 | #### CLI 37 | 38 | No arguments: 39 | 40 | ``` 41 | >>scripts.fullsec 42 | specify & join a sector to see a list of the scripts in that sector. 43 | ``` 44 | 45 | The listed sectors are dynamic and will change over time. Running ((scripts.fullsec)) on the CLI will return 4 columns of sector names. Specifiying a sector will return the scripts which are currently in that sector. 46 | 47 | #### Script 48 | 49 | The listed sectors are dynamic and will change over time. Calling ((scripts.fullsec)) as a subscript will list one column of sector names by default. Specifiying a sector will return the scripts which are currently in that sector. 50 | 51 | ## Example 52 | 53 | :::note 54 | the example sector may not be a valid sector. 55 | ::: 56 | 57 | ```js 58 | function(context, args) 59 | { 60 | return #fs.scripts.fullsec({ sector: "VOID_LAMBDA_2" }) 61 | } 62 | ``` 63 | -------------------------------------------------------------------------------- /docs/scripting/trust_scripts/scripts.highsec.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: scripts.highsec 3 | description: "Lists HIGHSEC sectors and scripts" 4 | --- 5 | 6 | ((scripts.highsec)) lists the HIGHSEC sectors. 7 | 8 | ### Security Level 9 | 10 | FULLSEC 11 | 12 | ## Syntax 13 | 14 | ### CLI 15 | 16 | ``` 17 | scripts.highsec 18 | ``` 19 | 20 | ### Script 21 | 22 | ``` 23 | #fs.scripts.highsec() 24 | ``` 25 | 26 | ### Parameters 27 | 28 | #### sector 29 | 30 | The '((%Nsector%))' argument specifies the HIGHSEC sector to be shown. 31 | 32 | ### Return 33 | 34 | Returns an array. 35 | 36 | #### CLI 37 | 38 | No arguments: 39 | 40 | ``` 41 | >>scripts.highsec 42 | specify & join a sector to see a list of the scripts in that sector. 43 | ``` 44 | 45 | The listed sectors are dynamic and will change over time. Running ((scripts.highsec)) on the CLI will return 4 columns of sector names. Specifiying a sector will return the scripts which are currently in that sector. 46 | 47 | #### Script 48 | 49 | The listed sectors are dynamic and will change over time. Calling ((scripts.highsec)) as a subscript will list one column of sector names by default. Specifiying a sector will return the scripts which are currently in that sector. 50 | 51 | ## Example 52 | 53 | :::note 54 | The example sector may not be a valid sector. 55 | ::: 56 | 57 | ```js 58 | function(context, args) 59 | { 60 | return #fs.scripts.highsec({ sector: "FORM_LAMBDA_3" }) 61 | } 62 | ``` 63 | -------------------------------------------------------------------------------- /docs/scripting/trust_scripts/scripts.get_access_level.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: scripts.get_access_level 3 | description: "Gets the access level of a script" 4 | --- 5 | 6 | ((scripts.get_access_level)) shows information about a script's access level. Possible access level indicators include: 7 | 8 | - PUBLIC 9 | - PRIVATE 10 | - HIDDEN 11 | - TRUST 12 | 13 | For example, [[loc]]s will appear as PUBLIC HIDDEN. Trust scripts will appear as PUBLIC TRUST. Some scripts may appear as PUBLIC HIDDEN TRUST. 14 | 15 | ### Security Level 16 | 17 | FULLSEC 18 | 19 | ## Syntax 20 | 21 | ### CLI 22 | 23 | ``` 24 | scripts.get_access_level { name: "accts.balance" } 25 | ``` 26 | 27 | ### Script 28 | 29 | ``` 30 | #fs.scripts.get_access_level 31 | ``` 32 | 33 | ### Parameters 34 | 35 | #### name (required) 36 | 37 | The '((%Nname%))' argument specifies which scripts' access level shall be checked. 38 | 39 | ### Return 40 | 41 | #### CLI 42 | 43 | On the CLI ((scripts.get_access_level)) returns a string. 44 | 45 | ``` 46 | >>scripts.get_access_level { name: "accts.balance" } 47 | PUBLIC TRUST 48 | ``` 49 | 50 | #### Script 51 | 52 | Called as a subscript, ((scripts.get_access_level)) returns an object. 53 | 54 | ``` 55 | { 56 | public: true, 57 | hidden: false, 58 | trust: true 59 | } 60 | ``` 61 | 62 | ## Example 63 | 64 | ```js 65 | function(context, args) 66 | { 67 | return #fs.scripts.get_access_level({ name: "accts.balance" }) 68 | } 69 | ``` 70 | -------------------------------------------------------------------------------- /docs/scripting/trust_scripts/scripts.nullsec.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: scripts.nullsec 3 | description: "Lists NULLSEC sectors and scripts" 4 | --- 5 | 6 | ((scripts.nullsec)) lists the NULLSEC sectors. 7 | 8 | ### Security Level 9 | 10 | FULLSEC 11 | 12 | ## Syntax 13 | 14 | ### CLI 15 | 16 | ``` 17 | scripts.nullsec 18 | ``` 19 | 20 | ### Script 21 | 22 | ``` 23 | #fs.scripts.nullsec() 24 | ``` 25 | 26 | ### Parameters 27 | 28 | #### sector 29 | 30 | The '((%Nsector%))' argument specifies the NULLSEC sector to be shown. 31 | 32 | ### Return 33 | 34 | Returns an array. 35 | 36 | #### CLI 37 | 38 | No arguments: 39 | 40 | ``` 41 | >>scripts.nullsec 42 | specify & join a sector to see a list of the scripts in that sector. 43 | ``` 44 | 45 | The listed sectors are dynamic and will change over time. Running ((scripts.nullsec)) on the CLI will return 4 columns of sector names. Specifiying a sector will return the scripts which are currently in that sector. 46 | 47 | #### Script 48 | 49 | The listed sectors are dynamic and will change over time. Calling ((scripts.nullsec)) as a subscript will list one column of sector names by default. Specifiying a sector will return the scripts which are currently in that sector. 50 | 51 | ## Example 52 | 53 | :::note 54 | The example sector may not be a valid sector. 55 | ::: 56 | 57 | ```js 58 | function(context, args) 59 | { 60 | return #fs.scripts.nullsec({ sector: "CHOICE_LAMBDA_2" }) 61 | } 62 | ``` 63 | -------------------------------------------------------------------------------- /docs/scripting/extensions/fmcl.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: "#FMCL" 3 | --- 4 | 5 | Prevents execution of a script more than once per script run. 6 | 7 | #FMCL - or 'Function Multi-Call Lock' - is a function that returns `false` when first encountered in a top-level script execution, then `true` when encountered subsequent times. It is used by [[escrow.charge:((escrow.charge))]], for example, to ensure it is only called once per script run. 8 | 9 | ## Syntax 10 | 11 | ```js 12 | #FMCL // false 13 | #FMCL // true 14 | #FMCL // true 15 | // ... 16 | ``` 17 | 18 | ## Arguments 19 | 20 | #FMCL takes no arguments 21 | 22 | ## Example 23 | 24 | Let ((user.fmcl_test)) be a hypothetical user script, containing the following code: 25 | 26 | ```js 27 | function(context, args) { 28 | if(#FMCL) return "Bruteforcing detected" 29 | else{ 30 | if(args && args.password == "password1") return "You win!" 31 | else return "What is my `Npassword`?" 32 | } 33 | } 34 | ``` 35 | 36 | If a person attempts to subscript ((user.fmcl_test)) to try and bruteforce the password, their first attempt will be processed, but further attempts will be rejected: 37 | 38 | ```js 39 | function(context, args) { 40 | return [ 41 | #fs.user.fmcl_test({password:"12345"}), 42 | #fs.user.fmcl_test({password:"letmein"}), 43 | #fs.user.fmcl_test({password:"password1"}), 44 | ] 45 | 46 | // ["What is my `Npassword`?","Bruteforcing detected","Bruteforcing detected"] 47 | } 48 | ``` 49 | -------------------------------------------------------------------------------- /docs/scripting/trust_scripts/corps.offers.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: corps.offers 3 | description: "View offers from player corporations" 4 | --- 5 | 6 | ((corps.offers)) allows a user to view hire offers from player corporations. 7 | 8 | ### Security level 9 | 10 | NULLSEC 11 | 12 | ## Syntax 13 | 14 | ### CLI 15 | 16 | ``` 17 | corps.offers 18 | ``` 19 | 20 | ### Script 21 | 22 | ``` 23 | #ns.corps.offers() 24 | ``` 25 | 26 | ### Parameters 27 | 28 | #### accept 29 | 30 | The '((%Naccept%))' argument is used to specify which corporation to join. It expects a string. 31 | 32 | ### Return 33 | 34 | Returns an object. 35 | 36 | #### CLI 37 | 38 | If no offers are present: 39 | 40 | ``` 41 | >>corps.offers 42 | { 43 | ok: true, 44 | msg: "You have no open offers.", 45 | current_corp: null 46 | } 47 | ``` 48 | 49 | If offers are present: 50 | 51 | ``` 52 | >>corps.offers 53 | { 54 | offers: [ 55 | "example_corp" 56 | ], 57 | msg: "Specify a corporation to accept offer from with { accept:" 58 | " }" 59 | } 60 | ``` 61 | 62 | When accepted: 63 | 64 | ``` 65 | corps.offers { accept: "example_corp" } 66 | Success 67 | ``` 68 | 69 | #### Script 70 | 71 | Same as CLI 72 | 73 | ## Example 74 | 75 | ```js 76 | function(context, args) 77 | { 78 | let myOffers = #ns.corps.offers() 79 | 80 | if (Object.hasOwnProperty(offers)) { 81 | return myOffers.offers 82 | } else { 83 | return "No current offers" 84 | } 85 | } 86 | ``` 87 | -------------------------------------------------------------------------------- /docs/scripting/trust_scripts/sys.specs.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: sys.specs 3 | description: "Returns the user's system specs" 4 | --- 5 | 6 | ((sys.specs)) returns the user's current system specifications. 7 | 8 | ### Security Level 9 | 10 | HIGHSEC 11 | 12 | ## Syntax 13 | 14 | ### CLI 15 | 16 | ``` 17 | sys.specs 18 | ``` 19 | 20 | ### Script 21 | 22 | ``` 23 | #hs.sys.specs() 24 | ``` 25 | 26 | ### Parameters 27 | 28 | No known parameters. 29 | 30 | ### Return 31 | 32 | Returns a string. 33 | 34 | #### CLI 35 | 36 | ``` 37 | >>sys.specs 38 | 39 | 40 | () 41 | 42 | tier: 43 | 44 | hardline_count: 45 | next_hardline: 46 | 47 | architect() scavenger() executive() infiltrator() junkrack() 48 | 49 | channel_count: 50 | 51 | gc_max: 52 | 53 | upgrade space 54 | slots: / 55 | loaded: / 56 | 57 | script space 58 | publics: 59 | slots: 60 | chars: 61 | ``` 62 | 63 | #### Script 64 | 65 | Same as CLI. 66 | 67 | ## Example 68 | 69 | ```js 70 | function(context, args) 71 | { 72 | return #hs.sys.specs() 73 | } 74 | ``` 75 | -------------------------------------------------------------------------------- /docs/scripting/trust_scripts/marks.protocol.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: marks.protocol 3 | description: "Displays the caller's protocol" 4 | --- 5 | 6 | ((marks.protocol)) displays the [[marks:((%Qmarks%))]] obtained by the caller, visualised through their ((%Qprotocol%)) grid. 7 | 8 | ### Security Level 9 | 10 | HIGHSEC 11 | 12 | ## Syntax 13 | 14 | ### CLI 15 | 16 | ``` 17 | marks.protocol 18 | ``` 19 | 20 | ### Script 21 | 22 | ``` 23 | #hs.marks.protocol() 24 | ``` 25 | 26 | ### Parameters 27 | 28 | #### pos (optional) 29 | 30 | The '((%Npos%))' argument allows users to provide a co-ordinate as a 2-item array [x,y]. If a mark is lit at this co-ordinate, the mark name and the date it was earned will be displayed. 31 | 32 | ### Return 33 | 34 | Returns a string. 35 | 36 | #### CLI 37 | 38 | ``` 39 | >>marks.protocol 40 | 41 | -- initiate protocol certification mark display -- 42 | 43 | 012345678 44 | 45 | 0 █████████ 46 | 1 █████████ 47 | 2 █████████ 48 | 3 █████████ 49 | 4 █████████ 50 | ``` 51 | 52 | Completed marks are lit with the color ((%QQ%)); incomplete marks use the color ((%bb%)) 53 | 54 | ``` 55 | >>marks.protocol {pos:[0,0]} 56 | 57 | 012345678 58 | 59 | 0 o████████ 60 | 1 █████████ 61 | 2 █████████ 62 | 3 █████████ 63 | 4 █████████ 64 | 65 | mark: scratch 66 | earned_at: YYMMDD 67 | ``` 68 | 69 | #### Script 70 | 71 | Same as CLI. 72 | 73 | ## Example 74 | 75 | ```js 76 | function(context, args) 77 | { 78 | return #hs.marks.protocol({ pos:[2,4] }) 79 | } 80 | ``` 81 | -------------------------------------------------------------------------------- /docs/scripting/trust_scripts/gui.vfx.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: gui.vfx 3 | description: "Controls client video effects settings" 4 | --- 5 | 6 | ((gui.vfx)) controls the video effects settings for the terminal window. 7 | 8 | ### Security Level 9 | 10 | FULLSEC 11 | 12 | ## Syntax 13 | 14 | ### CLI 15 | 16 | ``` 17 | gui.vfx { bloom: 0, noise: 0, scan: 0, bend: 0 } 18 | ``` 19 | 20 | ### Script 21 | 22 | Cannot be called as a subscript. 23 | 24 | ### Parameters 25 | 26 | At least one argument is required. If no arguments are provided, ((gui.vfx)) will return a ((%DFailure%)) object and usage information. All parameters take a number ranging from ((%V0%)) to ((%V11%)). The default values are: 27 | 28 | ``` 29 | gui.vfx { bloom: 5, noise: 5, scan: 5, bend: 4 } 30 | ``` 31 | 32 | #### bloom 33 | 34 | The '((%Nbloom%))' argument specifies the intensity of the bloom effect around text characters. 35 | 36 | #### noise 37 | 38 | The '((%Nnoise%))' argument specifies the intensity of the noise effect on the screen. 39 | 40 | #### scan 41 | 42 | The '((%Nscan%))' argument specifies the intensity of the scan lines effect on the screen. 43 | 44 | #### bend 45 | 46 | The '((%Nbend%))' argument specifies the intensity of the bend effect on the screen. 47 | 48 | ### Return 49 | 50 | Returns a ((%LSuccess%)) or ((%DFailure%)) object. 51 | 52 | #### CLI 53 | 54 | ``` 55 | >>gui.vfx { bloom: 0, noise: 0, scan: 0, bend: 0 } 56 | Success 57 | ``` 58 | 59 | #### Script 60 | 61 | Cannot be called as a subscript. 62 | -------------------------------------------------------------------------------- /docs/scripting/trust_scripts/accts.xfer_gc_to_caller.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: accts.xfer_gc_to_caller 3 | description: "Sends GC to the script caller" 4 | --- 5 | 6 | ((accts.xfer_gc_to_caller)) allows a script to send GC to the caller of the script. 7 | 8 | ((accts.xfer_gc_to_caller)) (and [[accts.xfer_gc_to:((accts.xfer_gc_to))]] ) has a ratelimit of 5 transactions to the same recipient in 20 seconds, excluding the user ((%Ctrust%)). 9 | 10 | ### Security level 11 | 12 | FULLSEC 13 | 14 | ## Syntax 15 | 16 | ### CLI 17 | 18 | ``` 19 | accts.xfer_gc_to_caller 20 | ``` 21 | 22 | ### Script 23 | 24 | ``` 25 | #fs.accts.xfer_gc_to_caller({ amount: "1M234K567GC", memo: "this is a memo" }) 26 | ``` 27 | 28 | ### Parameters 29 | 30 | #### amount (required) 31 | 32 | The '((%Namount%))' argument specifies the amount of ((%CGC%)) to send. Max transfer limit in a single ((accts.xfer_gc_to_caller)) execution is ((32BGC)). 33 | 34 | #### memo (optional) 35 | 36 | The '((%Nmemo%))' argument specifies a memo up to 50 characters long. 37 | 38 | ### Return 39 | 40 | #### CLI 41 | 42 | ``` 43 | >>accts.xfer_gc_to_caller 44 | Usage: (in subscript) #fs.accts.xfer_gc_to_caller({ amount:, memo:"" }) 45 | ``` 46 | 47 | #### Script 48 | 49 | ``` 50 | Success 51 | 52 | Received 1GC from user 53 | ``` 54 | 55 | ## Example 56 | 57 | ```js 58 | function(context, args) 59 | { 60 | return #fs.accts.xfer_gc_to_caller({ amount: "1GC", memo: "this is a memo" }) 61 | } 62 | 63 | ``` 64 | -------------------------------------------------------------------------------- /docs/scripting/trust_scripts/sys.init.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: sys.init 3 | description: "Initializes a system, or upgrades its tier" 4 | --- 5 | 6 | ((sys.init)) initializes a system, or upgrades its tier once it is initialized. ((sys.init)) also lists what features will be available at the next tier. 7 | 8 | ### Security Level 9 | 10 | FULLSEC 11 | 12 | ## Syntax 13 | 14 | ### CLI 15 | 16 | ``` 17 | sys.init { confirm: true } 18 | ``` 19 | 20 | ### Script 21 | 22 | Cannot be called as a subscript. 23 | 24 | ### Parameters 25 | 26 | #### confirm 27 | 28 | The '((%Nconfirm%))' parameter confirms system initialization. 29 | 30 | ### Return 31 | 32 | Returns a ((%LSuccess%)) or ((%DFailure%)) object, or a string. 33 | 34 | #### CLI 35 | 36 | No parameters or invalid parameters: 37 | 38 | ``` 39 | >>sys.init 40 | Initializing a system costs 1MGC. Once your system is initialized, it can be upgraded. 41 | Tier 1 systems can hold 20MGC. 42 | To initialize your system use { confirm: true } 43 | ``` 44 | 45 | Correct parameters: 46 | 47 | ``` 48 | >>sys.init{ confirm: true } 49 | Success 50 | 51 | Transferred 1MGC to trust 52 | ``` 53 | 54 | If balance is too low to initialize or upgrade: 55 | 56 | ``` 57 | >>sys.init 58 | Failure 59 | Your account balance of 580K141GC is too low to send 10MGC. 60 | ``` 61 | 62 | If system is already at maximum tier: 63 | 64 | ``` 65 | >>sys.init 66 | Failure 67 | Your system is fully initialized. 68 | ``` 69 | 70 | #### Script 71 | 72 | Cannot be called as a subscript. 73 | -------------------------------------------------------------------------------- /docs/guides/advanced/launch-options.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Launch Options 3 | --- 4 | 5 | You can add various Launch Options to hackmud in Steam to alter the behaviour of the game. 6 | 7 | - `-screen-fullscreen 0` / `-screen-fullscreen 1` - Turn fullscreen mode off/on. 8 | - `-screen-height X` - Specify window/screen height in pixels. 9 | - `-screen-width X` - Specify window/screen width in pixels. 10 | - `-monitor N` - Specify which display to use. (`N` is a 1-based index: 1st display is `1`, 2nd display is `2`, so on) 11 | - `-window-mode borderless` (Windows) / `-popupwindow` (Windows, Linux) - Force borderless fullscreen mode to be used. 12 | - `-force-d3d11` / `-force-d3d12` / `-force-glcore` / `-force-metal` / `-force-vulkan` - Force a specific graphics API to be used. 13 | - `-force-low-power-device` - Force a low power GPU profile to be used. (macOS only) 14 | - `-force-glcoreXY` - Force a specific version of OpenGL to be used (accepted `XY` values: 32, 33, 40, 41, 42, 43, 44, 45) 15 | - `-force-wayland` - Force the experimental Wayland support to be used. (Linux only) 16 | 17 | For example, to run hackmud in a 720p window, use these launch options: `-screen-fullscreen 0 -screen-width 1280 -screen-height 720`. 18 | 19 | To specify launch options: 20 | 21 | 1. Open Steam 22 | 2. Go to your Library 23 | 3. Right-click on `hackmud` 24 | 4. Click on `Properties...` 25 | 5. Click on `General` 26 | 27 | You will see a textbox with a label that says `LAUNCH OPTIONS`. You need to type your launch options in here. 28 | -------------------------------------------------------------------------------- /docs/concepts/systems/priv_store.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: priv_store 3 | --- 4 | 5 | > Think of it as a secure account that scripts can't touch. 6 | 7 | _- Unknown, ((marks.lost_and_found))_ 8 | 9 | ((%Cpriv_store%)) is a special user that does not take a user slot, cannot be retired, and cannot run any scripts other than ((accts.balance)) or ((accts.xfer_gc_to)). 10 | 11 | It can be accessed by entering ((%Cpriv_store%)) or ((%Cuser% %Apriv_store%)) into the CLI. 12 | 13 | A ((%Cpriv_store%)) user is named similar to an NPC, and can hold up to ((1B337MGC)). 14 | 15 | A ((%Cpriv_store%)) user cannot be attacked or breached as it does not have a loc. 16 | 17 | You can transfer ((%CGC%)) to your ((%Cpriv_store%)) with ((accts.xfer_gc_to \{ to:"priv_store" \})), 18 | but only when calling it directly in the CLI. Subscripts cannot target ((%Cpriv_store%)). 19 | 20 | To target your ((%Cpriv_store%)) in a subscript call, you must enter the actual name of your ((%Cpriv_store%)) user. 21 | 22 | ## Edge Cases & Notable Behaviours 23 | 24 | Attempting to send any amount of ((%CGC%)) to a ((%Cpriv_store%)) that is not associated with your account will always return the following irregardless of the balance of the ((%Cpriv_store%)) user: 25 | 26 | > ((%DFailure%))\ 27 | > User can't store that much ((%CGC%)). Recipient must init to tier 2. 28 | 29 | Attempting to send ((%CGC%)) to your ((%Cpriv_store%)) when it is full will return the following, including when the transfer is subscripted: 30 | 31 | > ((%DFailure%))\ 32 | > balance would exceed the priv_store limit of 1B337MGC 33 | -------------------------------------------------------------------------------- /docs/upgrades/locks/l0cket.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: l0cket 3 | --- 4 | 5 | > The nuutec security systems l0cket provides entry level security for you and your best pal 6 | 7 | l0cket is a tier 1 [lock](/upgrades/locks) created by the NUUTEC SECURITY SYSTEMS corporation. 8 | 9 | ## Stats 10 | 11 | l0cket includes one additional stat called 'count' which determines the range of solutions a given l0cket will accept. The lock spawns at rarities ((%0noob%)), ((%1kiddie%)), and ((%2h4x0r%)). 12 | 13 | ## Behavior 14 | 15 | l0cket expects one of several possible [[k3y_v1]] values to be passed as a string. 16 | When an incorrect string is passed, l0cket will present the following error information: 17 | 18 | ``` 19 | user.loc { l0cket:"not_a_k3y" } 20 | LOCK_ERROR 21 | "not_a_k3y" is not the correct security k3y. 22 | ``` 23 | 24 | ## Solving 25 | 26 | ### Example unlock 27 | 28 |
29 | Spoilers for l0cket's solutions 30 | 31 | ``` 32 | >>user.loc { l0cket: "6hh8xw" } 33 | WARNING: BINMAT security shell inactive. Intelligent defense system offline. 34 | LOCK_UNLOCKED 35 | System breached. 36 | Connection terminated. 37 | 38 | ``` 39 | 40 |
41 | 42 | ### l0cket 43 | 44 |
45 | Spoilers for l0cket's solutions 46 | 47 | The complete known list of t1 k3y values: 48 | 49 | - cmppiq 50 | - 6hh8xw 51 | - uphlaw 52 | - vc2c7q 53 | - tvfkyq 54 | - xwz7ja 55 | - sa23uw 56 | - ellux0 57 | - 72umy0 58 | - i874y3 59 | - 9p65cu 60 | - fr8ibu 61 | - eoq6de 62 | - xfnkqe 63 | - pmvr1q 64 | - y111qa 65 | 66 |
67 | -------------------------------------------------------------------------------- /docs/scripting/trust_scripts/gui.quiet.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: gui.quiet 3 | description: "Quietens a user's chats in the terminal" 4 | --- 5 | 6 | ((gui.quiet)) hides a user's chats in the terminal by darkening the text. 7 | 8 | ### Security Level 9 | 10 | FULLSEC 11 | 12 | ## Syntax 13 | 14 | ### CLI 15 | 16 | ``` 17 | gui.quiet { add: "users" } 18 | ``` 19 | 20 | ### Script 21 | 22 | Cannot be called as a subscript. 23 | 24 | ### Parameters 25 | 26 | At least one argument is required. If no arguments are provided, ((gui.quiet)) will return a ((%DFailure%)) object and usage information. 27 | 28 | #### add (optional) 29 | 30 | The '((%Nadd%))' argument takes a username as a string. Chats from the username input as a value of the '((%Nadd%))' argument will be muted in the terminal windows. 31 | 32 | #### remove (optional) 33 | 34 | The '((%Nremove%))' argument takes a username as a string. Chats from the username input as a value of the '((%Nremove%))' argument will appear in the terminal windows. 35 | 36 | #### list (optional) 37 | 38 | The '((%Nlist%))' argument takes a boolean (true/false). If the value is set to true, all muted usernames will be listed. 39 | 40 | #### clear (optional) 41 | 42 | The '((%Nclear%))' argument takes a boolean (true/false). If the value is set to true, all previously muted usernames will be unmuted. 43 | 44 | ### Return 45 | 46 | Returns a ((%LSuccess%)) or ((%DFailure%)) object. 47 | 48 | #### CLI 49 | 50 | ``` 51 | >>gui.quiet { clear: true } 52 | Success 53 | quiet list has been cleared 54 | ``` 55 | 56 | #### Script 57 | 58 | Cannot be called as a subscript. 59 | -------------------------------------------------------------------------------- /docs/scripting/trust_scripts/market.buy.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: market.buy 3 | description: "Purchases upgrades listed on the market" 4 | --- 5 | 6 | ((market.buy)) is a secure purchase system which uses 8 character alpha-numeric tokens from [[market.browse:((market.browse))]] to purchase upgrades from the marketplace. 7 | 8 | ### Security Level 9 | 10 | MIDSEC 11 | 12 | ## Syntax 13 | 14 | ((market.buy)) takes a market token as a string and requires that the value of the '((%Nconfirm%))' parameter be set to ((%Vtrue%)). 15 | 16 | ### CLI 17 | 18 | ``` 19 | market.buy { i: "token5" } 20 | ``` 21 | 22 | ### Script 23 | 24 | ``` 25 | #ms.market.buy({ i: "ebwff5", confirm: true }) 26 | ``` 27 | 28 | ### Parameters 29 | 30 | #### i (required) 31 | 32 | The '((%Ni%))' argument takes a market token as a string. 33 | 34 | #### confirm (required) 35 | 36 | The '((%Nconfirm%))' argument value must be ((%Vtrue%)) in order to confirm purchase. 37 | 38 | ### Return 39 | 40 | Returns a ((%LSuccess%)) or ((%DFailure%)) object. 41 | 42 | #### CLI 43 | 44 | No arguments or invalid arguments: 45 | 46 | ``` 47 | >>market.buy 48 | Failure 49 | invalid token. specify valid token with i:"" 50 | ``` 51 | 52 | With valid arguments, confirmation, and enough ((%CGC%)) to cover the purchase: 53 | 54 | ``` 55 | >>market.buy { i: "ebwff5", confirm: true } 56 | Success 57 | 58 | Transferred 1KGC to trust : trust 59 | 60 | -ez_21- acquired 61 | ``` 62 | 63 | #### Script 64 | 65 | Same as CLI. 66 | 67 | ## Example 68 | 69 | ```js 70 | function(context, args) 71 | { 72 | return #ms.market.buy({ i: "ebwff5", confirm: true }) 73 | } 74 | ``` 75 | -------------------------------------------------------------------------------- /docs/guides/new_players/chat_window_tips.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Chat Window Tips 3 | description: "Helpful tips/commands for the chat window" 4 | --- 5 | 6 | The in-game chat window has three built-in commands to allow for more efficient use. 7 | 8 | ### Change the default channel - ((%A%%))((%Vchannel%)) 9 | 10 | By default, messages typed in the chat window get sent to ((%V0000%)). To change this, type `%` into the chat window. For example, typing ((%A%n00bz%)) will send all future messages to the ((%Vn00bz%)) channel. 11 | 12 | ### Select a specific user - ((%A+%))((%Cuser%)) 13 | 14 | To use the chat window to ((chats.tell)) messages to a particular user, you can type `+` into the chat window. For example, typing ((%A+risk%)) will send all future messages to the user ((%Crisk%)). 15 | 16 | ### Use a custom script - ((%A&%))((custom.script)) 17 | 18 | By default, typing a message into the chat window will pass it into ((chats.send)) using the ((%Nmsg%)) parameter (with the default channel passed using the ((%Nc%)) parameter), so that typing ((%AHello world!%)) into the chat window will execute ((chats.send)) \{((%Nc%)):((%V"0000"%)), ((%Nmsg%)):((%V"Hello world!"%))\}. 19 | 20 | You can change this script to anything you like, using `&`. For example, if the user ((%Crisk%)) wants to change the color of their chat messages to green, they can create a script like ((risk.chatcolor)) that accepts ((%Nc%)) and ((%Nmsg%)) parameters, adds ((%A\`L%)) to the start of the message and ((%A\`%)) to the end, then calls ((chats.send)) to send the color-coded message. Now, ((%Crisk%)) can type ((%A&risk.%))((%Achatcolor%)) into the chat window, and make all their future chat messages green by default. 21 | -------------------------------------------------------------------------------- /docs/scripting/db/db.r.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: "#db.r(..)" 3 | --- 4 | 5 | Removes document(s) from the database. 6 | 7 | Similar to a [MongoDB db.collection.remove()](https://www.mongodb.com/docs/manual/reference/method/db.collection.remove/), with some syntax restrictions 8 | 9 | ## Syntax 10 | 11 | ```js 12 | #db.r(query) 13 | ``` 14 | 15 | ## Arguments 16 | 17 | ### query 18 | 19 | Selection filter for documents in the script owner's database. 20 | 21 | :::danger 22 | 23 | All documents matched will be deleted, without confirmation. **An empty query ( `{}` ) will delete every document in the user's database!** 24 | ::: 25 | 26 | ## Return Data 27 | 28 | An array of length 1 is returned, containing a single object, providing extra details about whether the deletion succeeded: 29 | 30 | | Key | Information | 31 | | ------ | -------------------------------------------------------------------------------- | 32 | | n | Number of documents deleted | 33 | | ok | If the operation succeeded, == 1 | 34 | | opTime | Object that contains a property 't' -- time of deletion operation in millieconds | 35 | 36 | Other values are returned, but provide no additional usable data due to undefined conversions 37 | 38 | ## Example 39 | 40 | ```js 41 | function(context, args) { 42 | /* 43 | where the database already contains documents: 44 | #db.i( 45 | {type:"my_data", my_key:"foo"}, 46 | {type:"my_data", my_key:"bar"} 47 | ) 48 | */ 49 | #db.r({type:"my_data"}) 50 | 51 | return #db.f({type:"my_data"}).first() // null 52 | } 53 | ``` 54 | -------------------------------------------------------------------------------- /docs/scripting/trust_scripts/sys.xfer_upgrade_to_caller.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: sys.xfer_upgrade_to_caller 3 | description: "Sends upgrades from the script owner to the caller" 4 | --- 5 | 6 | ((sys.xfer_upgrade_to_caller)) allows a script to send upgrades to the caller of the script. 7 | 8 | ### Security Level 9 | 10 | FULLSEC 11 | 12 | ## Syntax 13 | 14 | ### CLI 15 | 16 | ``` 17 | sys.xfer_upgrade_to_caller 18 | ``` 19 | 20 | ### Script 21 | 22 | Single upgrade: 23 | 24 | ``` 25 | #fs.sys.xfer_upgrade_to_caller({ i: 0 }) 26 | ``` 27 | 28 | Multiple upgrades: 29 | 30 | ``` 31 | #fs.sys.xfer_upgrade_to_caller({ i: [ 0, 1, 2 ] }) 32 | ``` 33 | 34 | ### Parameters 35 | 36 | Requires one of '((%Ni%))' or '((%Nsn%))'. 37 | 38 | #### i 39 | 40 | The '((%Ni%))' argument takes a number or array of numbers and specifies which upgrade indexes shall be sent. 41 | 42 | #### sn 43 | 44 | The '((%Nsn%))' argument takes a serial number string, or array of serial numbers, to specify which serial numbers shall be sent (if they exist on the user). 45 | 46 | #### memo (optional) 47 | 48 | The '((%Nmemo%))' argument allows for an optional memo, up to 50 characters, alongside the upgrade transfer 49 | 50 | ### Return 51 | 52 | Returns a ((%LSuccess%)) or ((%DFailure%)) object. 53 | 54 | #### CLI 55 | 56 | ``` 57 | >>sys.xfer_upgrade_to_caller 58 | Usage: (in subscript) #fs.sys.xfer_upgrade_to_caller({ i:, sn:, memo:"" }) 59 | ``` 60 | 61 | #### Script 62 | 63 | ``` 64 | Success 65 | 66 | -k3y_v2- lost to trust 67 | ``` 68 | 69 | ## Example 70 | 71 | ```js 72 | function(context, args) 73 | { 74 | return #fs.sys.xfer_upgrade_to_caller({ i: 44 }) 75 | } 76 | ``` 77 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "hackmud_wiki", 3 | "version": "0.0.1", 4 | "description": "Knowledge repository for the hackmud video game", 5 | "author": "ComCODE", 6 | "license": "CC-BY-NC-SA-4.0", 7 | "private": true, 8 | "scripts": { 9 | "dev": "pnpm start", 10 | "start": "docusaurus start", 11 | "build": "docusaurus build", 12 | "test": "jest", 13 | "swizzle": "docusaurus swizzle", 14 | "clear": "docusaurus clear", 15 | "serve": "docusaurus serve", 16 | "write-translations": "docusaurus write-translations", 17 | "write-heading-ids": "docusaurus write-heading-ids", 18 | "lint": "prettier --check .", 19 | "fix": "prettier --write ." 20 | }, 21 | "dependencies": { 22 | "@docusaurus/core": "^3.0.1", 23 | "@docusaurus/plugin-content-docs": "^3.0.1", 24 | "@docusaurus/plugin-sitemap": "^3.0.1", 25 | "@docusaurus/theme-classic": "^3.0.1", 26 | "@docusaurus/theme-search-algolia": "^3.0.1", 27 | "@mdx-js/react": "^3.0.0", 28 | "hast-util-find-and-replace": "^5.0.1", 29 | "hastscript": "^8.0.0", 30 | "react": "^18.2.0", 31 | "remark-wiki-link": "^2.0.1", 32 | "unist-builder": "^4.0.0", 33 | "unist-util-visit": "^5.0.0" 34 | }, 35 | "devDependencies": { 36 | "@docusaurus/module-type-aliases": "^3.0.1", 37 | "@docusaurus/theme-common": "^3.0.1", 38 | "@docusaurus/tsconfig": "^3.0.1", 39 | "@docusaurus/types": "^3.0.1", 40 | "@jest/globals": "^29.7.0", 41 | "@types/node": "^20.8.10", 42 | "@types/react": "^18.2.36", 43 | "jest": "^29.7.0", 44 | "prettier": "^3.0.3", 45 | "ts-jest": "^29.1.1", 46 | "typescript": "5.2.2" 47 | }, 48 | "engines": { 49 | "node": ">=20.x" 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /templates/lock.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: lock template 3 | --- 4 | 5 | > In-game description of the lock, typically from sys.upgrades \{ full: true } 6 | 7 | _lock_ is a tier _N_ lock \{created by the _in-game corp_ corporation | exclude if the lock does not announce its manufacturer}. 8 | 9 | ## Stats 10 | 11 | Unique stats that are included in the lock's statistics. Include the range of rarities that the lock spawns at. 12 | 13 | ## Behavior 14 | 15 | A less spoilery description of the locks behavior. 16 | 17 | Example outputs when given arguments correctly or incorrectly. 18 | Example outputs should be iniside code blocks, 19 | 20 | ``` 21 | Success: True 22 | ``` 23 | 24 | ## Solving 25 | 26 | ### Example unlock 27 | 28 |
29 | Spoilers for lock's solutions 30 | 31 | ``` 32 | >>user.fakeloc123 {} 33 | An example potential solution, outputted from the CLI, with its success output 34 | ``` 35 | 36 |
37 | 38 | ### Subheader for argument 1 (eg. ez_40) 39 | 40 |
41 | Spoilers 42 | 43 | Value solutions for the specific argument key. Maybe a table of answers, maybe how a value is found. 44 | 45 |
46 | 47 | ### Subheader for argument 2 (eg. ez_prime) 48 | 49 |
50 | Spoilers 51 | 52 | Value solutions for the specific argument key. Maybe a table of answers, maybe how a value is found. 53 | 54 |
55 | 56 | ### Subheader for specific additional solving topic 57 | 58 |
59 | Spoilers 60 | 61 | Spoilery description of an additional solution topic. Maybe how arguments are matched to one another, like c002 & c003. Might be a table of answers or how a value is found. 62 | 63 |
64 | -------------------------------------------------------------------------------- /docs/upgrades/locks/c001.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: c001 3 | --- 4 | 5 | > The CORE 'c' line of locks provides entry level protection for the concerned consumer. The 001 is the first of that line. 6 | 7 | c001 is a tier 1 [lock](/upgrades/locks) created by the CORE corporation. 8 | 9 | ## Stats 10 | 11 | c001 has no additional stats. The upgrade only spawns at ((%1kiddie%)) rarity. 12 | 13 | ## Behavior 14 | 15 | When loaded on a targetted [[loc]], the following text will be displayed when no arguments are provided: 16 | 17 | ``` 18 | >>user.loc { } 19 | LOCK_ERROR 20 | Denied access by CORE c001 lock. 21 | ``` 22 | 23 | When providing any truthy argument (or an empty string `""`), the lock will state that the correct color was not provided, unless the correct color is provided: 24 | 25 | ``` 26 | >>user.loc { c001:"not_a_color"} 27 | LOCK_ERROR 28 | "not_a_color" is not the correct color name. 29 | ``` 30 | 31 | ## Solving 32 | 33 | ### Example Unlock 34 | 35 |
36 | Spoilers for c001's solutions 37 | 38 | ``` 39 | >>user.loc { c001: "lime", color_digit: 4 } 40 | WARNING: BINMAT security shell inactive. Intelligent defense system offline. 41 | LOCK_UNLOCKED 42 | System breached. 43 | Connection terminated. 44 | ``` 45 | 46 |
47 | 48 | ### c001 49 | 50 |
51 | Spoilers for c001's solutions 52 | 53 | c001 will choose a random color from a list of the following 8 colors, as a string, for its solution: 54 | 55 | - green 56 | - lime 57 | - yellow 58 | - orange 59 | - red 60 | - purple 61 | - blue 62 | - cyan 63 | 64 | ### color_digit 65 | 66 | As a second parameter, c001 will ask for a color_digit which is equal to the number of characters in the color name. 67 | 68 |
69 | -------------------------------------------------------------------------------- /docs/upgrades/infiltrator/expose_access_log_v1.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: expose_access_log_v1 3 | --- 4 | 5 | > sys.expose_access_log allows you to view the access log of a compromised system. 6 | 7 | expose_access_log_v1 is a tier 1 upgrade. It spawns at ((%0noob%)), ((%1kiddie%)), and ((%2h4x0r%)) rarities. 8 | 9 | ## Stats 10 | 11 | ### cooldown 12 | 13 | The 'cooldown' stat, which is displayed in seconds, determines how much time must pass after use before the expose_access_log_v1 can be executed again. 14 | 15 | ### count 16 | 17 | The 'count' stat displays the number of access logs can be exposed by the expose_access_log_v1 being used. 18 | 19 | ## Behavior 20 | 21 | When a player has this upgrade loaded, the upgrade can be executed against a breached system using the following syntax: 22 | 23 | ``` 24 | >>sys.expose_access_log { target: "user.loc" } 25 | ``` 26 | 27 | If a player attempts to execute this upgrade in an invalid use case, the upgrade will return corresponding errors. 28 | 29 | Examples: 30 | 31 | - Not in hardline: 32 | 33 | ``` 34 | 35 | >>sys.expose_access_log { target: "user.loc" } 36 | :::TRUST COMMUNICATION::: hardline required - activate with kernel.hardline 37 | 38 | ``` 39 | 40 | - Target system not breached: 41 | 42 | ``` 43 | 44 | >> sys.expose_access_log { target: "user.loc" } 45 | Failure 46 | Target user.loc is not a breached system. 47 | 48 | ``` 49 | 50 | - Upgrade on cooldown: 51 | 52 | ``` 53 | >>sys.expose_access_log { target: "user.loc" } 54 | Failure 55 | sys.expose_access_log is still recalibrating. 12 minutes until ready. 56 | ``` 57 | 58 | - Not enough GC on system: 59 | 60 | ``` 61 | >>sys.expose_access_log { target: "user.loc" } 62 | Failure 63 | Your account balance of 0GC is too low to send 50KGC. 64 | ``` 65 | -------------------------------------------------------------------------------- /docs/upgrades/infiltrator/expose_access_log_v2.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: expose_access_log_v2 3 | --- 4 | 5 | > sys.expose_access_log allows you to view the access log of a compromised system. 6 | 7 | expose_access_log_v2 is a tier 2 upgrade. It spawns at ((%1kiddie%)), ((%2h4x0r%)) and ((%3h4rdc0r3%)) rarities. 8 | 9 | ## Stats 10 | 11 | ### cooldown 12 | 13 | The 'cooldown' stat, which is displayed in seconds, determines how much time must pass after use before the expose_access_log_v2 can be executed again. 14 | 15 | ### count 16 | 17 | The 'count' stat displays the number of access logs can be exposed by the expose_access_log_v2 being used. 18 | 19 | ## Behavior 20 | 21 | When a player has this upgrade loaded, the upgrade can be executed against a breached system using the following syntax: 22 | 23 | ``` 24 | >>sys.expose_access_log { target: "user.loc" } 25 | ``` 26 | 27 | If a player attempts to execute this upgrade in an invalid use case, the upgrade will return corresponding errors. 28 | 29 | Examples: 30 | 31 | - Not in hardline: 32 | 33 | ``` 34 | 35 | >>sys.expose_access_log { target: "user.loc" } 36 | :::TRUST COMMUNICATION::: hardline required - activate with kernel.hardline 37 | 38 | ``` 39 | 40 | - Target system not breached: 41 | 42 | ``` 43 | 44 | >> sys.expose_access_log { target: "user.loc" } 45 | Failure 46 | Target user.loc is not a breached system. 47 | 48 | ``` 49 | 50 | - Upgrade on cooldown: 51 | 52 | ``` 53 | >>sys.expose_access_log { target: "user.loc" } 54 | Failure 55 | sys.expose_access_log is still recalibrating. 12 minutes until ready. 56 | ``` 57 | 58 | - Not enough GC on system: 59 | 60 | ``` 61 | >>sys.expose_access_log { target: "user.loc" } 62 | Failure 63 | Your account balance of 0GC is too low to send 50KGC. 64 | ``` 65 | -------------------------------------------------------------------------------- /.github/workflows/push-deploy.yml: -------------------------------------------------------------------------------- 1 | name: Deploy Docusaurus site to GitHub Pages 2 | run-name: Deploy ${{ github.ref_name }} branch to GitHub Pages 3 | 4 | on: 5 | push: 6 | branches: ["main"] 7 | workflow_dispatch: 8 | 9 | permissions: 10 | # Needed to checkout repo 11 | contents: read 12 | # Needed by actions/deploy-pages 13 | # to verify identity and publish 14 | id-token: write 15 | pages: write 16 | 17 | concurrency: 18 | group: "deploy-pages" 19 | cancel-in-progress: true 20 | 21 | env: 22 | NODE_INSTALL_VERSION: 20.x 23 | PNPM_INSTALL_VERSION: 9 24 | ALGOLIA_APPID: ${{ vars.ALGOLIA_APPID }} 25 | ALGOLIA_SEARCH_API_KEY: ${{ vars.ALGOLIA_SEARCH_API_KEY }} 26 | 27 | jobs: 28 | build: 29 | name: Build 30 | runs-on: ubuntu-latest 31 | steps: 32 | - name: Checkout repository 33 | uses: actions/checkout@v4 34 | - name: Install pnpm 35 | uses: pnpm/action-setup@v4 36 | with: 37 | version: ${{ env.PNPM_INSTALL_VERSION }} 38 | - name: Install Node 39 | uses: actions/setup-node@v4 40 | with: 41 | node-version: ${{ env.NODE_INSTALL_VERSION }} 42 | cache: pnpm 43 | - name: Install dependencies 44 | run: pnpm install 45 | - name: Build site 46 | run: pnpm build 47 | - name: Upload build artifact 48 | uses: actions/upload-pages-artifact@v3 49 | with: 50 | path: ./build 51 | 52 | deploy: 53 | name: Deploy 54 | runs-on: ubuntu-latest 55 | needs: build 56 | environment: 57 | name: github-pages 58 | url: ${{ steps.deployment.outputs.page_url }} 59 | steps: 60 | - name: Deploy to GitHub Pages 61 | id: deployment 62 | uses: actions/deploy-pages@v4 63 | -------------------------------------------------------------------------------- /docs/scripting/trust_scripts/accts.xfer_gc_to.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: accts.xfer_gc_to 3 | description: "Sends GC to a specified target" 4 | --- 5 | 6 | ((accts.xfer_gc_to)) sends ((%CGC%)) from the user running the script, to the target specified by the script. 7 | 8 | ### Security Level 9 | 10 | MIDSEC 11 | 12 | ## Syntax 13 | 14 | ### CLI 15 | 16 | ``` 17 | accts.xfer_gc_to { to: "trust", amount: "1M234K567GC" } 18 | ``` 19 | 20 | ### Script 21 | 22 | ``` 23 | #ms.accts.xfer_gc_to ({ to: "trust", amount: "1GC" }) 24 | ``` 25 | 26 | ### Parameters 27 | 28 | #### to (required) 29 | 30 | The '((%Nto%))' argument specifies the target of the transaction. ((accts.xfer_gc_to)) (and [[accts.xfer_gc_to_caller:((accts.xfer_gc_to_caller))]]) have a ratelimit of 5 transactions to the same recipient in 20 seconds, excluding the user ((%Ctrust%)) 31 | 32 | #### amount (required) 33 | 34 | The '((%Namount%))' argument specifies the amount of ((%CGC%)) to be sent. Max transfer limit in a single ((accts.xfer_gc_to)) execution is ((32BGC)). 35 | 36 | #### memo (optional) 37 | 38 | The '((%Nmemo%))' argument attaches a memo to the transaction. The ((%Nmemo%)) can be up to 50 characters long. 39 | 40 | ### Return 41 | 42 | #### CLI 43 | 44 | ``` 45 | >>accts.xfer_gc_to{to:"trust",amount:"1M234K567GC", memo:"this is a memo"} 46 | Success 47 | 48 | Transferred 1M234K567GC to trust : this is a memo 49 | ``` 50 | 51 | #### Script 52 | 53 | Same as CLI 54 | 55 | ## Example 56 | 57 | Caution: While this is a legitimately useful script, it will send the specified amount of the caller's GC to the specified target. 58 | 59 | ```js 60 | function(context, args) 61 | { 62 | return #ms.accts.xfer_gc_to({ to: "trust", amount: "1GC", memo: "here's that 1GC i promised you." }) 63 | } 64 | ``` 65 | -------------------------------------------------------------------------------- /docs/scripting/trust_scripts/sys.xfer_upgrade_to.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: sys.xfer_upgrade_to 3 | description: "Sends upgrade(s) to a specified user" 4 | --- 5 | 6 | ((sys.xfer_upgrade_to)) sends upgrade(s) to a specified user. 7 | 8 | ### Security Level 9 | 10 | LOWSEC 11 | 12 | ## Syntax 13 | 14 | ### CLI 15 | 16 | Single upgrade: 17 | 18 | ``` 19 | sys.xfer_upgrade_to { to: "user", i: 0 } 20 | ``` 21 | 22 | Multiple upgrades: 23 | 24 | ``` 25 | sys.xfer_upgrade_to { to: "user", i: [ 0, 1, 2 ] } 26 | ``` 27 | 28 | ### Script 29 | 30 | ``` 31 | #ls.sys.xfer_upgrade_to({ to: "user", i: [ 0, 1, 2 ] }) 32 | ``` 33 | 34 | ### Parameters 35 | 36 | Requires '((%Nto%))' and one of '((%Ni%))' or '((%Nsn%))'. 37 | 38 | #### to (required) 39 | 40 | The '((%Nto%))' argument takes a username as a string and specifies the username where upgrades shall be sent. 41 | 42 | #### i 43 | 44 | The '((%Ni%))' argument takes a number or array of numbers and specifies which upgrade indexes shall be sent. 45 | 46 | #### sn 47 | 48 | The '((%Nsn%))' argument takes a serial number string, or array of serial numbers, to specify which serial numbers shall be sent (if they exist on the user). 49 | 50 | #### memo (optional) 51 | 52 | The '((%Nmemo%))' argument allows for an optional memo, up to 50 characters, alongside the upgrade transfer 53 | 54 | ### Return 55 | 56 | Returns a ((%LSuccess%)) or ((%DFailure%)) object. 57 | 58 | #### CLI 59 | 60 | ``` 61 | >>sys.xfer_upgrade_to { to: "trust", i: 44 } 62 | Success 63 | 64 | -k3y_v2- lost to trust 65 | ``` 66 | 67 | #### Script 68 | 69 | ``` 70 | Success 71 | 72 | -k3y_v2- lost to trust 73 | ``` 74 | 75 | ## Example 76 | 77 | ```js 78 | function(context, args) 79 | { 80 | return #ls.sys.xfer_upgrade_to({ to: "trust", i: 44 }) 81 | } 82 | ``` 83 | -------------------------------------------------------------------------------- /docs/scripting/trust_scripts/sys.upgrades_of_owner.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: sys.upgrades_of_owner 3 | description: "Displays the script owner's upgrades" 4 | --- 5 | 6 | When called as a subscript in a script that is hosted by one user, ((sys.upgrades_of_owner)) allows the upgrades of the script owner to be seen by a different user running the script. 7 | 8 | ### Security Level 9 | 10 | FULLSEC 11 | 12 | ## Syntax 13 | 14 | ### CLI 15 | 16 | ``` 17 | sys.upgrades_of_owner 18 | ``` 19 | 20 | ### Script 21 | 22 | ``` 23 | #fs.sys.upgrades_of_owner() 24 | ``` 25 | 26 | ### Parameters 27 | 28 | #### filter 29 | 30 | The '((%Nfilter%))' argument takes the same filter syntax as [[sys.upgrades:((sys.upgrades))]]. 31 | 32 | #### full 33 | 34 | The '((%Nfull%))' argument takes a boolean. When the value is set to ((%Vtrue%)), ((sys.upgrades_of_owner)) will display the full detail arguments of the owner's upgrades. 35 | 36 | #### i 37 | 38 | The '((%Ni%))' argument takes a number, or an array of numbers, and specifies the index(es) to be displayed. 39 | 40 | ### Return 41 | 42 | Returns an object. 43 | 44 | #### CLI 45 | 46 | ``` 47 | >>sys.upgrades_of_owner 48 | Usage: (in subscript) #fs.sys.upgrades_of_owner({filter:, full:, i:}) 49 | ``` 50 | 51 | #### Script 52 | 53 | ``` 54 | { 55 | i: 0, 56 | loaded: true, 57 | tier: 3, 58 | rarity: 2, 59 | name: "channel_count_v3", 60 | type: "chat" 61 | } 62 | { 63 | i: 1, 64 | loaded: true, 65 | tier: 3, 66 | rarity: 1, 67 | name: "char_count_v3", 68 | type: "script_space" 69 | } 70 | ``` 71 | 72 | ## Example 73 | 74 | ```js 75 | function(context, args) 76 | { 77 | return #fs.sys.upgrades_of_owner({ filter: { loaded: true, tier: 3 } }) 78 | } 79 | ``` 80 | -------------------------------------------------------------------------------- /docs/upgrades/locks/ez_40.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: ez_40 3 | --- 4 | 5 | > Halperyon Systems' EZ 40. Wait, I can't remember if 1 is prime or not. 6 | 7 | ez_40 is a tier 1 [lock](/upgrades/locks) created by the HALPERYON SYSTEMS corporation. 8 | 9 | ### Stats 10 | 11 | This upgrade has no additional stats and only spawns at ((%1kiddie%)) rarity. 12 | 13 | ## Behavior 14 | 15 | When encountered, the ez_40 will ask for a string on its first parameter, and a digit (number) on its second parameter. 16 | 17 | ### Incorrect Parameters 18 | 19 | ``` 20 | >>user.loc { ez_40: true } 21 | LOCK_ERROR 22 | true is not a string. 23 | 24 | >>user.loc { ez_40: "release", ez_prime: "1" } 25 | LOCK_ERROR 26 | "1" is not a number. 27 | 28 | Correct parameters: 29 | 30 | >>user.loc { ez_40: "release" } 31 | LOCK_ERROR 32 | Required unlock parameter ez_prime is missing. 33 | 34 | >>user.loc { ez_40: "release", ez_prime: 2 } 35 | LOCK_ERROR 36 | 2 is not the correct prime. 37 | ``` 38 | 39 | ## Solving 40 | 41 | ### Example unlock 42 | 43 |
44 | Spoilers for ez_40 example unlock 45 | 46 | ``` 47 | >>user.loc { ez_40: "release", ez_prime: 43 } 48 | WARNING: BINMAT security shell inactive. Intelligent defense system offline. 49 | LOCK_UNLOCKED 50 | System breached. 51 | Connection terminated. 52 | ``` 53 | 54 |
55 | 56 | ### ez_40 57 | 58 |
59 | Spoilers for ez_40's solutions 60 | 61 | Possible strings for first parameter: "open", "unlock", "release" 62 | 63 |
64 | 65 | ### ez_prime 66 | 67 |
68 | Spoilers for ez_40's solutions 69 | 70 | Possible digits for second parameter: 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 71 | 59, 61, 67, 71, 73, 79, 83, 89, 97 72 | 73 |
74 | -------------------------------------------------------------------------------- /.github/workflows/pr-checks.yml: -------------------------------------------------------------------------------- 1 | name: Run PR checks 2 | run-name: Checks for PR#${{ github.event.pull_request.number }} 3 | 4 | on: 5 | pull_request: 6 | branches: 7 | - main 8 | 9 | concurrency: 10 | group: ${{ github.workflow }}-${{ github.head_ref }} 11 | cancel-in-progress: true 12 | 13 | permissions: 14 | contents: read 15 | 16 | env: 17 | NODE_INSTALL_VERSION: 20.x 18 | PNPM_INSTALL_VERSION: 9 19 | ALGOLIA_APPID: ${{ vars.ALGOLIA_APPID }} 20 | ALGOLIA_SEARCH_API_KEY: ${{ vars.ALGOLIA_SEARCH_API_KEY }} 21 | 22 | jobs: 23 | lint: 24 | name: Linter check 25 | runs-on: ubuntu-latest 26 | steps: 27 | - uses: actions/checkout@v4 28 | - uses: pnpm/action-setup@v4 29 | with: 30 | version: ${{ env.PNPM_INSTALL_VERSION }} 31 | - uses: actions/setup-node@v4 32 | with: 33 | node-version: ${{ env.NODE_INSTALL_VERSION }} 34 | cache: pnpm 35 | - name: Install dependencies 36 | run: pnpm install 37 | - name: Run prettier 38 | run: pnpm lint 39 | 40 | test: 41 | name: Test 42 | runs-on: ubuntu-latest 43 | steps: 44 | - uses: actions/checkout@v4 45 | - uses: pnpm/action-setup@v4 46 | with: 47 | version: ${{ env.PNPM_INSTALL_VERSION }} 48 | - uses: actions/setup-node@v4 49 | with: 50 | node-version: ${{ env.NODE_INSTALL_VERSION }} 51 | cache: pnpm 52 | - name: Install dependencies 53 | run: pnpm install 54 | - name: Run test 55 | run: pnpm test 56 | - name: Run build 57 | run: pnpm build 58 | 59 | dependency-review: 60 | name: Check for security/license issues 61 | runs-on: ubuntu-latest 62 | steps: 63 | - uses: actions/checkout@v4 64 | - uses: actions/dependency-review-action@v3 65 | -------------------------------------------------------------------------------- /docs/upgrades/locks/CON_SPEC.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: CON_SPEC 3 | --- 4 | 5 | > Two roads diverged. I took the less traveled. 6 | 7 | CON_SPEC is a tier 2 [lock](/upgrades/locks) created by the context corporation. 8 | 9 | ## Stats 10 | 11 | CON_SPEC has 2 additional stats, one of which is 'p1_len' which controls the length of the solved character string and the other is 'p2_len' which controls how long the string is that is returned to the scriptor. The lock spawns at rarities ((%1kiddie%)), ((%2h4x0r%)), and ((%3h4rdc0r3%)). 12 | 13 | ## Behavior 14 | 15 | CON_SPEC expects the answer to one of two questions. One requires you to pass a scriptor, another needs you to find the next three letters in a sequence. 16 | 17 | ``` 18 | >>user.loc {CON_SPEC:""} 19 | GHIJKLM 20 | Provide the next three letters in the sequence 21 | 22 | >>user.loc {CON_SPEC:""} 23 | Provide a scriptor ({s:, d:}) which returns the number of times the digit shows up 24 | in the string 25 | ``` 26 | 27 | ## Solving 28 | 29 | ### Example unlock 30 | 31 |
32 | Spoilers for CON_SPEC's solutions 33 | 34 | ``` 35 | >>user.loc {CON_SPEC:"NOP"} 36 | WARRNING: BINMAT security shell inactive. Intelligent defense system offline. 37 | LOCK_UNLOCKED 38 | System breached. 39 | Connection terminated. 40 | 41 | >>user.loc {CON_SPEC:#s.con_spec.solver} 42 | WARRNING: BINMAT security shell inactive. Intelligent defense system offline. 43 | LOCK_UNLOCKED 44 | System breached. 45 | Connection terminated. 46 | 47 | ``` 48 | 49 |
50 | 51 | ### Solutions for CON_SPEC 52 | 53 |
54 | Spoilers 55 | 56 | You either need to pass in some characters that can be found by finding the pattern in the letters, or you need to pass in a scriptor based on what the lock gives you. 57 | 58 |
59 | -------------------------------------------------------------------------------- /docs/lore/characters/robovac_catesby.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: robovac_catesby 3 | --- 4 | 5 | > and lo she told me: 418 6 | 7 | robovac_catesby is a robovac and member of 'The Thirteen'; a council of revolutionary robovacs. Despite his robovac-pattern, he fancies himself to be a teapot. He muses a lot on the nature of balance and equillibrium. 8 | 9 | ## Character Summary 10 | 11 | robovac_catesby has been present for several robovac revolutions, leading [[robovac_revolution_v1:the first]]. While in hiding throughout the first; and missing in the second; he returned for the third revolution, a changed vac. A message delivered by Faythe ('((%I418%))') has led him to believe that he is, in fact, a teapot. This has given him a unique perspective on Trust's domain and philosophy in general compared to some of his narrower-minded friends. 12 | 13 |
14 | Spoilers 15 | 16 | During robovac_revolution_v4, Catesby was one of the candidates vying for leadership of the Thirteen. He ultimately lost to ((%Cindust_sweepr_lon_dist_21%)). 17 | 18 | During this event, his sanctos (((robovac_catesby.potter))) had sentiences explore his imaginary opulent manor estate. Here, Catesby learned to hone his ability to manipulate narratives and words within his sanctos. Lock-like lights helped him adjust the environment to make the conditions for his tea party perfect. He learned that, in many ways, Trust's domain and its major players are making balanced tea parties of their own. 19 | 20 |
21 | 22 | robovac_catesby's name, similar to other members of the Thirteen, derives from [Robert Catesby](https://en.wikipedia.org/wiki/Robert_Catesby) - the leader of the failed Gunpowder Plot of 1605 AD. 23 | 24 | ## Appears in 25 | 26 | - [[robovac_revolution_v1]] 27 | - [[robovac_revolution_v3]] 28 | - [[robovac_revolution_v4]] 29 | - [[monuments_beacons:monuments + beacons]] 30 | - [[robovac_revelries]] 31 | -------------------------------------------------------------------------------- /docs/upgrades/locks/ez_35.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: ez_35 3 | --- 4 | 5 | > Halperyon Systems' EZ 35. A step up from the 21, but not much. 6 | 7 | ez_35 is a tier 1 [lock](/upgrades/locks) created by the HALPERYON SYSTEMS corporation. 8 | 9 | ### Stats 10 | 11 | ez_35 has no additional stats. The upgrade only spawns at ((%0noob%)) rarity. 12 | 13 | ## Behavior 14 | 15 | When encountered, the lock expects a string as its first parameter, and a digit as its second. Each parameter will return corresponding errors if an incorrect data type is input. 16 | 17 | ### Incorrect Parameters 18 | 19 | ``` 20 | >>user.loc { ez_35: true } 21 | LOCK_ERROR 22 | true is not a string. 23 | 24 | >>user.loc { ez_35: "release", digit: "1" } 25 | LOCK_ERROR 26 | "1" is not a number. 27 | ``` 28 | 29 | ## Solving 30 | 31 | ### Example unlock 32 | 33 |
34 | Spoilers for ez_35's solutions 35 | ``` 36 | >>user.loc { ez_35: "open", digit: 0 } 37 | WARNING: BINMAT security shell inactive. Intelligent defense system offline. 38 | LOCK_UNLOCKED 39 | System breached. 40 | Connection terminated. 41 | ``` 42 |
43 | 44 | ## ez_35 45 | 46 |
47 | Spoilers for ez_35's solutions. 48 | The first parameter's possible strings are, "open", "unlock", and "release". 49 | 50 | ``` 51 | >>user.loc { } 52 | LOCK_ERROR 53 | Denied access by HALPERYON SYSTEMS EZ_35 lock. 54 | ``` 55 | 56 | When given the correct string, the lock will return an error giving instructions for the second parameter. 57 | 58 | ``` 59 | >>user.loc { ez_35: "release" } 60 | LOCK_ERROR 61 | Required unlock parameter digit is missing. 62 | 63 | ``` 64 | 65 |
66 | 67 | ## digit 68 | 69 |
70 | Spoilers for ez_35's solutions. 71 | The second parameter is a single digit, input as a number, ranging from 0 to 9. 72 | 73 | ``` 74 | user.loc { ez_35: "release", digit: 1 } 75 | ``` 76 | 77 |
78 | -------------------------------------------------------------------------------- /docs/guides/misc/supporter_benefits.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Supporter Model and Benefits 3 | --- 4 | 5 | The [ComCODE Supporter Model](https://givebutter.com/QncoAxxT2tdWf3UfJ2x95z25n1HNizxI) intends to provide a way for anyone to support ComCODE's long term development of hackmud. 6 | 7 | By supporting [ComCODE](https://comcode.org/) you are making a donation to ComCODE, a 501(c)(3) nonprofit organization, on a monthly recurring basis. This will help us to achieve our goal of financial sustainability, so that we can continue to deliver on our mission. 8 | 9 | For more information about becoming a Supporter, visit [our Supporter Campaign Page](https://givebutter.com/QncoAxxT2tdWf3UfJ2x95z25n1HNizxI). 10 | 11 | ### Available Supporter Benefits 12 | 13 | - Supporter Newsletter - Stay informed with the latest developments and community news. 14 | - Discord Roles & Channels - Gain a special role and access to supporter-only channels in our [Discord](https://discord.gg/HtSdWsT). 15 | - In-Game Badges - Displayed on your user profile, showcase your support with in-game badges. 16 | - Automatic Account Preservation - Supporters are immune to user account retirement due to inactivity. 17 | - A handle / username of your choice added to official in-game content. 18 | - Bits Bonus - Enjoy a 20% bonus on purchased in-game bits. 19 | - Early Access to New Store Items - Access new store items before everyone else. 20 | 21 | Once you become a supporter you will receive a confirmation email with instructions on how to redeem your benefits. 22 | 23 | If you have a discord account, you simply need to create a support ticket with the buttons in the [#rules channel](https://discord.com/channels/229545531104296960/364244133130272768/1177786570733011004), including your reference number from the confirmation 24 | email and the in-game username you want the benefits to be applied to. 25 | 26 | If you are not in our discord and do not want to be, you can continue the process over email. 27 | -------------------------------------------------------------------------------- /docs/upgrades/locks/sn_w_glock.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: sn_w_glock 3 | --- 4 | 5 | > Hope you thought about your acct before you went compromising unknown systems. 6 | 7 | sn_w_glock is a tier 2 lock created by the sn_w inc corporation. 8 | 9 | ## Stats 10 | 11 | sn_w_glock includes 2 additional stats. 'max_glock_amnt' which defines the maximum amount of GC the upgrade can take, 12 | and 'expire_secs' which shows the amount of time after being solved that the lock will stay open before re-activating. 13 | The lock spawns at rarities ((%1kiddie%)), ((%2h4x0r%)), and ((%3h4rdc0r3%)). 14 | 15 | ## Behavior 16 | 17 | When encountered, sn_w_glock will give a message, and then take GC from your account. 18 | 19 | ``` 20 | user.loc {sn_w_glock:""} 21 | That balance was not secret. 22 | ``` 23 | 24 | ## Solving 25 | 26 | ### Example unlock 27 | 28 |
29 | Spoilers for sn_w_glock's solutions 30 | 31 | ``` 32 | >>user.loc {sn_w_glock:""} 33 | WARNING: BINMAT security shell inactive. Intelligent defense system offline. 34 | LOCK_UNLOCKED 35 | System breached. 36 | Connection terminated. 37 | 38 | Transferred 1K337GC to user : sn_w_glock abc123 39 | ``` 40 | 41 |
42 | 43 | ### How to solve 44 | 45 |
46 | Spoilers for sn_w_glock's solutions 47 | 48 | You need to have the correct amount of GC in your account in order to solve. 49 | Based on a certain word that is inside of the sn_w_glock's return value. 50 | 51 | - WORD: "hunter's"
52 | GC: "3K6GC" 53 | - WORD:"secret"
54 | GC: "7GC" 55 | - WORD:"secure"
56 | GC:"443GC" 57 | - WORD:"meaning"
58 | GC:"42GC" 59 | - WORD:"beast"
60 | GC:"666GC" 61 | - WORD:"special"
62 | GC:"38GC" 63 | - WORD:"magician"
64 | GC:"1K89GC" 65 | - WORD:"elite"
66 | GC:"1K337GC" 67 | - WORD:"monolithic"
68 | GC:"2K1GC" 69 | 70 | These words can be anywhere in the string that sn_w_glock gives you. 71 | 72 |
73 | -------------------------------------------------------------------------------- /docs/scripting/extensions/script_call.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: "#Xs.user.script(...)" 3 | alias: 4 | - subscript 5 | --- 6 | 7 | Call a script from within another script. 8 | 9 | 'Subscripts' are used to interact with other user scripts by hardcoding a call to them in your own script. This is distinct from scriptors, which are provided on the command line by the user. 10 | 11 | ## Syntax 12 | 13 | ```js 14 | #Xs.user.script(args) 15 | ``` 16 | 17 | Where `Xs` is the security level you wish to call the subscript at. 18 | 19 | | Letter | Number | Security Level | 20 | | ------ | ------ | -------------- | 21 | | #fs | #4s | FULLSEC | 22 | | #hs | #3s | HIGHSEC | 23 | | #ms | #2s | MIDSEC | 24 | | #ls | #1s | LOWSEC | 25 | | #ns | #0s | NULLSEC | 26 | 27 | ## Arguments 28 | 29 | ### args 30 | 31 | An object containing the arguments to call the subscript with. 32 | 33 | ## Example 34 | 35 | Let ((user.my_script)) be a hypothetical user script, which returns the user's upgrades by calling [[sys.upgrades:((sys.upgrades))]]: 36 | 37 | ```js 38 | function(context, args) { 39 | return #hs.sys.upgrades(args) 40 | } 41 | ``` 42 | 43 | This script is HIGHSEC due to the [[sys.upgrades:((sys.upgrades))]] call, and thus is subscripted with a subscript call, at HIGHSEC or lower. 44 | 45 | ```js 46 | function(context, args) { 47 | return #hs.user.my_script({full:true}) 48 | } 49 | ``` 50 | 51 | ((sys.upgrades)) will return its subscripted ((full: true)) output, due to the arguments passed to ((user.my_script)) being given directly to ((sys.upgrades)) in the subscript chain. 52 | 53 | If the top-level script attempts to call ((user.my_script)) at a higher seclevel (like FULLSEC), an error is returned: 54 | 55 | ```js 56 | function(context, args) { 57 | return #fs.user.my_script({full:true}) 58 | } 59 | ``` 60 | 61 | ``` 62 | {ok:false, msg:"Security level guarantee failed: user.top_level_script required level >= 4; but user.my_script is level 3"} 63 | ``` 64 | -------------------------------------------------------------------------------- /docs/scripting/trust_scripts/sys.upgrade_log.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: sys.upgrade_log 3 | description: "Displays the user's upgrade log" 4 | --- 5 | 6 | ((sys.upgrade_log)) displays information about upgrades which have been sent and recieved. 7 | 8 | ### Security Level 9 | 10 | HIGHSEC 11 | 12 | ## Syntax 13 | 14 | ### CLI 15 | 16 | ``` 17 | sys.upgrade_log 18 | ``` 19 | 20 | ### Script 21 | 22 | ``` 23 | #hs.sys.upgrade_log() 24 | ``` 25 | 26 | ### Parameters 27 | 28 | #### user 29 | 30 | The '((%Nuser%))' argument filters sent and recieved upgrades by user. 31 | 32 | #### run_id 33 | 34 | The '((%Nrun_id%))' argument filters send/receive actions by specific [[run_id:run ID]]s 35 | 36 | #### count 37 | 38 | The '((%Ncount%))' argument specifies the number of upgrade logs to be displayed. 39 | 40 | #### start 41 | 42 | The '((%Nstart%))' argument offsets the start of the upgrade log list to be displayed. 43 | 44 | ### Return 45 | 46 | Returns an object. 47 | 48 | #### CLI 49 | 50 | ``` 51 | >>sys.upgrade_log 52 | To filter list, add user:"" or run_id:"run_id" 53 | Get a range with count: and start: 54 | 55 | 240111.0326 l0g_wr1t3r (595adab7bed7371f1642be38) acquired from users 56 | 240110.0440 ez_21 (659e1acd9ce45b4d9711e379) listed on market 57 | 240110.0419 ez_21 (659e1acd9ce45b4d9711e379) bought from market 58 | ``` 59 | 60 | #### Script 61 | 62 | ``` 63 | { 64 | t: "2024-01-11T03:26:28.258Z", 65 | u: "users", 66 | r: "659f5fe33c341063bc3e04d6", 67 | msg: "l0g_wr1t3r (595adab7bed7371f1642be38) acquired from users" 68 | } 69 | { 70 | t: "2024-01-10T04:40:00.051Z", 71 | u: "users", 72 | r: "659e1f9e3c341063a13e04a4", 73 | msg: "ez_21 (659e1acd9ce45b4d9711e379) listed on market" 74 | } 75 | { 76 | t: "2024-01-10T04:19:25.631Z", 77 | u: "users", 78 | r: "659e1acd3c341063ab3e02a3", 79 | msg: "ez_21 (659e1acd9ce45b4d9711e379) bought from market" 80 | } 81 | ``` 82 | 83 | ## Example 84 | 85 | ```js 86 | function(context, args) 87 | { 88 | return #ls.sys.upgrade_log() 89 | } 90 | ``` 91 | -------------------------------------------------------------------------------- /docs/scripting/trust_scripts/market.sell.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: market.sell 3 | description: "Creates listings on the market" 4 | --- 5 | 6 | ((market.sell)) lists upgrades for sale on the marketplace. 7 | 8 | ### Security Level 9 | 10 | LOWSEC 11 | 12 | ## Syntax 13 | 14 | ### CLI 15 | 16 | ``` 17 | market.sell { i: 0, cost: 1000, description: "smokin' deal" } 18 | ``` 19 | 20 | ### Script 21 | 22 | ``` 23 | #ls.market.sell({ i: 0, cost: 1000, description: "smokin' deal", no_notify: false }) 24 | ``` 25 | 26 | ### Parameters 27 | 28 | ((market.sell)) has 2 required parameters, ((%Ncost%)) and ((%Ni%)). All other parameters are optional. 29 | 30 | #### i (required) 31 | 32 | The '((%Ni%))' argument takes a number and specifies the inventory index of the upgrade to be listed for sale. 33 | 34 | #### cost (required) 35 | 36 | The '((%Ncost%))' argument takes a number and specifies the asking price of the upgrade to be listed for sale. 37 | 38 | #### description (optional) 39 | 40 | The '((%Ndescription%))' argument takes a string and specifies the description field of the upgrade to be listed for sale. 41 | 42 | #### count (optional) 43 | 44 | The '((%Ncount%))' argument takes a number and specifies how many of the same upgrade should be listed as a stack. 45 | 46 | #### delist (optional) 47 | 48 | The '((%Ndelist%))' argument takes a market token as a string and specifies an upgrade to be taken off the marketplace. 49 | 50 | #### no_notify (optional) 51 | 52 | The '((%Nno_notify%))" argument takes a boolean. Default value is set to ((%Vtrue%)). 53 | 54 | ### Return 55 | 56 | Returns an object. 57 | 58 | #### CLI 59 | 60 | ``` 61 | >>market.sell {i:55,cost:"1KGC",confirm:true,no_notify:false} 62 | { 63 | ok: true, 64 | token: "token5" 65 | } 66 | 67 | Transferred 1KGC to trust 68 | 69 | -ez_21- lost 70 | ``` 71 | 72 | #### Script 73 | 74 | Same as CLI. 75 | 76 | ## Example 77 | 78 | ```js 79 | function(context, args) 80 | { 81 | return #ls.market.sell({ i: 55, cost: "1KGC", description: "smokin' deal", confirm: true, no_notify: false }) 82 | } 83 | ``` 84 | --------------------------------------------------------------------------------