Discuss Scratch

Sheep_maker
Scratcher
1000+ posts

Creating extensions for Scratch 3.0

psicinfoscratch wrote:

Now it works, thanks!
Could I ask you why apparently some of your blocks (from the example https://nitrocipher.github.io/ext2to3/ext-test.js? ) do not return anything? I am intending, in particular, “javascript”, “prompt user with” and “get data from url”
Unofficial extensions are run in a web worker, which doesn't have access to functions such as alert or prompt, which the alert _, prompt user with _, and the default value for the javascript _ block use

The default value for the get data from url: _ block, "http://google.com ," wouldn't work for two reasons:
  • it's served on http sites, and now https sites cannot request anything from a http site for security reasons
  • Google doesn't allow other web pages to fetch it for security reasons
Also, the block uses jQuery to fetch the data, but jQuery isn't included with his extension

- Sheep_maker This is a kumquat-free signature. :P
What's happening? This is my signature; it appears below all my posts. Discuss it on my profile, not the forums.
To make your own, click “Change your signature” at the bottom of the discussion home page.


.postsignature { overflow: auto; } .scratchblocks { overflow-x: auto; overflow-y: hidden; }
NitroCipher
Scratcher
500+ posts

Creating extensions for Scratch 3.0

psicinfoscratch wrote:

-snip-
Now it works, thanks!
Could I ask you why apparently some of your blocks (from the example https://nitrocipher.github.io/ext2to3/ext-test.js? ) do not return anything? I am intending, in particular, “javascript”, “prompt user with” and “get data from url”

Hi, glad to hear that it works! The reason these blocks don't work is due to Scratch using web workers to isolate javascript. In this case, javascript is unable to use a few functions such as eval, window/document variables, and ajax.

I hope my post helped you in some way! Post count: 500+

Current project: [s3Blocks: scratchblocks rewritten for Scratch 3.0] ::#4b4a60 //https://scratch.mit.edu/discuss/topic/290031/ Basically done!
This is my signature identifier “aWFtbml0cm9jaXBoZXI=”
NitroCipher
Scratcher
500+ posts

Creating extensions for Scratch 3.0

Sheep_maker wrote:

-snip-

Also, the block uses jQuery to fetch the data, but jQuery isn't included with his extension

Ooops, completely forgot about jQuery when I made the 3.0 extension, I had written it to work through a chrome addon, and loaded jQuery through that. (it was originally an extension that loaded blocks directly into vanilla scratch)

I hope my post helped you in some way! Post count: 500+

Current project: [s3Blocks: scratchblocks rewritten for Scratch 3.0] ::#4b4a60 //https://scratch.mit.edu/discuss/topic/290031/ Basically done!
This is my signature identifier “aWFtbml0cm9jaXBoZXI=”
psicinfoscratch
New to Scratch
8 posts

Creating extensions for Scratch 3.0

NitroCipher wrote:

Sheep_maker wrote:

-snip-

Also, the block uses jQuery to fetch the data, but jQuery isn't included with his extension

Ooops, completely forgot about jQuery when I made the 3.0 extension, I had written it to work through a chrome addon, and loaded jQuery through that. (it was originally an extension that loaded blocks directly into vanilla scratch)

thanks for your kind attention, your posts were really useful to understand I have to face with another route to try to do what I want! (I have to try to modify scratch-vm very little just to save locally some execution data, but I still don't know how to do this)
ahtewhs
Scratcher
27 posts

Creating extensions for Scratch 3.0

Try to code this:When red button pressed
If do not know, then
when green flag clicked
forever
reset timer
end
when [ timer] > (0.01)
next backdrop
ahtewhs
Scratcher
27 posts

Creating extensions for Scratch 3.0

ummmmmmmmmmm……………………………………………………………………………………………………………………………………………………….
lktornado360
Scratcher
35 posts

Creating extensions for Scratch 3.0

ahtewhs wrote:

Try to code this:When red button pressed
If do not know, then
when green flag clicked
forever
reset timer
end
when [ timer] > (0.01)
next backdrop
that is unrelated

“Heluim is inert, it does not react to anything. This makes it perfect to help create a safe atmosphere for welding.” & “Atomic Number: 2; Formula: He; Atomic Weight: 4.002602; State at 20° C: gas; Boiling point: -268.928° C; Melting point: unknown; % in the Universe: 23; % in the Earth's crust: 0.00000055; % in Earths's oceans: 0.00000000072; % in humans: none.”
–The Periodic Table by Sean Callery and Miranda Smith

mvackel
New to Scratch
1 post

Creating extensions for Scratch 3.0

Hello,
after I create my own extension, is there a way to automatically load it's blocks just after launching Scratch? So as to skip clicking the lower left blue button and select the extension)? I'm using Github Pages to host the extension.
jaafreitas
Scratcher
1 post

Creating extensions for Scratch 3.0

mvackel wrote:

Hello,
after I create my own extension, is there a way to automatically load it's blocks just after launching Scratch? So as to skip clicking the lower left blue button and select the extension)? I'm using Github Pages to host the extension.

Yes, I did it in this way:
https://github.com/jaafreitas/scratch-vm/commit/f54b6e0927a58941f98667e9e3177d3c81999004

Cheers
Nobody_to_No-one
Scratcher
9 posts

Creating extensions for Scratch 3.0

i do not know what the text editor is
AlphabetCake
Scratcher
8 posts

Creating extensions for Scratch 3.0

abc

end
sillyscience8
Scratcher
16 posts

Creating extensions for Scratch 3.0

two questions:
1.what file do you store the code on?
2. what language do you code the block?
Super_OP_user
Scratcher
1 post

Creating extensions for Scratch 3.0

I think there should be a speech to text extension.
recognize speech and wait for <> :: sensing
(recognized speech)
if <(recognized speech) = [type your words here]> then
kursattuncel
New to Scratch
2 posts

Creating extensions for Scratch 3.0

Hello,

How can I load an extension in scratch-gui by launching

my_web_site/scratch-gui/?url=https://…

For example,

https://sheeptester.github.io/scratch-gui/?url=https://nitrocipher.github.io/ext2to3/ext-test.js

website loads the dynamic extension from another web page.

But when I build scratch-gui and run it, and give my url as a parameter,
it does not load the extension from the webpage.

this does not change also when I run the both the extension site and scratch-gui under https or http

do I need to run scratch-gui with some different parameter in order to load extensions from URL by giving it as a parameter?

Best Regards,

Sheep_maker
Scratcher
1000+ posts

Creating extensions for Scratch 3.0

kursattuncel wrote:

Hello,

How can I load an extension in scratch-gui by launching

my_web_site/scratch-gui/?url=https://…

For example,

https://sheeptester.github.io/scratch-gui/?url=https://nitrocipher.github.io/ext2to3/ext-test.js

website loads the dynamic extension from another web page.

But when I build scratch-gui and run it, and give my url as a parameter,
it does not load the extension from the webpage.

this does not change also when I run the both the extension site and scratch-gui under https or http

do I need to run scratch-gui with some different parameter in order to load extensions from URL by giving it as a parameter?

Best Regards,

That is a modified version of Scratch made to load extensions from a URL.

Here are the changes that were made to make that possible:

- Sheep_maker This is a kumquat-free signature. :P
What's happening? This is my signature; it appears below all my posts. Discuss it on my profile, not the forums.
To make your own, click “Change your signature” at the bottom of the discussion home page.


.postsignature { overflow: auto; } .scratchblocks { overflow-x: auto; overflow-y: hidden; }
kursattuncel
New to Scratch
2 posts

Creating extensions for Scratch 3.0

Thank you very much. I've found your repository after I wrote the message.

I was able to compile your gui code and successfully integrated into my site with extension loading feature.


Best Regards,

Powered by DjangoBB

Standard | Mobile