{"id":20789773,"url":"https://github.com/samualtnorman/hackmud-environment","last_synced_at":"2026-03-03T21:01:22.646Z","repository":{"id":42684295,"uuid":"293251386","full_name":"samualtnorman/hackmud-environment","owner":"samualtnorman","description":"Scripting environment for hackmud with minification, autocompletes / intellisense, and TypeScript support.","archived":false,"fork":false,"pushed_at":"2025-02-07T14:40:35.000Z","size":612,"stargazers_count":41,"open_issues_count":1,"forks_count":5,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-05T19:57:10.873Z","etag":null,"topics":["autocomplete","autocompletes","defintions","hackmud","hackmud-color","hackmud-environment","hackmud-script","intellisense","javascript","minification","minify","subscripts","trust-scripts","type-definitions","typescript","typescript-files","typescript-support","vscode","workspace"],"latest_commit_sha":null,"homepage":"https://github.com/samualtnorman/hackmud-environment#readme","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/samualtnorman.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":["samualtnorman"],"patreon":null,"open_collective":null,"ko_fi":"samualn","tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"lfx_crowdfunding":null,"polar":null,"buy_me_a_coffee":null,"custom":null}},"created_at":"2020-09-06T10:19:59.000Z","updated_at":"2025-03-15T17:47:26.000Z","dependencies_parsed_at":"2024-03-26T01:31:33.715Z","dependency_job_id":"390d0e59-42dc-4df7-a3ee-aee133daaf46","html_url":"https://github.com/samualtnorman/hackmud-environment","commit_stats":null,"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"purl":"pkg:github/samualtnorman/hackmud-environment","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samualtnorman%2Fhackmud-environment","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samualtnorman%2Fhackmud-environment/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samualtnorman%2Fhackmud-environment/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samualtnorman%2Fhackmud-environment/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/samualtnorman","download_url":"https://codeload.github.com/samualtnorman/hackmud-environment/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samualtnorman%2Fhackmud-environment/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30060625,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-03T18:21:05.932Z","status":"ssl_error","status_checked_at":"2026-03-03T18:20:59.341Z","response_time":61,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["autocomplete","autocompletes","defintions","hackmud","hackmud-color","hackmud-environment","hackmud-script","intellisense","javascript","minification","minify","subscripts","trust-scripts","type-definitions","typescript","typescript-files","typescript-support","vscode","workspace"],"created_at":"2024-11-17T15:29:09.272Z","updated_at":"2026-03-03T21:01:22.639Z","avatar_url":"https://github.com/samualtnorman.png","language":"TypeScript","readme":"# Hackmud Scripting Environment\nThis is for the game [hackmud](https://hackmud.com/). If you don't know what that is, you should go away and play it!\n\nThis is the whole kitchen sink built around HSM, setting this up takes more effort but will give you autocompletes in your IDE, automatic script pushing when you save a script, as well as minification. If you only need minification, I instead recommend heading over to [Hackmud Script Manager](https://github.com/samualtnorman/hackmud-script-manager#readme).\n\nJoin [our Discord server](https://discord.gg/RSa4Sc6pNA)!\n\n## Features\n### Minification\nThis is the main feature of this project and works with JavaScript or [TypeScript](https://www.typescriptlang.org/). All\nscripts are automatically minified before being written into the hackmud folder. This means you can focus less on\ngetting your character count down, and more on writing readable scripts.\n\n### Autocompletes/Intellisense\nIn modern editors like [Visual Studio Code](https://code.visualstudio.com/), as you're typing the names of subscripts or\nfilling the args of subscripts, drop-down menus of relevant autocompletes will appear. Hovering over a script also tells\nyou info like its security level.\n\n### TypeScript Support\nUsing TypeScript in this environment is completely optional, but using it means warnings when you use the wrong type in\na subscript's args or use an unsupported type in a DB query.\n\n## First Time Setup\n1. Install [Node.JS](https://nodejs.org/en/download) and [PNPM](https://pnpm.io/installation)\n2. Download this template:\n   - If you have [Git installed](https://git-scm.com/downloads), make a new folder, `cd` to it, and run `pnpm dlx tiged samualtnorman/hackmud-environment`\n   - Otherwise, [click here to download the ZIP](https://github.com/samualtnorman/hackmud-environment/archive/refs/heads/main.zip) and extract it somewhere, then `cd` to it\n4. Run `pnpm install`\n\nOnce you have everything setup, you just need to open the folder in your editor of choice.\n\n\u003e [!IMPORTANT]\n\u003e Do not put this template in your hackmud folder. This will not work.\u003cbr\u003eInstead put this template somewhere you have easy access to like your desktop or home folder.\n\n\u003e [!NOTE]\n\u003e If you get an error message that looks like this:\n\u003e ```\n\u003e [...]\\AppData\\Local\\pnpm\\hsm.ps1 cannot be loaded because running scripts is disabled on this system. [...]\n\u003e ```\n\u003e You will need to run `Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope CurrentUser` in PowerShell as an administrator. For more information, see [Microsoft's page about Execution Policies](https://learn.microsoft.com/en-gb/powershell/module/microsoft.powershell.core/about/about_execution_policies?view=powershell-7.4).\n\n## Guide\n### Writing scripts\nYou can create scripts in the `src/scripts` directory directly, and you can create a folder with the name of one of your users,\nand create scripts in that folder too.\n\n#### Alternative Preprocessor Format\nTo get autocompletes, you'll need to replace the `#` characters with `$` characters. For example instead of writing `#fs.scripts.trust()`, you'll need to write\n`$fs.scripts.trust()`.\n\n#### Autocompletes for Your Own Scripts\nTo get autocompletes for the other scripts you've written in the environment, instead of starting your scripts with\n`function (...`, start them with `export default function(...`.\n\n\u003e [!NOTE]\n\u003e When using this format, to get autocompletes working in hackmud, you must have a `// @autocomplete foo: \"bar\"` comment at the top above all other code.\n\n### Pushing Your Scripts\nUse `pnpm push` to push all your scripts to all your users.\nTo automatically push scripts as you edit them, leave `pnpm dev` running.\n\nScripts directly in the `src/scripts` folder are pushed to all your users.\nTo have a script be pushed to only a specific user, create a folder in the `src/scripts` folder and create your scripts in that\nnew folder.\n\nOnce a script has been pushed to a user, you can run `#up \u003cscript\u003e` in game to upload it.\n\n## Useful links\n- [Scripting Reference](https://hackmud.com/forums/general_discussion/scripting_reference)\n- [The Trust Scripts](https://wiki.hackmud.com/scripting/trust_scripts)\n- [Color Reference](https://wiki.hackmud.com/scripting/syntax/colors)\n\n## Contributing\nContributing is appreciated, especially if you have an API to add to the [type definitions](https://github.com/samualtnorman/hackmud-script-manager/blob/main/env.d.ts).\n\n## Credit\nThis project was originally a fork of [Snazzah](https://github.com/Snazzah)'s\n[hackmud_env](https://github.com/Snazzah/hackmud_env). Please also check out the [list of people who contributed to HSM](https://github.com/samualtnorman/hackmud-script-manager/graphs/contributors).\n\n## Related Projects\n### Hackmud Color\nIf you want to see your strings coloured to how they'd appear in the game, check out\n[Hackmud Color](https://marketplace.visualstudio.com/items?itemName=Samual.hackmud-color), my VS Code extension.\n\n### Hackmud Script Manager\nThis is the script manager that this environment relies on. Visit the\n[NPM page](https://www.npmjs.com/package/hackmud-script-manager), or the\n[repo](https://github.com/samualtnorman/hackmud-script-manager).\n","funding_links":["https://github.com/sponsors/samualtnorman","https://ko-fi.com/samualn"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamualtnorman%2Fhackmud-environment","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsamualtnorman%2Fhackmud-environment","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamualtnorman%2Fhackmud-environment/lists"}