Keba wrote:
Hm, so there is now way of combining own blocks (eg a "clone block hack") and BYOB togehter? Both hack into the image files, don`t they? So way cant I edit the BYOB`s image file and put some nice blocks into it?
And why is there no source code release of BYOB yet? That sucks, too.
BYOB-made blocks don't hack into the image, but simply combine the different pre-made blocks saving the new block into the project. you can try making some of your own blocks with that interface Jens added, but it's not perfect.
Last edited by LS97 (2010-04-18 13:01:55)
Offline
LS97 wrote:
Sperry wrote:
Great! I like it! One suggestion for your mousePressed block. I would suggest
^ false
instead of
^ Sensor redButtonPressed
If it even got as far as the last part, it should return false since it doesn't know what your talking about, why test some stuff that is jargon?I understand what you mean, but i thought of the lazy people who don't want to enter anything and have it like the default block straight away. what use would it be anyway if it returns false each time?
Well, Why test if a button is pressed if the user didn't specify for it to be? Anyway, it would return false if nothing was pressed anyway, and, if you tested for that one earlier, you'd find ir would return false there.
Offline
Sperry wrote:
Well, Why test if a button is pressed if the user didn't specify for it to be? Anyway, it would return false if nothing was pressed anyway, and, if you tested for that one earlier, you'd find ir would return false there.
well, true. but i prefer it to be like this. you're free to change it if you prefer to make it false. btw, i gave you an internet
Last edited by LS97 (2010-04-18 15:05:59)
Offline
Keba wrote:
Hm, so there is now way of combining own blocks (eg a "clone block hack") and BYOB togehter? Both hack into the image files, don`t they? So way cant I edit the BYOB`s image file and put some nice blocks into it?
And why is there no source code release of BYOB yet? That sucks, too.
if you want to save the BYOB image, shift click the file and save image for end user
Offline
midnightleopard wrote:
Keba wrote:
Hm, so there is now way of combining own blocks (eg a "clone block hack") and BYOB togehter? Both hack into the image files, don`t they? So way cant I edit the BYOB`s image file and put some nice blocks into it?
And why is there no source code release of BYOB yet? That sucks, too.if you want to save the BYOB image, shift click the file and save image for end user
Hmm... that didn't quite work for me. could you explain that better?
Offline
midnightleopard wrote:
Keba wrote:
Hm, so there is now way of combining own blocks (eg a "clone block hack") and BYOB togehter? Both hack into the image files, don`t they? So way cant I edit the BYOB`s image file and put some nice blocks into it?
And why is there no source code release of BYOB yet? That sucks, too.if you want to save the BYOB image, shift click the file and save image for end user
You can't hack BYOB's image. Period.
Offline
markyparky56 wrote:
midnightleopard wrote:
Keba wrote:
Hm, so there is now way of combining own blocks (eg a "clone block hack") and BYOB togehter? Both hack into the image files, don`t they? So way cant I edit the BYOB`s image file and put some nice blocks into it?
And why is there no source code release of BYOB yet? That sucks, too.if you want to save the BYOB image, shift click the file and save image for end user
You can't hack BYOB's image. Period.
YES YOU CAN!!!!
Offline
Could you make me a <sprite _ touching sprite_> block
Offline
johnnydean1 wrote:
Could you make me a <sprite _ touching sprite_> block
I'll try and see what i can do. Check back in a few mins, i might have it up!
EDIT: i got the block. here's the code:
sprite: t1 touching: t2 | t3 | t3 _ t1 bounds intersect: t2 bounds. (t3 width > 0 and: [t3 height > 0]) ifTrue: [^ true]. ^ false
i'm so proud of myself
Last edited by LS97 (2010-04-22 12:46:23)
Offline
MathWizz wrote:
markyparky56 wrote:
midnightleopard wrote:
if you want to save the BYOB image, shift click the file and save image for end user
You can't hack BYOB's image. Period.
YES YOU CAN!!!!
Without creating an error.
Offline
waveOSBeta wrote:
Can you please add more blocks, LS97?
Yeah sure, i'm just trying to figure out a certain block without success. i'll get on with the other ones and it might come to me.
Offline
Cool!
Last edited by waveOSBeta (2010-04-19 12:43:26)
Offline
The link block
Ok, finally some time to add the greatest block of all. the block links the user to a webpage, program or file as long as the path or URL is given. add in the blockspecs in the control section some kind of block code (choose whatever you want, you know how to do it). and add in the corresponding instance ops:
Cursor wait showWhile: [ScratchPlugin primOpenURL: t1]
So little code for such a great block... and remember to click accept!
Offline
The key_pressed reporter block
a great block that saves you the fuss of making 30 scripts for each different key. just add this to a forever if and youre done with your scripting for a text program! add the block wherever you want, and add this code into the corresponding instance ops.
(Sensor keyPressed: 65) ifTrue: [^ 'a']. (Sensor keyPressed: 66) ifTrue: [^ 'b']. (Sensor keyPressed: 67) ifTrue: [^ 'c']. (Sensor keyPressed: 68) ifTrue: [^ 'd']. (Sensor keyPressed: 69) ifTrue: [^ 'e']. (Sensor keyPressed: 70) ifTrue: [^ 'f']. (Sensor keyPressed: 71) ifTrue: [^ 'g']. (Sensor keyPressed: 72) ifTrue: [^ 'h']. (Sensor keyPressed: 73) ifTrue: [^ 'i']. (Sensor keyPressed: 74) ifTrue: [^ 'j']. (Sensor keyPressed: 75) ifTrue: [^ 'k']. (Sensor keyPressed: 76) ifTrue: [^ 'l']. (Sensor keyPressed: 77) ifTrue: [^ 'm']. (Sensor keyPressed: 78) ifTrue: [^ 'n']. (Sensor keyPressed: 79) ifTrue: [^ 'o']. (Sensor keyPressed: 80) ifTrue: [^ 'p']. (Sensor keyPressed: 81) ifTrue: [^ 'q']. (Sensor keyPressed: 82) ifTrue: [^ 'r']. (Sensor keyPressed: 83) ifTrue: [^ 's']. (Sensor keyPressed: 84) ifTrue: [^ 't']. (Sensor keyPressed: 85) ifTrue: [^ 'u']. (Sensor keyPressed: 86) ifTrue: [^ 'v']. (Sensor keyPressed: 87) ifTrue: [^ 'w']. (Sensor keyPressed: 88) ifTrue: [^ 'x']. (Sensor keyPressed: 89) ifTrue: [^ 'y']. (Sensor keyPressed: 90) ifTrue: [^ 'z']. (Sensor keyPressed: 32) ifTrue: [^ 'space']. (Sensor keyPressed: 1) ifTrue: [^ 'home']. (Sensor keyPressed: 4) ifTrue: [^ 'end']. (Sensor keyPressed: 5) ifTrue: [^ 'insert']. (Sensor keyPressed: 9) ifTrue: [^ 'tab']. (Sensor keyPressed: 11) ifTrue: [^ 'page up']. (Sensor keyPressed: 12) ifTrue: [^ 'page down']. (Sensor keyPressed: 127) ifTrue: [^ 'delete']. ^ 'none'
Pretty long eh? don't be discouraged it's worth it!
Offline
meew0 wrote:
Could you make a block spec for the "key pressed" reporter? I'm bad at making my own specs... i made 3 blocks, all don't work...
I can. here it is. you should have learned where to insert it from the previous posts in this thread.
For the block spec now:
('key pressed' #r #keyPressed)
obviously, the code in the instance part has to be named 'keyPressed'.
there you go, hope it helps (even a bit)!
Offline
nXIII wrote:
There's an easier way to make the key pressed block: have it use a do: loop to go through all the keyNames.
Yeah, i know (now).
EDIT: i discovered the timesRepeat block which does what the do: loop block does.
Last edited by LS97 (2010-04-21 13:35:34)
Offline
LS97 wrote:
meew0 wrote:
Could you make a block spec for the "key pressed" reporter? I'm bad at making my own specs... i made 3 blocks, all don't work...
I can. here it is. you should have learned where to insert it from the previous posts in this thread.
For the block spec now:Code:
('key pressed' #r #keyPressed)obviously, the code in the instance part has to be named 'keyPressed'.
there you go, hope it helps (even a bit)!
Yeah, it works. Thanks.
I had to move it in the "ScriptableScratchMorph" class - now it works! (The block and the method was previously in ScratchSpriteMorph).
Apropos:
The blocks i made was "share this project online", "get surprise sprite" and "import image from camera".
Offline
LS97 wrote:
midnightleopard wrote:
Keba wrote:
Hm, so there is now way of combining own blocks (eg a "clone block hack") and BYOB togehter? Both hack into the image files, don`t they? So way cant I edit the BYOB`s image file and put some nice blocks into it?
And why is there no source code release of BYOB yet? That sucks, too.if you want to save the BYOB image, shift click the file and save image for end user
Hmm... that didn't quite work for me. could you explain that better?
never mind
Offline
Here's another tip for formatting blocks on the screen:
Have you ever noticed how many blocks are put into groups, such as all the size blocks, both broadcast blocks, both timer blocks? If you haven't, go look now. Did you see how the groups have spaces between them? Well, when making custom blocks (such as the ones shown above) you might want to have your blocks separated from the rest, or put into their own individual group.
As explained in the original post, all block specs are surrounded by parentheses. Here's how the specs were originally, without a space.
(block spec) (block spec)
To put a space between two specs, change that to this:
(block spec) #- (block spec)
I hope that was helpful!
Offline
Please do the dialog block next. Thanks!
Offline