♪♫♪bumpety bumpy bump bump♪♫♪
Offline
nXIII wrote:
rubiks_cube_guy238 wrote:
♪♫♪bumpety bumpy bump bump♪♫♪
Character map or just the Alt shortcuts?
char map
Offline
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
I figured I'd trim a few characters off
(I actually did change the code, if you're wondering)
seesBroadcast:n
ScratchEvent allInstances do:[:e|e name=n ifTrue:[^true]].^ falseLast edited by nXIII (2010-08-02 19:03:27)
Offline
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:)
Offline
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: ' ')
Offline
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!!!![]()
OK, Ok.Anyways, here is the (long-awaited) code:
[drumroll]Code:
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.
THANKS!!!always wanted one. BTW i lost the game
Offline
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
![]()
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
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
![]()
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.
Offline
How long do 'ScratchEvents' live for?
Offline
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.
Offline
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
![]()
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
Thomas96 wrote:
rubiks_cube_guy238 wrote:
Code:
seesBroadcast: t1 | t2 | t2 _ ScratchEvent allInstances. t2 reverseDo: [:t3 | t3 name = t1 ifTrue: [^ true]. nil]. ^ falsewhere does this go in?
This code goes into instance, other ops and replace any code, with
seesBroadcast: t1
| t2 |
t2 _ ScratchEvent allInstances.
t2
reverseDo:
[:t3 |
t3 name = t1 ifTrue: [^ true].
nil].
^ falseYeah, 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):
('%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)
Offline
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.
Last edited by bbbeb (2010-11-14 14:27:19)
Offline
Actually, they are all correct.
Offline
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)
Offline
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...
Offline
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.
Offline
I'm not saying they all make sense, I am just saying that they all work and can therefore be considered correct.
Offline
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....
Offline
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
![]()
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".
Offline