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 saveScratchProject
What it does:
Opens the save project as dialog and lets you save it!
Shared by bbbeb
blockspec:
('press green flag' #- #pressGreenFlag)
code:
pressGreenFlag
#pressGreenFlagButton
What it does:
Triggers all scripts starting with a "when green flag clicked" hat. Note: This block is glitched, it won't work on a when flag clicked hat block, instead you can use 'self broadcast: 'Scratch-StartClicked' ' (info)
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!
Shared by rubiks_cube_guy238
blockspec:
('%e received?' #b #seesBroadcast:)
code
seesBroadcast: t1
| t2 |
t2 _ ScratchEvent allInstances.
t2
reverseDo:
[:t3 |
t3 name = t1 ifTrue: [^ true].
nil].
^ false
What it does:
Lets you test to see if a broadcast is being sent. Much sought after and requested.
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 permanently 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: t2
What 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: nil
What 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 (use with show cursor block above).
Shared by Pecola1
Blockspec:
('enable programmer facilities' #- #enableProgrammerFacilities)
Code:
enableProgrammerFacilities
Preferences enableProgrammerFacilities
What it does:
Enables the programmer facilities (info).
Shared by Pecola1
Blockspec:
('disable programmer facilities' #- #disableProgrammerFacilities)
Code:
disableProgrammerFacilities
Preferences disableProgrammerFacilities
What it does:
Disables the programmer facilities. Note: do not use until you make the enable programming facilities block. (info)
Shared by Pecola1
Blockspec:
('quit Scratch' #- #exitScratch)
Code:
exitScratch
Smalltalk snapshot: false andQuit: true
What it does:
Closes Scratch. Either save the image before testing it, or test and add it again after you reopen it.
How to make it a cap block:
1) Go to Scratch-Blocks >> CommandBlockMorph >> accessing >> isStop
2) Add the following code:
| (selector = #whatYourMethodIsCalled)
Shared by Pecola1
Blockspec:
('reverse' #c #doBackwards)
Code (Scratch-Execution Engine»ScratchProcess»private-special forms):
doBackwards
| t1 t2 |
t1 _ stackFrame expression.
t2 _ stackFrame arguments.
self popStackFrame.
self pushStackFrame: (ScratchStackFrame new expression: t1 firstBlockList reversed)
What it does:
Runs the blocks in the input backwards (if you had [say [hello]] [move (10) steps] it would do [move (10) steps] [say [hello]]) Note: Any C-block goes under Scratch-Execution Engine»ScratchProcess»private-special forms
Shared by Pecola1
Blockspec:
('shuffle' #c #doScramble)
Code (Scratch-Execution Engine»ScratchProcess»private-special forms):
doScramble
| t1 t2 |
t1 _ stackFrame expression.
t2 _ stackFrame arguments.
self popStackFrame.
self pushStackFrame: (ScratchStackFrame new expression: t1 firstBlockList shuffled)
What it does:
Runs the blocks in the input in a random order.
Shared by Pecola1
Blockspec:
('run' #c #doForwards)
Code (Scratch-Execution Engine»ScratchProcess»private-special forms):
doForwards
| t1 t2 |
t1 _ stackFrame expression.
t2 _ stackFrame arguments.
self popStackFrame.
self pushStackFrame: (ScratchStackFrame new expression: t1 firstBlockList)
What it does:
Runs the blocks in the input. Useful only in the scramble and reverse blocks.
Shared by zorket, based on the block by Pecola1
Blockspec:
('close Scratch' #- #quitScratch)
Code:
quitScratch
| t1 |
t1 _ self ownerThatIsA: ScratchFrameMorph.
t1 quitScratch
What it does:
Acts like if you click the "X" in the top right corner (Windows). See the quit Scratch block by Pecola1 for instructions on making a cap.
Shared by ProgrammingFreak, improved by Hardmath123, improved by Scimonster
Blockspec:
('Go to url %s . Http prefix included? %b' #- #gotourl:httpIncluded: 'scratch.mit.edu')
Code:
gotourl: t1 httpIncluded: t2
| url |
url _ t1.
t2 ifFalse: [url _ 'http://' , t1].
Cursor wait showWhile: [ScratchPlugin primOpenURL: url]
What it does:
This block opens a URL and adds the http:// prefix if the boolean is false (or empty).
Shared by Hardmath123
Blockspec:
('Open the %n th forum page' #- #openForum: 58790)
Code:
openForum: url
Cursor wait showWhile: [ScratchPlugin primOpenURL: http://scratch.mit.edu/forums/viewtopic.php?id=' , url asString]
What it does:
Opens the Scratch forums topic with the inputted ID.
Default value is the Block Library.
Shared by Hardmath123
Blockspec:
('Post on the %nth forum topic' #- #postForum: 58790)
Code:
postForum: t1
Cursor wait showWhile: [ScratchPlugin primOpenURL: http://scratch.mit.edu/forums/post.php?tid=' , t1 asString]
What it does:
Opens the post dialog for the specified forum ID.
Default value is the Block Library.
Shared by Hardmath123
Blockspec:
('pause' #- #pause)
Code:
pause
DialogBoxMorph warn: 'Paused: Click OK to continue'
What it does:
Opens a dialog box that says "Paused: Click OK to continue."
Shared by jslomba, improved by TheSuccessor
Blockspec:
('' #W #-)
Code:
ScratchFrameMorph->processWhenConditions and
OffscreenWorldMorph->processWhenConditions
Delete this line:
true ifTrue: [^ self]
Shared by jslomba, based on the Panther block by Sparks
Blockspec:
('open scratch user %s s my stuff page ' #- #Userlink:)
Code:
Userlink: t1
Cursor wait showWhile: [ScratchPlugin primOpenURL: 'http://scratch.mit.edu/users/' , t1 asString]
What this block does:
Opens the my stuff page of the entered user.
Shared by SSSS
Blockspec:
('Import theme %s') #- #themepacks:)
Code:
themepacks: t1
ScratchFrameMorph readSkinFrom: (FileDirectory default directoryNamed: t1)
What this block does:
You download the ScratchSkin, edit it, then you can use this block to import the skin during a project.
Shared by Pecola1
Blockspec:
('add %s to clipboard' #- #copy:)
Code:
copy: t1
ScratchTranslator unicodeClipboardPut: t1
What this block does:
Adds the text to your clipboard!
^ Back to Scratch Blocks
^ Back to Contents
█ █ █ █ █ █ █ █
Last edited by YourLocalBlockLib (2011-09-09 03:49:35)
Offline