If You Are Not An Experienced Squeak Hacker, Then This Is Not For You. If You Are, Then Hello! I Am Hosting A Contest For All Of You People! The First Person To Make The <receive []> Block And Tell Me The Code, Wins! The First Person To Give Me The Code Will:
1. Get A Love It On All Of Their Projects
2. Go On My Freinds List
3. Get A Free Ride On A Private Jet To Go To A Tropical Paradice!
Lol. I'm Joking. There Is No Tropical Paradice.
So Hurry Up And Give Me That Code!
RULES:
1. If You Give Me The Code First, Don't Go Bragging About It Or You'll Be Disqualified.
2. The Hacked Block MUST WORK.
3. DO NOT Complain If You Don't Give Me The Code First.
4. Have Fun! (Lol. That's Oldschool.)
5. Really? You Expect There To Be More Rules? No Way! Hey, It's A Free Country!
So What Are You Waiting For? The First Person To Give Me The Code For The Block Wins! So Hurry Up! HURRY HURRY HURRY HURRY!!!!!!!!!!!!
Offline
This is technically not possible. The Scratch team so nicely refers to broadcasting messages as 'events' in the source code, and that's for a reason. Basically, the <broadcast[ [/blocks] command calls a function which sorts through all the code and looks for scripts that handle the broadcasted event (message). If it finds one, it starts it up. There is no array of broadcasted messages, and how can you tell WHEN it was 'broadcasted' and for how long?
To do what you're trying to do, just use a trigger variable for when the sprite is looking for the message to be broadcasted, like so:
<when green flag clicked>
<forever>
<if><key[ space ]pressed?>
<set{ canAcceptBroadcast }to( 1
<else>
<set{ canAcceptBroadcast }to( 0
<end>
<end>
<when I receive[ someMessage
<if><( <{ canAcceptBroadcast }> <=> 1 )>
do something...
<end>
[/blocks]
Last edited by nXIII (2010-03-28 20:51:17)
Offline
I can think of a way it might be possible....................
I'll get back on that.
Offline
nXIII wrote:
This is technically not possible. The Scratch team so nicely refers to broadcasting messages as 'events' in the source code, and that's for a reason. Basically, the <broadcast[ [/blocks] command calls a function which sorts through all the code and looks for scripts that handle the broadcasted event (message). If it finds one, it starts it up. There is no array of broadcasted messages, and how can you tell WHEN it was 'broadcasted' and for how long?
To do what you're trying to do, just use a trigger variable for when the sprite is looking for the message to be broadcasted, like so:
<when green flag clicked>
<forever>
<if><key[ space ]pressed?>
<set{ canAcceptBroadcast }to( 1
<else>
<set{ canAcceptBroadcast }to( 0
<end>
<end>
<when I receive[ someMessage
<if><( <{ canAcceptBroadcast }> <=> 1 )>
do something...
<end>
[/blocks]
Of Course You Would Use That, And I've Always BEEN Doing That. But The <receive []> Block Would Be So Much Simpler Than That, Of Course. You Could Do:
<wait until> <receive [message]>
Last edited by TheGameMaster1231 (2010-03-29 07:23:22)
Offline
billyedward wrote:
I can think of a way it might be possible....................
I'll get back on that.
If It Is Possible, Then You And Jens Are Probably 2 Of The Best People That Could It!
Last edited by TheGameMaster1231 (2010-03-29 07:32:21)
Offline
I think that a [blocks] <{ last received message }> block might work better.
Offline
Billybob-Mario wrote:
I think that a [blocks] <{ last received message }> block might work better.
Not Really, Because With The <receive []> Block You Could Do This:
<wait until> <receive []>
With The <{ last received message }> Block You Would Not Be Able To Do That.
Last edited by TheGameMaster1231 (2010-03-29 15:46:37)
Offline
BWOG wrote:
Please Stop Talking Like This.
I Get That Alot.
Offline
I can't wait too see this block!
Offline
TheGameMaster1231 wrote:
BWOG wrote:
Please Stop Talking Like This.
I Get That Alot.
![]()
You don'te have to type in all caps.
Offline
soupoftomato wrote:
TheGameMaster1231 wrote:
BWOG wrote:
Please Stop Talking Like This.
I Get That Alot.
![]()
You don'te have to type in all caps.
i know i don't but it looks better than typing like this 0r l1ke 7yp1ng L1ke 7h1s.
Offline
TheGameMaster1231 wrote:
Billybob-Mario wrote:
I think that a [blocks] <{ last received message }> block might work better.
Not Really, Because With The <receive []> Block You Could Do This:
<wait until> <receive []>
With The <{ last received message }> Block You Would Not Be Able To Do That.![]()
I mean because it would be more possible. The <receive []> block wouldn't really work do to the source code stuff, <{last received}> would work better.
Offline
Billybob-Mario wrote:
TheGameMaster1231 wrote:
Billybob-Mario wrote:
I think that a [blocks] <{ last received message }> block might work better.
Not Really, Because With The <receive []> Block You Could Do This:
<wait until> <receive []>
With The <{ last received message }> Block You Would Not Be Able To Do That.![]()
I mean because it would be more possible. The <receive []> block wouldn't really work do to the source code stuff, <{last received}> would work better.
I Know What You're Saying, But Even If It COULD, It Would End Up Being:
<wait until> <{last received}>
But That Really Doesn't Make Any Sense At All.
Last edited by TheGameMaster1231 (2010-03-31 16:13:22)
Offline
er, I'm sorry but it seems to me that you have no actual idea how the block would work yourself, rather asking people to find the block code because you want it and increasing the intrest by releasing the request as a competition... Do correct me if I made a false assumption here, that's just how it looks.
Offline
sparks wrote:
er, I'm sorry but it seems to me that you have no actual idea how the block would work yourself, rather asking people to find the block code because you want it and increasing the intrest by releasing the request as a competition... Do correct me if I made a false assumption here, that's just how it looks.
Nope, that's probably right
Offline
sparks wrote:
er, I'm sorry but it seems to me that you have no actual idea how the block would work yourself, rather asking people to find the block code because you want it and increasing the intrest by releasing the request as a competition... Do correct me if I made a false assumption here, that's just how it looks.
Ok, Here Are The Things That Aren't Correct:
sparks wrote:
er, I'm sorry but it seems to me that HERE: you have no actual idea how the block would work yourself, rather asking people to find the block code because you want it AND HERE: and increasing the intrest by releasing the request as a competition... Do correct me if I made a false assumption here, that's just how it looks.
About The 'I Have No Idea How It Would Work' Thing, I Know Half Of The Code, I've Made The Block, But I Haven't Made It Function Properly. (It Keeps Coming Up With Errors When It Shouldn't...)
Now, About The 'Asking People To Find The Block Code' Thing, Yes, That Is True. But As Stated Above, I Know Half The Code Already.
And About Increasing Interest By Making It A Competetion, That's Not How I Roll. And Would It REALLY Attract More Attention If It's A Contest Anyway?
So You're About Half Right And Half Wrong.
Last edited by TheGameMaster1231 (2010-04-03 17:25:51)
Offline
I can make the block but I can't make it work.
I tried adding the same action as the [blocks]<when I receive[ what ]>[/blocks] but I just get an error.
yeah it doesn't work.
Last edited by midnightleopard (2010-04-09 19:29:48)
Offline
midnightleopard wrote:
I can make the block but I can't make it work.
I tried adding the same action as the [blocks]<when I receive[ what ]>[/blocks] but I just get an error.
http://dl.dropbox.com/u/5395643/Screenshot.png yeah it doesn't work.
Welcome To My World. Population: Me, Because It Is My World So You Should Not Be In It.
Oh, And I Also Tried Adding The Same Function Of The [block]<when I receive[ Something[/block] Block.
Last edited by TheGameMaster1231 (2010-04-10 07:34:04)
Offline
TheGameMaster1231 wrote:
Billybob-Mario wrote:
TheGameMaster1231 wrote:
Not Really, Because With The <receive []> Block You Could Do This:
<wait until> <receive []>
With The <{ last received message }> Block You Would Not Be Able To Do That.![]()
I mean because it would be more possible. The <receive []> block wouldn't really work do to the source code stuff, <{last received}> would work better.
I Know What You're Saying, But Even If It COULD, It Would End Up Being:
<wait until> <{last received}>
But That Really Doesn't Make Any Sense At All.![]()
The [blocks] < I receive [ ] ? > [/blocks] block wouldn't work, due to the way that scratch was made. [blocks] <{ last received }>[/blocks] would work.
Offline
Billybob-Mario wrote:
TheGameMaster1231 wrote:
Billybob-Mario wrote:
I mean because it would be more possible. The <receive []> block wouldn't really work do to the source code stuff, <{last received}> would work better.
I Know What You're Saying, But Even If It COULD, It Would End Up Being:
<wait until> <{last received}>
But That Really Doesn't Make Any Sense At All.![]()
The [blocks] < I receive [ ] ? > [/blocks] block wouldn't work, due to the way that scratch was made. [blocks] <{ last received }>[/blocks] would work.
I Understand What You Mean, But I Don't Even Understand How The [block]<Last Received>[/block] Block Would Work.
Offline
This Has Been So Old, I'm Asking A Mod To Close It.
Offline
TheGameMaster1231 wrote:
Billybob-Mario wrote:
TheGameMaster1231 wrote:
I Know What You're Saying, But Even If It COULD, It Would End Up Being:
<wait until> <{last received}>
But That Really Doesn't Make Any Sense At All.![]()
The [blocks] < I receive [ ] ? > [/blocks] block wouldn't work, due to the way that scratch was made. [blocks] <{ last received }>[/blocks] would work.
I Understand What You Mean, But I Don't Even Understand How The [block]<Last Received>[/block] Block Would Work.
![]()
It is a reporter block that reports the last thing received.
[blocks]<wait until<( <{ last received }> <=> whatever )>>
Offline