This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1601 2011-07-17 14:42:58

scimonster
Community Moderator
Registered: 2010-06-13
Posts: 1000+

Re: ITopic: Welcome to your local block library!

dav09 wrote:

WHen did http://blocks.scratchr.org launch? I havnt been active in this topic lately.

Just a few days ago.  big_smile

Offline

 

#1602 2011-07-17 15:59:35

mrsrec
Scratcher
Registered: 2010-11-14
Posts: 100+

Re: ITopic: Welcome to your local block library!

YourLocalBlockLib wrote:

http://scratch.mit.edu/redirect/url?lin … 4v6zh2.jpg
^Back to Scratch blocks

How to download a Scratch block
Credit to nXIII for his patcher, which this code was based on.

This is a way how you can make an "import block" item in the file menu so you can download and import blocks from the library.

Beware: this feature is untested! If you want to test it for us, great, but don't use this in your production environment yet!

The Importer
Installing the block importer is the hardest (but not very hard) thing you must do in order to import blocks. Simply follow these instructions:
Step 1: Open Scratch
Step 2: Press and hold the "shift" key while clicking the loop of the "R" in the Scratch logo
Step 3: Select "turn fill-screen off" from the popup menu which shows up
Not showing up? Make sure you're clicking inside the loop of the "R"; the "logo" referred to is the one that says "Scratch" in the top-left corner.
Step 4: Click anywhere in the "white space" which shows up at the bottom and right sides of the window
Step 5: Select "open..." from the popup menu
Step 6: Select "workspace" from the subsequent popup menu
Step 7: Copy the following text and paste it into the textbox-like window with (Windows) Alt+V or (Mac) Command+V, or by clicking the "-" button above the scrollbar (appears when the mouse is over the "workspace" window) and selecting "paste (v)"

Code:

'From MIT Squeak 0.9.4 (June 1, 2003) [No updates present.] on 18 June 2010 at 5:06:17 pm'!

!ScratchFileChooserDialog methodsFor: 'initialization'!
createBlockFileChooserFor: t1 
    scratchFrame _ nil.
    readingScratchFile _ true.
    list _ ScratchFilePicker new extensions: #(#block ).
    self removeAllMorphs.
    bottomSpacer delete.
    bottomSpacer _ nil.
    mainColumn addMorphBack: list.
    self title: 'Import Block'.
    list scratchInfoClient: nil.
    mainColumn addMorphBack: (Morph new extent: 5 @ 9;
         color: Color transparent);
     addMorphBack: newTitleBin.
    fileInfoColumn addMorphBack: buttonRow.
    self addMorphBack: shortcutColumn;
     addMorphBack: mainColumn;
     addMorphBack: fileInfoColumn! !


!ScratchFrameMorph methodsFor: 'menu/button actions'!
addBlock
    | t1 t2 t3 t4 |
    t1 _ ScratchFileChooserDialog new createBlockFileChooserFor: self;
             type: #block.
    t2 _ t1 getUserResponse.
    t2 = #cancelled ifTrue: [^ self].
    t3 _ (FileDirectory forFileName: t2)
                oldFileNamed: t2.
    t4 _ t3 contentsOfEntireFile.
    (ReadWriteStream
        on: t4
        from: 1
        to: t4 size) fileIn! !

!ScratchFrameMorph methodsFor: 'menu/button actions'!
fileMenu: t1 
    | t2 |
    t2 _ CustomMenu new.
    t2 add: 'New' action: #newScratchProject.
    t2 add: 'Open' action: #openScratchProject.
    t2 add: 'Save' action: #saveScratchProjectNoDialog.
    t2 add: 'Save As' action: #saveScratchProject.
    t2 addLine.
    t2 add: 'Import Project' action: #importScratchProject.
    t2 add: 'Export Sprite' action: #exportSprite.
    t2 addLine.
    t2 add: 'Import Block' action: #addBlock.
    t2 addLine.
    t2 add: 'Project Notes' action: #editNotes.
    Sensor shiftPressed
        ifTrue: 
            [t2 addLine.
            t2 add: 'Write Project Summary' action: #writeSummaryFile.
            t2 add: 'Write Multiple Project Summaries' action: #writeMultipleSummaries].
    t2 addLine.
    t2 add: 'Quit' action: #quitScratch.
    t2 localize.
    #(2 4 5 6 7 8 ) do: [:t3 | t2 labels at: t3 put: ((t2 labels at: t3)
                copyFrom: 1 to: (t2 labels at: t3) size - 1)
                , ScratchTranslator ellipsesSuffix].
    t2 invokeOn: self at: t1 bottomLeft + (0 @ 10)! !

