1.64.3 • Published 4 months ago

mucklet-script v1.64.3

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
4 months ago

A development cli tool used to build, test, and deploy room scripts for Mucklet.com, a textual world of roleplay.

Quick start

Install NodeJS, and run the following commands:

npx mucklet-script init myproject
cd myproject
npm install
npm run build

Usage

For full usage, run:

npx mucklet-script

Documentation

Script examples

Script fileDescription
hello_world.tsA Hello world script with informative comments on a script's entry functions.
ambience.tsA script showing ambient descriptions with random time intervals.
day_and_night.tsA script cycling between a "day" and "night" room profile based on real time.
intercom_inside.tsAn intercom script allowing communication with another room running the intercom_outside.ts script.
intercom_outside.tsAn intercom script allowing communication with another room running the intercom_inside.ts script.
lock_inside.tsA script that locks a door preventing others from using an exit in the room running the lock_outside.ts script.
lock_outside.tsA script that prevents characters from using an exit locked by the script running the lock_inside.ts script.
secret_exit.tsA script that reveals a secret passage when the password "tapeworm" is spoken.

About

The mucklet-script cli tool lets you:

  • create and initialize new script projects
  • build and test scripts
  • deploy scripts to a Mucklet realm
  • fetch and display script console logs

Scripts are written using AssemblyScript, a statically typed language similar to TypeScript, sharing many of its features and standard library functions (including its .ts suffix).

Standard library

In addition to the AssemblyScript's standard library, Mucklet room scripts also includes json-as available through the JSON namespace:

JSON.stringify("Hello, world!")

The Room namespace provides functions for interacting with the room:

Room.describe("A bird is chirping from a nearby tree.")

The Script namespace provides functions for sending and receiving messages from other scripts.

Script.post(destAddr, "newVisitor")

The Store namespace provides functions for setting, getting, and iterating over data from a persistent key/value store.

Store.setString("foo", "bar")
let str = Store.getString("foo")

(Room scripting is a restricted feature, only available to supporters and pioneers. Deploying scripts may not be available to everyone.)

1.64.3

4 months ago

1.64.2

5 months ago

1.64.1

5 months ago

1.64.0

5 months ago