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

#376 2011-04-10 06:02:28

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

Re: ITopic: Welcome to your local block library!

I don't know who did it, but I love the edit to the statistics page with the blue edit number!

I've made an update to the homepage just underneath the library logo! I hope it looks ok, feel free to move it. It shouldn't be too hard to edit the numbers, each character is a different image so you have s0-9, p0-9 and b0-9 .gif, the rest stays the same!

~Sparks


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

Offline

 

#377 2011-04-10 10:18:08

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

Re: ITopic: Welcome to your local block library!

A New Panther block (Can anyone test for me)

Name: friend of $string$
Type: r

Code:

Code:

    | t2 t3 t4 t5 t6 t7 t8 |
    t3 _ 'http://scratch.mit.edu/api/getfriendsbyusername/' , t1.
    t2 _ self readFromUrl: t3.
    t8 _ t2 size.
    t2 _ self
                letters: 4
                through: t8
                of: t2.
    t5 _ {} as: OrderedCollection.
    t4 _ 0.
    t6 _ ''.
    t3 _ t2 size.
    t3
        timesRepeat: 
            [t4 _ t4 + 1.
            t7 _ self letter: t4 of: t2.
            t7 = ':'
                ifTrue: 
                    [t5 add: t6.
                    t6 _ '']
                ifFalse: [t6 _ t6 , t7]].
    t3 _ t5 size.
    t3 > 0 ifFalse: [^ ''].
    t6 _ self randomFrom: 1 to: t3.
    t6 _ t6 asNumber.
    t7 _ t5 at: t6.
    t3 _ 'http://scratch.mit.edu/api/getusernamebyid/' , t7.
    t2 _ self readFromUrl: t3.
    t2 _ t2 asString.
    t3 _ t2 size.
    t4 _ self
                letters: 4
                through: t3
                of: t2.
    ^ t4 asString

Last edited by johnnydean1 (2011-04-10 11:05:15)


You can now reach me on Twitter @johnnydean1_

Offline

 

#378 2011-04-10 10:33:21

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

Re: ITopic: Welcome to your local block library!

This reports a random friend when I test it!

When I follow the interesting path http://scratch.mit.edu/api/getfriendsbyusername/sparks I just get a load of numbers!

It's a good block though, though there appears to be no way of choosing a friend or listing all friends with this block? How about modifying it to be a "friend $Number$ of Scratcher $String$" block?  smile

I've been experimenting with it a bit, it's great! I would add something to this line:

Code:

    t3 _ 'http://scratch.mit.edu/api/getfriendsbyusername/' , t1 [color=red]asString[/color].

As this allows you to drop reporters such as variables into a block without an error being caused! Because of a Panther glitch where if you drop a reporter into an argument and take it away again that argument is turned into a number argument for that copy of the block.

Last edited by sparks (2011-04-10 10:42:22)


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

Offline

 

#379 2011-04-10 10:41:08

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

Re: ITopic: Welcome to your local block library!

Ok Sparks. BTW Those random numbers are peoples user numbers. Look here and here


You can now reach me on Twitter @johnnydean1_

Offline

 

#380 2011-04-10 10:43:22

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

Re: ITopic: Welcome to your local block library!

Ah! I see! Interesting! See my edit above!


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

Offline

 

#381 2011-04-10 10:59:29

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

Re: ITopic: Welcome to your local block library!

Ok here:
Name: friend no $Number$ of $String$
Type: r
Code:

