Discuss Scratch

god286
Scratcher
1000+ posts

Meowclient - connect to Scratch with NodeJS

Redstone1080 wrote:

god286 wrote:

(#119)

Redstone1080 wrote:

buyt
What
It's a term I coined. It means “Bring Up Your Topic”
You could just write that fully because some people do not know what you want to say
god286
Scratcher
1000+ posts

Meowclient - connect to Scratch with NodeJS

BUMP
god286
Scratcher
1000+ posts

Meowclient - connect to Scratch with NodeJS

BUMP!
Please tell me about any problems you have with meowclient. Or any suggestions.
god286
Scratcher
1000+ posts

Meowclient - connect to Scratch with NodeJS

BUMP!
If you would like me to add some feature, please tell me.
WojtekGame
Scratcher
1000+ posts

Meowclient - connect to Scratch with NodeJS

bump…

god286 wrote:

BUMP!
If you would like me to add some feature, please tell me.
adding MINIMAL social actions such as GETting it and not POSTing it.

Last edited by WojtekGame (July 17, 2023 07:21:01)

god286
Scratcher
1000+ posts

Meowclient - connect to Scratch with NodeJS

WojtekGame wrote:

bump…

god286 wrote:

BUMP!
If you would like me to add some feature, please tell me.
adding MINIMAL social actions such as GETting it and not POSTing it.
Like what? The feature is probably implemented, you just need to import it.
god286
Scratcher
1000+ posts

Meowclient - connect to Scratch with NodeJS

I think I'll start working on adding some social actions to this. Don't use them badly, this is so that eventually there will be a good CLI interface for Scratch using meowclient.
god286
Scratcher
1000+ posts

Meowclient - connect to Scratch with NodeJS

Here's a cool showcase for meowclient: my signature vvv
god286
Scratcher
1000+ posts

Meowclient - connect to Scratch with NodeJS

Meowclient v4 is in progress!
I have changed my focus in Meowclient from just adding the bare minimum to working on something that will hopefully reach 99% of the feature list of the Scratch community.
The source code of v4 is on the main branch at https://github.com/webdev03/meowclient but if you would like to view the source code of v3.1 you can go to https://github.com/webdev03/meowclient/tree/v3.1.0
Unfortunately because of the new features I am adding to meowclient I had to add a few dependencies. Because of them, Meowclient v4 is ESM only. This means that you will have to add
"type": "module"
in your package.json file to successfully import meowclient. There are a lot of technical reasons as to why ESM is superior but this is not what I want to talk about here.

Phew! I can stop talking about the mess of ESM vs CJS. Here is a list of most of the features I have added so far (Including some ones already in 3.1):
  • Love and favourite on projects
  • Comment on projects
  • Search projects
  • Set project thumbnail
  • Follow and unfollow users
  • Follow and unfollow studios
  • Reply to a topic on the forums
  • Topic creation (I have not tested this yet because I don't have an excuse to create a topic)
  • Use Map to store Cloud variables instead of an object
  • Get messages
Any feature requests or breaking changes that you think would be good? Please tell me them now before v4 is out! I don't want to have to go directly from v4 to v5 because there is a slight breaking change.

Thank you everyone for using meowclient (If you use it, there are very little downloads on npm unfortunately)

Last edited by god286 (Oct. 5, 2023 02:44:03)

god286
Scratcher
1000+ posts

Meowclient - connect to Scratch with NodeJS

Earlier I wanted to switch to TypeScript with the strict mode on. Unfortunately there were many errors which stopped me. Now that I am working on meowclient v4 I am almost finished with switching to the strict mode, forcing me to add type guards everywhere
ajskateboarder
Scratcher
1000+ posts

Meowclient - connect to Scratch with NodeJS

god286 wrote:

Now that I am working on meowclient v4 I am almost finished with switching to the strict mode, forcing me to add type guards everywhere
Do you mean using the “typeof” keyword or type hints
god286
Scratcher
1000+ posts

Meowclient - connect to Scratch with NodeJS

ajskateboarder wrote:

god286 wrote:

Now that I am working on meowclient v4 I am almost finished with switching to the strict mode, forcing me to add type guards everywhere
Do you mean using the “typeof” keyword or type hints
https://www.typescriptlang.org/tsconfig#strict
When I started meowclient I forgot to enable that option. Now I decided to rework some of the code to make it compatible with the strictest mode of type checking in TypeScript.
god286
Scratcher
1000+ posts

Meowclient - connect to Scratch with NodeJS

You can help me test the alpha version of meowclient v4 by writing some code using the github repository instead of the npm package.
# Instead of running
npm install meowclient
# Run
npm install webdev03/meowclient
god286
Scratcher
1000+ posts

Meowclient - connect to Scratch with NodeJS

I have an idea, before I work on it I would like to ask for your opinion. I think it would be really cool if meowclient made it super easy to do encoding and decoding of cloud data. There would be two modes (First one much easier): a simple stateless mode where you could send and receive little packets of data, for example in a project that got the current weather, and a complex stateful mode like socket.io where each user had their own state, for example in a lichess-connected chess project.
NFlex23
Scratcher
1000+ posts

Meowclient - connect to Scratch with NodeJS

god286 wrote:

I have an idea, before I work on it I would like to ask for your opinion. I think it would be really cool if meowclient made it super easy to do encoding and decoding of cloud data. There would be two modes (First one much easier): a simple stateless mode where you could send and receive little packets of data, for example in a project that got the current weather, and a complex stateful mode like socket.io where each user had their own state, for example in a lichess-connected chess project.
That sounds really interesting! Could you give a code snippet of what each might look like?
ajskateboarder
Scratcher
1000+ posts

Meowclient - connect to Scratch with NodeJS

god286 wrote:

I have an idea, before I work on it I would like to ask for your opinion. I think it would be really cool if meowclient made it super easy to do encoding and decoding of cloud data. There would be two modes (First one much easier): a simple stateless mode where you could send and receive little packets of data, for example in a project that got the current weather, and a complex stateful mode like socket.io where each user had their own state, for example in a lichess-connected chess project.
I believe there are Python packages which do this automatically, like scratch2py. You should definitely add it, it would make cloud interactions with servers really easy

Also chess.com is better lole
god286
Scratcher
1000+ posts

Meowclient - connect to Scratch with NodeJS

ajskateboarder wrote:

Also chess.com is better lole
I know, I don't even use lichess, but I thought that it might be easier to use

NFlex23 wrote:

Could you give a code snippet of what each might look like?
Here's some pseudocode, please tell me if you have even a tiny thing to change:
Simple send-receive (stateless):
const cloudConn = new CloudConnection(session, 123);
const pCloud = new PacketCloud(cloudConn);
// There are two options:
pCloud.onRequest((name, value) => {
  if(name === "ping") {
    return "pong! " + (Number(value) + 1);
  } else {
    return "hmm, I don't know what is " + name;
  }
});
// or
pCloud.on("ping", (value) => {
  return "pong!" + (Number(value) + 1);
})
Stateful:
let counter = 0;
const cloudConn = new CloudConnection(session, 123);
const sCloud = new SocketCloud(cloudConn);
// Could be a miniature reimplementation of socket.io, this one will take much longer for me to add
sCloud.on("connection", (socket) => {
  socket.data = {pings: 1};
  socket.on("ping", () => {
    socket.data.pings++;
    return socket.data.pings;
  })
})
god286
Scratcher
1000+ posts

Meowclient - connect to Scratch with NodeJS

pCloud v0.0

Edit: send and receive now works!

Last edited by god286 (Oct. 13, 2023 09:32:16)

ajskateboarder
Scratcher
1000+ posts

Meowclient - connect to Scratch with NodeJS

god286 wrote:

Here's some pseudocode, please tell me if you have even a tiny thing to change:
Simple send-receive (stateless):
snip()
Stateful:
snip()
Personally, I like the stateless code since it's easier to read
god286
Scratcher
1000+ posts

Meowclient - connect to Scratch with NodeJS

The stateful code would make it easier to manage the state of each user

Powered by DjangoBB