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

#26 2010-07-31 06:21:15

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

Re: The Long-Awaited <[] received?> Block!!!!!!!!!!!!!!!!!!!!!!

♪♫♪bumpety bumpy bump bump♪♫♪


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

Offline

 

#27 2010-07-31 11:40:59

HD123
Scratcher
Registered: 2009-12-05
Posts: 500+

Re: The Long-Awaited <[] received?> Block!!!!!!!!!!!!!!!!!!!!!!

The class is

Code:

('I receive %e' #b #seesBroadcast: ' ')

Last edited by HD123 (2010-07-31 11:46:35)


~~HD123~~
Treat others as you want to be treated. |  big_smile  | http://i.imgur.com/OaNrY.gif | http://blocks.scratchr.org/libstatus.php?user=HD123&amp;online=http://lemonfanatic.webs.com/ONLINE.png&amp;offline=http://lemonfanatic.webs.com/OFFLINE.png

Offline

 

#28 2010-08-01 11:25:05

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

Re: The Long-Awaited <[] received?> Block!!!!!!!!!!!!!!!!!!!!!!

rubiks_cube_guy238 wrote:

♪♫♪bumpety bumpy bump bump♪♫♪

Character map or just the Alt shortcuts?


nXIII

Offline

 

#29 2010-08-01 12:52:43

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

Re: The Long-Awaited <[] received?> Block!!!!!!!!!!!!!!!!!!!!!!

nXIII wrote:

rubiks_cube_guy238 wrote:

♪♫♪bumpety bumpy bump bump♪♫♪

Character map or just the Alt shortcuts?

char map


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

Offline

 

#30 2010-08-02 15:32:42

Thomas96
Scratcher
Registered: 2010-03-25
Posts: 100+

Re: The Long-Awaited <[] received?> Block!!!!!!!!!!!!!!!!!!!!!!

rubiks_cube_guy238 wrote:

Code:

seesBroadcast: t1 
    | t2 |
    t2 _ ScratchEvent allInstances.
    t2
        reverseDo:     
            [:t3 | 
            t3 name = t1 ifTrue: [^ true].
            nil].
    ^ false

where does this go in?

Offline

 

#31 2010-08-02 19:03:04

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

Re: The Long-Awaited <[] received?> Block!!!!!!!!!!!!!!!!!!!!!!

I figured I'd trim a few characters off  tongue  (I actually did change the code, if you're wondering)

Code:

seesBroadcast:n
    ScratchEvent allInstances do:[:e|e name=n ifTrue:[^true]].^ false

Last edited by nXIII (2010-08-02 19:03:27)


nXIII

Offline

 

#32 2010-08-04 17:57:42

PlayWithFire
Scratcher
Registered: 2010-01-20
Posts: 1000+

Re: The Long-Awaited <[] received?> Block!!!!!!!!!!!!!!!!!!!!!!

