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

#226 2010-09-22 10:39:02

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

Re: Welcome to the OLD local block library!

zorket wrote:

Am I helpful for this topic? (Some have been stolen from others, but I gave credit)

Of course! As long as you tell me who it was made by, that's great, we get lots of additions!


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

Offline

 

#227 2010-09-23 07:36:09

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

Re: Welcome to the OLD local block library!

sparks wrote:

zorket wrote:

Am I helpful for this topic? (Some have been stolen from others, but I gave credit)

Of course! As long as you tell me who it was made by, that's great, we get lots of additions!

u gonna add the <I recieve> block?


Marzipan11 must learn to not spoil

Offline

 

#228 2010-09-23 15:21:04

SSBBM
Scratcher
Registered: 2009-10-09
Posts: 100+

Re: Welcome to the OLD local block library!

Awesome! Great job organizing this. I have a lot of BYOB blocks so I'll upload the pictures soon.

Last edited by SSBBM (2010-09-23 15:22:13)


http://goo.gl/zVfAp http://goo.gl/laci8

Offline

 

#229 2010-09-23 16:42:56

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

Re: Welcome to the OLD local block library!

Thanks very much! I look forward to adding them and I'm glad you like the refurbishments!

If you could provide a picture of the block as it appears in the pallet as well as the coding, that would be awesome, otherwise I have to go and generate an image of the block for each one as I add it to the forum.  smile


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

Offline

 

#230 2010-09-23 21:17:48

SSBBM
Scratcher
Registered: 2009-10-09
Posts: 100+

Re: Welcome to the OLD local block library!

sparks wrote:

Thanks very much! I look forward to adding them and I'm glad you like the refurbishments!

If you could provide a picture of the block as it appears in the pallet as well as the coding, that would be awesome, otherwise I have to go and generate an image of the block for each one as I add it to the forum.  smile

What do you mean pallet?


http://goo.gl/zVfAp http://goo.gl/laci8

Offline

 

#231 2010-09-24 10:44:21

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

Re: Welcome to the OLD local block library!

the pallet is the area in scratch/panther/byob that has all the blocks in it that you drag out.


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

Offline

 

#232 2010-09-24 13:10:19

SSBBM
Scratcher
Registered: 2009-10-09
Posts: 100+

Re: Welcome to the OLD local block library!

sparks wrote:

the pallet is the area in scratch/panther/byob that has all the blocks in it that you drag out.

Oh, ok. Got it!


http://goo.gl/zVfAp http://goo.gl/laci8

Offline

 

#233 2010-09-24 19:00:03

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

Re: Welcome to the OLD local block library!

sparks wrote:

the pallet is the area in scratch/panther/byob that has all the blocks in it that you drag out.

ADD RUBIKS_CUBE_GUY'S BLOCK!!!!!!!!!!!!!!!!!!!!!!!!!!!


Marzipan11 must learn to not spoil

Offline

 

#234 2010-09-24 19:40:41

SSBBM
Scratcher
Registered: 2009-10-09
Posts: 100+

Re: Welcome to the OLD local block library!

Here's some BYOB blocks!

http://img696.imageshack.us/img696/153/moveindir.gif

http://img541.imageshack.us/img541/185/ofcos.gif

http://img545.imageshack.us/img545/9666/lastcos.gif

http://img714.imageshack.us/img714/7598/fade.gif

http://img543.imageshack.us/img543/8347/sayno.gif

http://img715.imageshack.us/img715/8787/clickgreenflag.gif credit to zxz1661

http://img715.imageshack.us/img715/344/dkfj.gif

http://img690.imageshack.us/img690/3800/keypressed.gif

http://img693.imageshack.us/img693/1866/anyandnokeypressed.gif

http://img707.imageshack.us/img707/619/avgof.gif

http://img715.imageshack.us/img715/8800/ifthenelse.gif

http://img827.imageshack.us/img827/9442/xisinbetweenand.gif

I'll tell you if I get more!


http://goo.gl/zVfAp http://goo.gl/laci8

Offline

 

#235 2010-09-25 08:27:30

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

Re: Welcome to the OLD local block library!

woah! A HUGE contribution from SSBBM there, that's great! I have added them all up! Thanks very much!


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

Offline

 

#236 2010-09-25 13:24:13

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

Re: Welcome to the OLD local block library!

Whoa, that's a lot of blocks, SSBBM! I see I'm going to have my hands full updating the BYOB Block Library project, especially with the "key pressed" reporter.


Yawn.

Offline

 

#237 2010-09-25 15:48:06

