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

#2426 2011-12-13 10:10:03

zippynk
Scratcher
Registered: 2011-07-23
Posts: 500+

Re: ITopic: Welcome to your local block library!

Greenatic wrote:

WingsGames wrote:

I have a suggestion: a "set answer to" block.

That should be pretty simple.  However, the purpose of the (answer) value is to represent user input, not a variable value.

Yes, but without it, if the user entered their password using the the < password for () is () > block, it would be stored in the answer variable until they typed in something else.


https://dl.dropbox.com/u/60598636/trifocal_interlude_soundcloud_button.png

Offline

 

#2427 2011-12-13 12:25:00

joefarebrother
Scratcher
Registered: 2011-04-08
Posts: 1000+

Re: ITopic: Welcome to your local block library!

Splodgey wrote:

Greenatic wrote:

Splodgey wrote:


Are you talking about my block? Because if you are does that mean I submitted it correctly?

No, he was referring to lu9.   tongue

700TH POST!!!

DID I submit it correctly? If not how do I submit it correctly?

For scratch and panther. use this syntax:

image of block (with no inputs) - if you are a new scratcher, just post the url and ask someone else to add the [img] tags

blockspec:

Code:

 the blockspec in a code tag

code:

Code:

 the code in a code tag

For BYOB:

image of block (with no inputs)
image of the scripts


My latest project is called http://tinyurl.com/d2m8hne! It has http://tinyurl.com/d395ygk views, http://tinyurl.com/cnasmt7 love-its, and http://tinyurl.com/bwjy8xs comments.
http://tinyurl.com/756anbk   http://tinyurl.com/iplaychess

Offline

 

#2428 2011-12-13 14:23:06

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

Re: ITopic: Welcome to your local block library!

zippynk wrote:

Greenatic wrote:

WingsGames wrote:

I have a suggestion: a "set answer to" block.

That should be pretty simple.  However, the purpose of the (answer) value is to represent user input, not a variable value.

Yes, but without it, if the user entered their password using the the < password for () is () > block, it would be stored in the answer variable until they typed in something else.

Yep. That is a good idea.  smile


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

 

#2429 2011-12-13 17:33:50

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

Re: ITopic: Welcome to your local block library!

http://www.freewebs.com/polyeztahpuppies/setanswer.gif (Requested)

Code:

