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

#2101 2011-09-22 03:28:47

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

Re: ITopic: Welcome to your local block library!

Greenatic wrote:

sparks wrote:

Right, I especially said that your blocks were very good to imply that you weren't creating simple blocks, Greenatic! I Agree they're fantastic! I was just sort of mentioning it to the general community  smile

Oops.  I apologize for not reading the whole post, and for mistaking it for an implied insult.

scimonster wrote:

Greenatic wrote:

By the way, has anyone made a |save image for end-user| block?  I would check but my computer freezes for five minutes if I so much as look at the Block Library page 1.

I have.  big_smile

Did you share it?

I submitted it before I was a Librarian, but Sparks didn't add it. >_>

Offline

 

#2102 2011-09-22 03:57:50

Hardmath123
Scratcher
Registered: 2010-02-19
Posts: 1000+

Re: ITopic: Welcome to your local block library!

Code:

('In presentation mode?' #b #inPres)

inPres
(self ownerThatIsA: ScratchFrameMorph) ifNil:[^ false].
^ true

Last edited by Hardmath123 (2011-09-22 03:58:11)


Hardmaths-MacBook-Pro:~ Hardmath$ sudo make $(whoami) a sandwich

Offline

 

#2103 2011-09-22 07:08:08

Greenatic
Scratcher
Registered: 2009-05-03
Posts: 1000+

Re: ITopic: Welcome to your local block library!

Hardmath123 wrote:

Code:

('In presentation mode?' #b #inPres)

inPres
(self ownerThatIsA: ScratchFrameMorph) ifNil:[^ false].
^ true

1.  I think you have the returns swapped.
2.  I already made a (viewing mode) block, so this is the same as <(viewing mode) = presentation>.

Offline

 

#2104 2011-09-22 09:02:23

YourLocalBlockLib
Scratcher
Registered: 2011-03-10
Posts: 100+

Re: ITopic: Welcome to your local block library!

YourLocalBlockLib wrote:

The Block Library Is Currently Broken; DO NOT PANIC! We Are Sorting Out The Problem That Weebly Is Currently Filtered By Scratch

I fixed the first post, but I'm gonna talk to the ST to see if they'll give us an exception for welcometoyourlocalblocklibrary.weebly.com

~~Scimonster

Last edited by YourLocalBlockLib (2011-09-22 09:02:36)


http://dl.dropbox.com/u/6273449/BlockLibraryTitle.png

Offline

 

#2105 2011-09-22 19:24:29

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

Re: ITopic: Welcome to your local block library!

YourLocalBlockLib wrote:

YourLocalBlockLib wrote:

The Block Library Is Currently Broken; DO NOT PANIC! We Are Sorting Out The Problem That Weebly Is Currently Filtered By Scratch

I fixed the first post, but I'm gonna talk to the ST to see if they'll give us an exception for welcometoyourlocalblocklibrary.weebly.com

~~Scimonster

Uhh.... sorry guys... this is kinda my fault. I did change all those to weebly. Sorry, I hope the ST works it out.  hmm


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

 

#2106 2011-09-22 19:26:22

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

Re: ITopic: Welcome to your local block library!

Greenatic wrote:

Hardmath123 wrote:

Code:

('In presentation mode?' #b #inPres)

inPres
(self ownerThatIsA: ScratchFrameMorph) ifNil:[^ false].
^ true

1.  I think you have the returns swapped.
2.  I already made a (viewing mode) block, so this is the same as <(viewing mode) = presentation>.

This was made before your block, so we have to keep it, otherwise it isn't fair, I can see not allowing it if yours was before, but this block has been on for a long time and I think it should stay. And yes I think they are swapped...


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

 

#2107 2011-09-22 19:41:59

Greenatic
Scratcher
Registered: 2009-05-03
Posts: 1000+

Re: ITopic: Welcome to your local block library!

Pecola1 wrote:

Greenatic wrote:

Hardmath123 wrote:

Code:

('In presentation mode?' #b #inPres)

inPres
(self ownerThatIsA: ScratchFrameMorph) ifNil:[^ false].
^ true

1.  I think you have the returns swapped.
2.  I already made a (viewing mode) block, so this is the same as <(viewing mode) = presentation>.

This was made before your block, so we have to keep it, otherwise it isn't fair, I can see not allowing it if yours was before, but this block has been on for a long time and I think it should stay. And yes I think they are swapped...

Were you talking to me?

If so, mine still should go in the library because it adds compatibility for normal vs quarter mode.

Offline

 

#2108 2011-09-22 20:39:05

Greenatic
Scratcher
Registered: 2009-05-03
Posts: 1000+

Re: ITopic: Welcome to your local block library!

http://www.freewebs.com/polyeztahpuppies/menuitemaction.gif
When run, opens an untitled menu with the items of the "items" list.  It then reports the corresponding value of the "action" list.  Waits for an answer.  To add a line, add a single dash to both lists at the same index.  Note that the lists must be of identical length, or it reports nil.

Code:

('menu items: %L actions: %L' #r #MenuItem:Action: 'list' 'list')

MenuItem: t1 Action: t2 
    | t3 t4 |
    (self lineCountOfList: t1)
        = 0 | (self lineCountOfList: t2) = 0 | (self lineCountOfList: t1) ~= (self lineCountOfList: t2) ifTrue: [^ nil].
    t3 _ CustomMenu new.
    t4 _ 1.
    (self lineCountOfList: t1)
        timesRepeat: 
            [(self getLine: t4 ofList: t1)
                = '-' & (self getLine: t4 ofList: t2) = '-' ifTrue: [t3 addLine].
            (self getLine: t4 ofList: t1)
                = '-' & (self getLine: t4 ofList: t2) = '-' ifFalse: [t3 add: (self getLine: t4 ofList: t1)
                    action: (self getLine: t4 ofList: t2)].
            t4 _ t4 + 1].
    ^ t3 localize startUp

ScriptableScratchMorph > blocks > defaultArgsFor:
Add this code before the last line (^ t2):

Code:

#MenuItem:Action: = t4
        ifTrue: [t2 size >= 2
                ifTrue: 
                    [t2 at: 1 put: self defaultListName.
                    t2 at: 2 put: self defaultListName]].

http://www.freewebs.com/polyeztahpuppies/menutitleitemaction.gif
Functions like the above block, but the menu will have a title if this block is used.

Code:

 ('menu title: %s items: %L actions: %L' #r #MenuTitle:Item:Action: '' 'list' 'list')

MenuTitle: t1 Item: t2 Action: t3 
    | t4 t5 |
    (self lineCountOfList: t2)
        = 0 | (self lineCountOfList: t3) = 0 | (self lineCountOfList: t2) ~= (self lineCountOfList: t3) ifTrue: [^ nil].
    t4 _ CustomMenu new title: t1.
    t5 _ 1.
    (self lineCountOfList: t2)
        timesRepeat: 
            [(self getLine: t5 ofList: t2)
                = '-' & (self getLine: t5 ofList: t3) = '-' ifTrue: [t4 addLine].
            (self getLine: t5 ofList: t2)
                = '-' & (self getLine: t5 ofList: t3) = '-' ifFalse: [t4 add: (self getLine: t5 ofList: t2)
                    action: (self getLine: t5 ofList: t3)].
            t5 _ t5 + 1].
    ^ t4 localize startUp

ScriptableScratchMorph > blocks > defaultArgsFor:
Add this code before the last line (^ t2):

Code:

#MenuTitle:Item:Action: = t4
        ifTrue: [t2 size >= 3
                ifTrue: 
                    [t2 at: 1 put: (t2 at: 1) localized.
                    t2 at: 2 put: self defaultListName.
                    t2 at: 3 put: self defaultListName]].

Offline

 

#2109 2011-09-22 21:38:50

Greenatic
Scratcher
Registered: 2009-05-03
Posts: 1000+

Re: ITopic: Welcome to your local block library!

http://www.freewebs.com/polyeztahpuppies/triangleperimeter.gif

Code:

('perimeter of triangle (%n,%n)(%n,%n)(%n,%n)' #r #TriPeriX:y:X:y:X:y:)

TriPeriX: t1 y: t2 X: t3 y: t4 X: t5 y: t6
^ ((((t1 - t3) * (t1 - t3)) + ((t2-t4)* (t2-t4))) sqrt) + ((((t3 - t5) * (t3 - t5)) + ((t4-t6)* (t4-t6))) sqrt) +( (((t5 - t1) * (t5 - t1)) + ((t6-t2)* (t6-t2))) sqrt)

http://www.freewebs.com/polyeztahpuppies/trianglearea.gif

Code:

('area of triangle (%n,%n)(%n,%n)(%n,%n)' #r #TriAreaX:y:X:y:X:y:)

TriAreaX: t1 y: t2 X: t3 y: t4 X: t5 y: t6
| t7 t8 t9 |
t7 _ (((t1 - t3) * (t1 - t3)) + ((t2-t4)* (t2-t4))) sqrt.
t8 _ 1.
(((((t3 - t5) * (t3 - t5)) + ((t4-t6)* (t4-t6))) sqrt) > t7) ifTrue:[  t7 _ ((((t3 - t5) * (t3 - t5)) + ((t4-t6)* (t4-t6))) sqrt).
t8 _ 2].
(((((t5 - t1) * (t5 - t1)) + ((t6-t1)* (t6-t1))) sqrt) > t7) ifTrue:[
t7 _  ((((t5 - t1) * (t5 - t1)) + ((t6-t1)* (t6-t1))) sqrt).
t8 _ 3].
t8 = 1 ifTrue:[
t9 _ ((t1 + t3)/2) @ ((t2 + t4)/2).
^ 0.5 * t7 * 
((((t9 x) - t5) * ((t9 x) - t5)) + (((t9 y) -t6)* ((t9 y) -t6))) sqrt].
t8 = 2 ifTrue:[
t9 _ ((t3 + t5)/2) @ ((t4 + t6)/2).
^ 0.5 * t7 * 
((((t9 x) - t1) * ((t9 x) - t1)) + (((t9 y) -t2)* ((t9 y) -t2))) sqrt].
t8 = 3 ifTrue:[
t9 _ ((t5 + t1)/2) @ ((t5 + t1)/2).
^ 0.5 * t7 * 
((((t9 x) - t3) * ((t9 x) - t3)) + (((t9 y) -t4)* ((t9 y) -t4))) sqrt].

Offline

 

#2110 2011-09-23 02:38:01

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

Re: ITopic: Welcome to your local block library!

Pecola1 wrote:

YourLocalBlockLib wrote:

YourLocalBlockLib wrote:

The Block Library Is Currently Broken; DO NOT PANIC! We Are Sorting Out The Problem That Weebly Is Currently Filtered By Scratch

I fixed the first post, but I'm gonna talk to the ST to see if they'll give us an exception for welcometoyourlocalblocklibrary.weebly.com

~~Scimonster

Uhh.... sorry guys... this is kinda my fault. I did change all those to weebly. Sorry, I hope the ST works it out.  hmm

Still no reply on the thread. Time to email them.
Don't worry Pecola1.  smile

Offline

 

#2111 2011-09-23 17:12:45

Greenatic
Scratcher
Registered: 2009-05-03
Posts: 1000+

Re: ITopic: Welcome to your local block library!

http://www.freewebs.com/polyeztahpuppies/fitbtitledefault.gif

Opens a "Fill In The Blank" prompt and reports contents after they are entered.  If "Cancel" is pressed, reports a nil string.  Leave the first argument blank for untitled; leave the second argument blank for no default text.

Code:

('FillInTheBlank prompt title:%s default:%s' #r #FITBTitle:Default:)

FITBTitle: t1 Default: t2
^ FillInTheBlank request: t1 initialAnswer: t2

Offline

 

#2112 2011-09-23 18:06:22

Greenatic
Scratcher
Registered: 2009-05-03
Posts: 1000+

Re: ITopic: Welcome to your local block library!

http://www.freewebs.com/polyeztahpuppies/timethrough.gif

Reports how far through the sound you are.  Reports 0 if the sound does not exist or is not playing.

Code:

('time through %S' #r #TimeThrough:)

TimeThrough: t1
| t2 |
t2 _ self soundNamed: t1 ifAbsent:[^ 0].
t2 isPlaying ifFalse:[^ 0].
t2 currentSeconds

Offline

 

#2113 2011-09-23 20:24:34

tpaley
Scratcher
Registered: 2011-05-22
Posts: 100+

Re: ITopic: Welcome to your local block library!

Greenatic wrote:

http://www.freewebs.com/polyeztahpuppie … efault.gif

Opens a "Fill In The Blank" prompt and reports contents after they are entered.  If "Cancel" is pressed, reports a nil string.  Leave the first argument blank for untitled; leave the second argument blank for no default text.

Code:

('FillInTheBlank prompt title:%s default:%s' #r #FITBTitle:Default:)

FITBTitle: t1 Default: t2
^ FillInTheBlank request: t1 initialAnswer: t2

cool!


http://i49.tinypic.com/2z82h3d.gif

Offline

 

#2114 2011-09-23 20:29:35

Greenatic
Scratcher
Registered: 2009-05-03
Posts: 1000+

Re: ITopic: Welcome to your local block library!

tpaley wrote:

Greenatic wrote:

http://www.freewebs.com/polyeztahpuppie … efault.gif

Opens a "Fill In The Blank" prompt and reports contents after they are entered.  If "Cancel" is pressed, reports a nil string.  Leave the first argument blank for untitled; leave the second argument blank for no default text.

Code:

('FillInTheBlank prompt title:%s default:%s' #r #FITBTitle:Default:)

FITBTitle: t1 Default: t2
^ FillInTheBlank request: t1 initialAnswer: t2

cool!

Thanks!   smile

Offline

 

#2115 2011-09-23 20:35:50

tpaley
Scratcher
Registered: 2011-05-22
Posts: 100+

Re: ITopic: Welcome to your local block library!

roijac wrote:

improved case=sensitive BYOB
http://i.imgur.com/IsZFu.gif
download link:http://www.megaupload.com/?d=MQSWDR3A

what do those do?


http://i49.tinypic.com/2z82h3d.gif

Offline

 

#2116 2011-09-23 20:40:40

tpaley
Scratcher
Registered: 2011-05-22
Posts: 100+

Re: ITopic: Welcome to your local block library!

Greenatic wrote:

Pecola1 wrote:

scimonster wrote:

Could you provide explanations?
And when I do that update, we'll have to crown Greenatic as the new Scratch Blocks champ. ;D

Sweet! NEW CHAMP? I don't even remember him/her being here before summer! LOL

I wasn't.   tongue   (Him, by the way!)

Lol, looking back at the first block I made, the one w/ jslomba, I imagine how quickly I could have made that now...   tongue

BTW, were you just trying to get me to pause so you could catch up?  No way that's happening!  More blocks now!

http://www.freewebs.com/polyeztahpuppie … bounds.gif

Code:

('x:%n y: %n is within my bounds?' #b #WithinBoundsX:y:)

WithinBoundsX: t1 y: t2
^ (t1 <= (self xpos + (0.5 * self width))) &  (t1 >= (self xpos - (0.5 * self width))) &  (t2 <= (self ypos + (0.5 * self height))) &  (t2 >= (self ypos - (0.5 * self height)))

NOTE: The following two blocks require an alteration to the presentMenu method.  See the |make {  v} draggable| and |make {  v} undraggable| for instructions, but remember to use the methods of these blocks.
http://www.freewebs.com/polyeztahpuppie … bounds.gif

Code:

('%m center is within my bounds?' #b #CentWithin:)

CentWithin: t1
^ ((t1 xpos) <= (self xpos + (0.5 * self width))) &  (((t1 xpos) >= (self xpos - (0.5 * self width))) &  ((t1 ypos) <= (self ypos + (0.5 * self height))) &  ((t1 ypos) >= (self ypos - (0.5 * self height))))

http://www.freewebs.com/polyeztahpuppie … bounds.gif

Code:

('%m is completely within my bounds?' #b #CompWithin:)

CompWithin: t1
    ^ t1 xpos + (0.5 * t1 width) <= (self xpos + (0.5 * self width)) & (t1 xpos - (0.5 * t1 width) >= (self xpos - (0.5 * self width))) & (t1 ypos + (0.5 * t1 height) <= (self ypos + (0.5 * self height))) & (t1 ypos - (0.5 * t1 height) >= (self ypos - (0.5 * self height)))

how is "my bounds" defined?


http://i49.tinypic.com/2z82h3d.gif

Offline

 

#2117 2011-09-23 20:44:55

tpaley
Scratcher
Registered: 2011-05-22
Posts: 100+

Re: ITopic: Welcome to your local block library!

can someone make a [blocks]<Set stepping speed to: [turbo]>[/blocks] control drop-down menu and a [blocks]<stepping speed>[/blocks] sensing block?

Last edited by tpaley (2011-09-23 20:50:18)


http://i49.tinypic.com/2z82h3d.gif

Offline

 

#2118 2011-09-25 00:26:05

guitarherofan
Scratcher
Registered: 2010-08-20
Posts: 4

Re: ITopic: Welcome to your local block library!

This is going to be really helpful. Like uhh...

<say[((<{addition}><+><{2nd number}>))] for my random question game. The fourth one!

Offline

 

#2119 2011-09-25 02:00:49

veggieman001
Scratcher
Registered: 2010-02-20
Posts: 1000+

Re: ITopic: Welcome to your local block library!

guitarherofan wrote:

This is going to be really helpful. Like uhh...

<say[((<{addition}><+><{2nd number}>))] for my random question game. The fourth one!

you can't upload projects you make with them though


Posts: 20000 - Show all posts

Offline

 

#2120 2011-09-25 03:01:42

roijac
Scratcher
Registered: 2010-01-19
Posts: 1000+

Re: ITopic: Welcome to your local block library!

tpaley wrote:

roijac wrote:

improved case=sensitive BYOB
http://i.imgur.com/IsZFu.gif
download link:http://www.megaupload.com/?d=MQSWDR3A

what do those do?

they are case-sensitive checks: <CaSe=case> will return true with the normal block, but with mine only <case=case> or <CaSe=CaSe> will be true.

Offline

 

#2121 2011-09-25 05:44:58

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

Re: ITopic: Welcome to your local block library!

Greenatic wrote:

http://www.freewebs.com/polyeztahpuppie … efault.gif

Opens a "Fill In The Blank" prompt and reports contents after they are entered.  If "Cancel" is pressed, reports a nil string.  Leave the first argument blank for untitled; leave the second argument blank for no default text.

Code:

('FillInTheBlank prompt title:%s default:%s' #r #FITBTitle:Default:)

FITBTitle: t1 Default: t2
^ FillInTheBlank request: t1 initialAnswer: t2

What's FITB? I've never heard of anything like that in Scratch.  lol

Greenatic wrote:

http://www.freewebs.com/polyeztahpuppie … hrough.gif

Reports how far through the sound you are.  Reports 0 if the sound does not exist or is not playing.

Code:

('time through %S' #r #TimeThrough:)

TimeThrough: t1
| t2 |
t2 _ self soundNamed: t1 ifAbsent:[^ 0].
t2 isPlaying ifFalse:[^ 0].
t2 currentSeconds

How could it not exist?  tongue
And could you make one that sets how far? :3

Offline

 

#2122 2011-09-25 07:24:50

IHeartGaming
Scratcher
Registered: 2010-07-23
Posts: 1000+

Re: ITopic: Welcome to your local block library!

YourLocalBlockLib wrote:

[b]The Block Library Is Currently Broken; DO NOT PANIC! We Are Sorting Out The Problem That Weebly Is Currently Filtered By Scratch

You should make a folder called assets on your scratchr.org site.


IHeartGaming

Offline

 

#2123 2011-09-25 07:29:40

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

Re: ITopic: Welcome to your local block library!

IHeartGaming wrote:

YourLocalBlockLib wrote:

The Block Library Is Currently Broken; DO NOT PANIC! We Are Sorting Out The Problem That Weebly Is Currently Filtered By Scratch

You should make a folder called assets on your scratchr.org site.

Well, we would host it, but Sparks is having trouble with the MySQL being iffy — not always working.

Offline

 

#2124 2011-09-25 07:34:10

IHeartGaming
Scratcher
Registered: 2010-07-23
Posts: 1000+

Re: ITopic: Welcome to your local block library!

Host your weebly on a dot tk domain.


IHeartGaming

Offline

 

#2125 2011-09-25 07:36:02

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

Re: ITopic: Welcome to your local block library!

IHeartGaming wrote:

Host your weebly on a dot tk domain.

Now I have a dropbox, but we want to host it on the scratchr, I think.

Sparks, maybe you should put out a call in Misc to see if anyone can fix the MySQL.

Offline

 

Board footer