Discuss Scratch
- Discussion Forums
- » Developing Scratch Extensions
- » Scratch 3.0 Utilities extension
- DanimalsTCGYT
-
Scratcher
18 posts
Scratch 3.0 Utilities extension
I made an extension for Scratch 3.0 which you can try out here. It adds a few blocks, many of which are workaroundable, but still nice to have. They are all reporter/boolean blocks because currently extensions loaded from a URL can't access the rest of Scratch.
The blocks are current sorted in an arbitrary order:<is [apple] exactly [APPLE]?::#8BC34A>Case sensitive string comparison. It can also distinguish between different types (eg a number created from a + block vs a join block)<() \<= (50)::#8BC34A>I didn't use the special unicode characters because Scratch tends to use keyboard-only characters, as shown in the * and / blocks. The second input is 50 because the built in <, =, and > blocks follow this behaviour, a change in Scratch 3.0. They only support numbers, unlike the built in comparison blocks.
<() \>= (50)::#8BC34A><true::#8BC34A>Although unnecessary, it might make your code look cleaner and not have any empty slots or seemingly useless = blocks.
<false::#8BC34A>(() ^ ()::#8BC34A)I would probably have worded this as “to the power of” instead, but it's usually put as ^ on the Suggestions forums.(pi::#8BC34A)This reporter is often suggested on the suggestions forums.(if <> then [banana] else [apple]::#8BC34A)The ternary operator. The default strings are based off the new default values for the join block.(letters (5) to (7) of [red apple]::#8BC34A)The indices start from 1 and are inclusive, because I feel like they're more intuitive for beginners (they're used for page numbers, for example).(current millisecond::#8BC34A)This is also often suggested. I think it returns an integer between 0 and 999.(get content from [https://api.scratch.mit.edu/users/griffpatch/messages/count]::#8BC34A)I am using a page that doesn't output a very large string, yet is on Scratch. I chose griffpatch because he almost always has a nonzero message count.([fruit/apples] of [{"fruit": {"apples": 2, "bananas": 3}, "total_fruit": 5}]::#8BC34A)Parses the JSON and outputs the object at that path. If there's nothing at that path, then it returns an empty string. If there's an object, it returns the JSON of the object. I don't think the block is very intuitive, and it can be worded better. However, it will help beginners learn about the uses of the previous block.<[true]::#8BC34A>Not very intuitive; it literally just returns what you put in. However, it's a boolean reporter, so you can use it to put variables in if blocks:if <(game running?)::#8BC34A> then
...
end(replace [bananas are awesome. i like bananas.] using the rule [banana] with [apple]::#8BC34A)Uses regex to replace the string (the second input is the regex). The replacement is unfortunately case insensitive, which I feel will better fit the other Scratch blocks. You can replace captured groups using $n.
Do you think you could get a version of the “get content” block that returns all of the text that is displayed from a website. this could be used for a multitude of things such as getting battery percentage, as shown in this github repository I made: https://mystium-yt.github.io/Battery-Readout/
- vibingenzscratch
-
Scratcher
6 posts
Scratch 3.0 Utilities extension
Is there a way to get a value inside an array while getting a json?
Last edited by vibingenzscratch (Dec. 7, 2022 06:58:11)
- cookieclickerer33
-
Scratcher
1000+ posts
Scratch 3.0 Utilities extension
These are all blocks in snap!
- BIGSCRATCH123456
-
Scratcher
19 posts
Scratch 3.0 Utilities extension
will this work when scratch 3 come out???Scratch 3 came out, and no. I wish it was here too!
it very cool and make me happy
thank you,
jeffalo
- Heyya2831
-
Scratcher
58 posts
Scratch 3.0 Utilities extension
why you talking to someone from 2018 bro? that was 5 years ago.will this work when scratch 3 come out???Scratch 3 came out, and no. I wish it was here too!
it very cool and make me happy
thank you,
jeffalo
wait is 2018 actually 5 years ago?
dang
- ScratchNaut
-
Scratcher
3 posts
Scratch 3.0 Utilities extension
I made an extension for Scratch 3.0 which you can try out here. It adds a few blocks, many of which are workaroundable, but still nice to have. They are all reporter/boolean blocks because currently extensions loaded from a URL can't access the rest of Scratch.GitHub is blocked for me
The blocks are current sorted in an arbitrary order:<is [apple] exactly [APPLE]?::#8BC34A>Case sensitive string comparison. It can also distinguish between different types (eg a number created from a + block vs a join block)<() \<= (50)::#8BC34A>I didn't use the special unicode characters because Scratch tends to use keyboard-only characters, as shown in the * and / blocks. The second input is 50 because the built in <, =, and > blocks follow this behaviour, a change in Scratch 3.0. They only support numbers, unlike the built in comparison blocks.
<() \>= (50)::#8BC34A><true::#8BC34A>Although unnecessary, it might make your code look cleaner and not have any empty slots or seemingly useless = blocks.
<false::#8BC34A>(() ^ ()::#8BC34A)I would probably have worded this as “to the power of” instead, but it's usually put as ^ on the Suggestions forums.(pi::#8BC34A)This reporter is often suggested on the suggestions forums.(if <> then [banana] else [apple]::#8BC34A)The ternary operator. The default strings are based off the new default values for the join block.(letters (5) to (7) of [red apple]::#8BC34A)The indices start from 1 and are inclusive, because I feel like they're more intuitive for beginners (they're used for page numbers, for example).(current millisecond::#8BC34A)This is also often suggested. I think it returns an integer between 0 and 999.(get content from [https://api.scratch.mit.edu/users/griffpatch/messages/count]::#8BC34A)I am using a page that doesn't output a very large string, yet is on Scratch. I chose griffpatch because he almost always has a nonzero message count.([fruit/apples] of [{"fruit": {"apples": 2, "bananas": 3}, "total_fruit": 5}]::#8BC34A)Parses the JSON and outputs the object at that path. If there's nothing at that path, then it returns an empty string. If there's an object, it returns the JSON of the object. I don't think the block is very intuitive, and it can be worded better. However, it will help beginners learn about the uses of the previous block.<[true]::#8BC34A>Not very intuitive; it literally just returns what you put in. However, it's a boolean reporter, so you can use it to put variables in if blocks:if <(game running?)::#8BC34A> then
...
end(replace [bananas are awesome. i like bananas.] using the rule [banana] with [apple]::#8BC34A)Uses regex to replace the string (the second input is the regex). The replacement is unfortunately case insensitive, which I feel will better fit the other Scratch blocks. You can replace captured groups using $n.
- FireyMakesInScratch
-
Scratcher
6 posts
Scratch 3.0 Utilities extension
what url should the extension be? 

- Sheep_maker
-
Scratcher
1000+ posts
Scratch 3.0 Utilities extension
what url should the extension be?https://sheeptester.github.io/javascripts/utilities.js if that's what you're asking for
- FireyMakesInScratch
-
Scratcher
6 posts
Scratch 3.0 Utilities extension
Thanks!what url should the extension be?https://sheeptester.github.io/javascripts/utilities.js if that's what you're asking for
- carryondaksh133
-
Scratcher
3 posts
Scratch 3.0 Utilities extension
look over here!
I used JS to make it very good
Just: More motion blocks
I used JS to make it very good
Just: More motion blocks
Repeat [] to move x: [], y: [] :: motionto repeat and then move
if the animated sprite is [] degrees then, :: motion hatthe animated sprite is 90 degrees.
- carryondaksh133
-
Scratcher
3 posts
Scratch 3.0 Utilities extension
look over here!
I used JS to make it very good
Just: More motion blocks
I used JS to make it very good
Just: More motion blocks
Repeat [] to move x: [], y: [] :: motionto repeat and then move
if the animated sprite is [] degrees then, :: motion hatthe animated sprite is 90 degrees.
- FireyMakesInScratch
-
Scratcher
6 posts
Scratch 3.0 Utilities extension
look over here!
I used JS to make it very good
Just: More motion blocksRepeat [] to move x: [], y: [] :: motionto repeat and then move
Tho thats justrepeat ()
change x by ()
change y by ()
end
- Discussion Forums
- » Developing Scratch Extensions
-
» Scratch 3.0 Utilities extension








