Discuss Scratch
- Discussion Forums
- » Developing Scratch Extensions
- » Creating extensions for Scratch 3.0
- Elliot3-0
-
100+ posts
Creating extensions for Scratch 3.0
This can make it easier using the “Jila” coding language i can agreeSER(EXT-D0W)I’ll have more code here https://scratch.mit.edu/discuss/topic/655181/
/#:^Loads the extension in
By the way just ask for more code
- Elliot3-0
-
100+ posts
Creating extensions for Scratch 3.0
Should we use JS for making other blocks or no?
glide () secs to x: (0) y: (0) of [costume1] of [Sprite1]
Last edited by Elliot3-0 (March 7, 2023 16:20:50)
- bonamasa
-
20 posts
Creating extensions for Scratch 3.0
How to make a reporter that gives just a value like Pi reporters?
I need method because i made the block itself.
EXAMPLE:
I need method because i made the block itself.
EXAMPLE:
(PI :: #429677)(no matter what returns 3.14)
- HakunaJin
-
7 posts
Creating extensions for Scratch 3.0
hello. Currently, I want to drive my arduino hardware by linking it to scratch.
Currently in progress using the scratch-gui and scratch-vm files.
I want to connect it to a pc using an arduino cable.
How to communicate data?
It is very hard work…. What can i do…?
Sorry…. My English Not Gooooooooooood…….
Currently in progress using the scratch-gui and scratch-vm files.
I want to connect it to a pc using an arduino cable.
How to communicate data?
It is very hard work…. What can i do…?
Sorry…. My English Not Gooooooooooood…….

- HakunaJin
-
7 posts
Creating extensions for Scratch 3.0
hello. Currently, I want to drive my arduino hardware by linking it to scratch.
Currently in progress using the scratch-gui and scratch-vm files.
I want to connect it to a pc using an arduino cable.
How to communicate data?
It is very hard work…. What can i do…?
Sorry…. My English Not Gooooooooooood…….
Currently in progress using the scratch-gui and scratch-vm files.
I want to connect it to a pc using an arduino cable.
How to communicate data?
It is very hard work…. What can i do…?
Sorry…. My English Not Gooooooooooood…….

- bonamasa
-
20 posts
Creating extensions for Scratch 3.0
Where do I run the code?i personaly run it on sheep tester but you also can run it in turbowarp
- bonamasa
-
20 posts
Creating extensions for Scratch 3.0
Where do I run the code?btw if you dont wanna to host it on websites you can convert JS file to data url and paste it in custom extension url field
- TheBestMuslim_22
-
11 posts
Creating extensions for Scratch 3.0
when green flag clicked
say [COMPLEXITY[big]Here we go[/big]]











- We do list and refrencesPython And C++ SCRATCH
Users:griffpatch
My browser / operating system: Windows NT 10.0, Chrome 111.0.0.0, No Flash version detected
(New Reply)
Chess openings by topic: Magnus Carlsen
Underated me chess for Pd5 opening then Qh7 to target the pieces for the 5 moves check
Magnus Carlsen late reply at 5:09 in chess blitz
- TheBestMuslim_22
-
11 posts
Creating extensions for Scratch 3.0
gfcgghjuhb b
when backdrop switches to [ v]
if <> then
<key [<[me] = [griffpatch]> v] pressed?>
show list [ v]
show list [(pick random () to (10)) v]
stamp
stop all sounds
end
- SpeedCat709Rises
-
15 posts
Creating extensions for Scratch 3.0
when i am clicked
go to the store
- Elliot3-0
-
100+ posts
Creating extensions for Scratch 3.0
evil kumquat killer
when I receive [ kumquats come v]
kill [ all evil kumquats v]
- SpeedCat709Rises
-
15 posts
Creating extensions for Scratch 3.0
on start :: hat events
( :: operators #ffffff) yin :: #000000
yang (yang :: operators #000000) :: #ffffff
- Elliot3-0
-
100+ posts
Creating extensions for Scratch 3.0
whaton start :: hat events
( :: operators #ffffff) yin :: #000000
yang (yang :: operators #000000) :: #ffffff
- poptko
-
90 posts
Creating extensions for Scratch 3.0
i do not can javascript

add [js file] to [list v]
- iob321ytrewq
-
54 posts
Creating extensions for Scratch 3.0
(#1)can you make some blocks for me with the class GameMash for turbowarp? btw here are the ones that i want:Creating extensions for Scratch 3.0There is now official documentation regarding extensions!, but feel free to use this post to get you started
You'll want to start off by creating your extension's class, and register the extension - In my case, this would be ‘NitroBlock’class NitroBlock { //In both instances, NitroBlock will be the name in both instances } Scratch.extensions.register(new NitroBlock());
Next, we will be constructing block and menu definitions - We will continue to use ‘NitroBlock’ through this tutorialgetInfo() { return { "id": "NitroBlock", "name": "NitroBlock", "blocks": [ ], "menus": { //we will get back to this in a later tutorial } }; }
We are going to take a look at how blocks are constructed
For those of you that are familiar with extensions for Scratch 2.0, we will start off with this: - If not, you can ignore this['r', 'letters %n through %n of %s', 'substringy', '2', '5', 'hello world'] //breakdown below: ['r' = block type, 'letters %n through %n of %s' = block text, 'substringy' = block ID/opcode]{ "opcode": "substringy", //This will be the ID code for the block "blockType": "reporter", //This can either be Boolean, reporter, command, or hat "text": "letters [num1] through [num2] of [string]", //This is the block text, and how it will display in the Scratch interface "arguments": { //Arguments are the input fields in the block. In the block text, place arguments in square brackets with the corresponding ID "num1": { //This is the ID for your argument "type": "number", //This can be either Boolean, number, or string "defaultValue": "2" //This is the default text that will appear in the input field, you can leave this blank if you wish }, "num2": { "type": "number", "defaultValue": "5" }, "string": { "type": "string", "defaultValue": "hello world" } } },
We will put this newly constructed code into the blocks object above - My code will now look like thisclass NitroBlock { getInfo() { return { "id": "NitroBlock", "name": "NitroBlock", "blocks": [{ "opcode": "substringy", "blockType": "reporter", "text": "letters [num1] through [num2] of [string]", "arguments": { "num1": { "type": "number", "defaultValue": "2" }, "num2": { "type": "number", "defaultValue": "5" }, "string": { "type": "string", "defaultValue": "hello world" } } }, }], "menus": { //we will get back to this in a later tutorial } }; } Scratch.extensions.register(new NitroBlock());
Next we come to the most important part, the code that actually runs the blocks! - I am keeping this short and simple for tutorial's sake.//Make sure you name this function with with the proper ID for the block you defined above substringy({num1, num2, string}) { //these names will match the argument names you used earlier, and will be used as the variables in your code //this code can be anything you want return string.substring(num1 - 1, num2); //for reporters and Boolean blocks the important thing is to use 'return' to get the value back into Scratch. }
Place this new code below your getInfo() functionclass NitroBlock { getInfo() { return { "id": "NitroBlock", "name": "NitroBlock", "blocks": [{ "opcode": "substringy", "blockType": "reporter", "text": "letters [num1] through [num2] of [string]", "arguments": { "num1": { "type": "number", "defaultValue": "2" }, "num2": { "type": "number", "defaultValue": "5" }, "string": { "type": "string", "defaultValue": "hello world" } } }, }], "menus": { //we will get back to this in a later tutorial } }; substringy({num1, num2, string}) { return string.substring(num1 - 1, num2); }; }
Save this code to your computer as a js file, in my case it is NitroBlock_3.js
Congratz, you now have your extension code created!!
You can use this tutorial to add it your own personal copy of scratch
Or, you can host the extension with gh-pages, and go here to test it (provide your own url, don't use mine)
Here is the archived copy of my original postspawn(8)clones at x(0)y(0)delete all clones of sprite(1)
Last edited by iob321ytrewq (April 21, 2023 18:54:38)
- Mr_Spooky12
-
14 posts
Creating extensions for Scratch 3.0
think [Arbitrary colors?] :: #228b22
Last edited by Mr_Spooky12 (April 25, 2023 21:53:24)
- isaacics
-
6 posts
Creating extensions for Scratch 3.0
I really wish there is something that lets you have a vairiable go across different games.
Example: if you collect a mushroom in a game your mushroom amount goes up in than game if you coded it to do that right? What if there was a function where the mushroom count goes up in another game as well.
Example: if you collect a mushroom in a game your mushroom amount goes up in than game if you coded it to do that right? What if there was a function where the mushroom count goes up in another game as well.