0.20.2 • Published 4 days ago

hackmud-script-manager v0.20.2

Weekly downloads
9
License
MIT
Repository
github
Last release
4 days ago

Hackmud Script Manager

Command made for hackmud-environment, which is a scripting environment for hackmud with minification, autocompletes / intellisense, and TypeScript support.

Install

  1. Install Node.js
  2. Run npm install -g hackmud-script-manager

Usage

  1. Run #dir in game, then cd to that folder
  2. Name your source script file to <name>.src.js
  3. Run hsm golf <name>.src.js and it will create a minified script file called <name>.js

Features

  • Minification
    • This includes auto quine cheating.
      • Supported types are null, numbers, strings, and JSON compatible objects and arrays.
      • Non JSON compatible object keys are quine cheated.
      • Member expressions are converted to index notation so the index string can be quine cheated.
      • And template literals are converted to string concatenation so the strings can be quine cheated.
    • Global variable aliasing.
    • Convert function declarations to arrow function assigned to variable hoisted to the top of the block (function foo() { ... } -> let foo = () => ...).
    • Convert _START and _TIMEOUT to _ST and _TO.
    • Remove unused parameters from the main function expression.
  • Modern Javascript Syntax and Features
  • Future JavaScript Syntax and Features
  • TypeScript Support
    • This command/module does not do type checking, it simply removes type annotations so you'll need to rely on your IDE or run tsc seperatly with noEmit.
  • And “Cool” Unnecessary Features.
    • Variables declared outside the main function expression automatically become #G global variables.
    • Any code outside the function expression will only run once per top level script execution (#FMCL).
    • Basic seclevel verification.
      • Declaring // @seclevel HIGHSEC or any other seclevel before all of your code stops you from accidentally using #ls. or #ns..
    • Import node_modules modules into your script using import { foo } from "bar" syntax.
    • _SOURCE is replaced with a string of the source code of the script it's in.
    • _BUILD_DATE is replaced with a unix timestamp (Date.now()) of the build date of the script.
    • _SCRIPT_USER is replaced with a string of the user the script was pushed to.
      • This saves characters compared to context.this_script.split(".")[0].
    • _SCRIPT_NAME is like _SCRIPT_USER but for the name of the script.
      • Saves characters compared to context.this_script.split(".")[1].
    • _FULL_SCRIPT_NAME is replaced with what would be context.this_script.
    • #s. can be used and it'll automatically have the seclevel inserted.
    • Subscript and #db methods names are verified.
    • All references to preprocessor syntax functions not being called are turned into arrow function wrappers e.g. let debug = #D; -> let debug = v => #D(v);.
    • _SECLEVEL is replaced with a number (0 to 4) representing the seclevel of the script.
    • When exports are present in the script, it becomes a script that returns an object of the exported values.
      • _EXPORTS becomes an array of the names of the exported values.
  • And Neat Weird Fixes
    • Like .__proto__ and .prototype being converted to ["__proto__"] and ["prototype"].
    • Illegal and unsafe strings.
      • Appearences of _SC and friends are either renamed or have an escape inserted so that script is legal.
      • Preprocessor syntax in strings are escaped so hackmud doesn't recognise them as preprocessor syntax.
      • And appearences of // in strings and regexes have a backslash inserted between to stop hackmud's overagressive comment remover from removing half the line of code.
    • Classes are actually usable now, this module replaces instances of this with a variable referencing what would be this.
    • Function.prototype can be referenced (but only the .prototype property, nothing else).
    • Object.getPrototypeOf and Object.setPrototypeOf are replaced with equivalent functions.
0.20.2

4 days ago

0.20.2-3d1af3b

4 days ago

0.20.3-d3fbb44

4 days ago

0.20.1

6 days ago

0.20.0

6 days ago

0.19.1-b040eb5

6 days ago

0.19.1-6d8d544

6 days ago

0.20.1-9202bca

6 days ago

0.19.1-01c1752

6 days ago

0.19.1-d57be2a

6 days ago

0.20.1-503b02c

6 days ago

0.19.1-49ea60d

6 days ago

0.20.2-b7b7724

6 days ago

0.19.1-02bed1a

6 days ago

0.19.1-875bbe4

6 days ago

0.19.1-b3a477d

6 days ago

0.20.2-1656aa3

5 days ago

0.19.1-c2f3057

6 days ago

0.19.1-b80922d

6 days ago

0.19.1-8719c7d

7 days ago

0.19.1-b720a68

7 days ago

0.19.1-3712be4

9 days ago

0.19.1-7a27b63

9 days ago

0.19.1-a81047f

9 days ago

0.19.1-29fcf72

11 days ago

0.19.1-531ddb2

11 days ago

0.19.1-cb8d65f

11 days ago

0.19.1-07fc9cb

11 days ago

0.19.1-bf4dc4a

14 days ago

0.19.1-64ab3ba

15 days ago

0.19.1-3ef8894

15 days ago

0.19.1-003b022

15 days ago

0.19.1-5bceac8

16 days ago

0.19.1-bd545f5

15 days ago

0.19.1-1c8229a

17 days ago

0.19.1-98e81f8

18 days ago

0.19.1-27bbd7d

18 days ago

0.19.1-4bde221

18 days ago

0.19.0-b5e2c0b

4 months ago

0.19.0-fa82f73

4 months ago

0.20.0-b71a8be

4 months ago

0.19.0-7c69a3b

4 months ago

0.19.0

4 months ago

0.19.0-0d87e53

4 months ago

0.19.0-771b929

4 months ago

0.19.0-dbb7332

8 months ago

0.19.0-c12fd7c

10 months ago

0.19.0-f21e319

10 months ago

0.19.0-cd5548c

10 months ago

0.19.0-e6544c9

10 months ago

0.19.0-50a29ed

2 years ago

0.18.0-7f0c754

2 years ago

0.18.0

2 years ago

0.19.0-12a232c

2 years ago

0.18.0-7556335

2 years ago

0.19.0-f59b4c9

2 years ago

0.19.0-43367ba

2 years ago

0.18.0-7338c14

2 years ago

0.18.0-6155ebe

2 years ago

0.18.0-b0e9141

2 years ago

0.17.0

2 years ago

0.18.0-1392153

2 years ago

0.17.0-f0377d6

2 years ago

0.17.0-b9d03f8

2 years ago

0.17.0-2101274

2 years ago

0.16.1

2 years ago

0.15.0-65d6e88

2 years ago

0.14.0-f09e93a

2 years ago

0.13.0

2 years ago

0.13.1

2 years ago

0.14.0-049ae05

2 years ago

0.13.0-3552269

2 years ago

0.13.0-7dddbef

2 years ago

0.14.0

2 years ago

0.14.0-9126de3

2 years ago

0.13.0-02e8706

2 years ago

0.15.0-fcf8be4

2 years ago

0.15.0-dc021ad

2 years ago

0.14.0-496fb0f

2 years ago

0.15.0-3c27edd

2 years ago

0.15.0-4152f8d

2 years ago

0.15.0

2 years ago

0.17.0-43cb5e3

2 years ago

0.16.0-972cf7b

2 years ago

0.14.0-93bd75f

2 years ago

0.16.0-424d2ba

2 years ago

0.16.0-8448068

2 years ago

0.17.0-3de4ad4

2 years ago

0.15.0-32fc223

2 years ago

0.17.0-df208a9

2 years ago

0.13.0-bf69e1f

2 years ago

0.14.0-4776372

2 years ago

0.14.0-7ae2b93

2 years ago

0.16.0

2 years ago

0.14.0-66846c3

2 years ago

0.13.0-f373e9c

2 years ago

0.15.0-084d143

2 years ago

0.13.0-1c3fc89

2 years ago

0.13.0-30ea96c

2 years ago

0.13.0-3c2ea92

2 years ago

0.13.0-a60a7a2

2 years ago

0.13.0-bea275a

2 years ago

0.13.0-3909530

2 years ago

0.13.0-af0e1ee

2 years ago

0.13.0-1a09d06

2 years ago

0.13.0-48fae73

2 years ago

0.13.0-bdc0c8a

2 years ago

0.13.0-3dccdd1

2 years ago

0.13.0-be82add

2 years ago

0.13.0-f0c874d

2 years ago

0.13.0-c14e977

2 years ago

0.13.0-d5b12bf

2 years ago

0.13.0-693ed72

2 years ago

0.13.0-c636e0a

2 years ago

0.12.0

2 years ago

0.13.0-8ac303b

2 years ago

0.13.0-0425e06

2 years ago

0.13.0-6b46718

2 years ago

0.13.0-85da043

2 years ago

0.13.0-9d33890

2 years ago

0.13.0-c461329

2 years ago

0.13.0-851f724

2 years ago

0.12.0-19450b0

3 years ago

0.11.1

3 years ago

0.12.0-d7c4c7c

3 years ago

0.12.0-b914dde

3 years ago

0.12.0-e9c4f82

3 years ago

0.12.0-143f082

3 years ago

0.12.0-c276bb2

3 years ago

0.12.0-2ac9138

3 years ago

0.11.0

3 years ago

0.12.0-9309192

3 years ago

0.11.0-3cfb085

3 years ago

0.11.0-2c5ee07

3 years ago

0.11.0-2c7f410

3 years ago

0.10.0

3 years ago

0.11.0-2394fd6

3 years ago

0.10.0-67c66e3

3 years ago

0.10.0-5ddfb45

3 years ago

0.10.0-7dd6049

3 years ago

0.9.2

3 years ago

0.9.1

3 years ago

0.10.0-9edc2dc

3 years ago

0.10.0-421dec8

3 years ago

0.10.0-c4ea48a

3 years ago

0.10.0-9721f60

3 years ago

0.9.0-1b78d09

3 years ago

0.9.0-d31d499

3 years ago

0.9.0-fa64b7b

3 years ago

0.9.0-1359caa

3 years ago

0.9.0-1e6b0b1

3 years ago

0.9.0-a916cd8

3 years ago

0.9.0-1a8ab4c

3 years ago

0.9.0-85c635c

3 years ago

0.9.0-b7dc1db

3 years ago

0.8.6

3 years ago

0.9.0-d6a7553

3 years ago

0.9.0-b8a185e

3 years ago

0.9.0-278e9eb

3 years ago

0.9.0-d0f01aa

3 years ago

0.9.0-56d88c2

3 years ago

0.9.0-9a660f7

3 years ago

0.9.0-3b29ee7

3 years ago

0.9.0-3e47afd

3 years ago

0.9.0-335a1da

3 years ago

0.9.0-1c11edd

3 years ago

0.9.0-1098175

3 years ago

0.8.5

3 years ago

0.9.0-f3dc7c7

3 years ago

0.9.0-da1b492

3 years ago

0.9.0-0342bba

3 years ago

0.9.0-5268711

3 years ago

0.9.0-c9e7f64

3 years ago

0.9.0-fb7b2bc

3 years ago

0.9.0-6996aed

3 years ago

0.9.0-30de9a8

3 years ago

0.9.0-4431e13

3 years ago

0.9.0-64d3fa2

3 years ago

0.9.0-3580d38

3 years ago

0.9.0-d4e5d93

3 years ago

0.9.0-bfd5f00

3 years ago

0.9.0-06ee861

3 years ago

0.9.0-09288ca

3 years ago

0.9.0-a8c13c1

3 years ago

0.9.0-08fcbe0

3 years ago

0.9.0-c0859c8

3 years ago

0.9.0-e3fec93

3 years ago

0.8.3-10a4bb9

3 years ago

0.9.0

3 years ago

0.9.0-790d7fe

3 years ago

0.9.0-e6699ec

3 years ago

0.9.0-b7fe882

3 years ago

0.8.3-72ed331

3 years ago

0.8.3-8aeea89

3 years ago

0.8.3

3 years ago

0.8.2

3 years ago

0.8.1

3 years ago

0.8.0

3 years ago

0.7.1

3 years ago

0.7.0

3 years ago

0.6.0

3 years ago

0.5.0

3 years ago

0.4.0

3 years ago

0.3.0

3 years ago

0.3.1

3 years ago

0.2.3

4 years ago

0.2.2

4 years ago

0.2.1

4 years ago

0.2.0

4 years ago

0.1.2

4 years ago

0.1.3

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago