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

#1276 2011-01-27 14:58:21

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

Re: Welcome to the OLD local block library!

frowned wrote:

set rotation center blockspecs:

('set rotation center %s' #-    #setrotationcenter:)

set rotation center code:

setrotationcenter: t1
                    costume rotationCenter = t1

syntax for usage:
"xpos@ypos"

also i will later post my sprite attachment blocks  cool

The attach to and de-attach from blocks have already been made, why don't you check before posting a code.


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

 

#1277 2011-01-28 07:15:55

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

Re: Welcome to the OLD local block library!

I wrote:

Here's how (follow this pattern):

Code:

<selector name>
    | repeatclient |
    repeatclient _ <number of times it should repeat>
    self <selector name> + <repeatno: repeatclient>

Code:

<selector name> + <repeatno: repeatclient>
    repeatclient = 0 ifTrue: [^ self].
    <coding to be repeated>
    self <selector name> + <repeatno: repeatclient - 1>

Quoted from the block library

Last edited by Hardmath123 (2011-01-30 05:09:14)


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

Offline

 

#1278 2011-01-28 13:01:01

frowned
Scratcher
Registered: 2010-11-02
Posts: 42

Re: Welcome to the OLD local block library!

Code:

isStop
    ^ selector = #doReturn | (selector = #stopAll #freeze)

see correction to my tutorial i posted later in the thread, the code above is incorrect it should be:

Code:

isStop
    ^ selector = #doReturn | (selector = #stopAll) | (selector = #freeze)

Offline

 

#1279 2011-01-28 18:48:44

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

Re: Welcome to the OLD local block library!

Hardmath123 wrote:

Freeze Scratch:

Code:

('freeze Scratch!' #- #freeze)

Code:

freeze
    self freeze

Scratch-Blocks»CommandBlockMorph»all»isStop
replace coding with:

Code:

isStop
    ^ selector = #doReturn | (selector = #stopAll #freeze)

Please credit frowned (this post, in particular).

I figured out how to make a repeat code in Squeak!!!

Here's how (follow this pattern):

Code:

<selector name>
    | repeatclient |
    repeatclient _ <number of times it should repeat>
    self <selector name> + <repeatno: repeatclient>

Code:

<selector name> + <repeatno: repeatclient>
    repeatclient = 0 ifTrue: [^ self].
    <coding to be repeated>
    self <selector name> + <repeatno: repeatclient - 1>

WOW! I never thought you could do that, now almost ALL of the BYOB blocks can be made!


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

 

#1280 2011-01-29 07:55:47

kristianmischke
Scratcher
Registered: 2010-05-24
Posts: 7

Re: Welcome to the OLD local block library!

<change x by(

Offline

 

#1281 2011-01-29 11:52:19

fudgepop
Scratcher
Registered: 2010-05-29
Posts: 7

Re: Welcome to the OLD local block library!

HOW DO YOU MAKE A NEW ITEM IN SCRATCH OBJECTS -> INSTANCE OF SCRATCH-SPRITE-MORPH-> MOTION?????. i need the info to create any one of these blocks.

Offline

 

#1282 2011-01-29 12:17:42

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

Re: Welcome to the OLD local block library!

You just type or paste in it at the bottom.

Offline

 

#1283 2011-01-29 12:38:05

fudgepop
Scratcher
Registered: 2010-05-29
Posts: 7

Re: Welcome to the OLD local block library!

i mean in SCRATCH 1.4. i know how to copy and paste ot create the blocks, iam trying to make a new catagory to make the PROGRAMING for them. (=o)

Offline

 

#1284 2011-01-29 12:50:32

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

Re: Welcome to the OLD local block library!

Click on the - in the top left and choose new category.

Offline

 

#1285 2011-01-29 13:11:45

fudgepop
Scratcher
Registered: 2010-05-29
Posts: 7

Re: Welcome to the OLD local block library!

Thx (=d)

Offline

 

#1286 2011-01-29 19:20:35

SnowGuy
Scratcher
Registered: 2008-11-25
Posts: 41

Re: Welcome to the OLD local block library!

sparks wrote:

hmm, nXIII, you might want to look at this. I'm finding that after saving a project in panther 1.0, I can open but not import it :S

Panther only imports .sb at the moment.  Rename the file to sb and it will work.  (not good for panther in the long run though)


This account is dead. See my new one here.

Offline

 

#1287 2011-01-29 19:23:29

SnowGuy
Scratcher
Registered: 2008-11-25
Posts: 41

Re: Welcome to the OLD local block library!

I'm having a problem.  Sometimes, when I have the block to get code for panther blocks in a project, it will not save.  Originally, I saved the project somehow. but now, every time I try to save with the block to import blocks then I get an error message, something like "unknown ScratchCommentMorph" and I have lost a lot of work this way before i figured it out :-(

I can't seem to duplicate this bug at the moment. Could be only when i have imported a project, or with lots of sprites or lists or new blocks, no idea.


This account is dead. See my new one here.

Offline

 

#1288 2011-01-30 04:47:14

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

Re: Welcome to the OLD local block library!

http://i53.tinypic.com/5bqjxh.jpghttp://img94.imageshack.us/img94/9664/36662184.gif for BYOB

Offline

 

#1289 2011-01-30 08:46:37

SnowGuy
Scratcher
Registered: 2008-11-25
Posts: 41

Re: Welcome to the OLD local block library!

make hide cursor block for panther, and also a new image for cursor! (maybe a sprite called cursor?)


This account is dead. See my new one here.

Offline

 

#1290 2011-01-30 09:19:21

hpotter134
Scratcher
Registered: 2010-02-21
Posts: 100+

Re: Welcome to the OLD local block library!

I have a block to add.

http://img696.imageshack.us/img696/2761/messagerw.gif

This is a reporter block that returns the most recent broadcast.

Block spec: (Scratch-Objects>>ScriptableScratchMorph>>class>>block specs>>blockspecs - control)

Code:

('message' #r #lastMessage)

Scratch-Objects>>ScriptableScratchMorph

Add class variable LastMessage.
It might look like this:

Code:

Morph subclass: #ScriptableScratchMorph
    instanceVariableNames: 'objName vars lists blocksBin isClone media costume costumeChangeMSecs filterPack visibility volume tempoBPM sceneStates '
    classVariableNames: 'BlockColorDict BlockSpecDict DefaultBackgroundForm DefaultSpriteForm DoubleSize Experimental LastMessage ListBlockColor MeowSound OldMeowPrefixReversed PopSound RandomGen Recorder ScratchOrigin TimerStartMSecs '
    poolDictionaries: ''
    category: 'Scratch-Objects'

Scratch-Objects>>ScriptableScratchMorph>>Instance>>accessing

Code:

lastMessage
    ^ LastMessage

Code:

lastMessage: t1 
    LastMessage _ t1

Scratch-Objects>>ScriptableScratchMorph>>instance>>other ops>>broadcast:

Code:

broadcast: t1 
    self broadcast: t1 withArgument: 0.
    self lastMessage: t1

Scratch-Objects>>ScriptableScratchMorph>>instance>>other ops>>broadcast:withArgument:

Code:

broadcast: t1 withArgument: t2 
    | t3 |
    (t3 _ self ownerThatIsA: ScratchStageMorph) ifNotNil: [t3 broadcastEventNamed: t1 asString with: t2].
    self lastMessage: t1

Scratch-Objects>>ScriptableScratchMorph>>class>>other>>isSpriteSpecificTarget:selector:
Add 'lastMessage' to the list. It should look like this:

Code:

isSpriteSpecificTarget: t1 selector: t2 
    | t3 |
    (t1 isKindOf: ScratchSpriteMorph)
        ifFalse: [^ false].
    t3 _ t2 asString findAnySubStr: #('answer' 'key' 'Loud' 'lastMessage' 'mouse' 'sensor' 'soundLevel' 'tempo' 'timer' ) startingAt: 1.
    ^ t3 > t2 asString size

Last edited by hpotter134 (2011-01-30 09:25:12)


http://i45.tinypic.com/fxgtvc.png

Offline

 

#1291 2011-01-30 12:14:49

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

Re: Welcome to the OLD local block library!

Snowguy, this isn't the place to post Panther suggestions, post them in the Panther development thread  smile


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

Offline

 

#1292 2011-01-30 12:41:35

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

Re: Welcome to the OLD local block library!

The sprite touching sprite block isn't working for mouse touching edge and vise-versa. it comes up error! (scratch)
also, that block won't show edge unless you go to Scratch-Blocks>>SpriteArgMorph>>event handling>>presentMenu and add

Code:

            t2 = #sprite:touching: ifTrue: [t4 add: 'edge' localized asUTF8 action: #edge].

after

Code:

            t2 = #touching: ifTrue: [t4 add: 'edge' localized asUTF8 action: #edge].

Last edited by scimonster (2011-01-30 12:44:11)

Offline

 

#1293 2011-01-30 13:58:23

MrScoop
Scratcher
Registered: 2010-12-17
Posts: 100+

Re: Welcome to the OLD local block library!

this is good, but having a blockstore would be better. just vote 3 votes at: http://suggest.scratch.mit.edu/forums/60449-suggestions/suggestions/1431893-block-store

Offline

 

#1294 2011-01-30 14:36:11

djvalue
Scratcher
Registered: 2009-11-28
Posts: 13

Re: Welcome to the OLD local block library!

scimonster wrote:

improved version of the search block:
spec:

Code:

('%j %s' #- #doThis:on: 'google' 'scratch')

method (sensing ops):

Code:

doThis: t1 on: t2 
    'google' = t1 ifTrue: [ScratchPlugin primOpenURL: 'http://www.google.com/#sclient=psy&hl=en&q=' , t2 , '&aq=f&aqi=g5&aql=&oq=&gs_rfai=&pbx=1&fp=ab5cdb1806fef4aa&safe=activet1'].
    'yahoo' = t1 ifTrue: [ScratchPlugin primOpenURL: 'http://search.yahoo.com/search;_ylt=Aj.OqjGVrkBmY6mZqA_PSu.bvZx4?p=' , t2 , '&toggle=1&cop=mss&ei=UTF-8&fr=yfp-t-701'].
    'scratch.mit.edu/' = t1 ifTrue: [ScratchPlugin primOpenURL: 'http://scratch.mit.edu/' , t2].
    'search scratch for' = t1 ifTrue: [ScratchPlugin primOpenURL: 'http://scratch.mit.edu/pages/results?cx=010101365770046705949:gg_q9cry0mq&cof=FORID:11&q=' , t2 , '&safe=active&sa=search'].
    'IMDB' = t1 ifTrue: [ScratchPlugin primOpenURL: 'http://www.imdb.com/find?s=all&q=' , t2].
    'wikipedia search for' = t1 ifTrue: [ScratchPlugin primOpenURL: 'http://en.wikipedia.org/w/index.php?title=Special%3ASearch&redirs=0&search=' , t2 , '&fulltext=Search&ns0=1'].
    'load' = t1 ifTrue: [^ 0].
    ^ 0

also put in sensing ops:

Code:

engineNames
    ^ #('google' 'yahoo' 'scratch.mit.edu/' 'search scratch for' 'wikipedia search for' 'IMDB' 'load' )

then go to Scratch-Blocks -> CommandBlockMorph instance -> private -> uncoloredArgMorphFor:
add:

Code:

    $j = t2 ifTrue: [^ ChoiceArgMorph new getOptionsSelector: #engineNames;
         choice: 'google'].

also searches wikipedia!

So, how do you do this exactly? im very interested.


Cities will fall, men will die, but great ideas will live on

Offline

 

#1295 2011-01-30 18:45:58

nickbrickmaster
Scratcher
Registered: 2010-02-02
Posts: 500+

Re: Welcome to the OLD local block library!

Is there a "create .txt file of list _"?


Ask me what I'm doing, wait an hour than roll a die, if it's 4-6, I'm playing Skyrim, if it's 1, I'm eating, if it's 2-3 I'm programming.
Steam: nickbrickmaster | RotMG: PwnThemAll | Minecraft: nickbrickmaster | League Of Legends: BaneOfTitans

Offline

 

#1296 2011-01-30 20:05:42

msdosdude
Scratcher
Registered: 2009-06-11
Posts: 1000+

Re: Welcome to the OLD local block library!

I have a BYOB block. It says the blocks you put in the C-shape. http://www.megaupload.com/?d=IQ4AZX9K Section: Other


http://i39.tinypic.com/2vkxppf.png
Freebie. Not a Scratch OS, a REAL OS you can boot to, by msdosdude.

Offline

 

#1297 2011-01-30 20:16:52

bbbeb
Scratcher
Registered: 2009-06-11
Posts: 1000+

Re: Welcome to the OLD local block library!

@MSDOS: Do not use rapidshare or megaupload. Only premium accounts work well there.


Back in my day.... there were no laws that censored the internet... now, there are.... nah.

Offline

 

#1298 2011-01-30 21:41:13

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

Re: Welcome to the OLD local block library!

bbbeb wrote:

@MSDOS: Do not use rapidshare or megaupload. Only premium accounts work well there.

What do you mean?


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

 

#1299 2011-01-30 22:52:31

bbbeb
Scratcher
Registered: 2009-06-11
Posts: 1000+

Re: Welcome to the OLD local block library!

Pecola1 wrote:

bbbeb wrote:

@MSDOS: Do not use rapidshare or megaupload. Only premium accounts work well there.

What do you mean?

There is a download timer and truckloads of ads.


Back in my day.... there were no laws that censored the internet... now, there are.... nah.

Offline

 

#1300 2011-01-31 01:03:18

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

Re: Welcome to the OLD local block library!

Do you want me too make a thing for how to open the system browser for scratch?
I have a project you can link to also. How to open the System Browser to add blocks

Offline

 

Board footer