Step 8: Select all the text by click-and-drag or by pressing (Windows) Alt+A or (Mac) Command+A
Step 9: File in the selection by clicking on the "-" in the top left corner; choosing "more...", then "file it in"
Step 10: Shift-click the loop of the "R" in the Scratch logo again and select "save image for end-user" then select "yes" when prompted. Scratch should close, and when restarted you will see a new option in the file menu: "Import Block..."

http://scratch.mit.edu/redirect/url?lin … ibDiv2.png

^Back to Scratch blocks

You Know That Everything You Said Was ctrl + _____ Is Actually alt + _____ Right?


Scratchy Scratcher Scratched Scratch Scratches When He Scratchy Scratches Scratch Projects. These Scratch Projects Were Started From Scratch.
http://internetometer.com/image/37716.png

Offline

 

#1603 2011-07-17 16:09:33

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

Re: ITopic: Welcome to your local block library!

ctrl+ isn't written anywhere in that quote...


http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

#1604 2011-07-17 16:33:48

Bookworm300
Scratcher
Registered: 2011-06-04
Posts: 28

Re: ITopic: Welcome to your local block library!

Speaking of that, is anyone trying to make scratch sprites downloadable through the block importer right now?

Offline

 

#1605 2011-07-17 16:41:34

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

Re: ITopic: Welcome to your local block library!

No... I don't think so.


http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

#1606 2011-07-17 16:54:28

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

Re: ITopic: Welcome to your local block library!

I've locked the old block library, someone brought it back from the FOURTH page. I think we have everything we need here anyway  smile  I've just noticed we've got more posts on here than the old one!


http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

#1607 2011-07-17 20:31:21

owetre18
Scratcher
Registered: 2009-07-01
Posts: 1000+

Re: ITopic: Welcome to your local block library!

owetre18 wrote:

Now that I know squeak, I can make 2 new blocks!

Type: Both Scratch Blocks

v flip and h flip

Blockspecs

Scratch-Objects -> ScriptableSpriteMorph (class) -> block specs -> blockSpecs (under looks)

Code:

