Discuss Scratch

Sheep_maker
Scratcher
1000+ 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>
<() \>= (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.

<true::#8BC34A>
<false::#8BC34A>
Although unnecessary, it might make your code look cleaner and not have any empty slots or seemingly useless = blocks.

(() ^ ()::#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.

- 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; }
Jeffalo
Scratcher
1000+ posts

Scratch 3.0 Utilities extension

will this work when scratch 3 come out???


it very cool and make me happy

thank you,
jeffalo

disclaimer: sometimes my posts are pretty critical of the scratch team (especially my older ones), but i really do scratch & scratch team. jvvg made a short essay thing about the scratch team, which is a pretty good read, if you want a different perspective for the scratch team's actions.

my website: jeffalo.net | ocular: scratch forum search













Sheep_maker
Scratcher
1000+ posts

Scratch 3.0 Utilities extension

Jeffalo wrote:

will this work when scratch 3 come out???


it very cool and make me happy

thank you,
jeffalo
I can't guarantee it, but I'll try to update it if anything changes. I'd also have to get it approved by the ST before you can use it in your projects.

- 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; }
LuckyLucky7
Scratcher
1000+ posts

Scratch 3.0 Utilities extension

I have found a bug in the mod.
The ‘Add Extension’ button slightly overlaps where it's not supposed to.

I have about 3450 posts, 90 shared projects, 180 total created/followed topics, and 425 followers.

Sheep_maker
Scratcher
1000+ posts

Scratch 3.0 Utilities extension

Clicking on reporters in a custom extension seems to constantly report the value and can only be stopped by pressing the stop button; I will look into this.

LuckyLucky7 wrote:

I have found a bug in the mod.
The ‘Add Extension’ button slightly overlaps where it's not supposed to.
I updated the GUI in a state where they were in the middle of widening the category sidebar That should be fixed now.

- 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; }
LuckyLucky7
Scratcher
1000+ posts

Scratch 3.0 Utilities extension

Sheep_maker wrote:

Clicking on reporters in a custom extension seems to constantly report the value and can only be stopped by pressing the stop button; I will look into this.

LuckyLucky7 wrote:

I have found a bug in the mod.
The ‘Add Extension’ button slightly overlaps where it's not supposed to.
I updated the GUI in a state where they were in the middle of widening the category sidebar That should be fixed now.
Yep, it's fixed!

I have about 3450 posts, 90 shared projects, 180 total created/followed topics, and 425 followers.

ronsid
Scratcher
100+ posts

Scratch 3.0 Utilities extension

