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.
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 Scratcher
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.
You can also leave a studio easily by using this following code. There are tons more I know if you are somewhat interested
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.
- GeekTech
-
New Scratcher
32 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.Ah right! I understand now, I wasn't clear with what they were trying to do

- ScratchCatHELLO
-
Scratcher
1000+ 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);
});
-snip-
You can do that in scratchstats.com too…
- Vercte
-
Scratcher
500+ posts
New scratch console commands?
Ah, but Scratchstats/ScratchNotifier uses that tooHello! I'm not sure if this is what your looking for but the following code returns the amount of messages a user currently has.You can do that in scratchstats.com too…fetch("https://api.scratch.mit.edu/users/griffpatch/messages/count")
.then(res => res.json())
.then(obj => {
alert(obj.count);
});
-snip-

Last edited by Vercte (June 13, 2020 18:59:35)
- 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
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:
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 BlockSvg = Blockly.getMainWorkspace().newBlock().constructor
Then, you can change static properties of BlockSvg, like the minimum block height:
BlockSvg.MIN_BLOCK_Y = 28 // Original: 48
const workspace = Blockly.getMainWorkspace() // Scripts area workspace.getAllBlocks().forEach(b => b.render()) // Block palette workspace.getFlyout().workspace_.getAllBlocks().forEach(b => b.render())
- 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.- ScratchCatHELLO
-
Scratcher
1000+ 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);
});
-snip-
You can do that in scratchstats.com too…
I was am so cringy jeez
- 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
.then(res => res.json())
.then(obj => {
alert(obj.count);
}); code is epic
- Gamerboi276
-
Scratcher
14 posts
New scratch console commands?
omg the fetch("https://api.scratch.mit.edu/users/griffpatch/messages/count")WOAH
.then(res => res.json())
.then(obj => {
alert(obj.count);
}); code is epic
- 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)
(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)
- 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)
- sprite31415926535897
-
New Scratcher
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
in the editor and the blocks will snap to the workspace dots (subtle but noticeable)!
Or also in the editor, do
to change the workspace grid size. You can replace 5 with any number.
Blockly.getMainWorkspace().grid_.snapToGrid_ = true;
Or also in the editor, do
Blockly.getMainWorkspace().grid_.spacing_ = 5; Blockly.getMainWorkspace().grid_.update(Blockly.getMainWorkspace().scale);
Last edited by CST1229 (Dec. 15, 2021 16:58:28)
- hello16ddhudhf
-
Scratcher
7 posts
New scratch console commands?
There are tons of them. For example dowhat does it do it look like it makes more dotsin the editor and the blocks will snap to the workspace dots (subtle but noticeable)!Blockly.getMainWorkspace().grid_.snapToGrid_ = true;
Or also in the editor, doto change the workspace grid size. You can replace 5 with any number.Blockly.getMainWorkspace().grid_.spacing_ = 5; Blockly.getMainWorkspace().grid_.update(Blockly.getMainWorkspace().scale);
- CST1229
-
Scratcher
1000+ posts
New scratch console commands?
what does it do it look like it makes more dotsThe second one? That's what it does. But it also affects the snapping for the first code as well.
- MrIncredible-Uncanny
-
Scratcher
7 posts
New scratch console commands?
wdym?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














