Since June 2022 we introduced the ability for users to host their own scripting server.
It is a process that runs a websocket and uses event-based triggers to interact with the Cryptovoxels client.
NOTE: Creating a VSS is OPTIONAL for scripting; by default parcel will have wss://grid.cryptovoxels.com/grid/{Your parcel id}
as host, which is the official hosted service by Cryptovoxels.
The following steps are an example to make a VSS using replit.com;
Go to replit.com
and create app
Make an account if needed, and create a new NodeJS app (or a new NodeJS "Repl").
You'll then be welcomed by this screen:
Install the Voxels-Scripting-Server package
Go to the packages tab, and search for the "voxels-scripting-server" package.
Once you've found it, click the +
to install the package.
Run script
Head back to your index.js
file, and copy this code:
const vss =require("voxels-scripting-server");
vss.default.makeVSS(670).then((wss) => {
if (wss) {
console.log("Websocket started");
} else {
console.error("Websocket did not start");
}
});
and replace 670
with your parcel id number.
Server v 0... running!
Copy the address given by Replit (for example for me, the address is https://testCryptovoxelsserver.benjythebee.repl.co
) and paste it into your Voxels parcel settings:
Hit save, and tadaa, your parcel now runs scripts on a hosted server.
Replit does not keep your server alive by default. To keep your replit server alive, you have to upgrade your account and select the "Always on" feature in your settings.