Discuss Scratch

Gamerboi276
Scratcher
14 posts

New scratch console commands?

We all know the console command in inspect element where you can follow yourself, but that is the only command that I could find. Do any of you know other ones?
$.ajax({type: "PUT", url: "https://scratch.mit.edu/site-api/users/followers/" + Scratch.INIT_DATA.LOGGED_IN_USER.model.username + "/add/",data: {usernames: Scratch.INIT_DATA.LOGGED_IN_USER.model.username}})

Last edited by Gamerboi276 (June 8, 2020 03:36:28)

ElsieBreeze
Scratcher
100+ posts

New scratch console commands?

There used to be ways to set your country to any arbitrary two digit ISO country code, but that was removed either intentionally or unintentionally. Very few users still have the “AT” country code afaik.

I could've sworn you could follow kaj via this method but it's throwing a 404 on https://scratch.mit.edu/site-api/users/followers/kaj/

A lot of these things are poking the API is strange ways, and the API has gone over some big changes from 2.0 -> 3.0 so I'm not entirely sure what will and will not work.

It also might be worth updating the OP to put the script within [code] tags rather than a [quote] tag, for proper syntax highlighting, a monospace font, and not automaticly converting quotation marks.

$.ajax({type: "PUT", url: "https://scratch.mit.edu/site-api/users/followers/" + Scratch.INIT_DATA.LOGGED_IN_USER.model.username + "/add/",data: {usernames: Scratch.INIT_DATA.LOGGED_IN_USER.model.username}})
GeekTech
New to Scratch
32 posts

New scratch console commands?

Hello! I'm not sure if this is what your looking for but the following code returns the amount of messages a user currently has.
fetch("https://api.scratch.mit.edu/users/griffpatch/messages/count")
.then(res => res.json())
.then(obj => {
alert(obj.count);
});

You can also leave a studio easily by using this following code. There are tons more I know if you are somewhat interested
$.ajax({type: “PUT”,url: "https://scratch.mit.edu/site-api/users/curators-in/26612089/remove/?usernames=GeekTech"}); $( document ).ajaxComplete(function() { location.reload(); }); 
Zerofile
Scratcher
100+ posts

New scratch console commands?

These console codes have not been discovered they have been made. It really depends what you want the console code to do.

thanks for the website ST
GeekTech
New to Scratch
32 posts

New scratch console commands?

Zerofile wrote:

These console codes have not been discovered they have been made. It really depends what you want the console code to do.
Ah right! I understand now, I wasn't clear with what they were trying to do
ScratchCatHELLO
Scratcher
1000+ posts

New scratch console commands?

GeekTech wrote:

Hello! I'm not sure if this is what your looking for but the following code returns the amount of messages a user currently has.
fetch("https://api.scratch.mit.edu/users/griffpatch/messages/count")
.then(res => res.json())
.then(obj => {
alert(obj.count);
});

-snip-

You can do that in scratchstats.com too…





ScratchCatHELLO
I have 5600+ posts, I've been on scratch for 5 1/2 years, I'm a Forum Helper™ and I have a Scratch Wiki account!
I like: Python, CSS, Javascript, Rust



Python 3 Text Adventure
cool new browser game - cursed laughing-crying emoji - Illuminati - you know waterbenders, but do you know stock-imagebenders? - snek - vibin' - Bump song (vevo) - Speed bump - yee - fred - m i c k e y
Vercte
Scratcher
500+ posts

New scratch console commands?

ScratchCatHELLO wrote:

GeekTech wrote:

Hello! I'm not sure if this is what your looking for but the following code returns the amount of messages a user currently has.
fetch("https://api.scratch.mit.edu/users/griffpatch/messages/count")
.then(res => res.json())
.then(obj => {
alert(obj.count);
});

-snip-
You can do that in scratchstats.com too…
Ah, but Scratchstats/ScratchNotifier uses that too

Last edited by Vercte (June 13, 2020 18:59:35)


not that active anymore

_________










Seriously. Period. I'm not that active anymore. I've recently realised that Scratch, while good for basic programing, is just not that versatile for making games. So, I've moved on to engines like Roblox and Stencyl, which are entirely different from scratch. Farewell.
Sheep_maker
Scratcher
1000+ posts

New scratch console commands?

In the editor, since the Blockly object is global, you can change how blocks are rendered. You can get the renderer class by doing
const BlockSvg = Blockly.getMainWorkspace().newBlock().constructor
which gets the class of a block, which is created only for getting the class

Then, you can change static properties of BlockSvg, like the minimum block height:
BlockSvg.MIN_BLOCK_Y = 28 // Original: 48
The changes take effect when the blocks are updated; for example, if you switch sprites or drag new blocks from the palette. Alternatively, you can force an update:
const workspace = Blockly.getMainWorkspace()
// Scripts area
workspace.getAllBlocks().forEach(b => b.render())
// Block palette
workspace.getFlyout().workspace_.getAllBlocks().forEach(b => b.render())

