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

#701 2010-06-19 06:43:49

paserra
Scratcher
Registered: 2010-06-06
Posts: 10

Re: Cool custom blocks in Scratch

Hi,
I'm a new member and I'm trying to write simple blocks using SmallTalk.
I have a question about the #r statment. I want to write a block similar to "timer" block in sensing category but i don't want to have the check box allowing "View on stage" (the final results should be similar to "mousex" in the same category).
Do you have solutions or suggestions?
Thank you.
Regards,
Pier Andrea.

Offline

 

#702 2010-06-19 07:04:42

Sperry
Scratcher
Registered: 2010-03-09
Posts: 500+

Re: Cool custom blocks in Scratch

paserra wrote:

Hi,
I'm a new member and I'm trying to write simple blocks using SmallTalk.
I have a question about the #r statment. I want to write a block similar to "timer" block in sensing category but i don't want to have the check box allowing "View on stage" (the final results should be similar to "mousex" in the same category).
Do you have solutions or suggestions?
Thank you.
Regards,
Pier Andrea.

Welcome paserra.

I think this is what you need to do:

1) Got to Scratch-Blocks -> CommandBlockMorph -> Private
2) Edit the the canBecomeWatcher method so that the name of your method you are adding is listed in the brackets with the other methods in it, like this:

Code:

