Discuss Scratch

monstermash3
Scratcher
1000+ posts

ITopic: Everything you never knew about [scratchblocks]!

kenny2scratch wrote:

Hey!

The scratchblocks plugin has been updated since this topic was started, so I'll give you a few updates:

First, cstart, celse and cend seem not to have any effect anymore. Take a look:
[scratchblocks]
test cstart :: cstart
...
test celse :: celse
...
test cend :: cend
[/scratchblocks]
makes
test cstart :: cstart
...
test celse :: celse
...
test cend :: cend
.
The only way to make your own C blocks now is to use curly braces {}, like this:
[scratchblocks]
test cstart {
...
} test celse {
...
} test cend
[/scratchblocks]
test cstart {
...
} test celse {
...
} test cend
which (to me, since I've worked with JavaScript) makes a lot more sense.

Second, directly because of this, curly braces {} don't work as block inputs anymore, see:
[scratchblocks]
here is a block with what used to be a block input {block}
[/scratchblocks]
here is a block with what used to be a block input {block}
so instead. you can actually use parentheses () and inside them specify that the input is a block!
[scratchblocks]
here is a block with what is now a block input (block :: stack) :: control // 'cause I want to differentiate the colors
[/scratchblocks]
here is a block with what is now a block input (block :: stack) :: control // 'cause I want to differentiate the colors

Third, to control the type of a “if – else – finally” block, you just put the :: at the end, like this:
[scratchblocks]
test cstart {
...
} test celse {
...
} test cend :: control
[/scratchblocks]
test cstart {
...
} test celse {
...
} test cend :: control

Finally, here is a rewrite of @theonlygusti 's code, the way I think he meant it to be:
[scratchblocks]
when gf clicked :: operators hat
wait until (this block :: looks stack) turns purple {
say hi! :: sound stack
} and then {
use the colors {
to make life :: motion stack
} :: custom-arg
} finally :: extension
stop :: grey cap
[/scratchblocks]
when gf clicked :: operators hat
wait until (this block :: looks stack) turns purple {
say hi! :: sound stack
} and then {
use the colors {
to make life :: motion stack
} :: custom-arg
} finally :: extension
stop :: grey cap
@theonlygusti , I respect you for being the only one I've found that actually deliberately explained all the scratchblocks techniques. Here is an update for everyone who reads this topic!
Another thing: you can now set blocks to other colors. For example, to make a block black or white:
[scratchblocks]
::#000000
::#ffffff
[/scratchblocks]
::#000000
::#ffffff
Just use the hexadecimal code instead of a category.

Last edited by monstermash3 (Dec. 30, 2016 01:07:46)


(Swallowed by an evil kumquat who was just taking a walk in the neighborhood of evil kumquats when they saw a garage sale where they bought a plate which they used to eat but they discovered that it leaked and they went to get their money back but the sale was over so they went in the house but the door was locked so they got their key but it didn't fit so they went home to use the key on the right door which was their own door and then they decided to swallow a signature for no reason.)
dawidkrainski
Scratcher
100+ posts

ITopic: Everything you never knew about [scratchblocks]!

monstermash3 wrote:

Another thing: you can now set blocks to other colors. For example, to make a block black or white:
::#000000
::#ffffff
Just use the hexadecimal code instead of a category.
Hmm… I didn't knew that!
Tropic
Scratcher
1000+ posts

ITopic: Everything you never knew about [scratchblocks]!

dawidkrainski wrote:

monstermash3 wrote:

Another thing: you can now set blocks to other colors. For example, to make a block black or white:
::#000000
::#ffffff
Just use the hexadecimal code instead of a category.
Hmm… I didn't knew that!



My browser / operating system: Windows NT 10.0, Firefox 40.0.2, Flash 20.0 (release 0)
Last eaten by Evil Kumquat (Today 19:30:11)
when I receive [flash_player_version] :: motion
say [Windows 7, Flash 15.0 (release 0)] :: sensing
stop script :: custom
Tropical Productions
monstermash3
Scratcher
1000+ posts

ITopic: Everything you never knew about [scratchblocks]!

Tropic wrote:

dawidkrainski wrote:

monstermash3 wrote:

Another thing: you can now set blocks to other colors. For example, to make a block black or white:
::#000000
::#ffffff
Just use the hexadecimal code instead of a category.
Hmm… I didn't knew that!
Yeah, it doesn't seem to even be on the Wiki page yet, so it must be pretty new.

(Swallowed by an evil kumquat who was just taking a walk in the neighborhood of evil kumquats when they saw a garage sale where they bought a plate which they used to eat but they discovered that it leaked and they went to get their money back but the sale was over so they went in the house but the door was locked so they got their key but it didn't fit so they went home to use the key on the right door which was their own door and then they decided to swallow a signature for no reason.)
jokebookservice1
Scratcher
1000+ posts

ITopic: Everything you never knew about [scratchblocks]!

monstermash3 wrote:

Tropic wrote:

dawidkrainski wrote:

monstermash3 wrote:

Another thing: you can now set blocks to other colors. For example, to make a block black or white:
::#000000
::#ffffff
Just use the hexadecimal code instead of a category.
Hmm… I didn't knew that!
Yeah, it doesn't seem to even be on the Wiki page yet, so it must be pretty new.
It was introduced in the new version of scratchblocks3. I didn't notice that it wasn't on there, hopefully it will be added (I'll edit it tomorrow if nobody does so before me)
asivi
Scratcher
1000+ posts

ITopic: Everything you never knew about [scratchblocks]!

I do not understand the reason for this topic being in Help with Scripts, i think that this would must moved to [scratchblocks] OFFICIAL testing topic

Last edited by asivi (Dec. 31, 2016 00:16:17)

kenny2scratch
Scratcher
500+ posts

ITopic: Everything you never knew about [scratchblocks]!

Hello again, people!
Thanks to the posts after mine for a few things I had forgotten about.

duckboycool wrote:

But you can still do something like;
When {When gf clicked} clicked::events hat
[scratchblocks]
When {When gf clicked} clicked::events hat
[/scratchblocks]
To make them go inside other blocks.
@duckboycool, this is because you specified that the block has to be a hat block. Without the “hat” in “events hat”, the block would become a C block. If you put what was originally a block input into a block then the block you put it into will become a C block unless you specify its type.
[scratchblocks]
When {When gf clicked} clicked::events hat
[/scratchblocks]
makes
When {When gf clicked} clicked::events hat
while
[scratchblocks]
When {When gf clicked} clicked::events
[/scratchblocks]
makes
When {When gf clicked} clicked::events

Second

monstermash3 wrote:

Another thing: you can now set blocks to other colors. For example, to make a block black or white:
[scratchblocks]
::#000000
::#ffffff
[/scratchblocks]
::#000000
::#ffffff
Just use the hexadecimal code instead of a category.
Thanks, @monstermash3, for reminding me about this. Yes, you can set blocks to specific RGB hex colors. Enjoy.

That's all!
;

post brought to you by the preview links bug and previously the uploads site bug. 看一下中文 Scratch 維基想參加?請參考這頁
Join the Scratch Wiki!
Made by Scratchers, for Scratchers, since December 6, 2008

monstermash3
Scratcher
1000+ posts

ITopic: Everything you never knew about [scratchblocks]!

asivi wrote:

I do not understand the reason for this topic being in Help with Scripts, i think that this would must moved to [scratchblocks] OFFICIAL testing topic
There can't be topics within topics…

kenny2scratch wrote:

Second

monstermash3 wrote:

Another thing: you can now set blocks to other colors. For example, to make a block black or white:
[scratchblocks]
::#000000
::#ffffff
[/scratchblocks]
::#000000
::#ffffff
Just use the hexadecimal code instead of a category.
Thanks, @monstermash3, for reminding me about this. Yes, you can set blocks to specific RGB hex colors. Enjoy.

That's all!
;
Yay, it got added to the OP!

sakafitrady wrote:

You dont have to put > and )! They also added a special new diamond block! And black!
((((((((((((((((((((((((
<<<<<<<<<<<<<<
<(<(<(<(<(
Uh… isn't that the same?

(Swallowed by an evil kumquat who was just taking a walk in the neighborhood of evil kumquats when they saw a garage sale where they bought a plate which they used to eat but they discovered that it leaked and they went to get their money back but the sale was over so they went in the house but the door was locked so they got their key but it didn't fit so they went home to use the key on the right door which was their own door and then they decided to swallow a signature for no reason.)
jokebookservice1
Scratcher
1000+ posts

ITopic: Everything you never knew about [scratchblocks]!

What I think asivi meant was the contents of the OP be added to the other topic.
asivi
Scratcher
1000+ posts

ITopic: Everything you never knew about [scratchblocks]!

@monstermash3
Just asking myself how this is useful for people having issues with a project script.

sakafitrady wrote:

You dont have to put > and )! They also added a special new diamond block! And black!
((((((((((((((((((((((((
<<<<<<<<<<<<<<
<(<(<(<(<(
monstermash3
Scratcher
1000+ posts

ITopic: Everything you never knew about [scratchblocks]!

theonlygusti wrote:

Remember, use the proper testing topic to try out your new-found skills: http://scratch.mit.edu/discuss/topic/14778/

theonlygusti wrote:

Remember, only use this topic to follow along with the tutorial, ask for questions and suggest things I missed.

To test out your newly acquired skills, use this stickied topic by jvvg http://scratch.mit.edu/discuss/topic/14778/

Those links are to the old one. Here's the new one:
https://scratch.mit.edu/discuss/topic/219704/

(Swallowed by an evil kumquat who was just taking a walk in the neighborhood of evil kumquats when they saw a garage sale where they bought a plate which they used to eat but they discovered that it leaked and they went to get their money back but the sale was over so they went in the house but the door was locked so they got their key but it didn't fit so they went home to use the key on the right door which was their own door and then they decided to swallow a signature for no reason.)
monstermash3
Scratcher
1000+ posts

ITopic: Everything you never knew about [scratchblocks]!

The OP still does not seem to mention color pickers.

(Swallowed by an evil kumquat who was just taking a walk in the neighborhood of evil kumquats when they saw a garage sale where they bought a plate which they used to eat but they discovered that it leaked and they went to get their money back but the sale was over so they went in the house but the door was locked so they got their key but it didn't fit so they went home to use the key on the right door which was their own door and then they decided to swallow a signature for no reason.)
theonlygusti
Scratcher
1000+ posts

ITopic: Everything you never knew about [scratchblocks]!

I think all aspects of the new [scratchblocks] plugin have been covered in the OP. Thus, bumping for update!

monstermash3
Scratcher
1000+ posts

ITopic: Everything you never knew about [scratchblocks]!

theonlygusti wrote:

I think all aspects of the new [scratchblocks] plugin have been covered in the OP. Thus, bumping for update!
Yay! You added color pickers. Finally.

(Swallowed by an evil kumquat who was just taking a walk in the neighborhood of evil kumquats when they saw a garage sale where they bought a plate which they used to eat but they discovered that it leaked and they went to get their money back but the sale was over so they went in the house but the door was locked so they got their key but it didn't fit so they went home to use the key on the right door which was their own door and then they decided to swallow a signature for no reason.)
dvargasews
Scratcher
500+ posts

ITopic: Everything you never knew about [scratchblocks]!

I'm having problems with scratchblocks.
Sprite1: define one thing//local custom block
Sprite1: define one thing ::custom ::hat
Sprite1: define one thing ::hat ::custom
Sprite1: define one thing ::hat ::custom//local custom block
define something else//global custom block
Sprite1: define one thing//Sorry, but [scratchblocks] is not cooperating.
[/scratchblocks]
What's your advice for this?

Last edited by dvargasews (Jan. 9, 2017 23:23:40)


Please read my signature! It might explain some lingo that I used in my post or comment. However, not all of it shows, so you have to highlight the entire bottom of the post, from “Please read my signature!” to where it says report, and copy and paste in into a new sheet or tab or whatever.
I can't decide my signature between:
1. I'm a grammar stickler, and my pet peeve is when people use good as an adverb.
2. I have lots of [creativity]original ideas[/creativity]. [creativity]This[/creativity] is one of those ideas.
3. If I used this symbol: ⸮ in my comment, please look it up before doing anything else.
4. {Minot, North Dakota/Donald Trump parodies} “WE'RE GONNA BUILD A DAM AND MAKE CANADA PAY FOR IT!” “When Canada sends its water, they’re not sending their best drinking water…They’re bringing sleet. They’re bringing floods. The water's toxic.” (It's just a joke that I came up with.)
5. One should make his/her signature text small; that way (s)he can cram more text into the signature.
6. New [scratchblocks] idea each week! (Thanks to Bright-Idea (Read her signature.) for inspiration/the general idea.) Here's the archive:
Note: I stopped this because of signature character limits.
Week of 1-23-2017: Hat-caps tinyurl.com/htauyu2
Week of 1-16-2017: Country-colored scratchblocks tinyurl.com/z8lz6c4
Week of 1-9-2017: Drop-down booleans tinyurl.com/j5d3k6l
Week of 1-2-2017: Block->string inputs and more truth values tinyurl.com/jqu7avs

theonlygusti
Scratcher
1000+ posts

ITopic: Everything you never knew about [scratchblocks]!

dvargasews wrote:

I'm having problems with scratchblocks.
Sprite1: define one thing//local custom block
Sprite1: define one thing ::custom ::hat
Sprite1: define one thing ::hat ::custom
Sprite1: define one thing ::hat ::custom//local custom block
define something else//global custom block
Sprite1: define one thing
What's your advice for this?
It's because you're using the :: notation twice. Just type :: one time:

Sprite1: define one thing ::custom hat

Last edited by theonlygusti (Jan. 9, 2017 23:24:51)


Powered by DjangoBB