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

#1226 2011-01-19 18:10:30

Pecola1
Scratcher
Registered: 2010-09-06
Posts: 1000+

Re: Welcome to the OLD local block library!

hpotter134 wrote:

This is a great topic! I have a question though. I want to add motion blocks to the Stage . (mainly, the 'make %m move %n steps), but it always says "Stage selected: No motion blocks". How can I add motion blocks to the Stage?

Go to Scratch blocks ScriptableStageMorph class block specs blockspecs for the block then for the code jump to instance and go to other opp or whatever your block fits into (doesn't effect code but is for organizing use)
For Sprite only blocks go to Scratch blocks ScriptableSpriteMorph class block specs blockspecs for the block then for the code jump to instance
For both go to Scratch blocks ScriptableScratchMorph class block specs blockspecs for the block then for the code jump to instance

If you are talking about BYOB then you cannot make sprite only blocks but you can do for this sprite only.

Last edited by Pecola1 (2011-01-19 19:01:02)


If you are reading this, please read to the end, because if you don't you won't know what's at the end. Don't just skip to the end though otherwise you won't be able to read the middle, which is most important. Now you must be wondering why you just read all that, the reason is you may have not noticed something, read it again and see if you notice it this time  smile

Offline

 

#1227 2011-01-19 18:47:47

ssss
Scratcher
Registered: 2007-07-29
Posts: 1000+

Re: Welcome to the OLD local block library!

Pecola1 wrote:

hpotter134 wrote:

This is a great topic! I have a question though. I want to add motion blocks to the Stage . (namely, the 'make %m move %n steps), but it always says "Stage selected: No motion blocks". How can I add motion blocks to the Stage?

Go to Scratch blocks ScriptableStageMorph class block specs blockspecs for the block then for the code jump to instance and go to other opp or whatever your block fits into (doesn't effect code but is for organizing use)
For Sprite only blocks go to Scratch blocks ScriptableSpriteMorph class block specs blockspecs for the block then for the code jump to instance
For both go to Scratch blocks ScriptableScratchMorph class block specs blockspecs for the block then for the code jump to instance

If you are talking about BYOB then you cannot make sprite only blocks but you can do for this sprite only.

i didn't know that about byob  yikes


Hey.  It's me SSSS, back from the dead!  smile

Offline

 

#1228 2011-01-21 18:03:24

Pecola1
Scratcher
Registered: 2010-09-06
Posts: 1000+

Re: Welcome to the OLD local block library!

Sparks, I am working on a code for making you able to not have to make all the blocks and so it would upload all the blocks from the block library! Could you help? We can make a website that will have only text saying ('name of a new block' #type of block #method) so that we can make it upload new blocks by reading the html of the website and putting it into a method something like

uploadingNewBlockSpecs
^ readContentsOfFileAtUrl: libraryscratchblocks.com

It would be a lot more complicated but thats what we can do. I don't know how we would make it read a method though.

Last edited by Pecola1 (2011-01-21 18:04:06)


If you are reading this, please read to the end, because if you don't you won't know what's at the end. Don't just skip to the end though otherwise you won't be able to read the middle, which is most important. Now you must be wondering why you just read all that, the reason is you may have not noticed something, read it again and see if you notice it this time  smile

Offline

 

#1229 2011-01-21 18:29:39

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

Re: Welcome to the OLD local block library!

I'm not quite sure I  know what you're trying to say, Pecola  hmm


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

Offline

 

#1230 2011-01-21 18:30:24

ssss
Scratcher
Registered: 2007-07-29
Posts: 1000+

Re: Welcome to the OLD local block library!

sparks wrote:

I'm not quite sure I  know what you're trying to say, Pecola  hmm

Pecola is working on a way, to import every block in the block library, instead of having to edit the code  wink


Hey.  It's me SSSS, back from the dead!  smile

Offline

 

#1231 2011-01-21 19:31:20

Marioblender
Scratcher
Registered: 2010-04-04
Posts: 31

Re: Welcome to the OLD local block library!

Do you think you could use <sprite %m is %b> to report the action of another sprite?

Offline

 

#1232 2011-01-21 19:34:53

Pecola1
Scratcher
Registered: 2010-09-06
Posts: 1000+

Re: Welcome to the OLD local block library!

sparks wrote:

I'm not quite sure I  know what you're trying to say, Pecola1  hmm

I cannot figure out how to do it quite yet but by making a website, and making the methods for the read file from url blocks, you could make Scratch read from the webpage (like the panther one) but instead you can make a block specs area like the obsoleteBlockSpecs and under blockSpecs by the self obsoleteBlockSpecs you could put websiteBlockSpecs which would read what is on the website and it would make those blocks go under block specs. The only thing is I cannot figure out how to make something make a method (like when you have the panther blocks make a method for them) If I knew how to do that then i could finish. So far i have for what the website would be like:

'control'
'show mouse cursor'
#-
#showCursor

Then under websiteBlockSpecs

websiteBlockSpecs
^( readLine: 1 fromUrl: whateverIwillNamethewebsite.com ( readLine: 2 fromUrl: whateverIwillNamethewebsite.com readLine: 3 fromUrl: whateverIwillNamethewebsite.com readLine: 3 fromUrl: whateverIwillNamethewebsite.com ) )

Could anyone help me? I am also doing this for RKT me ProgrammingFreak and ESN's mod.

Last edited by Pecola1 (2011-01-21 20:05:29)


If you are reading this, please read to the end, because if you don't you won't know what's at the end. Don't just skip to the end though otherwise you won't be able to read the middle, which is most important. Now you must be wondering why you just read all that, the reason is you may have not noticed something, read it again and see if you notice it this time  smile

Offline

 

#1233 2011-01-21 19:41:20

Pecola1
Scratcher
Registered: 2010-09-06
Posts: 1000+

Re: Welcome to the OLD local block library!

Pecola1 wrote:

New Panther block (the following is not a joke)

Code:

Pecola1
obsolete!
-
#FF0000
self error

Or
First box

obsolete!

second box

-

third box

self error

and the color is red

Aheeeem, I was not being sarcastic.


If you are reading this, please read to the end, because if you don't you won't know what's at the end. Don't just skip to the end though otherwise you won't be able to read the middle, which is most important. Now you must be wondering why you just read all that, the reason is you may have not noticed something, read it again and see if you notice it this time  smile

Offline

 

#1234 2011-01-21 19:42:40

Pecola1
Scratcher
Registered: 2010-09-06
Posts: 1000+

Re: Welcome to the OLD local block library!

Marioblender wrote:

Do you think you could use <sprite %m is %b> to report the action of another sprite?

possibly, I don't know the code


If you are reading this, please read to the end, because if you don't you won't know what's at the end. Don't just skip to the end though otherwise you won't be able to read the middle, which is most important. Now you must be wondering why you just read all that, the reason is you may have not noticed something, read it again and see if you notice it this time  smile

Offline

 

#1235 2011-01-21 19:48:19

Pecola1
Scratcher
Registered: 2010-09-06
Posts: 1000+

Re: Welcome to the OLD local block library!

Pecola1 wrote:

BLOCK REQUEST
Make a (Instrument) reporter. The problem: There is no way scratch really can tell (correct me if i'm wrong) what instrument to play except for set instrument to otherwise it has when you play a note well... I am not sure how to decode it into human language but it pretty much says: Play instrument
And i cannot see where there is a place where it can tell the instrument!


If you are reading this, please read to the end, because if you don't you won't know what's at the end. Don't just skip to the end though otherwise you won't be able to read the middle, which is most important. Now you must be wondering why you just read all that, the reason is you may have not noticed something, read it again and see if you notice it this time  smile

Offline

 

#1236 2011-01-21 19:58:24

Pecola1
Scratcher
Registered: 2010-09-06
Posts: 1000+

Re: Welcome to the OLD local block library!

http://www.weebly.com/uploads/5/4/1/3/5413503/7131686.gif?366
I have been working for a long time.
Blockspec:

('%B for %m' #b #getBooleanAttribute:of:)

Go to Scratch-blocks CommandBlockMorph all uncoloredArgMorphFor:
And add the strip:

Code:

$B = t2 ifTrue: [^ ChoiceArgMorph new getOptionsSelector: #booleanAttributeNames;
         choice: 'pen down?']

Heres the method:

Code:

getBooleanAttribute: t1 of: t2
    | t3 |
    t3 _ self coerceSpriteArg: t2.
    (t3 isKindOf: ScriptableScratchMorph)
        ifFalse: [^ false].
    'pen down?' localized = t1 ifTrue: [^ t3 penDown].
    'draggable?' localized = t1 ifTrue: [^ t3 draggable].
    'is a clone?' localized = t1 ifTrue: [^ t3 isClone].
    ^ false

Its weird that the simplest thing stopped me! Credit to rubiks_cube_guy238 for showing me I needed the
of: t2
    | t3 |
    t3 _ self coerceSpriteArg: t2.
    (t3 isKindOf: ScriptableScratchMorph)
        ifFalse: [^ false].

Last edited by Pecola1 (2011-01-22 14:49:09)


If you are reading this, please read to the end, because if you don't you won't know what's at the end. Don't just skip to the end though otherwise you won't be able to read the middle, which is most important. Now you must be wondering why you just read all that, the reason is you may have not noticed something, read it again and see if you notice it this time  smile

Offline

 

#1237 2011-01-21 20:10:37

Pecola1
Scratcher
Registered: 2010-09-06
Posts: 1000+

Re: Welcome to the OLD local block library!

Found where to make a website! https://dl-web.dropbox.com/get/websiteF … w=dd92f7e3 (i used droppbox and found it from sparks)


If you are reading this, please read to the end, because if you don't you won't know what's at the end. Don't just skip to the end though otherwise you won't be able to read the middle, which is most important. Now you must be wondering why you just read all that, the reason is you may have not noticed something, read it again and see if you notice it this time  smile

Offline

 

#1238 2011-01-21 20:25:02

Pecola1
Scratcher
Registered: 2010-09-06
Posts: 1000+

Re: Welcome to the OLD local block library!

HELP!
I am still just working on the block specs

websiteBlockSpecs
^readFromUrl: https://dl-web.dropbox.com/get/websiteForLibraryUpload/websiteForLibraryUpload.txt?w=dd92f7e3

But it keeps saying

websiteBlockSpecs
^ Expression to return expected ->readFromUrl: https://dl-web.dropbox.com/get/websiteForLibraryUpload/websiteForLibraryUpload.txt?w=dd92f7e3


If you are reading this, please read to the end, because if you don't you won't know what's at the end. Don't just skip to the end though otherwise you won't be able to read the middle, which is most important. Now you must be wondering why you just read all that, the reason is you may have not noticed something, read it again and see if you notice it this time  smile

Offline

 

#1239 2011-01-21 20:25:43

ssss
Scratcher
Registered: 2007-07-29
Posts: 1000+

Re: Welcome to the OLD local block library!

maybe it needs a ^ at the start??


Hey.  It's me SSSS, back from the dead!  smile

Offline

 

#1240 2011-01-21 20:37:34

Pecola1
Scratcher
Registered: 2010-09-06
Posts: 1000+

Re: Welcome to the OLD local block library!

ssss wrote:

maybe it needs a ^ at the start??

It does have one


If you are reading this, please read to the end, because if you don't you won't know what's at the end. Don't just skip to the end though otherwise you won't be able to read the middle, which is most important. Now you must be wondering why you just read all that, the reason is you may have not noticed something, read it again and see if you notice it this time  smile

Offline

 

#1241 2011-01-21 20:41:56

Marioblender
Scratcher
Registered: 2010-04-04
Posts: 31

Re: Welcome to the OLD local block library!

I have a new code for the <%e recieved?>  block:

Code:

eventReceivedNamed: t1 
    | t2 t3 |
    self isSprite ifTrue: [^ (self ownerThatIsA: ScratchStageMorph)
            eventReceivedNamed: t1].
    t2 _ self scripts
                select: [:t4 | t4 class == EventHatMorph and: [t4 eventName caseInsensitiveEqual: t1]].
    t2 _ t2 asOrderedCollection.
    self
        submorphsDo: [:t5 | (t5 isKindOf: ScriptableScratchMorph)
                ifTrue: [(t5 scripts
                        select: [:t4 | t4 class == EventHatMorph and: [t4 eventName caseInsensitiveEqual: t1]])
                        do: [:t6 | t2 _ t2 copyWith: t6]]].
    t3 _ t2 select: [:t4 | t4 scratchProc notNil].
    ^ t3 size > 0

This blockspec could replace the old one:  neutral

Code:

('%e received?' #b #eventReceivedNamed:)

Offline

 

#1242 2011-01-21 20:46:33

ssss
Scratcher
Registered: 2007-07-29
Posts: 1000+

Re: Welcome to the OLD local block library!

Marioblender wrote:

I have a new code for the <%e recieved?>  block:

Code:

eventReceivedNamed: t1 
    | t2 t3 |
    self isSprite ifTrue: [^ (self ownerThatIsA: ScratchStageMorph)
            eventReceivedNamed: t1].
    t2 _ self scripts
                select: [:t4 | t4 class == EventHatMorph and: [t4 eventName caseInsensitiveEqual: t1]].
    t2 _ t2 asOrderedCollection.
    self
        submorphsDo: [:t5 | (t5 isKindOf: ScriptableScratchMorph)
                ifTrue: [(t5 scripts
                        select: [:t4 | t4 class == EventHatMorph and: [t4 eventName caseInsensitiveEqual: t1]])
                        do: [:t6 | t2 _ t2 copyWith: t6]]].
    t3 _ t2 select: [:t4 | t4 scratchProc notNil].
    ^ t3 size > 0

This blockspec could replace the old one:  neutral

Code:

('%e received?' #b #eventReceivedNamed:)

this doesn't report error, but it always reports false... Please help  hmm


Hey.  It's me SSSS, back from the dead!  smile

Offline

 

#1243 2011-01-21 22:14:45

Marioblender
Scratcher
Registered: 2010-04-04
Posts: 31

Re: Welcome to the OLD local block library!

The block will report true only if a [blocks]<when I receive[ any message]>[/blocks] block is running.
Try assembling this script and then check if true: [blocks]
<when I receive[ any message]>
<forever>
<end>[/blocks]

Offline

 

#1244 2011-01-22 02:32:37

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

Re: Welcome to the OLD local block library!

Hmm... I think I kinda get what you're saying. Do you mean a block that reads it's blockspec from a website? Cos then an internet connection would always be needed to make them work. Or do you mean a patch that people can add to their copy of Scratch that allows them to add custom blocks to their projects easily?

I don't think something should add ALL the block library blocks at once to a copy of Scratch. What if you don't want some?  smile


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

Offline

 

#1245 2011-01-22 08:40:29

hpotter134
Scratcher
Registered: 2010-02-21
Posts: 100+

Re: Welcome to the OLD local block library!

Pecola1 wrote:

Pecola1 wrote:

Can someone help me with this? http://www.weebly.com/uploads/5/4/1/3/5 … 86.gif?366
I have been working for a long time on it but it wont work.
Heres the code:

Code:

getBooleanAttribute: t1 
    | t2 |
    (vars includesKey: t1)
        ifTrue: [^ vars at: t1].
    t2 _ t1 localized.
    'pen down?' localized = t2 ifTrue: [^ self t1 penDown].
    'draggable?' localized = t2 ifTrue: [^ self t1 isDraggable].
    'is a clone?' localized = t2 ifTrue: [^ self t1 isClone].
    ^ false

it does not work yet.

Still cannot get this to work. It gets the attribute for a boolean. Like if its a clone pen is down or if its draggable.

This probably isn't what you wanted, but I tried to make something of the sort:

http://img13.imageshack.us/img13/6907/mispendown.gif

Blockspec:

'%m is pen down?' #b #isPenDown:

Code:

isPenDown: sprite
       ^ sprite penDown

It works for me...is that what you wanted to make, or am I misunderstanding you?

EDIT: I see now. You wanted to have multiple boolean attributes in one block. Sorry  neutral

Last edited by hpotter134 (2011-01-22 21:28:59)


http://i45.tinypic.com/fxgtvc.png

Offline

 

#1246 2011-01-22 09:38:27

rubiks_cube_guy238
Scratcher
Registered: 2009-07-02
Posts: 100+

Re: Welcome to the OLD local block library!

Marioblender wrote:

I have a new code for the <%e recieved?>  block:

Code:

eventReceivedNamed: t1 
    | t2 t3 |
    self isSprite ifTrue: [^ (self ownerThatIsA: ScratchStageMorph)
            eventReceivedNamed: t1].
    t2 _ self scripts
                select: [:t4 | t4 class == EventHatMorph and: [t4 eventName caseInsensitiveEqual: t1]].
    t2 _ t2 asOrderedCollection.
    self
        submorphsDo: [:t5 | (t5 isKindOf: ScriptableScratchMorph)
                ifTrue: [(t5 scripts
                        select: [:t4 | t4 class == EventHatMorph and: [t4 eventName caseInsensitiveEqual: t1]])
                        do: [:t6 | t2 _ t2 copyWith: t6]]].
    t3 _ t2 select: [:t4 | t4 scratchProc notNil].
    ^ t3 size > 0

This blockspec could replace the old one:  neutral

Code:

('%e received?' #b #eventReceivedNamed:)

That code isn't new. You just took that right from Panther.
_________________________________________________________________

Pecola1 wrote:

Pecola1 wrote:

Can someone help me with this? http://www.weebly.com/uploads/5/4/1/3/5 … 86.gif?366
I have been working for a long time on it but it wont work.
Heres the code:

Code:

getBooleanAttribute: t1 
    | t2 |
    (vars includesKey: t1)
        ifTrue: [^ vars at: t1].
    t2 _ t1 localized.
    'pen down?' localized = t2 ifTrue: [^ self t1 penDown].
    'draggable?' localized = t2 ifTrue: [^ self t1 isDraggable].
    'is a clone?' localized = t2 ifTrue: [^ self t1 isClone].
    ^ false

it does not work yet.

Still cannot get this to work. It gets the attribute for a boolean. Like if its a clone pen is down or if its draggable.

Try this:

Code:

getBooleanAttribute: t1 of: t2
    | t3 |
    t3 _ self coerceSpriteArg: t2.
    (t3 isKindOf: ScriptableScratchMorph)
        ifFalse: [^ false].
    'pen down?' localized = t1 ifTrue: [^ t3 penDown].
    'draggable?' localized = t1 ifTrue: [^ t3 draggable].
    'is a clone?' localized = t1 ifTrue: [^ t3 isClone].
    ^ false

The glass is never half full nor half empty; it is twice as large as it needs to be.

Offline

 

#1247 2011-01-22 13:39:40

scimonster
Community Moderator
Registered: 2010-06-13
Posts: 1000+

Re: Welcome to the OLD local block library!

That's what i was going to suggest.  I don't have scratch open right now, so I can't test it.

Offline

 

#1248 2011-01-22 14:28:55

Pecola1
Scratcher
Registered: 2010-09-06
Posts: 1000+

Re: Welcome to the OLD local block library!

sparks wrote:

I don't think something should add ALL the block library blocks at once to a copy of Scratch. What if you don't want some?  smile

I thought about this and decided that I could make it just like panther has, the code could be more like when you click the button show library blocks it would ask you how many you wan't to show, you could say 'all' or the number you want. It would be simpler than I thought it would! I could add a global variable that would be websiteBlocksShowing
and then for the code i would need to make it... NVM this will be a challenge, but i was mainly making it for RKT so people don't have to always get the new version and the new blocks would update.


If you are reading this, please read to the end, because if you don't you won't know what's at the end. Don't just skip to the end though otherwise you won't be able to read the middle, which is most important. Now you must be wondering why you just read all that, the reason is you may have not noticed something, read it again and see if you notice it this time  smile

Offline

 

#1249 2011-01-22 14:50:02

Pecola1
Scratcher
Registered: 2010-09-06
Posts: 1000+

Re: Welcome to the OLD local block library!

http://www.weebly.com/uploads/5/4/1/3/5413503/7131686.gif?366
I have been working for a long time.
Blockspec:

('%B for %m' #b #getBooleanAttribute:of:)

Go to Scratch-blocks CommandBlockMorph all uncoloredArgMorphFor:
And add the strip:

Code:

$B = t2 ifTrue: [^ ChoiceArgMorph new getOptionsSelector: #booleanAttributeNames;
         choice: 'pen down?']

Heres the method:

Code:

getBooleanAttribute: t1 of: t2
    | t3 |
    t3 _ self coerceSpriteArg: t2.
    (t3 isKindOf: ScriptableScratchMorph)
        ifFalse: [^ false].
    'pen down?' localized = t1 ifTrue: [^ t3 penDown].
    'draggable?' localized = t1 ifTrue: [^ t3 draggable].
    'is a clone?' localized = t1 ifTrue: [^ t3 isClone].
    ^ false

Code:

booleanAttributeNames
('pen down' 'draggable' 'is a clone')

Its weird that the simplest thing stopped me! Credit to rubiks_cube_guy238 for showing me I needed the
of: t2
    | t3 |
    t3 _ self coerceSpriteArg: t2.
    (t3 isKindOf: ScriptableScratchMorph)
        ifFalse: [^ false].

Last edited by Pecola1 (2011-01-23 17:03:26)


If you are reading this, please read to the end, because if you don't you won't know what's at the end. Don't just skip to the end though otherwise you won't be able to read the middle, which is most important. Now you must be wondering why you just read all that, the reason is you may have not noticed something, read it again and see if you notice it this time  smile

Offline

 

#1250 2011-01-23 00:09:59

beary605
Scratcher
Registered: 2010-02-06
Posts: 8

Re: Welcome to the OLD local block library!

sparks asked me to repost these, so... yeah.'
Exponent Block
http://img18.imageshack.us/img18/1241/exponentblock.gif
http://img705.imageshack.us/img705/1922/exponent.gif
Deriative Block
http://img257.imageshack.us/img257/3849/deriativeblock.gif
http://img143.imageshack.us/img143/850/deriative.gif
int(round down) Block
http://img34.imageshack.us/img34/4358/roundblock.gif
http://img249.imageshack.us/img249/6966/round.gif
Root Block
http://img146.imageshack.us/img146/439/rootblock.gif
http://img692.imageshack.us/img692/6972/epicroot.gif
Factorial Block
http://img257.imageshack.us/img257/3275/factorialblock.gif
http://img814.imageshack.us/img814/6238/factorial.gif
Prime Checker Block
http://img404.imageshack.us/img404/1273/primeblock.gif
http://img571.imageshack.us/img571/5038/primecheck.gif

Offline

 

Board footer