it works fine now, but you said to put this code in to someone
('%e received?' #b #seesBroadcast)

but i had to change it to this in order for it to work

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


http://scratch.mit.edu/static/projects/PlayWithFire/1610180_sm.png
Check out the DG Games Website For the latest news on games like Infected

Offline

 

#33 2010-08-06 07:48:28

HD123
Scratcher
Registered: 2009-12-05
Posts: 500+

Re: The Long-Awaited <[] received?> Block!!!!!!!!!!!!!!!!!!!!!!

PlayWithFire wrote:

it works fine now, but you said to put this code in to someone
('%e received?' #b #seesBroadcast)

but i had to change it to this in order for it to work

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

I didn't say ('%e received?' #b #seesBroadcast) I said ('%e received?' #b #seesBroadcast: ' ')


~~HD123~~
Treat others as you want to be treated. |  big_smile  | http://i.imgur.com/OaNrY.gif | http://blocks.scratchr.org/libstatus.php?user=HD123&amp;online=http://lemonfanatic.webs.com/ONLINE.png&amp;offline=http://lemonfanatic.webs.com/OFFLINE.png

Offline

 

#34 2010-09-20 17:02:46

zorket
Scratcher
Registered: 2010-05-25
Posts: 500+

Re: The Long-Awaited <[] received?> Block!!!!!!!!!!!!!!!!!!!!!!

('I am receiving %e' #b #seesBroadcast:) Is one of the blockspecs.


Marzipan11 must learn to not spoil

Offline

 

#35 2010-10-24 07:49:47

OldWheezerGeezer
Scratcher
Registered: 2010-06-04
Posts: 500+

Re: The Long-Awaited <[] received?> Block!!!!!!!!!!!!!!!!!!!!!!

rubiks_cube_guy238 wrote:

Laddies and gentlemen, may I now present:
The <[] received?> Block!!!!!!!!!!!!!!!!!!!!!!!
First of all, I would like to tha...
SHUT UP AND TELL US THE CODE ALREADY!!! mad
OK, Ok.  smile  Anyways, here is the (long-awaited) code:
[drumroll]

Code:

seesBroadcast: t1 
    | t2 |
    t2 _ ScratchEvent allInstances.
    t2
        reverseDo:     
            [:t3 | 
            t3 name = t1 ifTrue: [^ true].
            nil].
    ^ false

Unlike the Panther received block, this block picks up a broadcast wether there is a receive hat block for it or not. smile
[\b]

Note: The more broadcasts the project has, the less likely it is that the block will detect it. Also, the block probally will not work if it is a result of a sprite being clicked or a key being pressed. In other words, if you use this block, use
<when green flag clicked>
<forever if>[/blocks]<I receive []>
...do whatever here...

<end>
[/blocks] instead of
<when I receive[

Edit: If you are wondering how the heck there's so many views but so little posts, that's because I made a Panther ptoject to tell me when there's a new post. But that involved looking at the web page. Which made the views go up.
Also, this is NOT a forum thread to sugest hacked blocks. Just because I make one cool block does NOT make me a block dispenser.

THANKS!!!always wanted one. BTW i lost the game

Offline

 

#36 2010-10-24 07:53:40

OldWheezerGeezer
Scratcher
Registered: 2010-06-04
Posts: 500+

Re: The Long-Awaited <[] received?> Block!!!!!!!!!!!!!!!!!!!!!!

sparks wrote:

great work! this is a nice piece of work indeed, I really hope the mods see this and consider putting it in 2.0  smile

http://suggest.scratch.mit.edu/forums/60449-suggestions

BTW where do you put this code? Please tell me, thanks!

Last edited by OldWheezerGeezer (2010-10-24 07:54:19)

Offline

 

#37 2010-10-24 08:12:06

HD123
Scratcher
Registered: 2009-12-05
Posts: 500+

Re: The Long-Awaited <[] received?> Block!!!!!!!!!!!!!!!!!!!!!!

OldWheezerGeezer wrote:

sparks wrote:

great work! this is a nice piece of work indeed, I really hope the mods see this and consider putting it in 2.0  smile

http://suggest.scratch.mit.edu/forums/60449-suggestions

BTW where do you put this code? Please tell me, thanks!

Shortly,

Instance:
1. Shift-click the R on the Scratch logo and hit "turn fill screen off".
2. Right-click the white space.
3. Hit "open", then "browser".
4. Hit "Scratch-Objects".
5. Hit "ScriptableScratchMorph".
6. Scroll to the bottom.
7. Right-click next to "private".
8. A menu will come up.  Hit "new category...".
9. Hit "new...".
10. Type in "new ops" and click "Accept (s)".
11. In a text box it says "message selector and argument names "comment stating purpose of message" |temporary variable names| statements".  Delete that, and insert the code for the block.
12. Right-click the text and click "accept (s)".
13. Hit the close button at the top-left.
14. Shift click the R in the Scratch logo and hit "turn fill screen on".

WAIT!  It doesn't show up!

I know it doesn't show up yet.  You're not done coding yet.

The next part, the class:
1. Do steps 1-4 of the instance instructions.
2. Hit "class" (next to instance and ?).
3. Hit "ScriptableScratchMorph".
4. Hit "block specs".
5. Hit "blockSpecs".
6. Hit down, twice.
7. Press the right arrow key 17 times.
8. Press space.
9. Type in ('%e received?' #b #seesBroadcast: ' ')
10. Right click in the box.
11. Hit "accept (s)".
12. Hit the close button in the top-left.
13. Shift click the R in the scratch logo and select "turn fill screen on".

Hope this helps.


~~HD123~~
Treat others as you want to be treated. |  big_smile  | http://i.imgur.com/OaNrY.gif | http://blocks.scratchr.org/libstatus.php?user=HD123&amp;online=http://lemonfanatic.webs.com/ONLINE.png&amp;offline=http://lemonfanatic.webs.com/OFFLINE.png

Offline

 

#38 2010-10-24 08:55:06

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

Re: The Long-Awaited <[] received?> Block!!!!!!!!!!!!!!!!!!!!!!

How long do 'ScratchEvents' live for?


/* No comment */

Offline

 

#39 2010-10-24 14:03:26

bbbeb
Scratcher
Registered: 2009-06-11
Posts: 1000+

Re: The Long-Awaited <[] received?> Block!!!!!!!!!!!!!!!!!!!!!!

TheSuccessor wrote:

How long do 'ScratchEvents' live for?

Until it is done being called.

So to make this work well, then use the [broadcast [] and wait] block.


Back in my day.... there were no laws that censored the internet... now, there are.... nah.

Offline

 

#40 2010-10-25 17:08:42

OldWheezerGeezer
Scratcher
Registered: 2010-06-04
Posts: 500+

Re: The Long-Awaited <[] received?> Block!!!!!!!!!!!!!!!!!!!!!!

HD123 wrote:

OldWheezerGeezer wrote:

sparks wrote:

great work! this is a nice piece of work indeed, I really hope the mods see this and consider putting it in 2.0  smile

http://suggest.scratch.mit.edu/forums/60449-suggestions

BTW where do you put this code? Please tell me, thanks!

Shortly,

Instance:
1. Shift-click the R on the Scratch logo and hit "turn fill screen off".
2. Right-click the white space.
3. Hit "open", then "browser".
4. Hit "Scratch-Objects".
5. Hit "ScriptableScratchMorph".
6. Scroll to the bottom.
7. Right-click next to "private".
8. A menu will come up.  Hit "new category...".
9. Hit "new...".
10. Type in "new ops" and click "Accept (s)".
11. In a text box it says "message selector and argument names "comment stating purpose of message" |temporary variable names| statements".  Delete that, and insert the code for the block.
12. Right-click the text and click "accept (s)".
13. Hit the close button at the top-left.
14. Shift click the R in the Scratch logo and hit "turn fill screen on".

WAIT!  It doesn't show up!

I know it doesn't show up yet.  You're not done coding yet.

The next part, the class:
1. Do steps 1-4 of the instance instructions.
2. Hit "class" (next to instance and ?).
3. Hit "ScriptableScratchMorph".
4. Hit "block specs".
5. Hit "blockSpecs".
6. Hit down, twice.
7. Press the right arrow key 17 times.
8. Press space.
9. Type in ('%e received?' #b #seesBroadcast: ' ')
10. Right click in the box.
11. Hit "accept (s)".
12. Hit the close button in the top-left.
13. Shift click the R in the scratch logo and select "turn fill screen on".

Hope this helps.

ZOMG it works thank you!!!!

Offline

 

#41 2010-11-09 19:21:00

zorket
Scratcher
Registered: 2010-05-25
Posts: 500+

Re: The Long-Awaited <[] received?> Block!!!!!!!!!!!!!!!!!!!!!!

Thomas96 wrote:

rubiks_cube_guy238 wrote:

Code:

seesBroadcast: t1 
    | t2 |
    t2 _ ScratchEvent allInstances.
    t2
        reverseDo:     
            [:t3 | 
            t3 name = t1 ifTrue: [^ true].
            nil].
    ^ false

where does this go in?

This code goes into instance, other ops and replace any code, with

Code:

seesBroadcast: t1 
    | t2 |
    t2 _ ScratchEvent allInstances.
    t2
        reverseDo:     
            [:t3 | 
            t3 name = t1 ifTrue: [^ true].
            nil].
    ^ false

Yeah, I copied this off rubiks man.

You are going to use a blockspec. Here is a list of them (place one of them in control):

Code:

('%e received?' #b #seesBroadcast:) shows [ (broadcast) received?]

('I receive %e' #b #seesBroadcast:) shows [I receive (broadcast) ]

('%e being broadcasted?' #b #seesBroadcast:) shows [ (broadcast) bring broadcasted?]

If you want a custom spec, just ask!

Last edited by zorket (2010-11-09 19:28:10)


Marzipan11 must learn to not spoil

Offline

 

#42 2010-11-09 21:19:33

bbbeb
Scratcher
Registered: 2009-06-11
Posts: 1000+

Re: The Long-Awaited <[] received?> Block!!!!!!!!!!!!!!!!!!!!!!

zorket wrote:

You are going to use a blockspec. Here is a list of them (place one of them in control):

Code:

('%e received?' #b #seesBroadcast:) shows [ (broadcast) received?]

('I receive %e' #b #seesBroadcast:) shows [I receive (broadcast) ]

('%e being broadcasted?' #b #seesBroadcast:) shows [ (broadcast) bring broadcasted?]

If you want a custom spec, just ask!

All are incorrect except ('%e being broadcasted?'  #b #seesBroadcast:)

EDIT: Well, they all work, but the %e being broadcasted? makes more sense in my opinion.  tongue

Last edited by bbbeb (2010-11-14 14:27:19)


Back in my day.... there were no laws that censored the internet... now, there are.... nah.

Offline

 

#43 2010-11-10 11:33:09

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

Re: The Long-Awaited <[] received?> Block!!!!!!!!!!!!!!!!!!!!!!

Actually, they are all correct.


/* No comment */

Offline

 

#44 2010-11-10 15:33:11

bbbeb
Scratcher
Registered: 2009-06-11
Posts: 1000+

Re: The Long-Awaited <[] received?> Block!!!!!!!!!!!!!!!!!!!!!!

TheSuccessor wrote:

Actually, they are all correct.

%e received?  is saying you had received it. It is only temporary, and hardly functions to it's purpose.

I receive %e   is not a Boolean.

%e being broadcasted? makes the most sense. It says that the message is still a process, and can still be called.

The others cannot be called for more than 3 seconds.

Last edited by bbbeb (2010-11-10 15:33:40)


Back in my day.... there were no laws that censored the internet... now, there are.... nah.

Offline

 

#45 2010-11-13 20:33:02

zorket
Scratcher
Registered: 2010-05-25
Posts: 500+

Re: The Long-Awaited <[] received?> Block!!!!!!!!!!!!!!!!!!!!!!

bbbeb wrote:

TheSuccessor wrote:

Actually, they are all correct.

%e received?  is saying you had received it. It is only temporary, and hardly functions to it's purpose.

I receive %e   is not a Boolean.

%e being broadcasted? makes the most sense. It says that the message is still a process, and can still be called.

The others cannot be called for more than 3 seconds.

Blah blah blah, I am bbbeb and I like to be rude all day posting junk like this...


Marzipan11 must learn to not spoil

Offline

 

#46 2010-11-14 05:57:26

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

Re: The Long-Awaited <[] received?> Block!!!!!!!!!!!!!!!!!!!!!!

zorket wrote:

bbbeb wrote:

TheSuccessor wrote:

Actually, they are all correct.

%e received?  is saying you had received it. It is only temporary, and hardly functions to it's purpose.

I receive %e   is not a Boolean.

%e being broadcasted? makes the most sense. It says that the message is still a process, and can still be called.

The others cannot be called for more than 3 seconds.

Blah blah blah, I am bbbeb and I like to be rude all day posting junk like this...

Leave bbbeb alone. He has a valid point.


You can now reach me on Twitter @johnnydean1_

Offline

 

#47 2010-11-14 06:22:56

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

Re: The Long-Awaited <[] received?> Block!!!!!!!!!!!!!!!!!!!!!!

I'm not saying they all make sense, I am just saying that they all work and can therefore be considered correct.


/* No comment */

Offline

 

#48 2010-11-14 14:26:08

bbbeb
Scratcher
Registered: 2009-06-11
Posts: 1000+

Re: The Long-Awaited <[] received?> Block!!!!!!!!!!!!!!!!!!!!!!

TheSuccessor wrote:

I'm not saying they all make sense, I am just saying that they all work and can therefore be considered correct.

Aah, i get what you are saying.

zorket wrote:

Blah blah blah, I am bbbeb and I like to be rude all day posting junk like this...

Really? They are only suggestions....
And you are the one who posts tutorials all over threads so you can get more attention....


Back in my day.... there were no laws that censored the internet... now, there are.... nah.

Offline

 

#49 2010-11-16 17:33:13

ArrowHead
Scratcher
Registered: 2010-10-17
Posts: 92

Re: The Long-Awaited <[] received?> Block!!!!!!!!!!!!!!!!!!!!!!

HD123 wrote:

OldWheezerGeezer wrote:

sparks wrote:

great work! this is a nice piece of work indeed, I really hope the mods see this and consider putting it in 2.0  smile

BTW where do you put this code? Please tell me, thanks!

Shortly,

Instance:
1. Shift-click the R on the Scratch logo and hit "turn fill screen off".
2. Right-click the white space.
3. Hit "open", then "browser".
4. Hit "Scratch-Objects".
5. Hit "ScriptableScratchMorph".
6. Scroll to the bottom.
7. Right-click next to "private".
8. A menu will come up.  Hit "new category...".
9. Hit "new...".
10. Type in "new ops" and click "Accept (s)".
11. In a text box it says "message selector and argument names "comment stating purpose of message" |temporary variable names| statements".  Delete that, and insert the code for the block.
12. Right-click the text and click "accept (s)".
13. Hit the close button at the top-left.
14. Shift click the R in the Scratch logo and hit "turn fill screen on".

WAIT!  It doesn't show up!

I know it doesn't show up yet.  You're not done coding yet.

The next part, the class:
1. Do steps 1-4 of the instance instructions.
2. Hit "class" (next to instance and ?).
3. Hit "ScriptableScratchMorph".
4. Hit "block specs".
5. Hit "blockSpecs".
6. Hit down, twice.
7. Press the right arrow key 17 times.
8. Press space.
9. Type in ('%e received?' #b #seesBroadcast: ' ')
10. Right click in the box.
11. Hit "accept (s)".
12. Hit the close button in the top-left.
13. Shift click the R in the scratch logo and select "turn fill screen on".

Hope this helps.

Uh, you forgot step 14-15!

14.If you want to save your changes, Shift-click-R and click "save image for end user"(or something like that)
15. Click "yes".


See previews of Earth, my current project written in C# and XNA, and provide feedback here!

Offline

 

Board footer