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

#51 2010-08-05 19:49:02

meowmeow55
Scratcher
Registered: 2008-12-24
Posts: 1000+

Re: Welcome to the OLD local block library!

Here's my BYOB block, "[] = []" ! I know you're all like "There's already a [] = [] block!", but this block is built to get around the case-insensitiveness of the standard [] = [] block. Usually Scratch will report A=a as being true (even though one is uppercase and one is lowercase), but my block gets around this by using the ASCII values! Here's the code, enjoy! http://concat.jcshome.org/stuff/equals block.jpg

Edit: the above link no longer works, use this instead: http://i38.tinypic.com/1z23xco.jpg

Last edited by meowmeow55 (2010-08-27 20:09:18)


Yawn.

Offline

 

#52 2010-08-05 22:38:54

MathWizz
Scratcher
Registered: 2009-08-31
Posts: 1000+

Re: Welcome to the OLD local block library!

meowmeow55 wrote:

Here's my BYOB block, "[] = []" ! I know you're all like "There's already a [] = [] block!", but this block is built to get around the case-insensitiveness of the standard [] = [] block. Usually Scratch will report A=a as being true (even though one is uppercase and one is lowercase), but my block gets around this by using the ASCII values! Here's the code, enjoy! http://concat.jcshome.org/stuff/equals block.jpg

I had that idea but this work better.  smile

Code:

  _________
 /         \______
|(1 = A) = (2 = a)|
|_________________|
[report [<(list [(1)] < >) contains [(2)]>]]

Last edited by MathWizz (2010-08-05 22:39:45)


http://block.site90.net/scratch.mit/text.php?size=30&amp;text=%20A%20signature!&amp;color=333333

Offline

 

#53 2010-08-06 06:46:46

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

Re: Welcome to the OLD local block library!

oh very nice! Good use of the ascii blocks! I'm putting that right up!


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

Offline

 

#54 2010-08-06 09:28:03

zorket
Scratcher
Registered: 2010-05-25
Posts: 500+

Re: Welcome to the OLD local block library!

I love ya!


Marzipan11 must learn to not spoil

Offline

 

#55 2010-08-06 13:50:55

meowmeow55
Scratcher
Registered: 2008-12-24
Posts: 1000+

Re: Welcome to the OLD local block library!

Thanks!  smile


Yawn.

Offline

 

#56 2010-08-08 08:25:00

midnightleopard
Scratcher
Registered: 2007-09-13
Posts: 1000+

Re: Welcome to the OLD local block library!

Panther block: Based on code by nXIII. <String Contains String>
Box 1:
$String$ contains $String$
box 2
b
box 3
^ t1 includesSubString: t2

(His is a reported this is a boolean.)


http://pwp.wizards.com/5103673563/Scorecards/Landscape.png

Offline

 

#57 2010-08-08 16:09:12

zorket
Scratcher
Registered: 2010-05-25
Posts: 500+

Re: Welcome to the OLD local block library!