Code:

    | t3 t4 t5 t6 t7 t8 |
    t4 _ 'http://scratch.mit.edu/api/getfriendsbyusername/' , t2.
    t3 _ self readFromUrl: t4.
    t8 _ t3 size.
    t3 _ self
                letters: 4
                through: t8
                of: t3.
    t5 _ t3.
    t6 _ {} as: OrderedCollection.
    t5 _ 0.
    t7 _ ''.
    t4 _ t3 size.
    t4
        timesRepeat: 
            [t5 _ t5 + 1.
            t8 _ self letter: t5 of: t3.
            t8 = ':'
                ifTrue: 
                    [t6 add: t7.
                    t7 _ '']
                ifFalse: [t7 _ t7 , t8]].
    t4 _ t6 size.
    t4 > 0 ifFalse: [^ ''].
    t7 _ t1.
    t7 _ t7 asNumber.
    t7 > 0 ifFalse: [^ ''].
    t7 - 1 < t4 ifFalse: [^ ''].
    t8 _ t6 at: t7.
    t8 _ t8 asString.
    t4 _ 'http://scratch.mit.edu/api/getusernamebyid/' , t8.
    t3 _ self readFromUrl: t4.
    t3 _ t3 asString.
    t4 _ t3 size.
    t5 _ self
                letters: 4
                through: t4
                of: t3.
    ^ t5

You can now reach me on Twitter @johnnydean1_

Offline

 

#382 2011-04-10 11:00:34

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

Re: ITopic: Welcome to your local block library!

I can add both if you like? Random friend of $String$ and friend $Number$ of $String$


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

Offline

 

#383 2011-04-10 11:03:42

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

Re: ITopic: Welcome to your local block library!

Sorry just saw your posts, change it accordinly.
I'm using the blocks in Claw, (my mod) which when I made I named all the meathods to the same name as the Panther ones, so I could use Panther CYOB as standard blocks on Claw. So all of the code may need slight tweaks to work but nothing major.

EDIT:
Fixed a glitch on both blocks, it couldn't load up friend 1 due to some random spaces.

EDIT 2:
Go for it, add both.

Last edited by johnnydean1 (2011-04-10 11:25:51)


You can now reach me on Twitter @johnnydean1_

Offline

 

#384 2011-04-10 11:09:58

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

Re: ITopic: Welcome to your local block library!

YourLocalBlockLib wrote:

I've made an update to the homepage just underneath the library logo! I hope it looks ok, feel free to move it. It shouldn't be too hard to edit the numbers, each character is a different image so you have s0-9, p0-9 and b0-9 .gif, the rest stays the same!
~Sparks

Couldn't you do that by PHP and have the block libary website make the image, and then display it here. Like what someone did with the project stats in sig thing.

Last edited by johnnydean1 (2011-04-10 11:10:09)


You can now reach me on Twitter @johnnydean1_

Offline

 

#385 2011-04-10 11:19:44

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

Re: ITopic: Welcome to your local block library!

johnnydean1 wrote:

YourLocalBlockLib wrote:

I've made an update to the homepage just underneath the library logo! I hope it looks ok, feel free to move it. It shouldn't be too hard to edit the numbers, each character is a different image so you have s0-9, p0-9 and b0-9 .gif, the rest stays the same!
~Sparks

Couldn't you do that by PHP and have the block libary website make the image, and then display it here. Like what someone did with the project stats in sig thing.

I thought about it when I made it. The website isn't finished, the blocks aren't on it and nor are the stats  hmm


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

Offline

 

#386 2011-04-10 11:24:21

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

Re: ITopic: Welcome to your local block library!

sparks wrote:

johnnydean1 wrote:

YourLocalBlockLib wrote:

I've made an update to the homepage just underneath the library logo! I hope it looks ok, feel free to move it. It shouldn't be too hard to edit the numbers, each character is a different image so you have s0-9, p0-9 and b0-9 .gif, the rest stays the same!
~Sparks

Couldn't you do that by PHP and have the block libary website make the image, and then display it here. Like what someone did with the project stats in sig thing.

I thought about it when I made it. The website isn't finished, the blocks aren't on it and nor are the stats  hmm

Coolio (Wow Ive got to use that word more often  tongue ) The new friend blocks should be fast, but not brilliant. It is a improvement to my old friend blocks however which were VERY slow.

@Sparks
Do you know anyway of linking Scratch (or a mod) to a server (maybe through PHP) for a online mesh?


You can now reach me on Twitter @johnnydean1_

Offline

 

#387 2011-04-10 11:30:03

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

Re: ITopic: Welcome to your local block library!

