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

#901 2010-08-12 13:36:57

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

Re: Cool custom blocks in Scratch

because we make it so.

Offline

 

#902 2010-08-12 15:35:03

TheSuccessor
Scratcher
Registered: 2010-04-23
Posts: 1000+

Re: Cool custom blocks in Scratch

Oh yeah.
I've only just realised the sense in leaving them visible.


/* No comment */

Offline

 

#903 2010-08-13 05:49:15

johnnydean1
Scratcher
Registered: 2010-02-12
Posts: 1000+

Re: Cool custom blocks in Scratch

Ive know that for ages. You have to hack to open up a browser then find the pass. Easy.


You can now reach me on Twitter @johnnydean1_

Offline

 

#904 2010-08-13 07:45:56

TheSuccessor
Scratcher
Registered: 2010-04-23
Posts: 1000+

Re: Cool custom blocks in Scratch

That's what I did.


/* No comment */

Offline

 

#905 2010-08-15 09:26:54

Lellowsfuzz
Scratcher
Registered: 2009-04-17
Posts: 500+

Re: Cool custom blocks in Scratch

I would like a drop-down menu for the date block plz. How?

Offline

 

#906 2010-08-15 15:45:37

TheSuccessor
Scratcher
Registered: 2010-04-23
Posts: 1000+

Re: Cool custom blocks in Scratch

Lellowsfuzz wrote:

I would like a drop-down menu for the date block plz. How?

I think there's a tutorial earlier in this topic somewhere.  smile

Last edited by TheSuccessor (2010-08-15 15:45:51)


/* No comment */

Offline

 

#907 2010-08-15 15:47:44

TheSuccessor
Scratcher
Registered: 2010-04-23
Posts: 1000+

Re: Cool custom blocks in Scratch

(index of %s in %L) would be useful. Could anybody do it?


/* No comment */

Offline

 

#908 2010-08-15 16:06:16

nXIII
Community Moderator
Registered: 2009-04-21
Posts: 1000+

Re: Cool custom blocks in Scratch

^ (self listNamed: t2 ifNone: [^ 0]) listContents indexOf: t1 asString


nXIII

Offline

 

#909 2010-08-16 06:44:17

TheSuccessor
Scratcher
Registered: 2010-04-23
Posts: 1000+

Re: Cool custom blocks in Scratch

Thanks nXIII.  smile


/* No comment */

Offline

 

#910 2010-08-16 16:09:45

rdococ
Scratcher
Registered: 2009-10-11
Posts: 1000+

Re: Cool custom blocks in Scratch

randalpik wrote:

LS97 wrote:

randalpik wrote:

EDIT: I can't seem to make a "clone" block work, can anyone help?

it's simple!
add this code:

Code:

cloneAndSend: t1 
    | t2 t3 |
    (t2 _ self ownerThatIsA: ScratchFrameMorph) ifNil: [^ self].
    t3 _ self fullCopy.
    t3 objName: objName , ' clone'.
    t3 isClone: true.
    t3 blocksBin
        allMorphsDo: [:t4 | (t4 isKindOf: BlockMorph)
                ifTrue: [t4 stop]].
    t2 workPane addMorph: t3.
    t3 eventReceived: (ScratchEvent new name: t1 asString argument: 0)

i'm not sure though  hmm

That's already in ScratchSpriteMorph. Besides, it says "incorrect number of arguments."  hmm

The | t2 t3 | should be | t2 t3 t4 |. That's what I think.

Offline

 

#911 2010-08-17 07:31:23

TheSuccessor
Scratcher
Registered: 2010-04-23
Posts: 1000+

Re: Cool custom blocks in Scratch

I think it might be that in the code it needs an argument to be sent and stored under t1.
However if you are just doing a block with no arguments it will throw an error. You need to delete the ": t1" from the end, add t1 to the list of temporary variables and enter "t1 _ 'cloneCreated'." (without the quotes) as a line of code somewhere before the last line.


/* No comment */

Offline

 

#912 2010-08-17 08:05:32

TheSuccessor
Scratcher
Registered: 2010-04-23
Posts: 1000+

Re: Cool custom blocks in Scratch

Can anybody explain the Execution Engine? It just seems to push and pop stack frames. Is pushing and popping the same thing JavaScript does to arrays?


/* No comment */

Offline

 

#913 2010-08-17 12:23:04

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

Re: Cool custom blocks in Scratch

rdococ wrote:

randalpik wrote:

That's already in ScratchSpriteMorph. Besides, it says "incorrect number of arguments."  hmm

The | t2 t3 | should be | t2 t3 t4 |. That's what I think.