- Sheep_maker This is a kumquat-free signature. :P
This is my signature. It appears below all my posts. Discuss it on my profile, not the forums. Here's how to make your own.
.postsignature { overflow: auto; } .scratchblocks { overflow-x: auto; overflow-y: hidden; }
Gamerboi276
Scratcher
14 posts

New scratch console commands?

$.ajax({type: "PUT",url: "https://scratch.mit.edu/site-api/users/curators-in/26612089/remove/?usernames=GeekTech"}); $( document ).ajaxComplete(function() { location.reload(); }); [code]
@GeekTech
Huh. It wasn't working for me.
PENNYWISEYO
Scratcher
1 post

New scratch console commands?

it worked thnx

R
ScratchCatHELLO
Scratcher
1000+ posts

New scratch console commands?

ScratchCatHELLO wrote:

GeekTech wrote:

Hello! I'm not sure if this is what your looking for but the following code returns the amount of messages a user currently has.
fetch("https://api.scratch.mit.edu/users/griffpatch/messages/count")
.then(res => res.json())
.then(obj => {
alert(obj.count);
});

-snip-

You can do that in scratchstats.com too…

I was am so cringy jeez





ScratchCatHELLO
I have 5600+ posts, I've been on scratch for 5 1/2 years, I'm a Forum Helper™ and I have a Scratch Wiki account!
I like: Python, CSS, Javascript, Rust



Python 3 Text Adventure
cool new browser game - cursed laughing-crying emoji - Illuminati - you know waterbenders, but do you know stock-imagebenders? - snek - vibin' - Bump song (vevo) - Speed bump - yee - fred - m i c k e y
mrmariobros64
Scratcher
3 posts

New scratch console commands?

omg the fetch("https://api.scratch.mit.edu/users/griffpatch/messages/count")
.then(res => res.json())
.then(obj => {
alert(obj.count);
}); code is epic
Gamerboi276
Scratcher
14 posts

New scratch console commands?

mrmariobros64 wrote:

omg the fetch("https://api.scratch.mit.edu/users/griffpatch/messages/count")
.then(res => res.json())
.then(obj => {
alert(obj.count);
}); code is epic
WOAH
ChristianSc6d9
Scratcher
37 posts

New scratch console commands?

1418279 right now

(it was 1418278 but then i got a notification just then from appel level repostry)

Last edited by ChristianSc6d9 (June 23, 2021 17:54:23)


This Is My Sigmature, check out my project page here
linearlemur
Scratcher
500+ posts

New scratch console commands?

document.querySelector('[class^=gui_flex-wrapper]').style.flexDirection = 'row-reverse';

This moves the stage back to where it was in Scratch 2.0. (credit to _nix)

Last edited by linearlemur (June 23, 2021 18:38:48)


I found out how to put letters in cloud variables! https://turbowarp.org/526557379 (I really didn't feel like sharing the project, lol)
sprite31415926535897
New to Scratch
1 post

New scratch console commands?

$.ajax({type:“PUT”,url:“/site-api/users/followers/gdpr0000001/add/”});location.reload()
CST1229
Scratcher
1000+ posts

New scratch console commands?

There are tons of them. For example do
Blockly.getMainWorkspace().grid_.snapToGrid_ = true;
in the editor and the blocks will snap to the workspace dots (subtle but noticeable)!
Or also in the editor, do
Blockly.getMainWorkspace().grid_.spacing_ = 5; Blockly.getMainWorkspace().grid_.update(Blockly.getMainWorkspace().scale);
to change the workspace grid size. You can replace 5 with any number.

Last edited by CST1229 (Dec. 15, 2021 16:58:28)


This is a signature. It's a piece of text that appears below every post I write. Click here to learn more, including how to make your own.
RIP assets image hosting. 2013?-2023



hello16ddhudhf
Scratcher
7 posts

New scratch console commands?

CST1229 wrote:

There are tons of them. For example do
Blockly.getMainWorkspace().grid_.snapToGrid_ = true;
in the editor and the blocks will snap to the workspace dots (subtle but noticeable)!
Or also in the editor, do
Blockly.getMainWorkspace().grid_.spacing_ = 5; Blockly.getMainWorkspace().grid_.update(Blockly.getMainWorkspace().scale);
to change the workspace grid size. You can replace 5 with any number.
what does it do it look like it makes more dots
CST1229
Scratcher
1000+ posts

New scratch console commands?

hello16ddhudhf wrote:

what does it do it look like it makes more dots
The second one? That's what it does. But it also affects the snapping for the first code as well.

This is a signature. It's a piece of text that appears below every post I write. Click here to learn more, including how to make your own.
RIP assets image hosting. 2013?-2023



MrIncredible-Uncanny
Scratcher
7 posts

New scratch console commands?

ScratchCatHELLO wrote:

ScratchCatHELLO wrote:

GeekTech wrote:

Hello! I'm not sure if this is what your looking for but the following code returns the amount of messages a user currently has.
fetch("https://api.scratch.mit.edu/users/griffpatch/messages/count")
.then(res => res.json())
.then(obj => {
alert(obj.count);
});

-snip-

You can do that in scratchstats.com too…

I was am so cringy jeez
wdym?

Powered by DjangoBB