I don't know the code for this block and I don't have the image.
Here is it.
It's a sensing block and here is it's string.
Question.
It reports the last question asked with the ask blocks.
Offline
computerexpertFELIX wrote:
I don't know the code for this block and I don't have the image.
Here is it.
It's a sensing block and here is it's string.
Question.
It reports the last question asked with the ask blocks.
I could make it.
Offline
Hey Sparks, you know panther, how did you get the toggle button for block making there, I have all the needed files, but I need to know how to get the button there. , oh and what procedures do you go through to add new categories , if you don't know or can't tell me that's fine
Last edited by P110 (2012-06-09 09:41:10)
Offline
lol i just noticed the panther "download block" block gives you a message that says "sucess!"
Offline
REQUEST: A scratch block that opens the paint editor.
Offline
fetchydog567 wrote:
REQUEST: A scratch block that opens the paint editor.
Not sure if this has been done already, but:
('open paint editor' #- #editDrawing)
No code.
Offline
YourLocalBlockLib wrote:
http://dl.dropbox.com/u/6273449/BlockLibraryTitle.png
^Back to Scratch blocks
http://scratch.mit.edu/redirect/url?lin … ibDiv2.png
http://scratch.mit.edu/redirect/url?lin … 621999.png
http://scratch.mit.edu/redirect/url?lin … ibDiv2.png
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
I looked at the new method it added to the system browser. It appears it gets Smalltalk code from the file and files it in. That means you could make a fake block file that installs new morph types or deletes everything in the entire image file!!!!! On Panther to access the things you do with Shift-Click R on Scratch you use the source image wich has a menu called 'Dev'. So it could also do some like install this block:
[!random colorina!](supposed to be a color block.)
Offline
YourLocalBlockLib wrote:
Can't see images in the block library? Hopelessly unable to browse our collection of over 350 blocks? All you need to do is install Rookwood101's Antidiote script and you'll soon be able to see once more!
http://dl.dropbox.com/u/6273449/BlockLibraryTitle.png
.
. http://scratch.mit.edu/redirect/url?lin … 826509.gif
. http://scratch.mit.edu/redirect/url?lin … 041909.gif
. http://scratch.mit.edu/redirect/url?lin … 428862.gif
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!
Can I use these blocks in my Scratch Modification?
Just click on one of the block images below to find blocks for Scratch, BYOB and Panther!
http://scratch.mit.edu/redirect/url?lin … 942334.gif
http://scratch.mit.edu/redirect/url?lin … 732043.gif
http://scratch.mit.edu/redirect/url?lin … 967135.gif
So to all you curious Scratchers and viewers alike, I bid you welcome. Welcome to the Library!
http://scratch.mit.edu/redirect/url?lin … 841103.gif
Your Local Block Library Block Count:
http://scratch.mit.edu/redirect/url?lin … ratch1.gifhttp://scratch.mit.edu/redirect/url?lin … 449/s1.gifhttp://scratch.mit.edu/redirect/url?lin … 449/s6.gifhttp://scratch.mit.edu/redirect/url?lin … 449/s7.gifhttp://scratch.mit.edu/redirect/url?lin … ratch2.gif http://scratch.mit.edu/redirect/url?lin … /byob1.gifhttp://scratch.mit.edu/redirect/url?lin … 449/b1.gifhttp://scratch.mit.edu/redirect/url?lin … 449/b4.gifhttp://scratch.mit.edu/redirect/url?lin … 449/b3.gifhttp://scratch.mit.edu/redirect/url?lin … /byob2.gif http://scratch.mit.edu/redirect/url?lin … nther1.gifhttp://scratch.mit.edu/redirect/url?lin … 449/p6.gifhttp://scratch.mit.edu/redirect/url?lin … 449/p0.gifhttp://scratch.mit.edu/redirect/url?lin … nther2.gif
_________________________________
Want to add to the library? Please do! Comment below for it to be added.
_________________________________
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=Pecola1 Pecola1 About Pecola1
http://blocks.scratchr.org/libstatus.ph … scimonster Scimonster About Scimonster
http://blocks.scratchr.org/libstatus.ph … meowmeow55 Meowmeow55
http://blocks.scratchr.org/libstatus.php?user=Greenatic Greenatic About Greenatic
http://blocks.scratchr.org/libstatus.ph … ype=square YourLocalBlockLib The Block Library Experience
Past Librarians
http://blocks.scratchr.org/libstatus.ph … esuccessor Thesuccessor About Thesuccessor
Special thanks to coolstuff for pushing to get this Itopiced, fullmoon for helping with the account, nXIII for doing a lot of the excellent graphics and everyone who posted their block code and asked for this to be Itopiced, we couldn't have done it without you!
Read Also: Our Scratch Wiki Page
Did you say just post to request a scratchblock?
the blockspec is ('one item menu %s' #- #oneItemMenu:)
the procedure is called oneItemMenu:
it's code is
oneItemMenu: t1 | menu | menu _ customMenu new. menu add: t1.
do tab instead of the spaces (tab is what you get when you press the tab key.)
Offline
Jonathan50 wrote:
Did you say just post to request a scratchblock?
the blockspec is ('one item menu %s' #- #oneItemMenu:)
the procedure is called oneItemMenu:
it's code isCode:
oneItemMenu: t1 | menu | menu _ customMenu new. menu add: t1.do tab instead of the spaces (tab is what you get when you press the tab key.)
Try to avoid quoting the entire first post--it's huge.
That method won't work, for multiple reasons:
1. It's CustomMenu, not customMenu.
2. There needs to be an action: for the add: method. See below method.
3. There's nothing to start-up the list.
Try this method instead:
oneItemMenu: t1 | menu | menu _ CustomMenu new. menu add: t1 action: ''. ^ menu localize startUp
Offline
or you could use this block
('menu from list' #r #menuFromList:) ======================================================================== menuFromList: t1 | t3 | t3 _ CustomMenu new. (self listNamed: t1 ifNone: [^ '']) listContents do: [:t2 | t2 asString = '#-' ifTrue: [t3 addLine] ifFalse: [t3 add: t2 asString action: t2 asString].]. ^ t3 startUp
adding '#-' to your list adds a line to the menu.
Offline
the last question asked block would require an instance variable to be added but otherwise it's pretty simple.
declare the variable lastQuestion by typing this code and doing it
ScriptableScratchMorph addInstVarName: 'lastQuestion'
blockspec
('last question' #r #lastQuestion)
ScriptableScratchMorph
lastQuestion ^ lastQuestion
ScriptableScratchMorph
lastQuestion: t1 ^ lastQuestion
ScratchProcess
doAsk "Ask the user a question and wait until the user types some text and hits the accept button." | block args question prompter | block _ stackFrame expression. args _ stackFrame arguments. "first time (args size = 0): open prompter" args size = 0 ifTrue: [ block receiver promptInProgress ifTrue: [ self pushStackFrame: (ScratchStackFrame new shouldYield: true). ^ self]. question _ block args first asString. prompter _ block receiver promptForInput: question] ifFalse: [ prompter _ args first]. "if all processes have stopped, pop this frame and we're done." prompter isDone ifTrue: [^ self popStackFrame]. "Set up the wait loop. We need to: 1. yield to another process 2. evaluate the termination expression again Push these onto stack in reverse order." "2. evaluate this block again" "(Remove the current frame and replace it with one that will force the termination expression to be re-evaluated.)" self popStackFrameNoUnhightlight. self pushStackFrame: (ScratchStackFrame new expression: block; addArgument: prompter). stackFrame expression receiver lastQuestion: question. "1. yield to another process" self pushStackFrame: (ScratchStackFrame new shouldYield: true).
Offline
Requset:
[close scratch]
Offline
fetchydog567 wrote:
Requset:
[close scratch]
That block already exists:
Shared by Pecola1
Blockspec:Code:
('quit Scratch' #- #exitScratch)Code:
Code:
exitScratch Smalltalk snapshot: false andQuit: trueWhat 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)
Offline
exit panther
Offline
fetchydog567 wrote:
exit panther
Exit Panther uses the same code as the exit Scratch block. You can just change the blockspec to make the block say "exit Panther" instead of "exit Scratch".
Offline
P110 wrote:
P110 wrote:
P110 wrote:
hey I really need help with these blocks. Thanks!
stop quoting yourself!
Find out how to mod BYOB!!!
Offline
in spanish?
Offline
777w wrote:
in spanish?
I have tried! But I can't! I'll try again...
Offline