no way! t4 is aready declared afterwards in the do: [:t4 | etc. bit

Offline

 

#914 2010-08-17 12:24:13

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

Re: Cool custom blocks in Scratch

TheSuccessor wrote:

Can anybody explain the Execution Engine? It just seems to push and pop stack frames. Is pushing and popping the same thing JavaScript does to arrays?

that would be something nice ² explain. i never get it either.

Offline

 

#915 2010-08-17 13:01:29

TheSuccessor
Scratcher
Registered: 2010-04-23
Posts: 1000+

Re: Cool custom blocks in Scratch

I think from a lot of staring confused at my laptop that there is a 'stack frame' for each block and lots of 'stack frames' (i.e. a script) makes a 'stack'. Each 'stack frame' has an instance variable called 'parentFrame' that is set to the previous 'stack frame'.
However, everything else is extremely confusing and some of or all that I've just said could be wrong.


/* No comment */

Offline

 

#916 2010-08-18 02:48:20

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

Re: Cool custom blocks in Scratch

right... that didn't really help much  tongue
if i were to have programmed scratch i wouldn't have done it this way

Offline

 

#917 2010-08-18 05:02:51

Ralphjos
Scratcher
Registered: 2009-10-10
Posts: 100+

Re: Cool custom blocks in Scratch

LS97 wrote:

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:

Code:

    Cursor wait showWhile: [ScratchPlugin primOpenURL: t1]

So little code for such a great block... and remember to click accept!

I'm having trouble setting up this block. I am sorry if I'm interrupting anything. =3

Here is the attempted block spec I used:

Code:

('link to %s' #- #linkTo)

And here is the instance ops (I placed it in "string ops" if that matters).

Code:

linkTo: t1
    Cursor wait showWhile: [ScratchPlugin primOpenURL: t1]

I have no clue what I'm doing right.  tongue  Now, does this code, whenever activated, force open the website specified? Oh and my bad for not searching through 37 pages of responces to see if this was not possible or already solved.

Is it possible to make, "say, "Visit [link]" with the [link] as a hyperlinked text? Or probably able to do: Say, "Join [insert text I want] [link]"?

Thanks for your help, whether it works or not.  smile

~Regards,
~Ralphjos


http://i33.tinypic.com/2dt3j9j.gif

Offline

 

#918 2010-08-18 05:57:20

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

Re: Cool custom blocks in Scratch

@ralphjos:

yes, it is possible. i remember there's a url morph somwhere in the squeak codes. but i'm not sure where and it"s certainly not possible right now. for now, the say bubbles (for example) can only say plain text. you would have to do some serious coding.

Offline

 

#919 2010-08-18 06:15:33

Ralphjos
Scratcher
Registered: 2009-10-10
Posts: 100+

Re: Cool custom blocks in Scratch

Lol, I'm not going to make my fail attempts at it right now. Maybe in the near future. I'll just leave it unhyperlinked and force the users to type it in. Thanks for the info! =3

~Regards,
~Ralphjos


http://i33.tinypic.com/2dt3j9j.gif

Offline

 

#920 2010-08-18 06:54:04

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

Re: Cool custom blocks in Scratch

tongue  you're welcome

Offline

 

#921 2010-08-18 08:49:31

pwiter
Scratcher
Registered: 2010-06-02
Posts: 100+

Re: Cool custom blocks in Scratch

I got a new block
http://img831.imageshack.us/img831/1435/capturesc.jpg
Instance ops:

Code:

| dialogBox |
    dialogBox _ DialogBoxMorph new.
    dialogBox title: t1.
    dialogBox withButtonsForYes: false no: false okay: true cancel: false.
    dialogBox message: t2.
    dialogBox getUserResponse.

Blockspecs

Code:

('show dialog titled %s with contents %s' #- #showDialogTitle:Contents: 'info' 'hello')

Copyright pwitter 2010


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

Offline

 

#922 2010-08-18 11:58:16

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

Re: Cool custom blocks in Scratch

sssuuure....
try looking back on this thread. there's a block that does EXACTLY the same thing as yours.

(copyright busted)

Offline

 

#923 2010-08-18 13:12:23

nXIII
Community Moderator
Registered: 2009-04-21
Posts: 1000+

Re: Cool custom blocks in Scratch

Or the one I wrote in February....


nXIII

Offline

 

#924 2010-08-18 14:14:29

pwiter
Scratcher
Registered: 2010-06-02
Posts: 100+

Re: Cool custom blocks in Scratch

LS97 wrote:

sssuuure....
try looking back on this thread. there's a block that does EXACTLY the same thing as yours.

(copyright busted)

Which page?
I just came up with it!!!!!
WEird!


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

Offline

 

#925 2010-08-18 15:24:00

TheSuccessor
Scratcher
Registered: 2010-04-23
Posts: 1000+

Re: Cool custom blocks in Scratch

DialogBoxMorph inform: t1 title: t2


/* No comment */

Offline

 

Board footer