('set answer to %s' #- #setAnswerTo:)

ScriptableScratchMorph > sensing ops

Code:

setAnswerTo: t1
     ScratchPrompterMorph setAnswer: t1

ScratchPrompterMorph > class > accessing
Make a new method:

Code:

setAnswer: t1
     LastAnswer _ t1

Last edited by Greenatic (2011-12-17 10:45:27)

Offline

 

#2430 2011-12-13 17:50:22

Nireckda815
Scratcher
Registered: 2011-05-01
Posts: 16

Re: ITopic: Welcome to your local block library!

I have a suggestion for a block in the sensing category:

<Coordinates x: ( ) y: ( ) touching color [  ]>

it would be able to fit into the < > fields and would be useful for platformer sensing in combination with the (min x), (min y), (max x), and (max y) blocks.

Thanks!

Offline

 

#2431 2011-12-13 21:28:17

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

Re: ITopic: Welcome to your local block library!

Nireckda815 wrote:

I have a suggestion for a block in the sensing category:

<Coordinates x: ( ) y: ( ) touching color [  ]>

it would be able to fit into the < > fields and would be useful for platformer sensing in combination with the (min x), (min y), (max x), and (max y) blocks.

Thanks!

Hmm, I made some code for that that should work, but the Array is causing problems.  Oh well.   sad

Offline

 

#2432 2011-12-14 11:47:55

joefarebrother
Scratcher
Registered: 2011-04-08
Posts: 1000+

Re: ITopic: Welcome to your local block library!

you can do that so easily in panther. Just do
<(!colour of pixel at x:() y:()! as string) = (!colour you are testing for! as string)>


My latest project is called http://tinyurl.com/d2m8hne! It has http://tinyurl.com/d395ygk views, http://tinyurl.com/cnasmt7 love-its, and http://tinyurl.com/bwjy8xs comments.
http://tinyurl.com/756anbk   http://tinyurl.com/iplaychess

Offline

 

#2433 2011-12-14 11:51:57

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

Re: ITopic: Welcome to your local block library!

When are we getting an update done around here?
I'm way too busy to do one.  sad

Offline

 

#2434 2011-12-14 14:07:13

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

Re: ITopic: Welcome to your local block library!

joefarebrother wrote:

you can do that so easily in panther. Just do
<(!colour of pixel at x:() y:()! as string) = (!colour you are testing for! as string)>

I was thinking the same thing, only touching would mean having any of the pixels AROUND it as well.  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

 

#2435 2011-12-14 16:34:40

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

Re: ITopic: Welcome to your local block library!

Just announcing my holiday. Off to Switzerland, I'll be back on the 23rd  smile


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

Offline

 

#2436 2011-12-14 17:28:58

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

Re: ITopic: Welcome to your local block library!

Nireckda815 wrote:

I have a suggestion for a block in the sensing category:

<Coordinates x: ( ) y: ( ) touching color [  ]>

it would be able to fit into the < > fields and would be useful for platformer sensing in combination with the (min x), (min y), (max x), and (max y) blocks.

Thanks!

OK, here's the code:

http://www.freewebs.com/polyeztahpuppies/coordinatestouchingcolor.gif  (Requested)

Code:

(coordinates x:%n y:%n touching color %c?' #b #X:y:touching:)

Code:

X: t1 y: t2 touching: t3
                |t4 |
    t4 _ #() asOrderedCollection.
    t1 isInf | t1 isNaN | t2 isInf | t2 isNaN ifTrue: [^ false].
    #((1 -1) (1 0) (1 1) (0 1) (-1 1) (-1 0) (-1 -1) (0 -1) ) do: [:t5 | t4 add: ScratchOrigin + ((t5 at: 1)
                    @ (t5 at: 2)) + (t1 rounded @ t2 rounded)].
    t4 do: 
        [:t6 | 
        t6 x > (ScratchOrigin x + 240) ifTrue: [t6 _ ScratchOrigin x + 240 @ t6 y].
        t6 x < (ScratchOrigin x - 240) ifTrue: [t6 _ ScratchOrigin x - 240 @ t6 y].
        t6 y > (ScratchOrigin y + 180) ifTrue: [t6 _ t6 x @ (ScratchOrigin y + 180)].
        t6 y < (ScratchOrigin y - 180) ifTrue: [t6 _ t6 x @ (ScratchOrigin y - 180)]].
    t4 do: 
        [:t7 | 
        (Display colorAt: t7)
            = t3 ifTrue: [^ true].
        nil].
    ^ false

Last edited by Greenatic (2011-12-17 10:45:41)

Offline

 

#2437 2011-12-14 18:13:01

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

Re: ITopic: Welcome to your local block library!

OK, I know I made it a while ago, but my "About Me" page is now linked to in the library post!   smile

EDIT:  Wait, should I add the list of available dropdowns too?
EDIT2:  How many blocks do you all think need to be in an update for that update to be worthwhile?

Last edited by Greenatic (2011-12-14 19:20:04)

Offline

 

#2438 2011-12-14 20:30:20

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

Re: ITopic: Welcome to your local block library!

scimonster wrote:

When are we getting an update done around here?
I'm way too busy to do one.  sad

Yeah, I don't think an update has been done since page 72.   sad

I'm going to try to free up some time.  No guarantees, though.

Offline

 

#2439 2011-12-15 13:42:19

joefarebrother
Scratcher
Registered: 2011-04-08
Posts: 1000+

Re: ITopic: Welcome to your local block library!

Can I request a panther block? It is called
|floodfill at x: () y: () in colour ! !|
and it will be in the pen catogary.
If colours were in BYOB, I would use a script like
http://i44.tinypic.com/zwfiww.gif
Can someone convert that to smalltalk for me?

Also, all of those set blocks give me an idea for a new block for BYOB. It uses 2 blocks from the BYOB tool sprite
http://oi40.tinypic.com/2eg8f9w.jpg
The scripts are
http://i40.tinypic.com/sg309i.gif
and
http://i39.tinypic.com/2db5jlh.gif
(the version in the tool package is wrong)
The new block is
http://i43.tinypic.com/2lurou0.gif
and the scripts are
http://i44.tinypic.com/35arxx0.gif
An example of it would be this following script to draw a line:
http://i42.tinypic.com/16lmkvp.gif
Please add this, and please make my panther request. Thank you.

Last edited by joefarebrother (2011-12-16 11:27:43)


