Release v1.64.0 - Mucklet Script CLI

I keep pushing on with the scripting feature(s), determined to get it to the point where it becomes useable. It is a big effort, and I know it takes the focus from other features. Though, in the end, I believe it will be worth it!
With this release, we take a step closer to the goal of allowing scripts to be used to build intricate and interactive worlds, perfect for roleplaying.

Let’s have a look, shall we?

Features

Binary script files

(Supporter feature)
Scripts may now be uploaded as precompiled binary .wasm files. While it gives us less insights into the script’s workings, it allows players to create more complex scripts that uses multiple source files and shared imports.

A room script’s binary may be downloaded by clicking the link showing when using the roomscript command:

roomscript example

Note

The client currently does not provide any interface to upload binary files, but the mucklet-script tool uses the API to upload binaries.

Manager token

(Supporter feature)
It is now possible to create manager tokens which can be used by external tools (like mucklet-script) to access the API to manage resources for your account.

To create a manager token, log into the game and go to Player Settings by clicking the cog wheel-icon at the bottom of the left-side panel. Click the key-icon under the Manager token section:

Note

Manager tokens can currently only be used to handle room scripts. Later, they will also have access to manage areas, rooms, and exits.

Mucklet Script CLI tool

A mucklet-script npm package has been created from the mucklet-script repository, and can be used as a CLI (command line interface) tool:

  • mucklet-script init - create and initialize mucklet script projects
  • mucklet-script build - build room scripts locally to catch errors
  • mucklet-script deploy - deploy room scripts directly to rooms
  • mucklet-script logs - fetch console logs produced by room scripts

Quick start

To try it out without reading further, install NodeJS, and run the following commands:

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

Installation

The mucklet-script tool may be installed globally to handle single script files. To install it globally, run:

npm install -g mucklet-script

To build a single file, run:

mucklet-script build myscript.ts

Configuration

While global install is possible, mucklet-script is meant (a.k.a. recommended) to be used in a project with a mucklet.config.js configuration file, and as a dependency in package.json:

npm install mucklet-script@latest

To set up a project with some initial files, like mucklet.config.js and package.json , run:

npx mucklet-script init myproject

Usage

To see more info on how to use the mucklet-script tool, run:

npx mucklet-script

Or read the documentation on GitHub: Mucklet Script - documentation

Improvements

File checksums

Sha256 checksums are now created for files such as room script binaries. This may be used by tools such as mucklet-script to determine if a file should be updated or not.

Better roomscript help

The help texts for roomscript commands have seen some slight improvements with examples and links to resources. This affects:

help roomscript
help create roomscript
help set roomscript

Bot token authenticate

Bot tokens have now been prefixed with the text bot., making them distinguishable from other tokens.

This allows bot scripts to authenticate by including it as a bearer token in the Authorization HTTP header:

Authorization: Bearer bot.WOOK4BUHQB2JJTNOC3V6K5KVJNK6KKSR

When connecting to the WebSocket, the previous authenticate method, authenticateBot has been deprecated, and bot scripts should instead use the authenticate method:

client.authenticate('auth', 'authenticate', {
    token: 'bot.WOOK4BUHQB2JJTNOC3V6K5KVJNK6KKSR',
});

or include the token as a bearer token when establishing the WebSocket connection, in the same way one would do with HTTP requests.

Fixes

Access denied on get exit id
When using the command get exit, players got the error:

Access denied

This has been fixed, and non-Accipiter players may use the command as well.
Thanks to @GreenReaper for reporting the issue in this thread!

Requested exits not listed
Requesting an exit to another character’s room - either through the UI or the command line - resulted in an exit that didn’t show up in the exit list, but could still be used with the go command. This has been fixed, and all affected exits should now show up in the lists again.
Thanks once more to @GreenReaper for reporting the issue in this thread!

Room exit appearing second to last when shown
An exit that was either hidden or inactive, and then switched to be visible, ended up second to last in the list of exits. If no other exits existed, an internal error occurred.
This has been fixed.

Administration

Create user login (overseer)
It is now possible for overseers (Accipiter) to create username/password logins for accounts that previously used Google (OpenID) as means of login, but for some reason lost access to their Google account.

4 Likes