Here is the code for the <pen down?> block: ('pen down?' #b #penDown)


Marzipan11 must learn to not spoil

Offline

 

#58 2010-08-08 16:54:14

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

Re: Welcome to the OLD local block library!

midnightleopard wrote:

Panther block: Based on code by nXIII. <String Contains String>
Box 1:
$String$ contains $String$
box 2
b
box 3
^ t1 includesSubString: t2

(His is a reported this is a boolean.)

ah  tongue  thank you, that was a mistake on my part, I should have put b not r, so I'm afraid that that block has been shared already  tongue


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

Offline

 

#59 2010-08-08 19:49:09

zorket
Scratcher
Registered: 2010-05-25
Posts: 500+

Re: Welcome to the OLD local block library!

Uhh... You got my block wrong. It is a diamond shaped block, and it ha #b, not #R. But thanx for adding it to your main.


Marzipan11 must learn to not spoil

Offline

 

#60 2010-08-08 21:24:12

jman13
Scratcher
Registered: 2009-12-09
Posts: 65

Re: Welcome to the OLD local block library!

How do I save the image for a BYOB block?

Offline

 

#61 2010-08-09 15:00:58

markyparky56
Scratcher
Registered: 2008-03-20
Posts: 1000+

Re: Welcome to the OLD local block library!

meowmeow55 wrote:

Here's my BYOB block, "[] = []" ! I know you're all like "There's already a [] = [] block!", but this block is built to get around the case-insensitiveness of the standard [] = [] block. Usually Scratch will report A=a as being true (even though one is uppercase and one is lowercase), but my block gets around this by using the ASCII values! Here's the code, enjoy! http://concat.jcshome.org/stuff/equals block.jpg

Thats a brillant idea, nicely done.

jman13 wrote:

How do I save the image for a BYOB block?

The block
make sure that the scripting area is clear besides the block you want to take a picture of.
then right click on the scrpting area background and click save pciture of scripts.
The code
Option 1. (You can do this unless you use the report area below the scripting area)
Do the same as The block
Option 2. Right click on the stage and click grab screen region, then click and drag on the area of the scripting you want to save. then export the costume.

Last edited by markyparky56 (2010-08-09 15:06:51)


http://j.mp/jgVnTq
Check out my game engine development site: NewDawn I'm a Level 171 Scratcher.I am http://bit.ly/nkvLNT

Offline

 

#62 2010-08-11 06:28:56

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

Re: Welcome to the OLD local block library!

added Billybob-Mario's "save project as..." block for both scratch and Panther!


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

Offline

 

#63 2010-08-12 21:25:51

midnightleopard
Scratcher
Registered: 2007-09-13
Posts: 1000+

Re: Welcome to the OLD local block library!

sparks wrote:

midnightleopard wrote:

Panther block: Based on code by nXIII. <String Contains String>
Box 1:
$String$ contains $String$
box 2
b
box 3
^ t1 includesSubString: t2

(His is a reported this is a boolean.)

ah  tongue  thank you, that was a mistake on my part, I should have put b not r, so I'm afraid that that block has been shared already  tongue

oh cool


http://pwp.wizards.com/5103673563/Scorecards/Landscape.png

Offline

 

#64 2010-08-13 15:06:16

bbbeb
Scratcher
Registered: 2009-06-11
Posts: 1000+

Re: Welcome to the OLD local block library!

Here's a simple one!
Negative ()
Blockspecs:
('Negative %n'               %r        negativeOfNumber:)

Instance:
negativeOfNumber: t1
   ^t1_ t1*-1


Back in my day.... there were no laws that censored the internet... now, there are.... nah.

Offline

 

#65 2010-08-13 15:10:31

johnnydean1
Scratcher
Registered: 2010-02-12
Posts: 1000+

Re: Welcome to the OLD local block library!

or
^ 0 - t1.


You can now reach me on Twitter @johnnydean1_

Offline

 

#66 2010-08-13 17:29:58

markyparky56
Scratcher
Registered: 2008-03-20
Posts: 1000+

Re: Welcome to the OLD local block library!

Not that I see the usefulness of it, but why would you need that when you could just do:

[blocks]
           ((0 <->  <{ t1  }>  ))
[/blocks]


http://j.mp/jgVnTq
Check out my game engine development site: NewDawn I'm a Level 171 Scratcher.I am http://bit.ly/nkvLNT

Offline

 

#67 2010-08-13 17:51:46

bbbeb
Scratcher
Registered: 2009-06-11
Posts: 1000+

Re: Welcome to the OLD local block library!

lol.
it makes it easier!

Last edited by bbbeb (2010-08-13 17:52:00)


Back in my day.... there were no laws that censored the internet... now, there are.... nah.

Offline

 

#68 2010-08-13 18:02:59

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

Re: Welcome to the OLD local block library!

thanks for the contribution bbbeb! I'll put it up tomorrow! it's late here  tongue


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

Offline

 

#69 2010-08-14 12:34:40

midnightleopard
Scratcher
Registered: 2007-09-13
Posts: 1000+

Re: Welcome to the OLD local block library!

I've got a new BYOB block!
http://i36.tinypic.com/28vd7br.jpg
I got the idea from one of coconut's projects.


http://pwp.wizards.com/5103673563/Scorecards/Landscape.png

Offline

 

#70 2010-08-14 12:48:48

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

Re: Welcome to the OLD local block library!

thanks, ML, but I think that that block was already submitted to the library  hmm  If you think yours works better or works differently, I can always add both?


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

Offline

 

#71 2010-08-15 11:21:03

midnightleopard
Scratcher
Registered: 2007-09-13
Posts: 1000+

Re: Welcome to the OLD local block library!

Panther block:
first box:
Create squeak error
Second box:
g
third box
self duplicateNoAttach

this block couldn't have less of a point, unless you want a squeak error.


http://pwp.wizards.com/5103673563/Scorecards/Landscape.png

Offline

 

#72 2010-08-15 11:52:03

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

Re: Welcome to the OLD local block library!

midnightleopard wrote:

Panther block:
first box:
Create squeak error
Second box:
g
third box
self duplicateNoAttach

this block couldn't have less of a point, unless you want a squeak error.

thanks for sharing! ... any reason why it's a colour reporter? (theyve been taken out of 1.1 and replaced with normal variables that can reprort colours  smile )


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

Offline

 

#73 2010-08-16 18:58:22

stickdude123
Scratcher
Registered: 2010-05-31
Posts: 100+

Re: Welcome to the OLD local block library!

sparks wrote:

http://www.weebly.com/uploads/4/0/7/6/4 … 89.jpg?435

Welcome to your block library! One of the most important and beloved features of Scratch are the blocks, and a great deal of time and effort has gone into making the blocks you see. When building Scratch, the team specifically designed the code so that it would be as easy as possible to add new blocks, and many people have done just that!

This topic aims to bring together a collection of useful block code for experimenting Scratchers to try out and learn from, embracing the program and share parts of the Scratch Motto and hopefully letting users use what they learn here to imagine their own blocks!

This library currently deals with three types of block, and they are displayed under separate headings with explanations or explanatory links to avoid confusion. The three types are

Scratch Block
These blocks can be added directly into scratch.

BYOB Blocks
Built in the popular version of Scratch, BYOB blocks are composed of many other blocks and the code for these will probably be displayed as a block image.

Panther Blocks
Another popular version of Scratch, Panther has a "make a block" feature that lets users easily write block code to do pretty much anything.

So to all you curious Scratchers and viewers alike, I bid you welcome. Welcome to the Library!

===============================================================================
http://www.weebly.com/uploads/4/0/7/6/4 … 51.gif?111
===============================================================================
How to add one of these blocks to Scratch:
I suggest visiting this excellent forum page. It has a full explanation from Billyedward. You can also look at this detailed explaination on the layout of blockspecs by ScratchReallyRocks
_______________________________________________________________________________
Control
"Record sound" block Shared by Sparks
type: http://wiki.scratch.mit.edu/images/The_ … _Block.png
blockspec:

Code:

'record sound' #- #recordSound

no code needed

What it does:
Opens the sound recording window and lets you record a sound.
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
"open camera window" block Shared by Sparks
type: http://wiki.scratch.mit.edu/images/The_ … _Block.png
blockspec:

Code:

'open camera window' #- #takePhoto

no code needed

What it does:
Opens the webcam control window and lets you take photos.
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
"save project as..." block Shared by Billybob-Mario
type: http://wiki.scratch.mit.edu/images/The_ … _Block.png
blockspec:

Code:

'save project' #- #saveProj

code:

Code:

saveProj
| t1 |
t1 _ self ownerThatIsA: ScratchFrameMorph.
t1 saveScratchProject

What it does:
opens the save project as dialog and lets you save it!
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Pen
"pen size" block Shared by jonathanpb
type: http://wiki.scratch.mit.edu/images/The_ … _Block.png
blockspec:

Code:

'pen size' #r #penSize

no code needed

What it does:
Reports the current pen size.
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
"pen down?" block Shared by zorket
type: http://wiki.scratch.mit.edu/images/The_ … _block.png
blockspec:

Code:

'pen down?' #b #penDown

no code needed

What it does:
Reports wether the pen for that sprite is down or not.
===============================================================================
http://www.weebly.com/uploads/4/0/7/6/4 … 586.jpg?94
===============================================================================
how to add one of these blocks:
You need to download BYOB (Build Your Own Blocks) from this link to use the blocks shared in this section. A really helpful guide to understanding how to build your block can be found at this forum thread

To save space on this thread, any BYOB blocks shared will be displayed as links to images, rather than embedding the images to this thread directly. Just read the block description and click the link to the image if you want it.
_______________________________________________________________________________
Motion

[go to random X Y position] By jonathanpb
[turn clockwise( )° in ( ) secs] By PlayWithFire

Looks

[previous costume] By jonathanpb
[change costume by (n)]By jonathanpb
[switch to random costume]By jonathanpb
[animate costumes( ) through( ) with ( ) secs delay] By PlayWithFire
[go forward ( ) layers] By PlayWithFire

Operators

(pi) By PlayWithFire
(( )^( )) (to power) By PlayWithFire
<[]=[]> By meowmeow55Note, unlike the normal equals boolean, this one is case sensitive!

Pen

[stamp at X sad  ) Y sad  )] By PlayWithFire

