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!!!
OK, Ok.
Anyways, here is the (long-awaited) code:
[drumroll]
seesBroadcast: t1
| t2 |
t2 _ ScratchEvent allInstances.
t2
reverseDo:
[:t3 |
t3 name = t1 ifTrue: [^ true].
nil].
^ falseUnlike the Panther received block, this block picks up a broadcast wether there is a receive hat block for it or not.
[\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)
Offline
Cool
Its a nice peice of code...
And BTW
I just made a file exists block in Panther.
Offline
Oh can you try broadcast ___ to Sprite _____
Offline
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)
Offline
Ok but I think that that would be good...
Offline
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
Offline
Cool... but where do you put it?
Offline
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)
Offline
Awesome! I can't believe nobody found that out earlier...
Offline
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)
Offline
nXIII wrote:
Mods, please close this topic...
Why should they? Its only been open for a day.
Offline
TheGameMaster1231 wrote:
Awesome! I can't believe nobody found that out earlier...
![]()
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'.
Offline
Were do u put the code in scratch sprite morphs?
Offline
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 #-).
Offline
Also: Don't try to put this code into a Panther costom block.
^ spelling of custom
Offline
Popboy wrote:
[blocks] <point to x:( )y:( [/blocks]
lol the smiley detector picked that up as a frowny face cause you had :(
Offline
bumpety bumpy bump
Offline
Where do you put it, exactly?

Offline
JeanTheFox wrote:
Where do you put it, exactly?
The source-code. You should read up on it if you don't understand.
Offline
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.

Offline