Any mod with a url reading capabilities can use a website as a "server" using php and MySQL. The php can be placed in a block request like so:

contents of file at URL:(http://examplewebsite.com/playerstatus.php?username=jd1&password=pass&status=feeling%20bored!)

this would send the information of username, password and status to the php page when it reads it. Panther appears to read back the html but it triggers the php code at the same time. This way MySQL can now add that status to a MySQL table in the status space next to your username where other people can read it through something along the lines of /statuses.php?username=jd1. A message can even be sent back to Panther through html saying if the update was sucessful or not!


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

Offline

 

#388 2011-04-10 11:31:20

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

Re: ITopic: Welcome to your local block library!

Can you code that?

Move Conversation about this here. Keep on topic!!

Last edited by johnnydean1 (2011-04-10 11:41:24)


You can now reach me on Twitter @johnnydean1_

Offline

 

#389 2011-04-10 11:42:55

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


Panther blocks added: [2]
http://welcometoyourlocalblocklibrary.weebly.com/uploads/7/1/1/0/7110842/2994516.gif[38] by johnnydean1
http://welcometoyourlocalblocklibrary.weebly.com/uploads/7/1/1/0/7110842/7198632.gif[39] by johnnydean1

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

Last edited by YourLocalBlockLib (2011-04-21 14:11:32)


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

Offline

 

#390 2011-04-10 11:43:59

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

Re: ITopic: Welcome to your local block library!

YourLocalBlockLib wrote:

Panther blocks added: [2]
http://welcometoyourlocalblocklibrary.weebly.com/uploads/7/1/1/0/7110842/2994516.gif[38] by johnnydean1
http://welcometoyourlocalblocklibrary.weebly.com/uploads/7/1/1/0/7110842/7198632.gif[39] by johnnydean1

Thank you!

Last edited by johnnydean1 (2011-04-10 11:44:31)


You can now reach me on Twitter @johnnydean1_

Offline

 

#391 2011-04-10 13:38:03

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

Re: ITopic: Welcome to your local block library!

Pecola1 wrote:

danwoodski wrote:

Sorry if this is the wrong place to put this, but...
the <received?> block for scratch isn't working for me...first off, you may want to add the first ' to the block spec, and it is coming up with error messages for me...
this is VERY IMPORTANT to fix because it messes up all of the block specs after it.
error message:
http://dl.dropbox.com/u/12506914/untitled.bmp

Is that from my, exe creator? It worked fine for me. Let me try again, it may be because I am using windows 7 rather than windows.

Win 7 is Windows, same as Vista is Windows.  roll

I think I'm going to move the block stats.
EDIT: Done.
EDIT2: 1600th post!  big_smile

Last edited by scimonster (2011-04-10 13:50:16)

Offline

 

#392 2011-04-10 14:26:11

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

Re: ITopic: Welcome to your local block library!

scimonster wrote:

Win 7 is Windows, same as Vista is Windows.  roll

But it is a different Version of Windows. Try running a piece of software made for Vista in XP, it might work. Try running it in Windows 98 it almost certainly won't. Windows 7 is a relatively new operating system so a lot of hardware and software still does not work with it! I find that a lot in my job, where I have to make sure that the hardware and software works with windows 7 if that's the OS they have. It would, therefore, be quite likely that the fact it was being run in win7 was the reason it was not working.

The block stats look a lot better where you've put them, but why did you change them to single images?

EDIT: I take that back... The image is still in several parts, but I can pick up and drag all of them as a single image... How odd.

Last edited by sparks (2011-04-10 14:28:05)


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

Offline

 

#393 2011-04-10 14:29:17

Pecola1
Scratcher
Registered: 2010-09-06
Posts: 1000+

Re: ITopic: Welcome to your local block library!

scimonster wrote:

Pecola1 wrote:

danwoodski wrote:

Sorry if this is the wrong place to put this, but...
the <received?> block for scratch isn't working for me...first off, you may want to add the first ' to the block spec, and it is coming up with error messages for me...
this is VERY IMPORTANT to fix because it messes up all of the block specs after it.
error message:
http://dl.dropbox.com/u/12506914/untitled.bmp

Is that from my, exe creator? It worked fine for me. Let me try again, it may be because I am using windows 7 rather than windows.

Win 7 is Windows, same as Vista is Windows.  roll

I think I'm going to move the block stats.
EDIT: Done.
EDIT2: 1600th post!  big_smile

I meant because I hAve 7 he has xp, I think.


If you are reading this, please read to the end, because if you don't you won't know what's at the end. Don't just skip to the end though otherwise you won't be able to read the middle, which is most important. Now you must be wondering why you just read all that, the reason is you may have not noticed something, read it again and see if you notice it this time  smile

Offline

 

#394 2011-04-10 14:49:07

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

Re: ITopic: Welcome to your local block library!

sparks wrote:

scimonster wrote:

Win 7 is Windows, same as Vista is Windows.  roll

But it is a different Version of Windows. Try running a piece of software made for Vista in XP, it might work. Try running it in Windows 98 it almost certainly won't. Windows 7 is a relatively new operating system so a lot of hardware and software still does not work with it! I find that a lot in my job, where I have to make sure that the hardware and software works with windows 7 if that's the OS they have. It would, therefore, be quite likely that the fact it was being run in win7 was the reason it was not working.

The block stats look a lot better where you've put them, but why did you change them to single images?

EDIT: I take that back... The image is still in several parts, but I can pick up and drag all of them as a single image... How odd.

Whoa, that's weird! I didn't even realize.  tongue

Offline

 

#395 2011-04-10 18:19:04

Scratchycat123
Scratcher
Registered: 2010-03-19
Posts: 20

Re: ITopic: Welcome to your local block library!

I can't upload the image to a website, but i have a looks block for you guys. it goes under the Scratch Blocks category.

blockspecs:
('hidden?' #b #isHidden)

no code needed

What it does:
It states true if the block has been hidden with the hide block.


http://derpy.ponychan.net/chan/files/src/134343315274.png

Offline

 

#396 2011-04-10 21:20:19

Scratchycat123
Scratcher
Registered: 2010-03-19
Posts: 20

Re: ITopic: Welcome to your local block library!

A load of new scratch blocks i made for variables!

EDIT: now has the descriptions. Sorry i forgot earlier XD

NOTE: These only work on variables that belong to the sprite who is using the block.

None of these need codes.

Make new variable with name ___ block:
('make new variable with name %s' #- #addVariable:)

What it does: Creates a new variable with a certain name.

Make new variable with name ___ and value ___ block:
('make new variable with name %s and value %s' #- #addVariable:value:)

What it does: Creates a new variable with a certain name and value.

2 Delete variable ___ blocks:
('delete variable %v' #- #deleteVariable:)
('delete variable %s' #- #deleteVariable:)

What they do: Deletes the specified variable.

Thanks to Hardmath123 for the idea.

Last edited by Scratchycat123 (2011-04-11 09:16:49)


http://derpy.ponychan.net/chan/files/src/134343315274.png

Offline

 

#397 2011-04-11 04:02:06

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

Re: ITopic: Welcome to your local block library!

Request: Grab costume from X:|| Y:|| to X:|| Y:||
Grabs a costume from the stage useing the co-ordinates given.

Last edited by johnnydean1 (2011-04-11 04:02:18)


You can now reach me on Twitter @johnnydean1_

Offline

 

#398 2011-04-11 08:36:41

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

Re: ITopic: Welcome to your local block library!

I tried adding a block, it wouldn't upload the transparent version.
~~Scimonster


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

Offline

 

#399 2011-04-11 09:09:50

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

Re: ITopic: Welcome to your local block library!

It happened again!  sad
The title pic got removed.
Try it on weebly.

Oh, and I'm having a hard time with weebly. How do you upload the images?

Offline

 

#400 2011-04-11 10:35:34

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

Re: ITopic: Welcome to your local block library!

to upload an image in weebly, log on then drag in a picture element from the top tool bar.  click on it and it will let you choose an image from your computer.


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

Offline

 

Board footer