Sensing

<clicked?> By PlayWithFire
<mouse touching edge?> By PlayWithFire
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
================================================================================
http://www.weebly.com/uploads/4/0/7/6/4 … 986755.jpg
================================================================================
How to add one of these blocks:
To use the Panther coded blocks, you need to download Panther from this link.

To add a block code, you need to open Panther, go to the variables tab, scroll down and click the "make a block" button at the bottom. You will get a popup window with three text boxes and a colour square. The long thin one at the top needs to have the block name in it. The square one to the right with a "-" in it defines the type of block (reporter, stack etc.) and the large one below them is for the block code.
________________________________________________________________________________
Control

"Record sound" Block shared by: Sparks
box 1:
Record sound
box 2
-
box 3
self recordSound
What this block does:
this block opens the sound recorder and lets you record sound.
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
"open camera window" Block shared by: Sparks
box 1:
open camera window
box 2
-
box 3
self takePhoto
What this block does:
this block opens the camera window and lets you take photos.
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
"open webpage with URL [http://]" Block shared by: Billyedward
box 1:
open browser with URL $String$
box 2
-
box 3
Cursor wait showWhile:[ScratchPlugin primOpenURL: t1]
What this block does:
this block opens your default web browser with the webpage typed into the box if the browser is already open, it will open the page in a new tab on firefox, a new window in internet explorer).
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
"clone me" Block shared by: Unknown
box 1:
clone me
box 2
-
box 3
self duplicateNoAttach
What this block does:
This block creates a clone of the sprite that runs it. Unlike the standard clone blocks in Panther, this one creates a clone that does not dissapear once the stop button is pressed. If you want the clone to appear at the mouse pointer and let you place it, just don't put the NoAttach part into the CYOB window. note, does not work in presentation mode.
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
"permenantly delete me" Block shared by: Unknown
box 1:
permenantly delete me
box 2
-
box 3
self undoableDeleteSprite
What this block does:
This block permenantly deletes the sprite that runs it. Unlike the standard delete block in Panther, this block can delete originial (not a clone) sprites so use it with care. note, does not work in presentation mode.
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
"save project as..." Block shared by: Billybob-Mario
box 1:
save project as...
box 2
-
box 3
| t1 |
t1 _ self ownerThatIsA: ScratchFrameMorph.
t1 saveScratchProject
What this block does:
This block opens the save window and prompts you to save the project.
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Variables
"set background watcher colour of [ ] to [ ]" Block shared by: Unknown
box 1:
permenantly delete me
box 2
-
box 3
"permenantly delete me" Block shared by: nXIII
box 1:
set bg of $Variable$ to $Color$
box 2
-
box 3
| s  frame w b palette |
s _ self.
(self varNames includes: t1) ifFalse: [(s _ self ownerThatIsA: ScratchStageMorph) ifNil: [^ self]].
(s varNames includes: t1) ifFalse: [^ self].
frame _ self ownerThatIsA: ScratchFrameMorph.
frame ifNil: [
    (w _ self ownerThatIsA: OffscreenWorldMorph) ifNil: [^ self].
    frame _ w frame].
