I remade old Scloudjs for better usability like make it able to use it as a package, better interface and so on.
説明(日本語版)
Node.js (Should be new and stable version)
- Setup & Download package
npm init -y
npm i scloudjs
- Create javascript and write a few codes
const scloudjs = require("scloudjs"); //Able to use ScloudJS as a module
let clouddatas = new Object();//Cloud variable's data will be written here
clouddatas = scloudjs.setpredata(["CLIENT","HOST_1"]);//Name of cloud datas(optional)
const process = (data)=>{//Codes you want to run when you received a message from server
const temp = scloudjs.parsedata(data,clouddatas);//sort datas
clouddatas = temp.clouddatas;//Cloud variable's data
const changedlists = temp.changedlists;//List of cloud variables that has been changed
scloudjs.sendtocloud("HOST",19);//Change value "HOST" to 19
clouddatas["HOST"].value = 19 //Config your object because you'll not receive message when you send datas.
};
scloudjs.setdatas("username","password:","project id",process);//Config some datas
const func = async()=>{//run
await scloudjs.login();//Login to scratch
await scloudjs.connect();//Connect to scratch server
await scloudjs.handshake();//connect to your project
};
func();
I recommend to useScloudJS GUI Edition if you don't have enough coding skills.
libraries used : ws