Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » The Official Guide to the Scratchblocks Plugin
- han614698
- Scratcher
1000+ posts
The Official Guide to the Scratchblocks Plugin
The Official Guide to the Scratchblocks Plugin
Please test out your new scratchblocks skills here, not on this topic.
Note: If you're new to the scratchblocks plugin, I highly recommend you read all of Section 1 first so you do not get confused.
Table of Contents
Other/Older Topics
- A guide to [Scratchblocks] and other BBCode help by @Techno-CAT (Oct 1, 2014)
- ITopic: Everything you never knew about [scratchblocks]! by @theonlygusti (Oct 5, 2014)
- The Official BBCode Guide 2.0 by @Create-Scratch101
- CURRENT: The Official Guide to the Scratchblocks Plugin by @han614698 (May 15, 2024)
Credits
@Paddle2See for giving me permission here.
@Zydrolic for an image.
@Techno-CAT for a lot of the content (completely rewritten by me).
@theonlygusti for some ideas.
@Create-Scratch101 for inspiration.
@Maximouse for working with me and several others on my main source I used.
@Gamerboy1023 for some scratchblocks text that I then didn't have to make myself.
Last edited by han614698 (July 1, 2024 18:28:00)
<Scratch Wikian // 2000+ Edits | Forum Helper // 7000+ Posts | Scratcher // 530+ Followers>
banner coming soon…
- han614698
- Scratcher
1000+ posts
The Official Guide to the Scratchblocks Plugin
Section 1 - How They Work + Tips
SUBSECTION ONE - BASIC IIDEAS
What are scratchblocks?
Scratchblocks are a plugin on the forums (and on the wiki) where users can embed Scratch blocks into their text using a text based language. This topic will teach you how to write just normal scripts, and even by the end, make super cool custom blocks to show off your skills. Here's an example of something you could create (but not in real scratch ):( ::#000000) ( ::#FFFFFF) ( ::#000000) ( ::#FFFFFF) ( ::#000000) ::motion hatCredit to Gamerboy1023
( ::#FFFFFF) ( ::#000000) ( ::#FFFFFF) ( ::#000000) ( ::#FFFFFF) ::motion
( ::#000000) ( ::#FFFFFF) ( ::#000000) ( ::#FFFFFF) ( ::#000000) ::motion
( ::#FFFFFF) ( ::#000000) ( ::#FFFFFF) ( ::#000000) ( ::#FFFFFF) ::motion cap
Shortcut
When creating a forum post, there is a toolbar at the top of the text box. You can hover over the button to find a list of built in blocks. You will learn about how to write these without the dropdown, as well as your own custom blocks.
How to Make Scratchblocks Appear
Just like any other BBCode tag, you can use scratchblocks the same - just put a [scratchblocks] tag before your code, and a [/scratchblocks] tag after it.
Automatic Coloring
The scratchblocks parser, which runs your code, looks at your code for specific blocks which are in the List of Blocks. It will then color them accordingly. Section 2 talks about the syntax to write blocks that already exist in the link above.
SUBSECTION TWO - TIPS
If you're new to scratchblocks, read the other sections before reading these tips.TO BE ADDED LATER
Last edited by han614698 (May 17, 2024 01:52:03)
<Scratch Wikian // 2000+ Edits | Forum Helper // 7000+ Posts | Scratcher // 530+ Followers>
banner coming soon…
- han614698
- Scratcher
1000+ posts
The Official Guide to the Scratchblocks Plugin
Section 2 - Basic Syntax
SUBSECTION ONE - BASIC BLOCKS
Stack BlocksTo display a stack block, all you have to do is type the block text. The parser always defaults to a stack block.producesif on edge, bounceif on edge, bounce
Reporter BlocksTo display a reporter block, you have to type the block text in parentheses.produces(x position)(x position)
Boolean BlocksTo display a boolean block, you have to put the block text between ‘<’ and ‘>’.produces<mouse down?><mouse down?>
C BlocksTo display a C block, you have to type the block text, then a line break, and then ‘end’. Blocks inside the C between.producesforever
if on edge, bounce
endforever
if on edge, bounce
end
Cap and Hat BlocksTo display a cap or hat block, all you have to do is just type the block text normally, and the parser will parse it as such.produceswhen green flag clicked
delete this clonewhen gf clicked
delete this clone
Custom BlocksTo display a custom block, you have to type your the normally with “define” in front of it.producesdefine previous costumedefine previous costume
SUBSECTION TWO - INPUTS
TextTo add a text input to a block, you have to type the text between brackets.producesthink [Hello World!]think [Hello World!]
NumberTo add a number input to a block, you have to type the number between parentheses.produceswait (1) secswait (1) secs
Insertable DropdownTo add an insertable dropdown to a block, you have to type the option between parentheses, with a ‘v’ added.producesplay drum (8 v) for (0.25) beatsplay drum (8 v) for (0.25) beats
Uninsertable DropdownTo add an uninsertable dropdown to a block, you have to type the option between brackets, with a ‘v’ added.producesswitch costume to [costume1 v]switch costume to [costume1 v]
ColorTo add a color input to a block, you have to add the color hex code between bracket.produces<touching color [#aaaaaa]?><touching color [#aaaaaa]?>
SUBSECTION THREE - OTHER BASIC FEATURES
CommentsTo add a comment to a block, you have to add two slashes followed by the comment.producesmove (10) steps//This is a comment.move (10) steps//This is a comment
PlaceholderTo add a placeholder block, you have to add three dots, with or without spaces. (… or . . .)produces. . .
.... . .
...
SUBSECTION FOUR - SUBSTITUTES
RotationIf you want to use the rotation blocks, you have to type cw or ccw double depending on the direction. This will not work outside of these two blocks.producesturn cw () degrees
turn ccw () degreesturn cw () degrees
turn ccw () degrees
Green FlagIf you want to shorthand type the “when green flag clicked” block, you can type when gf clicked.produceswhen gf clickedwhen gf clicked
Last edited by han614698 (June 27, 2024 02:56:47)
<Scratch Wikian // 2000+ Edits | Forum Helper // 7000+ Posts | Scratcher // 530+ Followers>
banner coming soon…
- han614698
- Scratcher
1000+ posts
The Official Guide to the Scratchblocks Plugin
Section 3 - Advanced Syntax
SUBSECTION ONE - DEVELOPING NEW BLOCKS
Custom ColoringTo create custom coloring on a block, you must add a preset color or hex code after the block.
The preset colors available are the following:
- motion
- looks
- sound
- pen
- variables
- list
- events
- control
- sensing
- operators
- custom
- custom-arg
- extension
- grey
- obsolete
producescool new block::custom-argcool new block::custom-arg
Custom ShapesIn order to create custom shapes, you have to put one of the below types of block after two colons (::).
- hat
- stack
- ring
- boolean
- reporter
- cap
produceswhen green flag clicked::capwhen green flag clicked::cap
Stacking Custom Colors and BlocksIf you want to have a custom shape and color of a block, you can stack the two above properties.produceswhen project ends::grey reporterwhen project ends::grey reporter
Custom CTo create a custom C block, you have to use curly brackets to separate the lines.producesrepeat (forever v){
move (10) blocks
}and ever::controlrepeat (forever v){
move (10) steps
}and ever::control
SUBSECTION TWO - INSERTABLE IMAGES
Green FlagIf you want to add a Green Flag to a block, you have to type the code @greenFlag.produces<@greenFlag clicked?::control><@greenFlag clicked?::control>
Input Addition and DeletionIf you want to add the symbol to delete and add inputs to a block, you have to type the codes @delInput or @addInput.producescreate variable [foo] [bar] @delInput @addInput::variablescreate variable [foo] [bar] @delInput @addInput::variables
Loop ArrowIf you want to add a loop arrow to a block, you have to type the code @loopArrow.producesif <[1]=[1]> then repeat (10){
. . .
} @loopArrow::controlif <[1]=[1]> then repeat (10){
. . .
} @loopArrow::control
Last edited by han614698 (Aug. 17, 2024 20:39:30)
<Scratch Wikian // 2000+ Edits | Forum Helper // 7000+ Posts | Scratcher // 530+ Followers>
banner coming soon…
- han614698
- Scratcher
1000+ posts
The Official Guide to the Scratchblocks Plugin
Built-In Blocks
move () steps
turn cw () degrees
turn ccw () degrees
point in direction ( v)
point towards [ v]
go to x: () y: (0)
go to [ v]
glide () secs to x: (0) y: (0)
change x by ()
set x to ()
change y by ()
set y to ()
if on edge, bounce
set rotation style [(x position)(y position) v]
change [ v] effect by (25)
set [ v] effect to (0)
clear graphic effects
change size by ()
set size to () %
go to front
go back () layers
(costume #)
(size)
(backdrop name)
play sound [ v]
play sound [ v] until done
stop all sounds
play drum ( v) for (0.25) beats
rest for () beats
play note ( v) for (0.5) beats
set instrument to ( v)
change volume by ()
set volume to (volume) %
change tempo by ()
set tempo to () bpm
clear
stamp
pen down
pen up
set pen color to [#c4296b]
change pen color by ()
set pen color to ()
change pen shade by ()
set pen shade to ()
change pen size by ()
when green flag clicked
when [ v] key pressed
when this sprite clicked
when backdrop switches to [ v]
when [ v] > (10)
when I receive [ v]
broadcast [ v]
broadcast [ v] and wait
wait () secs
repeat ()
end
forever
end
if <> then
end
if <> then
else
end
wait until <>
repeat until <>
end
stop [ v]
when I start as a clone
create clone of [ v]
<touching [ v] ?>
<touching color [#9f7427] ?>
<color [#719e16] is touching [#d34608] ?>
(distance to [ v])
ask [] and wait
(answer)
<key [ v] pressed?>
<mouse down?>
(mouse x)
(mouse y)
(loudness)
(video [ v] on [Stage v])
turn video [ v]
set video transparency to () %
(timer)
reset timer
([ v] of [Sprite1 v])
(current [ v])
(() + (0))
(() - (0))
(() * (0))
(() / (0))
(() - (0))
(pick random () to (10))
<[] < []>
<[] = []>
<[] > []>
<<> and <>>
<<> or <>>
<not <>>
(join [] [world])
(letter () of [world])
(length of [])
(() mod (0))
(round ())
(foo)
(☁ score)
set [ v] to []
change [ v] by (0)
show variable [ v]
hide variable [ v]
(list :: list)
add [] to [list v]
delete ( v) of [list v]
insert [] at (1 v) of [list v]
replace item ( v) of [list v] with [thing]
(item ( v) of [list v] :: list)
(length of [ v] :: list)
<[ v] contains [thing] ?>
show list [ v]
hide list [ v]
Last edited by han614698 (May 16, 2024 00:39:36)
<Scratch Wikian // 2000+ Edits | Forum Helper // 7000+ Posts | Scratcher // 530+ Followers>
banner coming soon…
- han614698
- Scratcher
1000+ posts
The Official Guide to the Scratchblocks Plugin
I am for sure looking for feedback on this.
<Scratch Wikian // 2000+ Edits | Forum Helper // 7000+ Posts | Scratcher // 530+ Followers>
banner coming soon…
- Dagriffpatchfan
- Scratcher
500+ posts
The Official Guide to the Scratchblocks Plugin
Hi
I am (probably) Griffpatch's biggest fan, I mean he did comment on my profile!!!!! Please consider checking out my projects such as my SMB4 remake!
Need an image hosted? Click here
If I wrote something, and then you wrote something back, if I don't respond, feel free to send me the topic link and a reminder on my Profile page
- tristan54mdr
- Scratcher
3 posts
The Official Guide to the Scratchblocks Plugin
not sure how this works but looks nice, you should've putten hard-work into this!
—————————————–IF YOU NEED ANY HELP PLEASE TELL ME THE LINK OF YOUR POST IN MY PROFILE——————————————
Join our Team: The S.S Studio! | Wanna play some Ping-Pong? Try to beat my score!
Let's rush the 100 answers on posts!
Have a great day! ^^
Tristan, France
- han614698
- Scratcher
1000+ posts
The Official Guide to the Scratchblocks Plugin
I have no objections to this but where do you think would be a good spot? Do you think you could like the BBCode help one I made? Mine is in QaS, so it won’t be as seen as yours (which is in HwS)
<Scratch Wikian // 2000+ Edits | Forum Helper // 7000+ Posts | Scratcher // 530+ Followers>
banner coming soon…
- godzglaalaa
- New Scratcher
0 posts
The Official Guide to the Scratchblocks Plugin
i am coming for your soul...::#999999 hat
say(aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa)
- LynnSncks
- Scratcher
1 post
The Official Guide to the Scratchblocks Plugin
How do you make a button work if the answer is shown
- kittenclaw1
- Scratcher
19 posts
The Official Guide to the Scratchblocks Plugin
i am coming for your soul...::#999999 hat
say(aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa)
define [no]
Last edited by kittenclaw1 (May 26, 2024 03:04:06)
- kittenclaw1
- Scratcher
19 posts
The Official Guide to the Scratchblocks Plugin
define (this is cool)
Last edited by kittenclaw1 (May 26, 2024 03:05:10)
- DarthTater85
- Scratcher
26 posts
The Official Guide to the Scratchblocks Plugin
when green flag clickedOK!!!
say [what]
pen down
play sound [recording1 v]
repeat (99)
jahaah
move (100) steps
end
We need you
You will eat pizza if you want tohttps://scratch-mit-edu.ezproxy.canberra.edu.au
Thin j in goddog
Last edited by DarthTater85 (June 13, 2024 17:04:14)
- DarthTater85
- Scratcher
26 posts
The Official Guide to the Scratchblocks Plugin
z²+c
Last edited by DarthTater85 (May 26, 2024 20:59:47)
- Discussion Forums
- » Help with Scripts
- » The Official Guide to the Scratchblocks Plugin