What this block does:
This block permenantly deletes the sprite that runs it. Unlike the standard delete block in Panther, this block can delete originial (not a clone) sprites so use it with care. note, does not work in presentation mode.
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Operators

"[] contains []?" Block shared by: nXIII
box 1:
$String$ contains $String$?
box 2
b
box 3
^ t1 includesSubString: t2
What this block does:
This block tells you wether the text in the first box contains the text in the second. Excellent for searching for keywords in an input answer.
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯

Want to add to the library? Please do! comment below for it to be added above.

maybe you should call it blocklabray


http://internetometer.com/imagesmall/34259.png http://www.mediafire.com/convkey/418e/lkb7wmv2n2k73rz5g.jpg         http://blocks.scratchr.org/API.php?user=stickdude123&amp;action=onlineStatus&amp;type=square

Offline

 

#74 2010-08-17 07:53:08

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

Re: Welcome to the OLD local block library!

1) you quoted the entire post?

2) what's a blocklabray?


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

Offline

 

#75 2010-08-17 08:37:17

midnightleopard
Scratcher
Registered: 2007-09-13
Posts: 1000+

Re: Welcome to the OLD local block library!

sparks wrote:

midnightleopard wrote:

Panther block:
first box:
Create squeak error
Second box:
g
third box
self duplicateNoAttach

this block couldn't have less of a point, unless you want a squeak error.

thanks for sharing! ... any reason why it's a colour reporter? (theyve been taken out of 1.1 and replaced with normal variables that can reprort colours  smile )

well, a reporter will work as well I think.


http://pwp.wizards.com/5103673563/Scorecards/Landscape.png

Offline

 

Board footer