Sheep_maker wrote:

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>
<() \>= (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.

<true::#8BC34A>
<false::#8BC34A>
Although unnecessary, it might make your code look cleaner and not have any empty slots or seemingly useless = blocks.

(() ^ ()::#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.
yeah?

This siggy is protected by the Antiquat group
when green flag clicked
say [Scratch Time] for (2) secs
broadcast [funtime v]
when I receive [funtime v]
say [ Yaay] for (2) secs
ScratchDiogoh
Scratcher
1000+ posts

Scratch 3.0 Utilities extension

Suggestions:
move all blocks to operators
to remove
current millisecond ::#8BC34A reporter
to fit with the block:
(current [milisecond v])
Errors:
the blocks are updating themselves
unlike kept blocks

Last edited by ScratchDiogoh (July 23, 2018 14:40:01)


+1700 Bad Posts
Sheep_maker
Scratcher
1000+ posts

Scratch 3.0 Utilities extension

ScratchDiogoh wrote:

Suggestions:
move all blocks to operators
to remove
current millisecond ::#8BC34A reporter
to fit with the block:
(current [milisecond v])
The purpose of this extension is to be an extension, not a Scratch 3.0 mod.

ScratchDiogoh wrote:

Errors:
the blocks are updating themselves
unlike kept blocks
I am aware of this issue; I will look into it eventually.

- 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; }
ScratchFoxBot
Scratcher
3 posts

Scratch 3.0 Utilities extension

(get content from [https://api.scratch.mit.edu/users/griffpatch/messages/count]::#8BC34A)
This one doesn't seem to work. Is it supposed to be working?
It might have to do with async vs sync stuff

Edit: The problem is CORS blocking**
If you have problems with this, use CORS Anywhere or try making sure your link has https instead of http

Last edited by ScratchFoxBot (Dec. 21, 2018 04:42:32)

XayCraft360
Scratcher
100+ posts

Scratch 3.0 Utilities extension

Bug:

the () >= () and () <= () doesn't expand the values to be the same, thus not accurate

Last edited by XayCraft360 (Dec. 22, 2018 14:00:09)


<Insert copy of NilsTheBest's OLD uncreative copy of adsuri's uncreative copy of Wahsp's uncreative copy of -ShadowOfTheFuture's- uncreative signature here>

I AM NO LONGER ON SCRATCH
JGames101
Scratcher
100+ posts

Scratch 3.0 Utilities extension

I've noticed with every Scratch 3 Extension I have tried, that if you put custom reporters in another block, like
((pi::#8BC34A) + (current millisecond::#8BC34A)) // Nothing will get returned

say (pi::#8BC34A) // Nothing will get said
It won't return anything. An error gets logged to the console saying “inputName is null”.

The same thing happens with a boolean block, in an if block:
if <is [apple] extacly [apple]::#8BC34A >then
say [hello] // This won't get run
end

Like I said, this issue isn't exclusive to your extension, but it does affect it.
SimpleScratch
Scratcher
500+ posts

Scratch 3.0 Utilities extension

JGames101 wrote:

I've noticed with every Scratch 3 Extension I have tried, that if you put custom reporters in another block, like
((pi::#8BC34A) + (current millisecond::#8BC34A)) // Nothing will get returned

say (pi::#8BC34A) // Nothing will get said

Getting the same issue with a Raspberry Pi extension
Clicking directly on reporter gives the correct value but if put inside a say block - nothing gets said
SimpleScratch
Scratcher
500+ posts

Scratch 3.0 Utilities extension

@sheep_maker has updated their site so that the the reporters now work inside other blocks
JGames101
Scratcher
100+ posts

Scratch 3.0 Utilities extension

SimpleScratch wrote:

@sheep_maker has updated their site so that the the reporters now work inside other blocks
Great!
LuckyLucky7
Scratcher
1000+ posts

Scratch 3.0 Utilities extension

I'm just wondering, but is this extension still in development? I would like to see more extensions or more blocks related to this extension.

I have about 3450 posts, 90 shared projects, 180 total created/followed topics, and 425 followers.

Sheep_maker
Scratcher
1000+ posts

Scratch 3.0 Utilities extension

LuckyLucky7 wrote:

I'm just wondering, but is this extension still in development? I would like to see more extensions or more blocks related to this extension.
Not really since I'm not sure what else to add that non-core extensions can do, but I've recently synced up my mod to the latest Scratch version

- 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; }
LuckyLucky7
Scratcher
1000+ posts

Scratch 3.0 Utilities extension

Sheep_maker wrote:

LuckyLucky7 wrote:

I'm just wondering, but is this extension still in development? I would like to see more extensions or more blocks related to this extension.
Not really since I'm not sure what else to add that non-core extensions can do, but I've recently synced up my mod to the latest Scratch version
Wait, can you link me to the mod(unless you are taking about syncing this extension)?

I have about 3450 posts, 90 shared projects, 180 total created/followed topics, and 425 followers.

Sheep_maker
Scratcher
1000+ posts

Scratch 3.0 Utilities extension

LuckyLucky7 wrote:

Wait, can you link me to the mod(unless you are taking about syncing this extension)?
https://sheeptester.github.io/scratch-gui/
Load an extension from a URL from the extensions library or by adding ?url=extension_url to the URL

- 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; }
LuckyLucky7
Scratcher
1000+ posts

Scratch 3.0 Utilities extension

Sheep_maker wrote:

LuckyLucky7 wrote:

Wait, can you link me to the mod(unless you are taking about syncing this extension)?
https://sheeptester.github.io/scratch-gui/
Load an extension from a URL from the extensions library or by adding ?url=extension_url to the URL
I think you mean syncing the editor to the latest version.

I have about 3450 posts, 90 shared projects, 180 total created/followed topics, and 425 followers.

Powered by DjangoBB