MathWizz wrote:
I have a bunch of blocks. Here are the images. Ah, a file might be better. Here.
why aren't you talking on Hamachi?
Offline
there are a lot of inconsistencies in this post.
sparks wrote:
Control
Shared by Sparks
blockspec:'open camera window' #- #takePhoto
no code needed
What it does:
Opens the webcam control window and lets you take photos.
Shared by Billybob-Mario
blockspec:'save project' #- #saveProj
code:
saveProj
| t1 |
t1 _ self ownerThatIsA: ScratchFrameMorph.
t1 saveScratchProjectWhat it does:
opens the save project as dialog and lets you save it!
what the blockspec says is different from what the block picture says.
Shared by bbbeb
blockspec:'Press Green Flag' - pressGreenFlag
code
pressGreenFlag
#pressGreenFlagButtonWhat it does:
triggers all scripts starting with a "when green flag clicked" hat.
you know this is for the source code, right?
for regular scratch, it would be like this:
'Press Green Flag' #- #pressGreenFlag
Shared by zorket
blockspec:('go to scratch website...' #- #link)
code
link
Cursor wait showWhile: [ScratchPlugin primOpenURL: 'http://scratch.mit.edu/']What it does:
Opens the Scratch homepage!
the blockspec says 'go to scratch website...' but the block says 'open scratch homepage'. fix!
Shared by zorket (made by rubiks_cube_guy238)
blockspec:(I recieve %e' #b #seesBroadcast)
code
seesBroadcast: t1
| t2 |
t2 _ ScratchEvent allInstances.
t2
reverseDo:
[:t3 |
t3 name = t1 ifTrue: [^ true].
nil].
^ falseWhat it does:
lets you test to see if a broadcast is being sent. Much sought after and requested.
now i know that <broadcast received?> (receive! i before e except after c) is proper boolean statement, but the block is telling the thought-of <i receive>.
and, this won't work.
proper blockspec:
(%e received?' #b #seesBroadcast:)
Shared by midnightleopard
blockspec:('%j %s' #- #doThis:on:)
code (place under sensing ops)
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].
^ 0Code (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'last bit of code (scratch objects -> scriptable scratch morph -> sensing ops ->)
engineNames
^ #('google' 'yahoo' 'scratch.mit.edu/' 'search scratch for' 'IMDB' 'load' )What it does:
lets you search google, yahoo!, the scratch site, scratch.mit.edu and IMDB! (opens your default web browser)
why have it replace all if there are other times you want dropdown menus? and why is this one of the few times you use the [code] tag? just have it:
Code (scratch blocks -> command block morph -> private -> uncoloredArgMorphFor:
then add a line:
$j = t2 ifTrue: [^ ChoiceArgMorph new getOptionsSelector: #engineNames; choice: 'google'].
Shared by lots of people
blockspec:'clone me' #- #duplicateNoAttach
no code needed
What it does:
This block creates a clone of the sprite that runs it.Note: this block does not work in presentation mode.
Shared by lots of people
blockspec:'delete me' #- #undoableDeleteSprite
no code needed
What it does:
This block permenantly deletes the sprite that runs it.Note: this block does not work in presentation mode.
Shared by Zorket
Blockspec:('set single stepping' #- #setSpeed)
Code:
setSpeed
| t1 t2 |
t1 _ CustomMenu new title: 'Single-step speed?'.
t1 add: 'Turbo speed' action: 0.
t1 add: 'Normal' action: 1.
t1 add: 'Flash blocks (fast)' action: 30.
t1 add: 'Flash blocks (slow)' action: 200.
t2 _ t1 localize startUp.
t2 ifNil: [^ self].
ScratchProcess blockHighlightMSecs: t2What it does:
This block lets you change the speed of your project! Very useful when you want a mix of fast computing and good graphics.
Shared by Pecola1
Blockspec:('show cursor' #- #showCursor)
Code:
showCursor
World activeHand showTemporaryCursor: nilWhat it does:
Shows the cursor (use with hide cursor block below).
Shared by Pecola1
Blockspec:('hide cursor' #- #hideCursor)
Code:
hideCursor
World activeHand showTemporaryCursor: ((Form extent: 1 @ 1 depth: 32)
fillColor: Color transparent)What it does:
hides the cursor.
^ Back to Scratch Blocks
^ Back to Contents
thanks.
Last edited by scimonster (2011-01-19 02:53:59)
Offline
erm....
the discrepencies between block image and blockspec are when someone else gave me the block image and I decided a better wording for the block could be found.
I use the code rather than quote tag whenever the code is longer than a code space, to save space on the thread, but use a quote otherwise because that saves space without the extra line that says code..
I see no problem with the layout of the received block, though you're correct about the spelling.
I can't say I spend any particular care on spelling or grammar while creating these threads, so the spelling and grammar throughout are my normal, unchecked standard. There are probably quite a few mistakes here and there but for now, provided i dont start typin lik this i think its not 2 much of a prob.
Offline
I would like to share the time/date block: (shared by me, made by LS97. see here)
Block spec:
('get %s' #r #getTime: 'date')
getTime: t1 t1 = 'date' ifTrue: [^ Date today]. t1 = 'short date' ifTrue: [^ Date today printFormat: #(1 2 3 $- 2 2 )]. t1 = 'time' ifTrue: [^ Time now]. t1 = 'seconds' ifTrue: [^ Time now seconds]. t1 = 'minutes' ifTrue: [^ Time now minutes]. t1 = 'hours' ifTrue: [^ Time now hours]. t1 = 'day' ifTrue: [^ Date today weekday]. t1 = 'help' ifTrue: [^ 'type date, short date, time, seconds, minutes, day, hours']. ^ 'Error!'
EDIT: Oops, already in sensing category.
EDIT #2: Another one:
(made by LS97, same forum as above)
keyPressed (Sensor keyPressed: 65) ifTrue: [^ 'a']. (Sensor keyPressed: 66) ifTrue: [^ 'b']. (Sensor keyPressed: 67) ifTrue: [^ 'c']. (Sensor keyPressed: 68) ifTrue: [^ 'd']. (Sensor keyPressed: 69) ifTrue: [^ 'e']. (Sensor keyPressed: 70) ifTrue: [^ 'f']. (Sensor keyPressed: 71) ifTrue: [^ 'g']. (Sensor keyPressed: 72) ifTrue: [^ 'h']. (Sensor keyPressed: 73) ifTrue: [^ 'i']. (Sensor keyPressed: 74) ifTrue: [^ 'j']. (Sensor keyPressed: 75) ifTrue: [^ 'k']. (Sensor keyPressed: 76) ifTrue: [^ 'l']. (Sensor keyPressed: 77) ifTrue: [^ 'm']. (Sensor keyPressed: 78) ifTrue: [^ 'n']. (Sensor keyPressed: 79) ifTrue: [^ 'o']. (Sensor keyPressed: 80) ifTrue: [^ 'p']. (Sensor keyPressed: 81) ifTrue: [^ 'q']. (Sensor keyPressed: 82) ifTrue: [^ 'r']. (Sensor keyPressed: 83) ifTrue: [^ 's']. (Sensor keyPressed: 84) ifTrue: [^ 't']. (Sensor keyPressed: 85) ifTrue: [^ 'u']. (Sensor keyPressed: 86) ifTrue: [^ 'v']. (Sensor keyPressed: 87) ifTrue: [^ 'w']. (Sensor keyPressed: 88) ifTrue: [^ 'x']. (Sensor keyPressed: 89) ifTrue: [^ 'y']. (Sensor keyPressed: 90) ifTrue: [^ 'z']. (Sensor keyPressed: 32) ifTrue: [^ 'space']. (Sensor keyPressed: 1) ifTrue: [^ 'home']. (Sensor keyPressed: 4) ifTrue: [^ 'end']. (Sensor keyPressed: 5) ifTrue: [^ 'insert']. (Sensor keyPressed: 9) ifTrue: [^ 'tab']. (Sensor keyPressed: 11) ifTrue: [^ 'page up']. (Sensor keyPressed: 12) ifTrue: [^ 'page down']. (Sensor keyPressed: 127) ifTrue: [^ 'delete']. ^ 'none'
('key pressed' #r #keyPressed)
I'm in a hurry.
Last edited by comp500 (2011-01-05 03:29:13)
Offline
comp500 wrote:
I would like to share the time/date block: (shared by me, made by LS97. see here)
Block spec:
('get %s' #r #getTime: 'date')Code:
getTime: t1 t1 = 'date' ifTrue: [^ Date today]. t1 = 'short date' ifTrue: [^ Date today printFormat: #(1 2 3 $- 2 2 )]. t1 = 'time' ifTrue: [^ Time now]. t1 = 'seconds' ifTrue: [^ Time now seconds]. t1 = 'minutes' ifTrue: [^ Time now minutes]. t1 = 'hours' ifTrue: [^ Time now hours]. t1 = 'day' ifTrue: [^ Date today weekday]. t1 = 'help' ifTrue: [^ 'type date, short date, time, seconds, minutes, day, hours']. ^ 'Error!'EDIT: Oops, already in sensing category.
EDIT #2: Another one:
(made by LS97, same forum as above)Code:
keyPressed (Sensor keyPressed: 65) ifTrue: [^ 'a']. (Sensor keyPressed: 66) ifTrue: [^ 'b']. (Sensor keyPressed: 67) ifTrue: [^ 'c']. (Sensor keyPressed: 68) ifTrue: [^ 'd']. (Sensor keyPressed: 69) ifTrue: [^ 'e']. (Sensor keyPressed: 70) ifTrue: [^ 'f']. (Sensor keyPressed: 71) ifTrue: [^ 'g']. (Sensor keyPressed: 72) ifTrue: [^ 'h']. (Sensor keyPressed: 73) ifTrue: [^ 'i']. (Sensor keyPressed: 74) ifTrue: [^ 'j']. (Sensor keyPressed: 75) ifTrue: [^ 'k']. (Sensor keyPressed: 76) ifTrue: [^ 'l']. (Sensor keyPressed: 77) ifTrue: [^ 'm']. (Sensor keyPressed: 78) ifTrue: [^ 'n']. (Sensor keyPressed: 79) ifTrue: [^ 'o']. (Sensor keyPressed: 80) ifTrue: [^ 'p']. (Sensor keyPressed: 81) ifTrue: [^ 'q']. (Sensor keyPressed: 82) ifTrue: [^ 'r']. (Sensor keyPressed: 83) ifTrue: [^ 's']. (Sensor keyPressed: 84) ifTrue: [^ 't']. (Sensor keyPressed: 85) ifTrue: [^ 'u']. (Sensor keyPressed: 86) ifTrue: [^ 'v']. (Sensor keyPressed: 87) ifTrue: [^ 'w']. (Sensor keyPressed: 88) ifTrue: [^ 'x']. (Sensor keyPressed: 89) ifTrue: [^ 'y']. (Sensor keyPressed: 90) ifTrue: [^ 'z']. (Sensor keyPressed: 32) ifTrue: [^ 'space']. (Sensor keyPressed: 1) ifTrue: [^ 'home']. (Sensor keyPressed: 4) ifTrue: [^ 'end']. (Sensor keyPressed: 5) ifTrue: [^ 'insert']. (Sensor keyPressed: 9) ifTrue: [^ 'tab']. (Sensor keyPressed: 11) ifTrue: [^ 'page up']. (Sensor keyPressed: 12) ifTrue: [^ 'page down']. (Sensor keyPressed: 127) ifTrue: [^ 'delete']. ^ 'none'Code:
('key pressed' #r #keyPressed)I'm in a hurry.
they are both there, i think.
Offline
sparks wrote:
I see no problem with the layout of the received block, though you're correct about the spelling.
the problem is that it is looking for the method #seesBroadcast while the existing method is #seesBroadcast:
see the : at the end?
Last edited by scimonster (2011-01-05 08:57:08)
Offline
the updates history logo needs updating. just notifying you, sparks
Offline
sparks wrote:
Yes, sorry comp, they're already in the library but thanks all the same for your contribution
Where is the second one?
Offline
comp500 wrote:
sparks wrote:
Yes, sorry comp, they're already in the library but thanks all the same for your contribution
Where is the second one?
it seems the (key pressed) one is actually BYOB.
i think they can be added to scratch blocks.
Offline
scimonster wrote:
comp500 wrote:
sparks wrote:
Yes, sorry comp, they're already in the library but thanks all the same for your contribution
Where is the second one?
it seems the (key pressed) one is actually BYOB.
i think they can be added to scratch blocks.
yep. And maybe panther.(if it hasn't been done already)
Offline
comp500 wrote:
scimonster wrote:
comp500 wrote:
Where is the second one?it seems the (key pressed) one is actually BYOB.
i think they can be added to scratch blocks.yep. And maybe panther.(if it hasn't been done already)
do you know Squeak?
Offline
A byob one:
Project:
and-or.ypr
Offline
ProgrammingFreak wrote:
comp500 wrote:
scimonster wrote:
it seems the (key pressed) one is actually BYOB.
i think they can be added to scratch blocks.yep. And maybe panther.(if it hasn't been done already)
do you know Squeak?
A little bit, but I know how to mess around with it and make simple blocks
Offline
comp500 wrote:
ProgrammingFreak wrote:
comp500 wrote:
yep. And maybe panther.(if it hasn't been done already)do you know Squeak?
A little bit, but I know how to mess around with it and make simple blocks
cool i want to learn it
Offline
comp500 wrote:
A byob one:
http://img267.imageshack.us/img267/2176/andor.gif
http://img573.imageshack.us/img573/5561/andor1.gif
Project:
and-or.ypr
If we look at this using a truth table we can see that this is the same as an OR block.
AND: 1 2 out
true true true
true false false
false true false
false false false
OR: 1 2 out
true true true
true false true
false true true
false false false
AND/OR: 1 2 out
true true true
true false true
false true true
false false false
So sadly it already exists nice idea though
Offline
sparks wrote:
erm....
the discrepencies between block image and blockspec are when someone else gave me the block image and I decided a better wording for the block could be found.
I use the code rather than quote tag whenever the code is longer than a code space, to save space on the thread, but use a quote otherwise because that saves space without the extra line that says code..
I see no problem with the layout of the received block, though you're correct about the spelling.
I can't say I spend any particular care on spelling or grammar while creating these threads, so the spelling and grammar throughout are my normal, unchecked standard. There are probably quite a few mistakes here and there but for now, provided i dont start typin lik this i think its not 2 much of a prob.
The received block has to have a ':' in it.
Nice idea with the quote/tagging.
Do you mean you use the image people give you? I wouldn't know cuz all of mine are from imageshack. But it does mean you didn't just copy the img url I used.
spallin' lik dis idn't two bad id ip? i maen wen dit cumes to takin like dis i doo it perfactly! i are good at mat 2:
(( 1 <+> 1 ))<=> 55billion )>
<< <not> (( 1 <+> 1 )) <=> 2 )> >>
__________________________________
I don't like it when I talk like that
Offline
.... you sound just like someone taking no care in their spelling at all! The most annoying ones for me are the misspellings that are as many characters long as the correct spelling
like cos and cuz.
Why did you highlight "discrepencies"?
Offline
sparks wrote:
Why did you highlight "discrepencies"?
You mean Discrepancies
--edit--
Last edited by Pecola1 (2011-01-05 17:22:47)
Offline
sparks wrote:
comp500 wrote:
A byob one:
http://img267.imageshack.us/img267/2176/andor.gif
http://img573.imageshack.us/img573/5561/andor1.gif
Project:
and-or.yprIf we look at this using a truth table we can see that this is the same as an OR block.
AND: 1 2 out
true true true
true false false
false true false
false false false
OR: 1 2 out
true true true
true false true
false true true
false false false
AND/OR: 1 2 out
true true true
true false true
false true true
false false false
So sadly it already exists nice idea though
Ahh.
Well I didn't know this becouse:
1. I thought OR meant either and AND meant both so AND/OR meant both or either.
2. I never test things.
3. I don't know what a truth table is.
Offline
sparks wrote:
Yes, sorry comp, they're already in the library but thanks all the same for your contribution
The second one isn't in panther or scratch, just byob.
Offline
sparks wrote:
Shared by Pecola1.
Blockspec:('report %b or %b randomly' #b #booleanRandom:Or:)
Code:
booleanRandom: t1 Or: t2
| t3 |
t3 _ self randomFrom: 0 to: 1.
t3 = 1 ifTrue: [^ t1].
^ t2What it does:
Reports it's contents. Useful for putting text in areas where it normally can't go. (such as the [go to $Sprites$] block.
NOT WHAT IT DOES!!!!
and also have it %m for scratch.
it should say:
Reports either of the booleans randomly
Offline