Discuss Scratch

donotforgetmycode
Scratcher
1000+ posts

My Scratch Extension

How to link to another website on Scratch
Step 1:
Highlight the code below and press Ctrl+C or right-click and select Copy.
(function(ext) {
// Cleanup function when the extension is unloaded
ext._shutdown = function() {};

// Status reporting code
// Use this to report missing hardware, plugin or unsupported browser
ext._getStatus = function() {
return {status: 2, msg: 'Ready'};
};

ext.my_first_block = function(website) {
window.location.href = website;
};

// Block and block menu descriptions
var descriptor = {
blocks: [
// Block type, block name, function name
[' ', 'link to %s', 'my_first_block', 'https://scratch.mit.edu'],
]
};

// Register the extension
ScratchExtensions.register('Link', descriptor, ext);
})({});
Step 2:
Go to Scratch and press Ctrl+Shift+J.
Press Ctrl+V or right-click and select Paste.
Step 3:
Click More Blocks. You should see this block:
link to [https://scratch.mit.edu]
Use the block!

This text under the grey line is my signature. It's not part of my post, but it automatically shows up under all of my posts.

I recommend reading jvvg and Sliverus's essays.

She/her


















Stuff at the bottom of my signature:

for \({
set [i v] to [0]
}; <(i) < [10]>; {
change [i v] by (1)
}) \{{
think (i) for (1) secs
}} :: control
https://scratch.mit.edu/discuss/post/6785965/

Paddle2See wrote:

Would you recommend a confirmation dialog box on that action?
________________________________
| Really send missiles? (Y)es (N)o |
——————————————————

Please forgive my crude mock-up.

By the way - this is rejected for safety reasons.

An0therRand0mC0der wrote:

a bully with a big belly steals your moist cheesy beef
music origins
Be horizontal —
(thanks @thugatwoary and @Za-Chary)
Be high contrast
Generation -1: The first time you see this, copy and paste it on top of your signature in the Scratch forums, and decrease the generation by 1. Social experiment.
i ran out of characters
Kumquat lore
The Scratch Forums support bf +-<>[],.
_3thou_
It seems I can still use assets in my signature. test:
;
donotforgetmycode
Scratcher
1000+ posts

My Scratch Extension

herohamp wrote:

Wrong forum…………………..
My I teach you about /discuss/48?
https://scratch.mit.edu/discuss/48/
Oops, sorry
I think it has been moved though.

Last edited by donotforgetmycode (Aug. 15, 2017 08:26:09)


This text under the grey line is my signature. It's not part of my post, but it automatically shows up under all of my posts.

I recommend reading jvvg and Sliverus's essays.

She/her


















Stuff at the bottom of my signature:

for \({
set [i v] to [0]
}; <(i) < [10]>; {
change [i v] by (1)
}) \{{
think (i) for (1) secs
}} :: control
https://scratch.mit.edu/discuss/post/6785965/

Paddle2See wrote:

Would you recommend a confirmation dialog box on that action?
________________________________
| Really send missiles? (Y)es (N)o |
——————————————————

Please forgive my crude mock-up.

By the way - this is rejected for safety reasons.

An0therRand0mC0der wrote:

a bully with a big belly steals your moist cheesy beef
music origins
Be horizontal —
(thanks @thugatwoary and @Za-Chary)
Be high contrast
Generation -1: The first time you see this, copy and paste it on top of your signature in the Scratch forums, and decrease the generation by 1. Social experiment.
i ran out of characters
Kumquat lore
The Scratch Forums support bf +-<>[],.
_3thou_
It seems I can still use assets in my signature. test:
;
JGames101
Scratcher
100+ posts

My Scratch Extension

donotforgetmycode wrote:

How to link to another website on Scratch
Step 1:
Highlight the code below and press Ctrl+C or right-click and select Copy.
(function(ext) {
// Cleanup function when the extension is unloaded
ext._shutdown = function() {};

// Status reporting code
// Use this to report missing hardware, plugin or unsupported browser
ext._getStatus = function() {
return {status: 2, msg: 'Ready'};
};

ext.my_first_block = function(website) {
window.location.href = website;
};

// Block and block menu descriptions
var descriptor = {
blocks: [
// Block type, block name, function name
[' ', 'link to %s', 'my_first_block', 'https://scratch.mit.edu'],
]
};

// Register the extension
ScratchExtensions.register('Link', descriptor, ext);
})({});
Step 2:
Go to Scratch and press Ctrl+Shift+J.
Press Ctrl+V or right-click and select Paste.
Step 3:
Click More Blocks. You should see this block:
link to [https://scratch.mit.edu]
Use the block!
This is great! I remember my first extension was just true and false blocks…
Here are a few tips for your forum post, though:
instead of having your block look like
link to [https://scratch.mit.edu]
link to [https://scratch.mit.edu]
You can do
link to [https://scratch.mit.edu] :: extension
link to [https://scratch.mit.edu] :: extension
Just to make it look better
Another thing you can do is instead of using
[code]
[/code]
You can do
[code=javascript]
[/code]
And instead of being all grey, it makes the text look like
(function(ext) {
    // Cleanup function when the extension is unloaded
    ext._shutdown = function() {};
    // Status reporting code
    // Use this to report missing hardware, plugin or unsupported browser
    ext._getStatus = function() {
        return {status: 2, msg: 'Ready'};
    };
    ext.my_first_block = function(website) {
        window.location.href = website;
    };
    // Block and block menu descriptions
    var descriptor = {
        blocks: [
            // Block type, block name, function name
            [' ', 'link to %s', 'my_first_block', 'https://scratch.mit.edu'],
        ]
    };
    // Register the extension
    ScratchExtensions.register('Link', descriptor, ext);
})({});
So it's easier to understand. Anyway, great extension, and I look forward to seeing what you create in the future
donotforgetmycode
Scratcher
1000+ posts

My Scratch Extension

JGames101 wrote:

This is great! I remember my first extension was just true and false blocks…
Here are a few tips for your forum post, though:
instead of having your block look like
link to [https://scratch.mit.edu]
link to [https://scratch.mit.edu]
You can do
link to [https://scratch.mit.edu] :: extension
link to [https://scratch.mit.edu] :: extension
Just to make it look better
Another thing you can do is instead of using
[code]
[/code]
You can do
[code=javascript]
[/code]
And instead of being all grey, it makes the text look like
(function(ext) {
    // Cleanup function when the extension is unloaded
    ext._shutdown = function() {};
    // Status reporting code
    // Use this to report missing hardware, plugin or unsupported browser
    ext._getStatus = function() {
        return {status: 2, msg: 'Ready'};
    };
    ext.my_first_block = function(website) {
        window.location.href = website;
    };
    // Block and block menu descriptions
    var descriptor = {
        blocks: [
            // Block type, block name, function name
            [' ', 'link to %s', 'my_first_block', 'https://scratch.mit.edu'],
        ]
    };
    // Register the extension
    ScratchExtensions.register('Link', descriptor, ext);
})({});
So it's easier to understand. Anyway, great extension, and I look forward to seeing what you create in the future
Thank you

Last edited by donotforgetmycode (Aug. 20, 2017 12:55:34)


This text under the grey line is my signature. It's not part of my post, but it automatically shows up under all of my posts.

I recommend reading jvvg and Sliverus's essays.

She/her


















Stuff at the bottom of my signature:

for \({
set [i v] to [0]
}; <(i) < [10]>; {
change [i v] by (1)
}) \{{
think (i) for (1) secs
}} :: control
https://scratch.mit.edu/discuss/post/6785965/

Paddle2See wrote:

Would you recommend a confirmation dialog box on that action?
________________________________
| Really send missiles? (Y)es (N)o |
——————————————————

Please forgive my crude mock-up.

By the way - this is rejected for safety reasons.

An0therRand0mC0der wrote:

a bully with a big belly steals your moist cheesy beef
music origins
Be horizontal —
(thanks @thugatwoary and @Za-Chary)
Be high contrast
Generation -1: The first time you see this, copy and paste it on top of your signature in the Scratch forums, and decrease the generation by 1. Social experiment.
i ran out of characters
Kumquat lore
The Scratch Forums support bf +-<>[],.
_3thou_
It seems I can still use assets in my signature. test:
;
jackkillian
Scratcher
24 posts

My Scratch Extension

You said go to Scratch and press Control+Shift+J.
The Scratch homepage or the Scratch project editor.

Last edited by jackkillian on March 9, 9999
#Bring_it_Back
Hi, and welcome to Scratch! Click Here to go to the Scratch home page.
jackkillian
Scratcher
24 posts

My Scratch Extension

My browser / operating system: MacOS Macintosh X 10.12.5, Chrome 60.0.3112.101, Flash 26.0 (release 0)
Not working for me on either.

Last edited by jackkillian on March 9, 9999
#Bring_it_Back
Hi, and welcome to Scratch! Click Here to go to the Scratch home page.
donotforgetmycode
Scratcher
1000+ posts

My Scratch Extension

jackkillian wrote:

My browser / operating system: MacOS Macintosh X 10.12.5, Chrome 60.0.3112.101, Flash 26.0 (release 0)
Not working for me on either.
Try holding cmd instead of ctrl in the project editor. Do not do anything on the editor, otherwise the JavaScript console will not appear. ☺

This text under the grey line is my signature. It's not part of my post, but it automatically shows up under all of my posts.

I recommend reading jvvg and Sliverus's essays.

She/her


















Stuff at the bottom of my signature:

for \({
set [i v] to [0]
}; <(i) < [10]>; {
change [i v] by (1)
}) \{{
think (i) for (1) secs
}} :: control
https://scratch.mit.edu/discuss/post/6785965/

Paddle2See wrote:

Would you recommend a confirmation dialog box on that action?
________________________________
| Really send missiles? (Y)es (N)o |
——————————————————

Please forgive my crude mock-up.

By the way - this is rejected for safety reasons.

An0therRand0mC0der wrote:

a bully with a big belly steals your moist cheesy beef
music origins
Be horizontal —
(thanks @thugatwoary and @Za-Chary)
Be high contrast
Generation -1: The first time you see this, copy and paste it on top of your signature in the Scratch forums, and decrease the generation by 1. Social experiment.
i ran out of characters
Kumquat lore
The Scratch Forums support bf +-<>[],.
_3thou_
It seems I can still use assets in my signature. test:
;
donotforgetmycode
Scratcher
1000+ posts

My Scratch Extension

bump

This text under the grey line is my signature. It's not part of my post, but it automatically shows up under all of my posts.

I recommend reading jvvg and Sliverus's essays.

She/her


















Stuff at the bottom of my signature:

for \({
set [i v] to [0]
}; <(i) < [10]>; {
change [i v] by (1)
}) \{{
think (i) for (1) secs
}} :: control
https://scratch.mit.edu/discuss/post/6785965/

Paddle2See wrote:

Would you recommend a confirmation dialog box on that action?
________________________________
| Really send missiles? (Y)es (N)o |
——————————————————

Please forgive my crude mock-up.

By the way - this is rejected for safety reasons.

An0therRand0mC0der wrote:

a bully with a big belly steals your moist cheesy beef
music origins
Be horizontal —
(thanks @thugatwoary and @Za-Chary)
Be high contrast
Generation -1: The first time you see this, copy and paste it on top of your signature in the Scratch forums, and decrease the generation by 1. Social experiment.
i ran out of characters
Kumquat lore
The Scratch Forums support bf +-<>[],.
_3thou_
It seems I can still use assets in my signature. test:
;
Monkeymono2019
Scratcher
21 posts

My Scratch Extension

define (yourself v)
This is a test

Wanna check out my profile? Go here!
exa_lyrua
Scratcher
16 posts

My Scratch Extension

how to help me pls !?
(Help to)
switch costume to [coins (no i'am not give coins)]
exa_lyrua
Scratcher
16 posts

My Scratch Extension

donotforgetmycode wrote:

JGames101 wrote:

This is great! I remember my first extension was just true and false blocks…
Here are a few tips for your forum post, though:
instead of having your block look like
link to [https://scratch.mit.edu]
link to [https://scratch.mit.edu]
You can do
link to [https://scratch.mit.edu] :: extension
link to [https://scratch.mit.edu] :: extension
Just to make it look better
Another thing you can do is instead of using
[code]
[/code]
You can do
[code=javascript]
[/code]
And instead of being all grey, it makes the text look like
(function(ext) {
    // Cleanup function when the extension is unloaded
    ext._shutdown = function() {};
    // Status reporting code
    // Use this to report missing hardware, plugin or unsupported browser
    ext._getStatus = function() {
        return {status: 2, msg: 'Ready'};
    };
    ext.my_first_block = function(website) {
        window.location.href = website;
    };
    // Block and block menu descriptions
    var descriptor = {
        blocks: [
            // Block type, block name, function name
            [' ', 'link to %s', 'my_first_block', 'https://scratch.mit.edu'],
        ]
    };
    // Register the extension
    ScratchExtensions.register('Link', descriptor, ext);
})({});
So it's easier to understand. Anyway, great extension, and I look forward to seeing what you create in the future
Thank you
its not working
donotforgetmycode
Scratcher
1000+ posts

My Scratch Extension

This only worked on Scratch 2.0.

This text under the grey line is my signature. It's not part of my post, but it automatically shows up under all of my posts.

I recommend reading jvvg and Sliverus's essays.

She/her


















Stuff at the bottom of my signature:

for \({
set [i v] to [0]
}; <(i) < [10]>; {
change [i v] by (1)
}) \{{
think (i) for (1) secs
}} :: control
https://scratch.mit.edu/discuss/post/6785965/

Paddle2See wrote:

Would you recommend a confirmation dialog box on that action?
________________________________
| Really send missiles? (Y)es (N)o |
——————————————————

Please forgive my crude mock-up.

By the way - this is rejected for safety reasons.

An0therRand0mC0der wrote:

a bully with a big belly steals your moist cheesy beef
music origins
Be horizontal —
(thanks @thugatwoary and @Za-Chary)
Be high contrast
Generation -1: The first time you see this, copy and paste it on top of your signature in the Scratch forums, and decrease the generation by 1. Social experiment.
i ran out of characters
Kumquat lore
The Scratch Forums support bf +-<>[],.
_3thou_
It seems I can still use assets in my signature. test:
;

Powered by DjangoBB