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

#1 2011-09-05 16:40:06

Death_Wish
Scratcher
Registered: 2011-07-26
Posts: 1000+

<Last Broadcast=[]>

I'd like a <Last Broadcast=[]>. It would work well if you want it to do one thing if the last broadcast was ___ and another thing if the last broadcast was ____. You could use something like

When ___ clicked
If <Last Broadcast=[Move -10 Steps]>
Move 10 steps
If <Last Broadcast=[Move 10 Steps]>
Move -10 steps.

(It would be a boolean)
I'm sure there's already a bypass for this, but Scratch is about being easy, right? And this has already probably been suggested, so if this is a duplicate, please tell me and I'll delete it.


With a straight flush.
http://4.bp.blogspot.com/-FlUhnzmIROE/TgtpjdJl4tI/AAAAAAAABCM/W19pvFTZFaU/s1600/save_the_world.png http://blocsonic.com/images/special/rip-stevejobs.jpg

Offline

 

#2 2011-09-05 16:44:53

cpumaster930
Scratcher
Registered: 2009-02-23
Posts: 100+

Re: <Last Broadcast=[]>

http://i.imgur.com/1dKXx.gif
Done.  Simple enough  wink

Just set the variable "Last Broadcast" to whatever you're broadcasting every time you broadcast something. ;D

And if it was going to be a custom block, it'd be a built-in variable, not a boolean, so you could do more with it like string manipulation and the like.  smile


http://i.imgur.com/Qd0lu.png

Offline

 

#3 2011-09-05 16:52:15

Greenatic
Scratcher
Registered: 2009-05-03
Posts: 1000+

Re: <Last Broadcast=[]>

It would probably be better to just do (last broadcast).

Last edited by Greenatic (2011-09-05 20:25:45)

Offline

 

#4 2011-09-05 18:29:07

Death_Wish
Scratcher
Registered: 2011-07-26
Posts: 1000+

Re: <Last Broadcast=[]>

1.) You'd have to have many variables, and this'd work for a game that would include a lot of this.
2.) Greenatic, but then you wouldn't be able to make a difference if the last broadcast were, let's say Broadcast1 than Broadcast2. It wouldn't make a purpose...


With a straight flush.
http://4.bp.blogspot.com/-FlUhnzmIROE/TgtpjdJl4tI/AAAAAAAABCM/W19pvFTZFaU/s1600/save_the_world.png http://blocsonic.com/images/special/rip-stevejobs.jpg

Offline

 

#5 2011-09-05 19:08:35

kayybee
Scratcher
Registered: 2009-12-07
Posts: 1000+

Re: <Last Broadcast=[]>

Greenatic wrote:

It would probably be better to just do <last broadcast>.

You mean (last broadcast), right?

Because <last broadcast> would just say true/false, while (last broadcast) says the broadcast.

I believe (last broadcast) will be more efficient, because you can just combine it with <[] = []>

Offline

 

#6 2011-09-05 19:09:19

Death_Wish
Scratcher
Registered: 2011-07-26
Posts: 1000+

Re: <Last Broadcast=[]>

Oh, yeah, I guess (last broadcast) would be better, but probably harder to make.


With a straight flush.
http://4.bp.blogspot.com/-FlUhnzmIROE/TgtpjdJl4tI/AAAAAAAABCM/W19pvFTZFaU/s1600/save_the_world.png http://blocsonic.com/images/special/rip-stevejobs.jpg

Offline

 

#7 2011-09-05 20:24:21

Greenatic
Scratcher
Registered: 2009-05-03
Posts: 1000+

Re: <Last Broadcast=[]>

kayybee wrote:

Greenatic wrote:

It would probably be better to just do <last broadcast>.

You mean (last broadcast), right?

Because <last broadcast> would just say true/false, while (last broadcast) says the broadcast.

I believe (last broadcast) will be more efficient, because you can just combine it with <[] = []>

Yeah, I'll fix that.

DeathWish wrote:

Greenatic, but then you wouldn't be able to make a difference if the last broadcast were, let's say Broadcast1 than Broadcast2. It wouldn't make a purpose...