My latest project is called http://tinyurl.com/d2m8hne! It has http://tinyurl.com/d395ygk views, http://tinyurl.com/cnasmt7 love-its, and http://tinyurl.com/bwjy8xs comments.
http://tinyurl.com/756anbk   http://tinyurl.com/iplaychess

Offline

 

#2440 2011-12-15 18:05:59

nXIII
Community Moderator
Registered: 2009-04-21
Posts: 1000+

Re: ITopic: Welcome to your local block library!

Panther block: update from [] with version []
This block performs an automatic update from the URL specified. The URL should point to a directory containing (at least) a file named version.txt, and a file named <first line of version.txt>.pt (the most recent version of the project). The second argument to the block specifies the current version of the project. If the user is using an outdated project (the version is not the same as the first line of version.txt), he/she is asked if he/she wants to download the new version. If so, the new version is downloaded, opened, and run.

(-) update from $String$ with version $String$

Code:

"Usage: provide a directory URL with version.txt and (first line of version.txt).pt"
| version frame dir name stream |

(t1 endsWith: '/') ifFalse: [t1 := t1, '/'].
frame := ScratchFrameMorph allInstances first.
version := (HTTPSocket httpGet: t1, 'version.txt') contents lines first.
version = t2 ifTrue: [^ self].

(DialogBoxMorph ask: 'A new version (', version, ') is available. Would you like to download it?') ifFalse: [^ self].

name := frame projectName, '.pt'.

(dir := frame projectDirectory) deleteFileNamed: name.

stream := (dir newFileNamed: version, '.pt').
stream reset.
stream nextPutAll: (HTTPSocket httpGet: t1, version, '.pt') contents.

frame openScratchProjectNamed: dir pathName, dir slash, version, '.pt'; shoutGo.

Last edited by nXIII (2011-12-15 18:06:09)


nXIII

Offline

 

#2441 2011-12-16 17:58:55

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

Re: ITopic: Welcome to your local block library!

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

Code:

('set Scratch interface font to %s' #- #UIFontTo:)

Code:

UIFontTo: t1
((UnicodePlugin getFontList) includes: (t1 asString)) ifTrue:[
ScratchTranslator renderFont: t1.
ScratchTranslator updateScratchUI]

ScratchTranslator > class > any category

Create new method:

Code:

renderFont: t1
     RenderFont _ t1

Last edited by Greenatic (2011-12-17 10:46:21)

Offline

 

#2442 2011-12-17 13:16:55

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

Re: ITopic: Welcome to your local block library!

Has .BLOCK development frozen?   sad

Last edited by Greenatic (2011-12-17 13:17:02)

Offline

 

#2443 2011-12-17 14:22:02

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

Re: ITopic: Welcome to your local block library!

Greenatic wrote:

Has .BLOCK development frozen?   sad

Uh... I think so. XD


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

 

#2444 2011-12-17 14:31:09

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

Re: ITopic: Welcome to your local block library!

Pecola1 wrote:

Greenatic wrote:

Has .BLOCK development frozen?   sad

Uh... I think so. XD

Darn.

*cue the trumpets* Update underway! Now let's hope I don't completely mess this up...   tongue   And don't expect me to get through 16 pages of library today.  That's not going to happen.

Last edited by Greenatic (2011-12-17 14:31:51)

Offline

 

#2445 2011-12-17 15:13:48

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

Re: ITopic: Welcome to your local block library!

@All librarians:  I post all my block images on an old Webs account, but I would prefer, for the sake of organization, that I keep that for only my block images (I use this as a way to go back and figure out what blocks I made).  Some people (no names to be mentioned!) didn't upload pictures, and I was never granted access to the weebly (I think).  Could someone please upload and post links for the following blockspecs:

('%n is even?' #b #even:)
('a:%n b:%n c:%n is Pythagorean triplet?' #b #py: 3 4 5 th:ag:)
('if x: %n y: %n , go to x: %n y: %n' #- #ifx:y:gox:y: 0 0 10 10)

Offline

 

#2446 2011-12-17 15:23:55

ianidani
New Scratcher
Registered: 2011-12-17
Posts: 3

Re: ITopic: Welcome to your local block library!

Here is a sound amplitude recorder and writer.(Sorry, it cannot replay the music)
<when green flag clicked>< delete (all) of [amp]><go to x sad  -240 )y sad 0) <pen up><clear><set pen color to( 0)<point in direction( 0)<pen down><recorddb>

recorddb is:
<<forever><<repeat( 480)<set y to( <loudness>)<change x by(1)<add <loudness> to [amp]><end>>
<clear><pen up><go to x sad -240 )y sad  0)><pen down><end>>

