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

#1 2010-07-04 13:04:12

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

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

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.

Last edited by rubiks_cube_guy238 (2010-08-24 16:35:05)


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

Offline

 

#2 2010-07-04 13:06:14

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

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

Cool  smile


Its a nice peice of code...

And BTW
I just made a file exists block in Panther.


You can now reach me on Twitter @johnnydean1_

Offline

 

#3 2010-07-04 13:23:07

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

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

Oh can you try broadcast ___ to Sprite _____


You can now reach me on Twitter @johnnydean1_

Offline

 

#4 2010-07-04 13:24:07

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

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

johnnydean1 wrote:

Oh can you try broadcast ___ to Sprite _____

I already tried that. It doesn't work. And that wouldn't help the <[] received?> block.
Edit: Oh sorry I thought you said 'Or you can try...'.

Last edited by rubiks_cube_guy238 (2010-07-04 13:27:50)


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

Offline

 

#5 2010-07-04 13:26:22

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

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

Ok but I think that that would be good...


You can now reach me on Twitter @johnnydean1_

Offline

 

#6 2010-07-04 14:00:11

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

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

Ha... ScratchEvent....


nXIII

Offline

 

#7 2010-07-04 14:01:19

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

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

rubiks_cube_guy238 wrote:

johnnydean1 wrote:

Oh can you try broadcast ___ to Sprite _____

I already tried that. It doesn't work. And that wouldn't help the <[] received?> block.
Edit: Oh sorry I thought you said 'Or you can try...'.

t2 eventReceived: t1


nXIII

Offline

 

#8 2010-07-04 19:14:15

MathManiac
Scratcher
Registered: 2009-12-22
Posts: 37

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

Cool... but where do you put it?


http://i49.tinypic.com/29qjrwm.png
Programmers, Graphics and Music/SFX needed! Join Now!

Offline

 

#9 2010-07-04 20:27:36

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

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

Mods, please close this topic...


nXIII

Offline

 

#10 2010-07-05 10:08:21

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

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

ScratchReallyROCKS wrote:

nXIII wrote:

Mods, please close this topic...

bump.........where are you mods........

No, I want the feedback. I just DON'T want the feedback to be in the form of block sugestions or spam. And you don't need to bump this topic. It already has more than 14000 views which I accidently caused with a Panther project. It won't be getting down from the top of the Advanced Topics anytime soon.

Last edited by rubiks_cube_guy238 (2010-07-05 10:10:00)


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

Offline

 

#11 2010-07-05 10:19:29

TheGameMaster1231
Scratcher
Registered: 2009-07-24
Posts: 1000+

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

Awesome! I can't believe nobody found that out earlier...  tongue

Offline

 

#12 2010-07-05 10:48:48

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

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

This is a cool block! It works really well.

(I'm not sure how you could get any bad feedback on it....

Last edited by ScratchReallyROCKS (2010-07-05 10:51:07)


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

Offline

 

#13 2010-07-05 11:30:26

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

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

nXIII wrote:

Mods, please close this topic...

Why should they? Its only been open for a day.


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

 

#14 2010-07-05 12:58:16

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

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

TheGameMaster1231 wrote:

Awesome! I can't believe nobody found that out earlier...  tongue

Yeah. I actually had the same reaction when I figured out that it actually worked. Most people probably wouldn't think that a data structure would work with the allInstances method. The only reason why I tried it was because it was 'just crazy enough to work'.


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

Offline

 

#15 2010-07-05 13:00:20

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

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

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://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

#16 2010-07-05 13:19:35

recycle49
Scratcher
Registered: 2009-12-21
Posts: 1000+

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

Were do u put the code in scratch sprite morphs?


"Every challenge must be met, every battle must be won, and every story will end." -Me
Recycle49 December 09 - November 11 Goodbye

Offline

 

#17 2010-07-05 13:29:29

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

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

recycle49 wrote:

Were do u put the code in scratch sprite morphs?

Actually, you put all the code in ScriptableScratchMorph. You can just put it in the instance category 'other ops'. As for in the class blockSpecs, put ('%e received?' #b #seesBroadcast) after ('when I receive %e' #E #-).


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

Offline

 

#18 2010-07-10 14:27:33

bendad
Scratcher
Registered: 2008-06-14
Posts: 100+

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

it doesn't work for me....


Hi!  big_smile
Good to see you. (Even if I don't know you  wink  )

Offline

 

#19 2010-07-11 18:52:55

sccar3
Scratcher
Registered: 2008-09-04
Posts: 100+

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

thnx!  smile


http://1.bp.blogspot.com/-WInb2DZ2LBM/UQaLETx3VII/AAAAAAAAAmQ/ZOpSwEPggiE/s1600/The%2BElder%2BScrolls%2BOnline%2BSignup%2BBeta.jpg

Offline

 

#20 2010-07-20 12:56:16

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

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

Also: Don't try to put this code into a Panther costom block.

^ spelling of custom


You can now reach me on Twitter @johnnydean1_

Offline

 

#21 2010-07-21 20:52:15

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

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

Popboy wrote:

[blocks] <point to x:(  )y:(   [/blocks]

lol the smiley detector picked that up as a frowny face cause you had :(


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

Offline

 

#22 2010-07-25 07:57:10

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

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

bumpety bumpy bump


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

Offline

 

#23 2010-07-28 11:47:10

JeanTheFox
Scratcher
Registered: 2010-06-14
Posts: 1000+

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

Where do you put it, exactly?


http://i51.tinypic.com/20gcn5j.png

Offline

 

#24 2010-07-28 14:33:00

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

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

JeanTheFox wrote:

Where do you put it, exactly?

The source-code. You should read up on it if you don't understand.


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

 

#25 2010-07-28 17:45:12

JeanTheFox
Scratcher
Registered: 2010-06-14
Posts: 1000+

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

markyparky56 wrote:

JeanTheFox wrote:

Where do you put it, exactly?

The source-code. You should read up on it if you don't understand.

Is that a specific area? Does it go to the main block programming area or in a separate area? If you think I don't understand BYOB, I do, I've made a functioning one.


http://i51.tinypic.com/20gcn5j.png

Offline

 

Board footer