canBecomeWatcher
    | t1 |
    t1 _ selector asString findAnySubStr: #('mouse' 'key' 'touching' 'distance' ) startingAt: 1.
    ^ self isReporter & (self argumentCount <= 1) & (#(#not #atRandom #abs #rounded #lineCountOfList: #stringLength: #INSERT METHOD NAME HERE) includes: selector) not & (t1 > selector asString size)

Hope this helps!


http://img709.imageshack.us/img709/3252/gobanim2.gifhttp://ls.gd/bo

Offline

 

#703 2010-06-19 07:20:46

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

Re: Cool custom blocks in Scratch

@Sperry:
couldn't have said it better!  big_smile

Offline

 

#704 2010-06-19 07:32:57

paserra
Scratcher
Registered: 2010-06-06
Posts: 10

Re: Cool custom blocks in Scratch

Thank you Sperry,
I've followed your instructions and it worked without problems...
Thank you again.
Pier Andrea.

Offline

 

#705 2010-06-19 07:45:39

Sperry
Scratcher
Registered: 2010-03-09
Posts: 500+

Re: Cool custom blocks in Scratch

paserra wrote:

Thank you Sperry,
I've followed your instructions and it worked without problems...
Thank you again.
Pier Andrea.

Your welcome! I'm glad it worked.


http://img709.imageshack.us/img709/3252/gobanim2.gifhttp://ls.gd/bo

Offline

 

#706 2010-06-19 10:57:52

Joeman592
Scratcher
Registered: 2010-01-23
Posts: 100+

Re: Cool custom blocks in Scratch

how do i make my skin upload into my mod?


http://i.imgur.com/HcAj1.png
http://i.imgur.com/gss7S.gifhttp://i.imgur.com/kbcKt.gifhttp://i.imgur.com/0LteM.gif

Offline

 

#707 2010-06-19 11:11:09

coolstuff
Community Moderator
Registered: 2008-03-06
Posts: 1000+

Re: Cool custom blocks in Scratch

Joeman592 wrote:

how do i make my skin upload into my mod?

Maybe this tutorial, and its sequels, can help you:
http://scratch.mit.edu/projects/Wolfie1996/972636

Offline

 

#708 2010-06-19 12:07:32

jmarie
Scratcher
Registered: 2010-03-13
Posts: 7

Re: Cool custom blocks in Scratch

<mouse down? move(  )steps distance to[ color[  ] Please Scratch team make this script

I have a really complicated project to make. Please?

Offline

 

#709 2010-06-19 12:45:04

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

Re: Cool custom blocks in Scratch

jmarie wrote:

<mouse down? move(  )steps distance to[ color[  ] Please Scratch team make this script

I have a really complicated project to make. Please?

could you explain yourself better?

Offline

 

#710 2010-06-19 12:50:04

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

Re: Cool custom blocks in Scratch

coolstuff wrote:

Joeman592 wrote:

how do i make my skin upload into my mod?

Maybe this tutorial, and its sequels, can help you:
http://scratch.mit.edu/projects/Wolfie1996/972636

i don't think that's the best way of changing the skin. besides, the tutorial doesn't include graphic elements. to load the new skin into your mod,
- make sure the skin is in a folder called ScratchSkin in the root directory of your mod.
- Open a workspace (World -> Open -> Workspace)
- paste into the workspace:

ScratchFrameMorph readSkinFrom: (FileDirectory default directoryNamed: 'ScratchSkin')

- select that text
- right-click and click 'do it'
- open a new Scratch frame (World -> Open -> Scratch)
- check all the features
- if everything works, save the scratch image.

Offline

 

#711 2010-06-19 13:07:25

Joeman592
Scratcher
Registered: 2010-01-23
Posts: 100+

Re: Cool custom blocks in Scratch

thx


http://i.imgur.com/HcAj1.png
http://i.imgur.com/gss7S.gifhttp://i.imgur.com/kbcKt.gifhttp://i.imgur.com/0LteM.gif

Offline

 

#712 2010-06-19 13:37:31

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

Re: Cool custom blocks in Scratch

LS97 wrote:

Treat others as you would like to be treated  smile  -Paddle2See

I doubt Paddle2See was the first to make that up lol


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

Offline

 

#713 2010-06-19 17:46:28

climber59
Scratcher
Registered: 2009-12-15
Posts: 100+

Re: Cool custom blocks in Scratch

midnightleopard wrote:

LS97 wrote:

Treat others as you would like to be treated  smile  -Paddle2See

I doubt Paddle2See was the first to make that up lol

He could have been the first to say it with a smilie though.


Check out my projects if you have a chance.

Offline

 

#714 2010-06-19 19:33:22

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

Re: Cool custom blocks in Scratch

climber59 wrote:

midnightleopard wrote:

LS97 wrote:

Treat others as you would like to be treated  smile  -Paddle2See

I doubt Paddle2See was the first to make that up lol

He could have been the first to say it with a smilie though.

Not just a smile - a smile EMOTICON!


nXIII

Offline

 

#715 2010-06-19 22:10:22

brantsmith
Scratcher
Registered: 2010-04-01
Posts: 21

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!

Just a little word to the wise. DO NOT PUT THIS BOCK IN A FOREVER or FOREVER IF BLOCK. I did it by accident one time and when the program ran, it shut down my internet. So  ( forever - go to www.someplace.com ) works great as a virus, but not as a good script!

Last edited by brantsmith (2010-06-19 22:11:52)


http://gbryouth.webstarts.com/uploads/event2.jpg

Offline

 

#716 2010-06-19 22:36:20

ScratchReallyROCKS
Scratcher
Registered: 2009-04-22
Posts: 1000+

Re: Cool custom blocks in Scratch

midnightleopard wrote:

LS97 wrote:

Treat others as you would like to be treated  smile  -Paddle2See

I doubt Paddle2See was the first to make that up lol

Paddle2See pioneered it on Scratch though...


http://imageshack.us/a/img694/3806/sigmad.png

Offline

 

#717 2010-06-20 03:22:15

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

Re: Cool custom blocks in Scratch

brantsmith 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!

Just a little word to the wise. DO NOT PUT THIS BOCK IN A FOREVER or FOREVER IF BLOCK. I did it by accident one time and when the program ran, it shut down my internet. So  ( forever - go to www.someplace.com ) works great as a virus, but not as a good script!

true. but i bet you didnt know you could actually make viruses in scratch  smile

Offline

 

#718 2010-06-20 03:23:23

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

Re: Cool custom blocks in Scratch

ScratchReallyROCKS wrote:

midnightleopard wrote:

LS97 wrote:

Treat others as you would like to be treated  smile  -Paddle2See

I doubt Paddle2See was the first to make that up lol

Paddle2See pioneered it on Scratch though...

my sig is just one of many thanks to the thread: The Paddle2See Revolution

Offline

 

#719 2010-06-20 03:59:19

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

Re: Cool custom blocks in Scratch

well, not anymore i guess  smile

Offline

 

#720 2010-06-20 11:13:43

paserra
Scratcher
Registered: 2010-06-06
Posts: 10

Re: Cool custom blocks in Scratch

Hi,
do someone knows how to implement a routine equivalent to strtok (in c) using squeak?
A similar scratch block cold be useful for parsing list items (loaded from a text file).
Regards,
Pier Andrea.

Offline

 

#721 2010-06-20 11:17:50

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

Re: Cool custom blocks in Scratch

whats strtok


You can now reach me on Twitter @johnnydean1_

Offline

 

#722 2010-06-20 11:29:54

paserra
Scratcher
Registered: 2010-06-06
Posts: 10

Re: Cool custom blocks in Scratch

johnnydean1 wrote:

whats strtok

strtok is a string function in c useful for splitting a string in substrings..ie you can split the following string "one,two,three" in three separare strings ("one" "two" "three") look at the following link:
http://www.elook.org/programming/c/strtok.html
Pier Andrea.

Offline

 

#723 2010-06-20 11:33:00

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

Re: Cool custom blocks in Scratch

so like using a sepearator like in a list

Cheese/Ham/Pepper

can become

Cheese
Ham
Pepper


In a list?


You can now reach me on Twitter @johnnydean1_

Offline

 

#724 2010-06-20 13:28:57

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

Re: Cool custom blocks in Scratch

Can anybody do
____      _________________
|    |__|          _____      |
| run smalltalk |      |     |
|___     ________________|
     |__|


/* No comment */

Offline

 

#725 2010-06-20 13:41:51

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

Re: Cool custom blocks in Scratch

@TheSuccessor:
i can try. should be easy.

Offline

 

Board footer