<(last broadcast) = [ ]>.  Plus, you would be able to manipulate it as a string, etc.

EDIT:  Sorry DeathWish, didn't see your last post.

Last edited by Greenatic (2011-09-05 20:27:03)

Offline

 

#8 2011-09-05 20:27:58

Greenatic
Scratcher
Registered: 2009-05-03
Posts: 1000+

Re: <Last Broadcast=[]>

Death_Wish wrote:

Oh, yeah, I guess (last broadcast) would be better, but probably harder to make.

And actually, it wouldn't be any harder.  In fact, the code would even be a little shorter!

Offline

 

#9 2011-09-06 02:29:14

scimonster
Community Moderator
Registered: 2010-06-13
Posts: 1000+

Re: <Last Broadcast=[]>

Greenatic wrote:

It would probably be better to just do (last broadcast).

Offline

 

#10 2011-09-06 17:02:40

ImagineIt
Scratcher
Registered: 2011-02-28
Posts: 1000+

Re: <Last Broadcast=[]>

scimonster wrote:

Greenatic wrote:

It would probably be better to just do (last broadcast).

Hey sci! Could you try making this and adding it to the block library?

Offline

 

#11 2011-09-07 00:34:57

scimonster
Community Moderator
Registered: 2010-06-13
Posts: 1000+

Re: <Last Broadcast=[]>

ImagineIt wrote:

scimonster wrote:

Greenatic wrote:

It would probably be better to just do (last broadcast).

Hey sci! Could you try making this and adding it to the block library?

... I guess I forgot to add it when it was submitted. >.<

Offline

 

#12 2011-09-07 17:44:19

Greenatic
Scratcher
Registered: 2009-05-03
Posts: 1000+

Re: <Last Broadcast=[]>

scimonster wrote:

ImagineIt wrote:

scimonster wrote:


Hey sci! Could you try making this and adding it to the block library?

... I guess I forgot to add it when it was submitted. >.<

You mean someone already made it?

Offline

 

#13 2011-09-08 03:16:42

scimonster
Community Moderator
Registered: 2010-06-13
Posts: 1000+

Re: <Last Broadcast=[]>

Greenatic wrote:

scimonster wrote:

ImagineIt wrote:


Hey sci! Could you try making this and adding it to the block library?

... I guess I forgot to add it when it was submitted. >.<

You mean someone already made it?

Yes.

Offline

 

#14 2011-09-08 08:13:54

Greenatic
Scratcher
Registered: 2009-05-03
Posts: 1000+

Re: <Last Broadcast=[]>

What's the default value?  I mean, what does it report if no broadcast has been sent?  Nil?  Green flag?

Offline

 

#15 2011-09-08 09:41:22

scimonster
Community Moderator
Registered: 2010-06-13
Posts: 1000+

Re: <Last Broadcast=[]>

Greenatic wrote:

What's the default value?  I mean, what does it report if no broadcast has been sent?  Nil?  Green flag?

Whatever you saved the image with.  tongue

Offline

 

#16 2011-09-08 09:43:15

JJROCKER
Scratcher
Registered: 2010-09-06
Posts: 1000+

Re: <Last Broadcast=[]>

I like the idea.


http://www.blocks.scratchr.org/API.php?action=random&amp;return=image&amp;link1=http://img255.imageshack.us/img255/3491/signature1y.jpg&amp;link2=http://img577.imageshack.us/img577/5272/signature1sx.jpg&amp;link3=http://img4.imageshack.us/img4/8514/signature1et.jpg&amp;link4=http://i.imgur.com/POEpQyZ.png&amp;link5=http://img163.imageshack.us/img163/4640/jjrockerfinal.jpg

Offline

 

#17 2011-09-08 13:05:26

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

Re: <Last Broadcast=[]>

I think that, with the advent of procedures and BYOB in Scratch 2.0, it will be easy to put  cpumaster's script into a custom block. That would be the ideal solution to this problem that has been asked so many times!

Last edited by LS97 (2011-09-08 13:05:35)

Offline

 

Board footer