nXIII
Community Moderator
Registered: 2009-04-21
Posts: 1000+

Re: Welcome to the OLD local block library!

sparks wrote:

woah! A HUGE contribution from SSBBM there, that's great! I have added them all up! Thanks very much!

slightly optimized (# of costumes) block:

(# of costumes)
script variables OC
set OC to (costume #)
switch to costume (0 + 0)
switch to costume (OC)

report (costume #)


nXIII

Offline

 

#238 2010-09-25 15:52:48

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

Re: Welcome to the OLD local block library!

nXIII wrote:

sparks wrote:

woah! A HUGE contribution from SSBBM there, that's great! I have added them all up! Thanks very much!

slightly optimized (# of costumes) block:

(# of costumes)
script variables OC
set OC to (costume #)
switch to costume (0 + 0)
switch to costume (OC)

report (costume #)

(# of costumes)
script variables OC Out
set OC to (costume #)
switch to costume 1
switch to costume ( (costume # ) - 1)
set Out to (costume #)
switch to costume (OC)
report (Out)


You can now reach me on Twitter @johnnydean1_

Offline

 

#239 2010-09-25 16:14:08

nXIII
Community Moderator
Registered: 2009-04-21
Posts: 1000+

Re: Welcome to the OLD local block library!

johnnydean1 wrote:

nXIII wrote:

sparks wrote:

woah! A HUGE contribution from SSBBM there, that's great! I have added them all up! Thanks very much!

slightly optimized (# of costumes) block:

(# of costumes)
script variables OC
set OC to (costume #)
switch to costume (0 + 0)
switch to costume (OC)

report (costume #)

(# of costumes)
script variables OC Out
set OC to (costume #)
switch to costume 1
switch to costume ( (costume # ) - 1)
set Out to (costume #)
switch to costume (OC)
report (Out)

Oh... I fail.
Haha....  lol

(# of costumes)

script variables OC Out
set OC to (costume #)
switch to costume (0+0)
set Out to (costume #)
switch to costume (OC)

report (Out)

Last edited by nXIII (2010-09-25 16:15:08)


nXIII

Offline

 

#240 2010-09-26 01:02:15

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

Re: Welcome to the OLD local block library!

nXIII wrote:

johnnydean1 wrote:

nXIII wrote:

slightly optimized (# of costumes) block:

(# of costumes)
script variables OC
set OC to (costume #)
switch to costume (0 + 0)
switch to costume (OC)

report (costume #)

(# of costumes)
script variables OC Out
set OC to (costume #)
switch to costume 1
switch to costume ( (costume # ) - 1)
set Out to (costume #)
switch to costume (OC)
report (Out)

Oh... I fail.
Haha....  lol

(# of costumes)

script variables OC Out
set OC to (costume #)
switch to costume (0+0)
set Out to (costume #)
switch to costume (OC)

report (Out)

(# of costumes)

script variables check rebound
set check to 0
switch to costume (0+1)
repeat until <<costume number=0> and <rebound=1>
switch to costume ((costume #)+1)
change check by 1
if <(costume #>0)>
set rebound to 1

report(check)

big_smile  lol

Last edited by bbbeb (2010-09-26 01:02:30)


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

Offline

 

#241 2010-09-26 10:30:53

nXIII
Community Moderator
Registered: 2009-04-21
Posts: 1000+

Re: Welcome to the OLD local block library!

bbbeb wrote:

(# of costumes)

script variables check rebound
set check to 0
switch to costume (0+1)
repeat until <<costume number=0> and <rebound=1>
switch to costume ((costume #)+1)
change check by 1
if <(costume #>0)[/blocks]>
set rebound to 1

report(check)

big_smile  lol

Oh my gosh...
Optimization is making something run FASTER, not making it LONGER and SLOWER!
This:

(# of costumes)

script variables OC Out
set OC to (costume #)
switch to costume (0+0)
set Out to (costume #)
switch to costume (OC)

report (Out)

is the most optimized version. If you have one that's shorter which also works, please post it.

Last edited by nXIII (2010-09-26 10:31:13)


nXIII

Offline

 

#242 2010-09-26 12:35:08

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

Re: Welcome to the OLD local block library!

now get a block image for that  smile

meowmeow55 wrote:

I see I'm going to have my hands full updating the BYOB Block Library project, especially with the "key pressed" reporter.

Yes, that's what I thought when I saw it too. That's one block where it's definitely useful to have it made for you in a project! And thanks for running that project, I'm sure lots of people find it useful. I might do the same thing for Panther but as CYOB blocks currently fail when you try to export them, there's not much point...


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

Offline

 

#243 2010-09-26 14:04:56

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

Re: Welcome to the OLD local block library!

nXIII wrote:

bbbeb wrote:

(# of costumes)

script variables check rebound
set check to 0
switch to costume (0+1)
repeat until <<costume number=0> and <rebound=1>
switch to costume ((costume #)+1)
change check by 1
if <(costume #>0)[/blocks]>
set rebound to 1

report(check)

big_smile  lol

Oh my gosh...
Optimization is making something run FASTER, not making it LONGER and SLOWER!
This:

(# of costumes)

script variables OC Out
set OC to (costume #)
switch to costume (0+0)
set Out to (costume #)
switch to costume (OC)

report (Out)

is the most optimized version. If you have one that's shorter which also works, please post it.

lol i thought that didnt work from the look  tongue


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

Offline

 

#244 2010-09-26 18:05:34

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

Re: Welcome to the OLD local block library!

Does costume zero equal last one?


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

Offline

 

#245 2010-09-26 20:12:37

nXIII
Community Moderator
Registered: 2009-04-21
Posts: 1000+

Re: Welcome to the OLD local block library!

bbbeb wrote:

Does costume zero equal last one?

it uses i mod size so yes, it will turn out to be the last costume.


nXIII

Offline

 

#246 2010-09-27 02:57:53

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

Re: Welcome to the OLD local block library!

nXIII wrote:

bbbeb wrote:

Does costume zero equal last one?

it uses i mod size so yes, it will turn out to be the last costume.

Another way of prooving it is that
switch to costume 1
switch to costume ( (costume no.) - 1) "The same as 0"

Last edited by johnnydean1 (2010-09-27 02:58:57)


You can now reach me on Twitter @johnnydean1_

Offline

 

#247 2010-09-27 14:35:10

nXIII
Community Moderator
Registered: 2009-04-21
Posts: 1000+

Re: Welcome to the OLD local block library!

johnnydean1 wrote:

nXIII wrote:

bbbeb wrote:

Does costume zero equal last one?

it uses i mod size so yes, it will turn out to be the last costume.

Another way of prooving it is that
switch to costume 1
switch to costume ( (costume no.) - 1) "The same as 0"

Oh, yea.


nXIII

Offline

 

#248 2010-09-28 20:16:06

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

Re: Welcome to the OLD local block library!

Operators
(if <> then () else ()

blockspec:

('if %b then %s else %s' #r #if:then:else:)

Code:

if: t1 then: t2 else: t3
| t4 |
t1
ifTrue: [t4 _ t2]
ifFalse: [t4 _ t3].
^ t4

Or you can use

Code:

if: t1 then: t2 else: t3
t1 ifTrue: [^ t2].
^ t3

I'm not positive though

Last edited by zorket (2010-10-01 15:57:27)


Marzipan11 must learn to not spoil

Offline

 

#249 2010-09-28 21:07:10

nXIII
Community Moderator
Registered: 2009-04-21
Posts: 1000+

Re: Welcome to the OLD local block library!

Code:

if: t1 then: t2 else: t3
t1 ifTrue: [^ t2].
^ t3

nXIII

Offline

 

#250 2010-09-28 21:10:13

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

Re: Welcome to the OLD local block library!

got one for scratch source code.
Name of block: Search on...
Author: MidnightLeopard
Category: Sensing

blockspecs:

Code:

('%j %s' #- #doThis:on:)

sensing ops:

Code:

doThis: t1 on: t2 
    | engines l |
    'google' = t1 ifTrue: [ScratchPlugin primOpenURL: 'http://www.google.com/#sclient=psy&hl=en&q=' , t2 , '&aq=f&aqi=g5&aql=&oq=&gs_rfai=&pbx=1&fp=ab5cdb1806fef4aa&safe=activet1'].
    'yahoo' = t1 ifTrue: [ScratchPlugin primOpenURL: 'http://search.yahoo.com/search;_ylt=Aj.OqjGVrkBmY6mZqA_PSu.bvZx4?p=' , t2 , '&toggle=1&cop=mss&ei=UTF-8&fr=yfp-t-701'].
    'scratch.mit.edu/' = t1 ifTrue: [ScratchPlugin primOpenURL: 'http://scratch.mit.edu/' , t2].
    'search scratch for' = t1 ifTrue: [ScratchPlugin primOpenURL: 'http://scratch.mit.edu/pages/results?cx=010101365770046705949:gg_q9cry0mq&cof=FORID:11&q=' , t2 , '&safe=active&sa=search'].
    'IMDB' = t1 ifTrue: [ScratchPlugin primOpenURL: 'http://www.imdb.com/find?s=all&q=' , t2].
    'load' = t1 ifTrue: [^ 0].
    ^ 0

scratch blocks -> command block morph -> private -> uncoloredArgMorphFor:
then delete all of that code and replace it with:

Code:

uncoloredArgMorphFor: t1 
    | t2 |
    t2 _ t1 at: 2.
    $a = t2 ifTrue: [^ AttributeArgMorph new choice: 'volume'].
    $b = t2 ifTrue: [^ BooleanArgMorph new].
    $c = t2 ifTrue: [^ ColorArgMorph new showPalette: true].
    $C = t2 ifTrue: [^ ColorArgMorph new showPalette: false].
    $d = t2 ifTrue: [^ ExpressionArgMorphWithMenu new numExpression: '0';
         menuSelector: #directionMenu].
    $D = t2 ifTrue: [^ ExpressionArgMorphWithMenu new numExpression: '48';
         menuSelector: #midiDrumMenu].
    $R = t2 ifTrue: [^ ChoiceArgMorph new getOptionsSelector: #operatorNames;
         choice: '+'].
    $e = t2 ifTrue: [^ EventTitleMorph new].
    $f = t2 ifTrue: [^ ChoiceArgMorph new getOptionsSelector: #mathFunctionNames;
         choice: 'sqrt'].
    $g = t2 ifTrue: [^ ChoiceArgMorph new getOptionsSelector: #graphicEffectNames;
         choice: 'color'].
    $j = t2 ifTrue: [^ ChoiceArgMorph new getOptionsSelector: #engineNames;
         choice: 'google'].
    $H = t2 ifTrue: [^ ChoiceArgMorph new getOptionsSelector: #hookupSensorNames].
    $h = t2 ifTrue: [^ ChoiceArgMorph new getOptionsSelector: #hookupBooleanSensorNames].
    $I = t2 ifTrue: [^ ExpressionArgMorphWithMenu new numExpression: '1';
         menuSelector: #midiInstrumentMenu].
    $i = t2 ifTrue: [^ ExpressionArgMorphWithMenu new numExpression: '1';
         menuSelector: #listIndexMenu].
    $k = t2 ifTrue: [^ ChoiceArgMorph new getOptionsSelector: #keyNames;
         choice: 'space'].
    $L = t2 ifTrue: [^ ChoiceArgMorph new getOptionsSelector: #listVarMenu].
    $l = t2 ifTrue: [^ ChoiceOrExpressionArgMorph new getOptionsSelector: #costumeNames;
         choice: 'costume1'].
    $m = t2 ifTrue: [^ SpriteArgMorph new].
    $M = t2 ifTrue: [^ ChoiceArgMorph new getOptionsSelector: #motorNames].
    $n = t2 ifTrue: [^ ExpressionArgMorph new numExpression: '10'].
    $N = t2 ifTrue: [^ ExpressionArgMorphWithMenu new numExpression: '60';
         menuSelector: #noteSelector].
    $s = t2 ifTrue: [^ ExpressionArgMorph new stringExpression: ''].
    $S = t2 ifTrue: [^ ChoiceOrExpressionArgMorph new getOptionsSelector: #soundNames;
         choice: 'pop'].
    $v = t2 ifTrue: [^ ChoiceArgMorph new getOptionsSelector: #varNamesMenu;
         choice: ''].
    $W = t2 ifTrue: [^ ChoiceArgMorph new getOptionsSelector: #motorDirection].
    $x = t2 ifTrue: [^ ChoiceOrExpressionArgMorph new getOptionsSelector: #sceneNames;
         choice: ''].
    $y = t2 ifTrue: [^ ExpressionArgMorphWithMenu new numExpression: '1';
         menuSelector: #listIndexForDeleteMenu].
    ^ ExpressionArgMorph new numExpression: '10'

then scratch objects -> scriptable scratch morph -> sensing ops ->

Code:

engineNames
    ^ #('google' 'yahoo' 'scratch.mit.edu/' 'search scratch for' 'IMDB' 'load' )

it looks like this
http://i52.tinypic.com/zkjy8h.jpg
it can search google, IMDB, yahoo, scratch, or go to a scratch url. Also, the load option does nothing, but can be used to test if your user has added this block, like:
^when flag clicked^
[set 'has block' to '0']
[load '']
[set 'has block' to '1']

this is the best piece of code I have ever made in smalltalk, so please tell me how it goes!


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

Offline

 

Board footer