Offline

 

#2447 2011-12-17 15:27:00

ianidani
New Scratcher
Registered: 2011-12-17
Posts: 3

Re: ITopic: Welcome to your local block library!

ianidani wrote:

Here is a sound amplitude recorder and writer.(Sorry, it cannot replay the music)
<when green flag clicked>< delete (all) of [amp]><go to x sad -240) y sad 0) <pen up><clear><set pen color to( 0)<point in direction( 0)<pen down><recorddb>

recorddb is:
<forever><repeat( 480)<set y to(<loudness>)<change x by(1)<add <loudness> to [amp]><end>
<clear><pen up><go to x sad -240) y sad  0)><pen down><end>

Offline

 

#2448 2011-12-17 16:41:08

joefarebrother
Scratcher
Registered: 2011-04-08
Posts: 1000+

Re: ITopic: Welcome to your local block library!

ianidani wrote:

Here is a sound amplitude recorder and writer.(Sorry, it cannot replay the music)
[blocks]<when green flag clicked>< delete (all) of [amp]><go to x sad  -240 )y sad 0) <pen up><clear><set pen color to( 0)<point in direction( 0)<pen down><recorddb>

recorddb is:
<<forever><<repeat( 480)<set y to( <loudness>)<change x by(1)<add <loudness> to [amp]><end>>
<clear><pen up><go to x sad -240 )y sad  0)><pen down><end>>[/blocks]

use new lines between blocks like this:

[blocks]<when green flag clicked>
< delete (all) of [amp]>
<go to x sad  -240 )y sad 0)
<pen up>
<clear><set pen color to( 0)
<point in direction( 0)
<pen down>
<recorddb>

recorddb is:
<<forever>
<<repeat( 480)
<set y to( <loudness>)
<change x by(1)
<add <loudness> to [amp]>
<end>> [/blocks]




Oh, and please remember the

Code:

[blocks][/blocks]

tage when you use the blocks.

Last edited by joefarebrother (2011-12-17 16:41:24)


My latest project is called http://tinyurl.com/d2m8hne! It has http://tinyurl.com/d395ygk views, http://tinyurl.com/cnasmt7 love-its, and http://tinyurl.com/bwjy8xs comments.
http://tinyurl.com/756anbk   http://tinyurl.com/iplaychess

Offline

 

#2449 2011-12-17 22:04:48

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

Re: ITopic: Welcome to your local block library!

http://welcometoyourlocalblocklibrary.weebly.com/uploads/7/1/1/0/7110842/292223741.gif

Scratch Blocks added: [0]
http://www.freewebs.com/polyeztahpuppies/averageoflist.gif Shared by Greenatic
http://polyeztahpuppies.webs.com/fontnumber.gif Shared by Greenatic
http://polyeztahpuppies.webs.com/additemstolist.gif Shared by Greenatic
http://polyeztahpuppies.webs.com/numbersort.gif Shared by Greenatic
http://polyeztahpuppies.webs.com/stringsort.gif Shared by Greenatic
http://polyeztahpuppies.webs.com/firstindex.gif Shared by Greenatic
http://polyeztahpuppies.webs.com/timesappearsinlist.gif Shared by Greenatic
http://polyeztahpuppies.webs.com/modesof.gif Shared by Greenatic
http://scratch.mit.edu/redirect/url?link=http://weebly.com/uploads/8/1/3/6/8136364/7833808.gif Improved by Greenatic
http://www.freewebs.com/polyeztahpuppies/soundamount.gif Shared by Greenatic

As of this update, Greenatic is now Top Scratch Blocks Contributor.

Update carried out by block librarian: Greenatic
________________________________________________________________________________
^home
^updates archive

Last edited by YourLocalBlockLib (2011-12-17 22:05:59)


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

Offline

 

#2450 2011-12-17 22:08:04

meowmeow55
Scratcher
Registered: 2008-12-24
Posts: 1000+

Re: ITopic: Welcome to your local block library!

YourLocalBlockLib wrote:

As of this update, Greenatic is now Top Scratch Blocks Contributor.

*applause*


Yawn.

Offline

 

Board footer