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

#776 2010-06-29 03:25:27

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: Cool custom blocks in Scratch

complete tutorial for watcher:
- open browser
- follow the path: Scratch-Blocks -> CommandBlockMorph -> private -> canBecomeWatcher
- add this to the beginning of the code (not including title!) :

(#( #info:fromZip: #synonym: #wordOfTheDay: #jokeOfTheDay: #askYahoo #scratchrInfo:forUser: ) includes: selector) ifTrue: [^ true].

you should be fine now. the watchers should appear in front of the block when you restart scratfch.

Offline

 

#777 2010-06-29 03:30:22

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: Cool custom blocks in Scratch

if you would like to have those same menus (instead of string arguments) that netScratch has, you can edit the uncoloredArgMorphFor: code in the same category (private) and add those codes (%z, %j, %w etc.). then add the menu names. it's a bit more complicated, tell me if you want it or not and i'll make a clearer tutorial.  smile

Offline

 

#778 2010-06-29 06:23:47

dav09
Scratcher
Registered: 2009-03-25
Posts: 1000+

Re: Cool custom blocks in Scratch

thanks you!(i will  give u credit if i finish this!!!)
i think the port would look better if i had the %g blocks, thanks!

Last edited by dav09 (2010-06-29 06:33:19)

Offline

 

#779 2010-06-29 09:13:03

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: Cool custom blocks in Scratch

you cant make the #g, but you can make the %z %w and %j.
here's how:
go to scratch-objects -> commandblockmorph -> private -> uncoloredargmorphfor:

and you'll see some frightening code. there, you'll find a list of $x = code ifTrue: [^ something]. all in alphabetical order.

add

$z = code ifTrue: [^ ChoiceOrExpressionArgMorph new getOptionsSelector: zipNames; choice: 'city'].

in the right alphabetical place.

now, back to ScriptableScratchMorph, add a method called zipNames like this:

zipNames
^ #( 'city' 'state' temperature' )

and all of that stuff following this template. then do the same thing from the beginning for the other two, %j and %w (which in the uncoloredArgMorphFor are $j and $w).

Offline

 

#780 2010-06-29 09:52:14

dav09
Scratcher
Registered: 2009-03-25
Posts: 1000+

Re: Cool custom blocks in Scratch

ok thanks  smile
had the 2nd part done already(but a little differant)
ps, i think u mean scratch blocks, not objects.
the weather block should work now right?

Last edited by dav09 (2010-06-29 10:15:44)

Offline

 

#781 2010-06-29 12:07:56

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: Cool custom blocks in Scratch

@dav09:

yeah that's what i meant. and the weather block should work, if you did the method right in the first place  smile  (the one called by the blockSpec)

Offline

 

#782 2010-06-29 12:25:30

dav09
Scratcher
Registered: 2009-03-25
Posts: 1000+

Re: Cool custom blocks in Scratch

yeah i did the block spec right, you have really helped me with squeak programing  smile  Thanks

Offline

 

#783 2010-06-29 12:58:19

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: Cool custom blocks in Scratch

you're welcome!
but are you going to release this mod, or will you keep it to yourself?

oh and i noticed, you were actually the first one to post on this thread after me! you're still here after 32 pages! thanks for the loyalty  smile

Last edited by LS97 (2010-06-29 13:11:01)

Offline

 

#784 2010-06-29 15:01:54

ironmannn
Scratcher
Registered: 2010-02-20
Posts: 42

Re: Cool custom blocks in Scratch

huh? i know lua scripting but just the basics and im working on a pdf tutorial

but ive never done smalll talk

-----------------------------------------------------------------------------------------
~ironmannn~

<when[ 51productions ]key pressed>
<broadcast[ 51 productions loaded
<if><( <{ load }> <=> 90 )>

Last edited by ironmannn (2010-06-29 15:06:08)

Offline

 

#785 2010-06-29 15:49:27

dav09
Scratcher
Registered: 2009-03-25
Posts: 1000+

Re: Cool custom blocks in Scratch

LS97 wrote:

you're welcome!
but are you going to release this mod, or will you keep it to yourself?

oh and i noticed, you were actually the first one to post on this thread after me! you're still here after 32 pages! thanks for the loyalty  smile

i hope to release it when i finish, and i will giv u some credit also, since u did help... alot!
Yeah the first post helped me also  smile

Last edited by dav09 (2010-06-29 15:52:26)

Offline

 

#786 2010-06-29 15:51:18

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: Cool custom blocks in Scratch

dav09 wrote:

LS97 wrote:

you're welcome!
but are you going to release this mod, or will you keep it to yourself?

oh and i noticed, you were actually the first one to post on this thread after me! you're still here after 32 pages! thanks for the loyalty  smile

i hope to release it when i finish, and i will giv u some credit also, since u did help... alot!

smile  you're very kind. looking forward to seeing it!

Offline

 

#787 2010-06-29 16:13:40

dav09
Scratcher
Registered: 2009-03-25
Posts: 1000+

Re: Cool custom blocks in Scratch

im sorry to bother u again but its still not workin? I have block specks and the other instance blocks matching. when i try select temperature in it comes up where a variable (in the corner would usuall be) sprite 1 %r of %s, it should be temperature :?
And if i double click the block it wont work, just error

Offline

 

#788 2010-06-30 07:45:47

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: Cool custom blocks in Scratch

the %r of %s is normal, unfortunately i still can't find the code that replaces that with the argument. but if the block says error it's a problem with the blockSpec, not any code i've given you. can't help more than that. and have a nice holiday, i'm leaving  smile

Offline

 

#789 2010-06-30 12:19:39

dav09
Scratcher
Registered: 2009-03-25
Posts: 1000+

Re: Cool custom blocks in Scratch

(post 1500!)ok bye... have a nice time...

Last edited by dav09 (2010-06-30 12:36:50)

Offline

 

#790 2010-07-04 07:45:14

TheSuccessor
Scratcher
Registered: 2010-04-23
Posts: 1000+

Re: Cool custom blocks in Scratch

LS97's in Antarctica!?


/* No comment */

Offline

 

#791 2010-07-05 12:32:25

celloguy123
Scratcher
Registered: 2009-01-15
Posts: 100+

Re: Cool custom blocks in Scratch

How do you make the block like a [blocks]<stop all>[/blocks] block? And TheSuccessor, where did you get the idea of antarctica? And while we're at it, why are we talking about this?

Last edited by celloguy123 (2010-07-05 12:35:51)


http://internetometer.com/image/33068.png

Offline

 

#792 2010-07-05 13:06:31

johnnydean1
Scratcher
Registered: 2010-02-12
Posts: 1000+

Re: Cool custom blocks in Scratch

the stop all broadcasts a message that stops all scripts.


You can now reach me on Twitter @johnnydean1_

Offline

 

#793 2010-07-05 15:30:20

markyparky56
Scratcher
Registered: 2008-03-20
Posts: 1000+

Re: Cool custom blocks in Scratch

celloguy123 wrote:

... And TheSuccessor, where did you get the idea of antarctica? And while we're at it, why are we talking about this?

http://img266.imageshack.us/img266/9528/ls97.png
any questions?


http://j.mp/jgVnTq
Check out my game engine development site: NewDawn I'm a Level 171 Scratcher.I am http://bit.ly/nkvLNT

Offline

 

#794 2010-07-09 10:49:12

whizzer
Scratcher
Registered: 2008-05-27
Posts: 500+

Re: Cool custom blocks in Scratch

LS97 wrote:

The link block
Ok, finally some time to add the greatest block of all. the block links the user to a webpage, program or file as long as the path  or URL is given. add in the blockspecs in the control section some kind of block code (choose whatever you want, you know how to do it). and add in the corresponding instance ops:

Code:

    Cursor wait showWhile: [ScratchPlugin primOpenURL: t1]

So little code for such a great block... and remember to click accept!

I tried making my own Block Spec - but it just made the Control section unopenable. Can you give the Spec? Also, can you add some blocks with drop-down boxes? (Including (get {date}) ) Thanks  smile  .


http://i46.tinypic.com/33df6me.png I'm whizzer0 for all things Minecraft.

Offline

 

#795 2010-07-09 10:53:10

whizzer
Scratcher
Registered: 2008-05-27
Posts: 500+

Re: Cool custom blocks in Scratch

whizzer wrote:

LS97 wrote:

The link block
Ok, finally some time to add the greatest block of all. the block links the user to a webpage, program or file as long as the path  or URL is given. add in the blockspecs in the control section some kind of block code (choose whatever you want, you know how to do it). and add in the corresponding instance ops:

Code:

    Cursor wait showWhile: [ScratchPlugin primOpenURL: t1]

So little code for such a great block... and remember to click accept!

I tried making my own Block Spec - but it just made the Control section unopenable. Can you give the Spec? Also, can you add some blocks with drop-down boxes? (Including (get {date}) ) Thanks  smile  .

Oh, sorry I found it here: http://scratch.mit.edu/forums/viewtopic.php?pid=371891#p371891 .


http://i46.tinypic.com/33df6me.png I'm whizzer0 for all things Minecraft.

Offline

 

#796 2010-07-09 11:21:48

TheSuccessor
Scratcher
Registered: 2010-04-23
Posts: 1000+

Re: Cool custom blocks in Scratch

This forum's sort of jammed now LS97's not here. Surely we can do something?


/* No comment */

Offline

 

#797 2010-07-09 12:54:00

whizzer
Scratcher
Registered: 2008-05-27
Posts: 500+

Re: Cool custom blocks in Scratch

LS97 wrote:

randalpik wrote:

I can't figure out how to make the Graphic effect reporter block... can someone help?

Here it is just quickly. i've got hw to do now!

Code:

getEffect: t1 
    filterPack ifNil: [^ 0].
    'blur' = t1 ifTrue: [^ filterPack blur].
    'brightness' = t1 ifTrue: [^ filterPack brightnessShift].
    'fisheye' = t1 ifTrue: [^ filterPack fisheye].
    'color' = t1 ifTrue: [^ filterPack hueShift].
    'colour' = t1 ifTrue: [^ filterPack hueShift].
    'mosaic' = t1 ifTrue: [^ filterPack mosaicCount].
    'pixelate' = t1 ifTrue: [^ filterPack pixelateCount].
    'pointillize' = t1 ifTrue: [^ filterPack pointillizeSize].
    'saturation' = t1 ifTrue: [^ filterPack saturationShift].
    'transparency' = t1 | ('ghost' = t1) ifTrue: [^ self transparency].
    'whirl' = t1 ifTrue: [^ filterPack whirl]

Hope it helps.

What's the Block Spec? I seem to be having trouble creating one... and where do you put the code?


http://i46.tinypic.com/33df6me.png I'm whizzer0 for all things Minecraft.

Offline

 

#798 2010-07-09 13:08:19

midnightleopard
Scratcher
Registered: 2007-09-13
Posts: 1000+

Re: Cool custom blocks in Scratch

whizzer wrote:

LS97 wrote:

randalpik wrote:

I can't figure out how to make the Graphic effect reporter block... can someone help?

Here it is just quickly. i've got hw to do now!

Code:

getEffect: t1 
    filterPack ifNil: [^ 0].
    'blur' = t1 ifTrue: [^ filterPack blur].
    'brightness' = t1 ifTrue: [^ filterPack brightnessShift].
    'fisheye' = t1 ifTrue: [^ filterPack fisheye].
    'color' = t1 ifTrue: [^ filterPack hueShift].
    'colour' = t1 ifTrue: [^ filterPack hueShift].
    'mosaic' = t1 ifTrue: [^ filterPack mosaicCount].
    'pixelate' = t1 ifTrue: [^ filterPack pixelateCount].
    'pointillize' = t1 ifTrue: [^ filterPack pointillizeSize].
    'saturation' = t1 ifTrue: [^ filterPack saturationShift].
    'transparency' = t1 | ('ghost' = t1) ifTrue: [^ self transparency].
    'whirl' = t1 ifTrue: [^ filterPack whirl]

Hope it helps.

What's the Block Spec? I seem to be having trouble creating one... and where do you put the code?

the block spec is ('effect %g' #r #getEffect:)


http://pwp.wizards.com/5103673563/Scorecards/Landscape.png

Offline

 

#799 2010-07-09 13:13:06

whizzer
Scratcher
Registered: 2008-05-27
Posts: 500+

Re: Cool custom blocks in Scratch

Sparkyasa wrote:

nXIII wrote:

Sparkyasa wrote:

What's the code for the (ascii for[])?

um... asciiFor:

What's the Squeak code for it? And where should I put the code?

Incredibly, I've found that that code is already there  smile  . You only need to add the Block Spec.


http://i46.tinypic.com/33df6me.png I'm whizzer0 for all things Minecraft.

Offline

 

#800 2010-07-10 06:06:34

johnnydean1
Scratcher
Registered: 2010-02-12
Posts: 1000+

Re: Cool custom blocks in Scratch

LS97 wrote:

you cant make the #g, but you can make the %z %w and %j.
here's how:
go to scratch-blocks -> commandblockmorph -> private -> uncoloredargmorphfor:

and you'll see some frightening code. there, you'll find a list of $x = code ifTrue: [^ something]. all in alphabetical order.

add

$z = code ifTrue: [^ ChoiceOrExpressionArgMorph new getOptionsSelector: zipNames; choice: 'city'].

in the right alphabetical place.

now, back to ScriptableScratchMorph, add a method called zipNames like this:

zipNames
^ #( 'city' 'state' temperature' )

and all of that stuff following this template. then do the same thing from the beginning for the other two, %j and %w (which in the uncoloredArgMorphFor are $j and $w).


You can now reach me on Twitter @johnnydean1_

Offline

 

Board footer