edqx / node-scratch-client

A client for the scratch 3.0 website.
16 stars 7 forks source link

Error when running #8

Open LordoCreations opened 3 years ago

LordoCreations commented 3 years ago

image

code: const scratch = require("node-scratch-client"); // const fetch = require("node-fetch"); Commented out to improve loading times. Uncomment if needed.

console.log("Successfully initialized external server components") console.log("Establishing connection to scratch...")

// Session validation const Client = new scratch.Client({ username: , password: , });

// Setup const projectID = '582530103';

console.log("Connection to servers established!")

// Session start and event loop Client.login().then(() => { let cloud = Client.session.createCloudSession(projectID);

cloud.connect().then(() => {
    cloud.on("set", variable => {
        console.log(variable)
        //console.log("Variable changed to " + variable.value);
    });
});

});