Discuss Scratch
- Discussion Forums
- » Developing Scratch Extensions
- » Scratch 3.0 Utilities extension
- DanimalsTCGYT
- Scratcher
18 posts
Scratch 3.0 Utilities extension
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.I made an extension for Scratch 3.0 which you can try out
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!
⠀ ⠀ I beat Mario 64 yay! ⠀⠀ ⠀ ⠀ ⠀ ⠀ I love you ivy & may :3
⠀ ⠀ ⠀ ⠀ ⠀ ⠀⠀ ⠀ ⠀GEOMETRY DASH
- BIGSCRATCH123456
- Scratcher
19 posts
Scratch 3.0 Utilities extension
Scratch 3 came out, and no. I wish it was here too! will this work when scratch 3 come out???
it very cool and make me happy
thank you,
jeffalo
ilovescratch
- Heyya2831
- Scratcher
58 posts
Scratch 3.0 Utilities extension
why you talking to someone from 2018 bro? that was 5 years ago.Scratch 3 came out, and no. I wish it was here too! will this work when scratch 3 come out???
it very cool and make me happy
thank you,
jeffalo
wait is 2018 actually 5 years ago?
dang
A normal kumquat paid me 10K to not make a signature.
- ScratchNaut
- Scratcher
3 posts
Scratch 3.0 Utilities extension
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 I made an extension for Scratch 3.0 which you can try out
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.
- Discussion Forums
- » Developing Scratch Extensions
- » Scratch 3.0 Utilities extension