('h flip' #- #hflip) ('v flip' #- #vflip)

code 1 (v flip)
http://i.imgur.com/Bib6g.gif

Scratch-Objects -> ScriptableSpriteMorph (instance) -> looks ops

Code:

vflip
    costume form: (self form flipBy: #vertical centerAt: 0 @ 0).
    self costumeChanged

code 2 (h flip)
http://i.imgur.com/SvimA.gif

Scratch-Objects -> ScriptableSpriteMorph (instance) -> looks ops

Code:

hflip
    costume form: (self form flipBy: #horizontal centerAt: 0 @ 0).
    self costumeChanged

Edit: Credit to Jens, he made the flip block, I based them off of that
Edit2: Added Images

*cough* *cough* A few updates were made after I posted this. I reposted to make it easier for the Librarians to find it without digging through 8 pages (like I did).

Last edited by owetre18 (2011-07-17 20:31:55)

Offline

 

#1608 2011-07-17 20:41:06

ssss
Scratcher
Registered: 2007-07-29
Posts: 1000+

Re: ITopic: Welcome to your local block library!

sparks wrote:

No... I don't think so.

Seems like a good idea though.  Therefore, I take it xD


Hey.  It's me SSSS, back from the dead!  smile

Offline

 

#1609 2011-07-18 03:00:08

scimonster
Community Moderator
Registered: 2010-06-13
Posts: 1000+

Re: ITopic: Welcome to your local block library!

sparks wrote:

I've locked the old block library, someone brought it back from the FOURTH page. I think we have everything we need here anyway  smile  I've just noticed we've got more posts on here than the old one!

Finally.
And I have it backed up to my comp, so no worries about losing it.

Offline

 

#1610 2011-07-18 03:19:09

YourLocalBlockLib
Scratcher
Registered: 2011-03-10
Posts: 100+

Re: ITopic: Welcome to your local block library!

owetre18 wrote:

owetre18 wrote:

Now that I know squeak, I can make 2 new blocks!

Type: Both Scratch Blocks

v flip and h flip

Blockspecs

Scratch-Objects -> ScriptableSpriteMorph (class) -> block specs -> blockSpecs (under looks)

Code:

('h flip' #- #hflip) ('v flip' #- #vflip)

code 1 (v flip)
http://i.imgur.com/Bib6g.gif

Scratch-Objects -> ScriptableSpriteMorph (instance) -> looks ops

Code:

vflip
    costume form: (self form flipBy: #vertical centerAt: 0 @ 0).
    self costumeChanged

code 2 (h flip)
http://i.imgur.com/SvimA.gif

Scratch-Objects -> ScriptableSpriteMorph (instance) -> looks ops

Code:

hflip
    costume form: (self form flipBy: #horizontal centerAt: 0 @ 0).
    self costumeChanged

Edit: Credit to Jens, he made the flip block, I based them off of that
Edit2: Added Images

*cough* *cough* A few updates were made after I posted this. I reposted to make it easier for the Librarians to find it without digging through 8 pages (like I did).

Sorry... Queued.
~sci


http://dl.dropbox.com/u/6273449/BlockLibraryTitle.png

Offline

 

#1611 2011-07-18 08:17:21

Hardmath123
Scratcher
Registered: 2010-02-19
Posts: 1000+

Re: ITopic: Welcome to your local block library!

Please queue...
Also, the hidden queue link can be hidden further by underlining the surrounding text.


Hardmaths-MacBook-Pro:~ Hardmath$ sudo make $(whoami) a sandwich

Offline

 

#1612 2011-07-18 08:40:17

YourLocalBlockLib
Scratcher
Registered: 2011-03-10
Posts: 100+

Re: ITopic: Welcome to your local block library!

Hardmath123 wrote:

Please queue...
Also, the hidden queue link can be hidden further by underlining the surrounding text.

I don't think we need to underline it.
If someone else feels we should, I don't mind.
NonEdit: Well, if the rest got underlined, it wouldn't look out of place.
~~ “teh almighty Scimonster„

Last edited by YourLocalBlockLib (2011-07-18 08:41:30)


http://dl.dropbox.com/u/6273449/BlockLibraryTitle.png

Offline

 

#1613 2011-07-18 09:45:36

IHeartGaming
Scratcher
Registered: 2010-07-23
Posts: 1000+

Re: ITopic: Welcome to your local block library!

I installed the block importer. But where do I download the blocks?


IHeartGaming

Offline

 

#1614 2011-07-18 09:53:03

scimonster
Community Moderator
Registered: 2010-06-13
Posts: 1000+

Re: ITopic: Welcome to your local block library!

IHeartGaming wrote:

I installed the block importer. But where do I download the blocks?

We haven't made BLOCK files yet...

Offline

 

#1615 2011-07-18 10:33:03

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

Re: ITopic: Welcome to your local block library!

Hardmath123 wrote:

Please queue...
Also, the hidden queue link can be hidden further by underlining the surrounding text.

I don't think we're really trying to hide it, just add a little link that isn't in the way for people when they view the post, but makes certain pages faster to access for librarians  smile

IHeartGaming wrote:

I installed the block importer. But where do I download the blocks?

I'm starting to think we should remove the link to this tutorial until we get it working as people are installing it in the hope it does work without seeing the message saying it does not!


http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

#1616 2011-07-18 10:40:06

owetre18
Scratcher
Registered: 2009-07-01
Posts: 1000+

Re: ITopic: Welcome to your local block library!

Sparks, the link to Panther Blocks on the panther website still links to the old block library. (The link on the BlockShop page)

Offline

 

#1617 2011-07-18 11:01:16

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

Re: ITopic: Welcome to your local block library!

I'll log on and change it as soon as I'm done cleaning!


http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

#1618 2011-07-18 11:22:08

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

Re: ITopic: Welcome to your local block library!

updated


http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

#1619 2011-07-18 11:43:28

Bookworm300
Scratcher
Registered: 2011-06-04
Posts: 28

Re: ITopic: Welcome to your local block library!

sparks wrote:

No... I don't think so.

Could somebody try to do that because I don't get how to download the block sprites the other way and it makes it a lot easier

Offline

 

#1620 2011-07-18 11:58:57

YourLocalBlockLib
Scratcher
Registered: 2011-03-10
Posts: 100+

Re: ITopic: Welcome to your local block library!

Updated first post with:

Librarians
http://blocks.scratchr.org/libstatus.php?user=sparks Sparks About Sparks
http://blocks.scratchr.org/libstatus.php?user=SSBBM SSBBM About SSBBM
http://blocks.scratchr.org/libstatus.php?user=TheSuccessor TheSuccessor About TheSuccessor
http://blocks.scratchr.org/libstatus.php?user=Pecola1 Pecola1 About Pecola1
http://blocks.scratchr.org/libstatus.php?user=scimonster Scimonster About Scimonster
http://blocks.scratchr.org/libstatus.php?user=meowmeow55 Meowmeow55

This uses my API to show which librarians are online!

~Sparks

EDIT BY SCIMONSTER:
I added YourLocalBlockLib to the list too.  wink  http://blocks.scratchr.org/libstatus.php?user=YourLocalBlockLib&type=square
And who deleted all the messages?

Last edited by YourLocalBlockLib (2011-07-18 13:04:49)


http://dl.dropbox.com/u/6273449/BlockLibraryTitle.png

Offline

 

#1621 2011-07-18 12:07:12

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

Re: ITopic: Welcome to your local block library!

I did. In announcements we were asked to do so to speed up a site.


http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

#1622 2011-07-18 13:00:11

jslomba
Scratcher
Registered: 2009-09-25
Posts: 1000+

Re: ITopic: Welcome to your local block library!

does anyone have the code for an <is %s online> block?


the the the the the

Offline

 

#1623 2011-07-18 13:05:48

YourLocalBlockLib
Scratcher
Registered: 2011-03-10
Posts: 100+

Re: ITopic: Welcome to your local block library!

jslomba wrote:

does anyone have the code for an <is %s online> block?

Lol, maybe now that we have an online checker, maybe someone could make that!
~sci


http://dl.dropbox.com/u/6273449/BlockLibraryTitle.png

Offline

 

#1624 2011-07-18 13:22:45

YourLocalBlockLib
Scratcher
Registered: 2011-03-10
Posts: 100+

Re: ITopic: Welcome to your local block library!

I've just added this too the Scratch Blocks Importer post:

http://scratch.mit.edu/redirect/url?link=http://weebly.com/uploads/8/1/3/6/8136364/3621999.png

Hopefully this will deter people from using it for now.
~sci

Last edited by YourLocalBlockLib (2011-07-18 13:23:10)


http://dl.dropbox.com/u/6273449/BlockLibraryTitle.png

Offline

 

#1625 2011-07-18 13:44:14

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

Re: ITopic: Welcome to your local block library!

jslomba wrote:

does anyone have the code for an <is %s online> block?

BOOM! You ask you get!

$String$ is on the Scratch fora? (boolean)

|page startpos endpos refined|
page_self readFromUrl: 'http://scratch.mit.edu/forums/index.php'.
startpos_self indexOf: 'Online:&nbsp;</strong></dt>' startingAt: 1 in: page.
endpos_self stringLength: page.
refined_self letters: startpos through: endpos of: page.

^ refined includesSubString: t1


http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

Board footer