Can somebody make answer contains[] for me? I'm a beginner at squeak and I want it for my coding language.
Offline
i tried to get the get time/date block and the save stage area to sprite block and they didn't work i think it was because whenever i went out of the system browser or pressed a button it said nothing had been saved continue or not i continued because i dont know how to save in the system browser. if this is the problem can somebody tell me how to save if this is not the problem can somebody tell me what is because i did what the instructions said to do.
Offline
flurr wrote:
i tried to get the get time/date block and the save stage area to sprite block and they didn't work i think it was because whenever i went out of the system browser or pressed a button it said nothing had been saved continue or not i continued because i dont know how to save in the system browser. if this is the problem can somebody tell me how to save if this is not the problem can somebody tell me what is because i did what the instructions said to do.
wait never mind i know wat it was.
Offline
poemon1 wrote:
littlebird2472 wrote:
Can somebody make answer contains[] for me? I'm a beginner at squeak and I want it for my coding language.
('answer contains %s' #b #answerContains 'thing')
The block doesn't work.
Last edited by littlebird2472 (2011-07-26 16:19:21)
Offline
littlebird2472 wrote:
poemon1 wrote:
littlebird2472 wrote:
Can somebody make answer contains[] for me? I'm a beginner at squeak and I want it for my coding language.
('answer contains %s' #b #answerContains 'thing')
The block doesn't work.
try copying the code off slash
Offline
poemon1 wrote:
littlebird2472 wrote:
poemon1 wrote:
('answer contains %s' #b #answerContains 'thing')The block doesn't work.
try copying the code off slash
('%s contains %s' #b #if:contains: 'something' 'thing')
and
if: t1 contains: t2
(t1 findString: t2)
> 0 ifTrue: [^ true].
^ false
Offline
poemon1 wrote:
poemon1 wrote:
littlebird2472 wrote:
The block doesn't work.try copying the code off slash
('%s contains %s' #b #if:contains: 'something' 'thing')
and
if: t1 contains: t2
(t1 findString: t2)
> 0 ifTrue: [^ true].
^ false
Testing it now. Thanks!
Offline
littlebird2472 wrote:
poemon1 wrote:
poemon1 wrote:
try copying the code off slash('%s contains %s' #b #if:contains: 'something' 'thing')
and
if: t1 contains: t2
(t1 findString: t2)
> 0 ifTrue: [^ true].
^ falseTesting it now. Thanks!
yw
Offline
Thank you for this useful tutorial! Now, I can create my,"Say Nothing" block! It will allow you to stop your chat and get rid of your speech bubble. I LOVEZ BLEW!
Offline
Hello again, I created a code to help me do something in Javascript and maybe help others to create a hacking software for other games.
javascript;c#_(hack)01_addPoints[999999999999999]client;sideHack:giveTeleportaccessEverywhere+freeAdmin4Life:D.createJump/RunValues(Jump:9999999999.Run:9999999999);
Thanks for looking at it!
Offline
xboxdude wrote:
Hello again, I created a code to help me do something in Javascript and maybe help others to create a hacking software for other games.
Code:
javascript;c#_(hack)01_addPoints[999999999999999]client;sideHack:giveTeleportaccessEverywhere+freeAdmin4Life:D.createJump/RunValues(Jump:9999999999.Run:9999999999);Thanks for looking at it!
Don't post such things here. They don't belong here. Make a new topic?
But that is a cool thing there...
Offline
placeholder post: ignore
Offline
xboxdude wrote:
Thank you for this useful tutorial! Now, I can create my,"Say Nothing" block! It will allow you to stop your chat and get rid of your speech bubble. I LOVEZ BLEW!
What's the code for that?
Offline
flurr wrote:
i tried to get the get time/date block and the save stage area to sprite block and they didn't work i think it was because whenever i went out of the system browser or pressed a button it said nothing had been saved continue or not i continued because i dont know how to save in the system browser. if this is the problem can somebody tell me how to save if this is not the problem can somebody tell me what is because i did what the instructions said to do.
If you want to save the custom block scroll to the bottom and right click the blank space and then click "accept (s)".
Offline
guys, use the block library, it's much more easy to navigate and understand.
Offline
rookwood101 wrote:
guys, use the block library, it's much more easy to navigate and understand.
Thank you. I even specified in first post.
Offline
LS97 wrote:
Note. IF THIS IS THE FIRST TIME YOU ARE READING THIS THREAD, READ THIS!
I am not doing any requests for blocks. This thread is now defunct, so please use it for information only and do not post requests. I will not answer any requests nor anymore clarifications. There's an amazing block library now where you can find many more blocks. If you have a good question about mods, you may post, but your question might not be answered.Hey Scratchers!
Are you all wondering how to make your own blocks in Scratch using Squeak? Well then, you've come to the right place. This forum thread will include tutorials, links to other projects, and more to make blocks like this:
http://www.freeimagehosting.net/uploads/ef0a230720.gif
The blocks are pretty much self-explanatory, so no need for a list of what they do. i'll start with the block-making right away.
Note for the lazy people: this tutorial aims to teach people to work in Squeak, not only to get the new blocks. So do not ask for my image file.
First, we have to open the system browser. Here's a tutorial for it:
T - Open Browser
Now, we're ready to start programming. From the browser, go to:
>Scratch-Objects
>ScriptableScratchMorph
>Click onto Class
>Scratch (or) BlockSpecs
>blockSpecks
Here we've got the main bit of blocks. it all looks very messy, so you can use the find option if you want to save your eyes when looking for a block. Now let's take a block to analize: the yellow repeat(X) block.
http://www.freeimagehosting.net/uploads/fb29012635.png
See how i highlighted a bit? that's the code for that block.
The block coding structure is as follows:
('repeat %n' #c #doRepeat 10)
the block is identified by the two brackets (blue).
the block text is in between apostrophes (black).
the block type identifier or block arguments follow a # sign (red).
the command also follows a # sign (green).
any additional arguments follow the command (purple).
the %n in the block is the input box, where the user can put the number. in fact, %n produces that round textbox where only numbers can be inserted. here's the full list:Code:
a: attribute of another sprite, such as X position or size. b: a boolean inserter c: a colour picker that shows the menu. C: a colour picker that doesn't d: the sprite direction menu/numerical inserter. D: the menu for midi drums e: The broadcast message menu f: math function menu (with sin, abs, etc.) g: menu for the different graphic effects. h: numerical sensor board selector menu H: boolean sensor board selector menu i: midi instrument menu/numerical inserter k: menu for the names of the different keys, used in the key sensor blocks. l: menu with the costume names of the given sprite. L: list name menu. m: sprite list n: numerical inserter N: note name menu/inserter s: string inserter S: sound selector menu v: variable labels menu y: menu used to delete either a number of the last value or all of a list.Credit to billyedward for this list.
the repeat block, having to 'host' other blocks in it, is C shaped. that's why the block argument (above in red) is a c.
Here's a brief list of the different arguments:Code:
#- no arguments (command or 'stack' block) #r Reporter block (the round ones) #b boolean block (diamond shaped) #c C shaped block (like the forever block) #t Time block (like wait X secs) #W 'when' hat block (obsolete) #S start button click hat block #K key-activated hat block #E event hat block (broadcast) #s special form (hard to code)but it's not all that simple! now that we've got the block in the block palette, we need to give it the code it needs to perform the action. for this you need to go to 'instance', then to the appropriate 'ops'. there, after creating a method, you can add the code you need.
________
Now that you know a bit about the structure, we can move on quickly to the actual new blocks you saw at the beginning. I'm not going to add them into this post, it would be too long. you'll find the different blocks in different posts.
I hope you'll enjoy your new blocks!
well, I can't find the first block specs in 1.4. Are you using something different?
Offline