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

#1926 2011-08-29 11:21:59

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

Re: ITopic: Welcome to your local block library!

flashgocrazy wrote:

does anybody have to code for a block in panther that imports a project?

import project
-

Code:

| t1 |
t1 _ self ownerThatIsA: ScratchFrameMorph.
t1 importScratchProject

Offline

 

#1927 2011-08-29 21:38:51

Squawkers13
Scratcher
Registered: 2010-11-20
Posts: 500+

Re: ITopic: Welcome to your local block library!

Remember the "password for _ is _ " block? Every time I use it it says: Trouble resolving server name. WHAT does that mean? Please correct! 

Blockspec:
('password for %s is %s ?'  #b #username:password:)

Code:
username: t1 password:t2
(HTTPSocket httpGet: 'contentshttp://scratch.mit.edu/api/authenticateuser? username=" , t1 , '&password='  ,  t2) contents = 'false' ifTrue: [ ^ false].
^ true


http://pekkit.net/banners/pekkit.png

Offline

 

#1928 2011-08-30 02:42:49

nathanprocks
Scratcher
Registered: 2011-04-14
Posts: 1000+

Re: ITopic: Welcome to your local block library!

Squawkers13 wrote:

Remember the "password for _ is _ " block? Every time I use it it says: Trouble resolving server name. WHAT does that mean? Please correct! 

Blockspec:
('password for %s is %s ?'  #b #username:password:)

Code:
username: t1 password:t2
(HTTPSocket httpGet: 'contentshttp://scratch.mit.edu/api/authenticateuser? username=" , t1 , '&password='  ,  t2) contents = 'false' ifTrue: [ ^ false].
^ true

make sure you are connected to the internet and try again. if you are behind a firewall, add scratch as an exception.


http://carrot.cassiedragonandfriends.org/Scratch_Signature/randomsig.php
http://trinary.site40.net/images/scratchrank.php?username=nathanprocks&display=small

Offline

 

#1929 2011-08-30 05:06:35

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

Re: ITopic: Welcome to your local block library!

as nathanprocks says, "trouble resolving server name" is the message given by Scratch when it tries to find a website and can't This could be caused by your internet connection, the site being down or the address being wrong  smile


http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

#1930 2011-08-30 08:49:35

SSBBM
Scratcher
Registered: 2009-10-09
Posts: 100+

Re: ITopic: Welcome to your local block library!

lu9 wrote:

Made something, that should be useful for card magic, or card playing:
http://oi54.tinypic.com/2a8p20j.jpg
It's a BYOB Block that reports any card, example:
Ace of Spades,
2 of Hearts,
King of Diamonds
Jack of Clubs... Etc.  I Made from boredoom  smile
I've put in "variables" because i won't know if it fits in any other thing.
[blocks]<say[ Please Add It!! ]for( 2 )secs>[/blocks]

BYOB comes with an other category for blocks that don't fit anywhere else. I think your block goes there.  Could you supply a picture with the scripts to make that block?


http://goo.gl/zVfAp http://goo.gl/laci8

Offline

 

#1931 2011-08-30 09:46:08

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

Re: ITopic: Welcome to your local block library!

SSBBM wrote:

lu9 wrote:

Made something, that should be useful for card magic, or card playing:
http://oi54.tinypic.com/2a8p20j.jpg
It's a BYOB Block that reports any card, example:
Ace of Spades,
2 of Hearts,
King of Diamonds
Jack of Clubs... Etc.  I Made from boredoom  smile
I've put in "variables" because i won't know if it fits in any other thing.
[blocks]<say[ Please Add It!! ]for( 2 )secs>[/blocks]

BYOB comes with an other category for blocks that don't fit anywhere else. I think your block goes there.  Could you supply a picture with the scripts to make that block?

There's a link behind the pic.  tongue

Offline

 

#1932 2011-08-30 10:29:38

SSBBM
Scratcher
Registered: 2009-10-09
Posts: 100+

Re: ITopic: Welcome to your local block library!

scimonster wrote:

There's a link behind the pic.  tongue

Oh. I must have missed that. But it doesn't have a report block. I'm guessing (join (join (number) (of) (image)))

Last edited by SSBBM (2011-08-30 10:32:30)


http://goo.gl/zVfAp http://goo.gl/laci8

Offline

 

#1933 2011-08-30 10:43:08

Hardmath123
Scratcher
Registered: 2010-02-19
Posts: 1000+

Re: ITopic: Welcome to your local block library!

Hardmath123 wrote:

Please update these.


Hardmaths-MacBook-Pro:~ Hardmath$ sudo make $(whoami) a sandwich

Offline

 

#1934 2011-08-30 11:52:04

YourLocalBlockLib
Scratcher
Registered: 2011-03-10
Posts: 100+

Re: ITopic: Welcome to your local block library!

.                              http://welcometoyourlocalblocklibrary.weebly.com/uploads/7/1/1/0/7110842/292223741.gif

BYOB Blocks added: 5
http://oi54.tinypic.com/2a8p20j.jpg Shared  by Lu9, updated by SSBBM
http://i.imgur.com/EPFpN.gif Shared by Flashgocrazy, updated by Joefarebrother
http://i.imgur.com/3j8oe.gif Shared by Flashgocrazy, updated by Joefarebrother
http://i53.tinypic.com/qzhd8g.gif Shared by Joefarebrother
http://i53.tinypic.com/eiv4pk.gif Shared by Joefarebrother

Update carried out by block librarian: SSBBM
________________________________________________________________________________
^home
^updates archive

Last edited by YourLocalBlockLib (2011-08-31 20:16:09)


http://dl.dropbox.com/u/6273449/BlockLibraryTitle.png

Offline

 

#1935 2011-08-30 12:00:14

SSBBM
Scratcher
Registered: 2009-10-09
Posts: 100+

Re: ITopic: Welcome to your local block library!

^ Added the random card block. I updated it with a simpler script. I'm going to try to add joefarebrother's block now.


http://goo.gl/zVfAp http://goo.gl/laci8

Offline

 

#1936 2011-08-30 16:50:13

joefarebrother
Scratcher
Registered: 2011-04-08
Posts: 1000+

Re: ITopic: Welcome to your local block library!

which one? i made 2.


My latest project is called http://tinyurl.com/d2m8hne! It has http://tinyurl.com/d395ygk views, http://tinyurl.com/cnasmt7 love-its, and http://tinyurl.com/bwjy8xs comments.
http://tinyurl.com/756anbk   http://tinyurl.com/iplaychess

Offline

 

#1937 2011-08-30 18:29:44

SSBBM
Scratcher
Registered: 2009-10-09
Posts: 100+

Re: ITopic: Welcome to your local block library!

joefarebrother wrote:

which one? i made 2.

Everything in this post. I only made it to the updates you made before I ran out of time.

Last edited by SSBBM (2011-08-30 18:50:31)


http://goo.gl/zVfAp http://goo.gl/laci8

Offline

 

#1938 2011-08-30 18:52:15

SSBBM
Scratcher
Registered: 2009-10-09
Posts: 100+

Re: ITopic: Welcome to your local block library!

Joefarebrother, should your (ancestor) block report nil like the (attribute[parent]) block if there is no ancestor.


http://goo.gl/zVfAp http://goo.gl/laci8

Offline

 

#1939 2011-08-30 19:41:44

Squawkers13
Scratcher
Registered: 2010-11-20
Posts: 500+

Re: ITopic: Welcome to your local block library!

nathanprocks wrote:

Squawkers13 wrote:

Remember the "password for _ is _ " block? Every time I use it it says: Trouble resolving server name. WHAT does that mean? Please correct! 

Blockspec:
('password for %s is %s ?'  #b #username:password:)

Code:
username: t1 password:t2
(HTTPSocket httpGet: 'contentshttp://scratch.mit.edu/api/authenticateuser? username=" , t1 , '&password='  ,  t2) contents = 'false' ifTrue: [ ^ false].
^ true

make sure you are connected to the internet and try again. if you are behind a firewall, add scratch as an exception.

THAN WHAT IS THE RIGHT ADDRESS?


http://pekkit.net/banners/pekkit.png

Offline

 

#1940 2011-08-30 20:22:28

christian2000
Scratcher
Registered: 2010-11-01
Posts: 100+

Re: ITopic: Welcome to your local block library!

i'm sure that somebody has found this from the obselete blocks, but here it is:
blockSpecs:


                ('set stretch to %n%' #- #setStretchTo: 100)


it doesnt need a code.


blerp......
http://obscureinternet.com/wp-content/uploads/Fail-at-Life-Funny-Cards.png

Offline

 

#1941 2011-08-31 05:00:15

joefarebrother
Scratcher
Registered: 2011-04-08
Posts: 1000+

Re: ITopic: Welcome to your local block library!

SSBBM wrote:

Joefarebrother, should your (ancestor) block report nil like the (attribute[parent]) block if there is no ancestor.

no it should report itself


My latest project is called http://tinyurl.com/d2m8hne! It has http://tinyurl.com/d395ygk views, http://tinyurl.com/cnasmt7 love-its, and http://tinyurl.com/bwjy8xs comments.
http://tinyurl.com/756anbk   http://tinyurl.com/iplaychess

Offline

 

#1942 2011-09-02 17:22:15

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

Re: ITopic: Welcome to your local block library!

I have a block request! (or just a script)

I need (for panther) a (days since date () month () year ()) block. It needs to deal with leap years and different month lengths, thanks in advance :)

EDIT: This may help:

$Number$ is leap year?

|t2 t3|
t2_t1 / 4.
t3_ t1 / 4.
^ t2  rounded = t3.

Last edited by sparks (2011-09-02 17:31:41)


http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

#1943 2011-09-02 17:58:36

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

Re: ITopic: Welcome to your local block library!

sparks wrote:

$Number$ is leap year?

|t2 t3|
t2_t1 / 4.
t3_ t1 / 4.
^ t2  rounded = t3.

That would be much more efficient as:

^ (t1/4) = (t1/4) rounded

Offline

 

#1944 2011-09-02 17:59:36

SSBBM
Scratcher
Registered: 2009-10-09
Posts: 100+

Re: ITopic: Welcome to your local block library!

sparks wrote:

I have a block request! (or just a script)

I need (for panther) a (days since date () month () year ()) block. It needs to deal with leap years and different month lengths, thanks in advance  smile

EDIT: This may help:

$Number$ is leap year?

|t2 t3|
t2_t1 / 4.
t3_ t1 / 4.
^ t2  rounded = t3.

I'll work on that for you.

Last edited by SSBBM (2011-09-02 17:59:53)


http://goo.gl/zVfAp http://goo.gl/laci8

Offline

 

#1945 2011-09-03 04:11:54

joefarebrother
Scratcher
Registered: 2011-04-08
Posts: 1000+

Re: ITopic: Welcome to your local block library!

you need to account for the fact that when a year ends with 00 it isn't a leap year unless it divides by 400.


My latest project is called http://tinyurl.com/d2m8hne! It has http://tinyurl.com/d395ygk views, http://tinyurl.com/cnasmt7 love-its, and http://tinyurl.com/bwjy8xs comments.
http://tinyurl.com/756anbk   http://tinyurl.com/iplaychess

Offline

 

#1946 2011-09-03 07:10:11

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

Re: ITopic: Welcome to your local block library!

Didn't know about that! Thanks for the information!

I present my revised script:

$Number$ is a leap year?

(t1/100) = (t1/100) rounded
ifTrue:[
(t1/400) = (t1/400) rounded
ifTrue:[
     ^ true
     ]
     ifFalse:[
          ^ false
     ]
]
ifFalse:[
     ^ (t1/4) = (t1/4) rounded
]

Last edited by sparks (2011-09-03 07:16:49)


http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

#1947 2011-09-04 10:59:45

jurk
Scratcher
Registered: 2010-05-06
Posts: 100+

Re: ITopic: Welcome to your local block library!

Can you save BYOB blocks In BYOB?
For example I make a Byob block And I like it And wont it again But I closed it can I Save a block


http://dl.dropbox.com/u/54228408/cool.png

Offline

 

#1948 2011-09-04 11:56:41

SSBBM
Scratcher
Registered: 2009-10-09
Posts: 100+

Re: ITopic: Welcome to your local block library!

jurk wrote:

Can you save BYOB blocks In BYOB?
For example I make a Byob block And I like it And wont it again But I closed it can I Save a block

There's no such thing as a block file, but you can save the project or export the sprite. The downloadable BYOB blocks in the library are BYOB sprites.


http://goo.gl/zVfAp http://goo.gl/laci8

Offline

 

#1949 2011-09-04 12:27:32

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

Re: ITopic: Welcome to your local block library!

So I've made it as far as working out how far apart two days in the same month are (I know, amazing huh?) But the months are the hardest because they're all different!

days between d:$Number$ m:$Number$ y:$Number$ and d:$Number$ m:$Number$ y:$Number$

Code:

t3 = t6
ifTrue:[
     t2 = t5
     ifTrue:[
          ^(t4 - t1) 
     ]
]

http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

#1950 2011-09-04 12:49:38

SSBBM
Scratcher
Registered: 2009-10-09
Posts: 100+

Re: ITopic: Welcome to your local block library!

sparks wrote:

So I've made it as far as working out how far apart two days in the same month are (I know, amazing huh?) But the months are the hardest because they're all different!

days between d:$Number$ m:$Number$ y:$Number$ and d:$Number$ m:$Number$ y:$Number$

Code:

t3 = t6
ifTrue:[
     t2 = t5
     ifTrue:[
          ^(t4 - t1) 
     ]
]

I've got to the point of it calculating it all with a BYOB script (I love my custom blocks!). But it take FOREVER to run. I have an idea to speed it up, but I haven't perfected it yet.

Last edited by SSBBM (2011-09-04 12:49:54)


http://goo.gl/zVfAp http://goo.gl/laci8

Offline

 

Board footer