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

#1 2010-09-13 21:47:01

midnightleopard
Scratcher
Registered: 2007-09-13
Posts: 1000+

Scratch website block for the win!

This is my BEST Block for SURE!!!! Also, one of my favorite blocks of all! It took like fourty five minutes to make!

It searches on google, scratch, scratch search, yahoo, youtube, IMDB or tests to see if the person using the project has the block. So to get it, do these codes in the browser.

this one goes in Scratch Objects -> Scriptable Sprite Morph -> sensing ops ->

Code:

doThis: t1 on: t2 
    | engines l |
    '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].
    'load' = t1 ifTrue: [^ 0].
    ^ 0

and this one also goes in the same place:

Code:

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

and this one goes in scratch objects -> scriptable sprite morph -> class -> block specs -> block specs (just put it in sensing)

Code:

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

now this one goes in Scratch Blocks -> Command Block Morph -> Private -> uncoloredArgMorphFor (delete all of it and replace it with this)

Code:

uncoloredArgMorphFor: t1 
    | t2 |
    t2 _ t1 at: 2.
    $a = t2 ifTrue: [^ AttributeArgMorph new choice: 'volume'].
    $b = t2 ifTrue: [^ BooleanArgMorph new].
    $c = t2 ifTrue: [^ ColorArgMorph new showPalette: true].
    $C = t2 ifTrue: [^ ColorArgMorph new showPalette: false].
    $d = t2 ifTrue: [^ ExpressionArgMorphWithMenu new numExpression: '0';
         menuSelector: #directionMenu].
    $D = t2 ifTrue: [^ ExpressionArgMorphWithMenu new numExpression: '48';
         menuSelector: #midiDrumMenu].
    $e = t2 ifTrue: [^ EventTitleMorph new].
    $f = t2 ifTrue: [^ ChoiceArgMorph new getOptionsSelector: #mathFunctionNames;
         choice: 'sqrt'].
    $g = t2 ifTrue: [^ ChoiceArgMorph new getOptionsSelector: #graphicEffectNames;
         choice: 'color'].
    $j = t2 ifTrue: [^ ChoiceArgMorph new getOptionsSelector: #engineNames;
         choice: 'google'].
    $H = t2 ifTrue: [^ ChoiceArgMorph new getOptionsSelector: #hookupSensorNames].
    $h = t2 ifTrue: [^ ChoiceArgMorph new getOptionsSelector: #hookupBooleanSensorNames].
    $I = t2 ifTrue: [^ ExpressionArgMorphWithMenu new numExpression: '1';
         menuSelector: #midiInstrumentMenu].
    $i = t2 ifTrue: [^ ExpressionArgMorphWithMenu new numExpression: '1';
         menuSelector: #listIndexMenu].
    $k = t2 ifTrue: [^ ChoiceArgMorph new getOptionsSelector: #keyNames;
         choice: 'space'].
    $L = t2 ifTrue: [^ ChoiceArgMorph new getOptionsSelector: #listVarMenu].
    $l = t2 ifTrue: [^ ChoiceOrExpressionArgMorph new getOptionsSelector: #costumeNames;
         choice: 'costume1'].
    $m = t2 ifTrue: [^ SpriteArgMorph new].
    $M = t2 ifTrue: [^ ChoiceArgMorph new getOptionsSelector: #motorNames].
    $n = t2 ifTrue: [^ ExpressionArgMorph new numExpression: '10'].
    $N = t2 ifTrue: [^ ExpressionArgMorphWithMenu new numExpression: '60';
         menuSelector: #noteSelector].
    $s = t2 ifTrue: [^ ExpressionArgMorph new stringExpression: ''].
    $S = t2 ifTrue: [^ ChoiceOrExpressionArgMorph new getOptionsSelector: #soundNames;
         choice: 'pop'].
    $v = t2 ifTrue: [^ ChoiceArgMorph new getOptionsSelector: #varNamesMenu;
         choice: ''].
    $W = t2 ifTrue: [^ ChoiceArgMorph new getOptionsSelector: #motorDirection].
    $x = t2 ifTrue: [^ ChoiceOrExpressionArgMorph new getOptionsSelector: #sceneNames;
         choice: ''].
    $y = t2 ifTrue: [^ ExpressionArgMorphWithMenu new numExpression: '1';
         menuSelector: #listIndexForDeleteMenu].
    ^ ExpressionArgMorph new numExpression: '10'

And we're done! So here are a Frequently Asked Questions:

Q: What is 'load' for?
A: Load doesn't do anything. It is used to make sure people using your project have the block.

Q: Will this screw up my scratch?
A: It shouldn't, but tell me if it does.

Q: Can I put this in my Source Code mod?
A: Yes, but please, please, please give me some credit!

Q: Youtube doesn't work!
A: It should work but if it doesn't tell me.

Last edited by midnightleopard (2010-09-17 12:29:56)


http://pwp.wizards.com/5103673563/Scorecards/Landscape.png

Offline

 

#2 2010-09-13 21:51:35

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

Re: Scratch website block for the win!

SSmmmaaarrrtt.....?
(begin ranting)
And Common Sense Dictates to NOT press the green flag on any hacked mod without checking it first.
Once, i made a program that searched your documents and cleared all .txt files.
I deleted it to make sure it didn't come back. It was in PANTHER too!!! AAHHH!!!!
PAANNNTTTHHHHEEERRR CAN LAUNCH MALICIOUS CODE!!!!!! SCCCRRREEEEEAAAAMMM!!
/rant


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

Offline

 

#3 2010-09-13 21:55:05

ScratchReallyROCKS
Scratcher
Registered: 2009-04-22
Posts: 1000+

Re: Scratch website block for the win!

bbbeb wrote:

SSmmmaaarrrtt.....?
(begin ranting)
And Common Sense Dictates to NOT press the green flag on any hacked mod without checking it first.
Once, i made a program that searched your documents and cleared all .txt files.
I deleted it to make sure it didn't come back. It was in PANTHER too!!! AAHHH!!!!
PAANNNTTTHHHHEEERRR CAN LAUNCH MALICIOUS CODE!!!!!! SCCCRRREEEEEAAAAMMM!!
/rant

Malicious code that doesn't control itself...doesn't seem that bad...


http://imageshack.us/a/img694/3806/sigmad.png

Offline

 

#4 2010-09-13 23:35:11

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

Re: Scratch website block for the win!

ScratchReallyROCKS wrote:

bbbeb wrote:

SSmmmaaarrrtt.....?
(begin ranting)
And Common Sense Dictates to NOT press the green flag on any hacked mod without checking it first.
Once, i made a program that searched your documents and cleared all .txt files.
I deleted it to make sure it didn't come back. It was in PANTHER too!!! AAHHH!!!!
PAANNNTTTHHHHEEERRR CAN LAUNCH MALICIOUS CODE!!!!!! SCCCRRREEEEEAAAAMMM!!
/rant

Malicious code that doesn't control itself...doesn't seem that bad...

Yeah..... doesn't control itself, eh?.... you would love to see that, wouldny you? WOULDNT YOU? WOULDNT YOU?! WOULDNT YOU?!?!?

Just Kidding. It can get out of hand, though.


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

Offline

 

#5 2010-09-14 02:36:41

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

Re: Scratch website block for the win!

no malicious code has been submitted to the Panther site as of yet, I do carefully check every single project before I upload it, but yes, it worries me too. Even so, that's the price to pay for more control.

You should be glad you didn't accidentally run it and delete your files  tongue
______________________________________________

I like this idea, it's a lot safer than the free URL block, though in the same way as above, it's limited in it's application.


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

Offline

 

#6 2010-09-14 06:52:11

ScratchReallyROCKS
Scratcher
Registered: 2009-04-22
Posts: 1000+

Re: Scratch website block for the win!

bbbeb wrote:

ScratchReallyROCKS wrote:

bbbeb wrote:

SSmmmaaarrrtt.....?
(begin ranting)
And Common Sense Dictates to NOT press the green flag on any hacked mod without checking it first.
Once, i made a program that searched your documents and cleared all .txt files.
I deleted it to make sure it didn't come back. It was in PANTHER too!!! AAHHH!!!!
PAANNNTTTHHHHEEERRR CAN LAUNCH MALICIOUS CODE!!!!!! SCCCRRREEEEEAAAAMMM!!
/rant

Malicious code that doesn't control itself...doesn't seem that bad...

Yeah..... doesn't control itself, eh?.... you would love to see that, wouldny you? WOULDNT YOU? WOULDNT YOU?! WOULDNT YOU?!?!?

Just Kidding. It can get out of hand, though.

Woah! Turn down the rant meter!  tongue


http://imageshack.us/a/img694/3806/sigmad.png

Offline

 

#7 2010-09-14 06:53:52

ssss
Scratcher
Registered: 2007-07-29
Posts: 1000+

Re: Scratch website block for the win!

ScratchReallyROCKS wrote:

bbbeb wrote:

ScratchReallyROCKS wrote:


Malicious code that doesn't control itself...doesn't seem that bad...

Yeah..... doesn't control itself, eh?.... you would love to see that, wouldny you? WOULDNT YOU? WOULDNT YOU?! WOULDNT YOU?!?!?

Just Kidding. It can get out of hand, though.

Woah! Turn down the rant meter!  tongue

Yeah...

[OT]  I used this block in a forever script, guess what that did!!![/OT]


Hey.  It's me SSSS, back from the dead!  smile

Offline

 

#8 2010-09-14 11:16:37

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

Re: Scratch website block for the win!

ssss wrote:

ScratchReallyROCKS wrote:

bbbeb wrote:

Yeah..... doesn't control itself, eh?.... you would love to see that, wouldny you? WOULDNT YOU? WOULDNT YOU?! WOULDNT YOU?!?!?

Just Kidding. It can get out of hand, though.

Woah! Turn down the rant meter!  tongue

Yeah...

[OT]  I used this block in a forever script, guess what that did!!![/OT]

A lot of stuff.
When you put a clear file [pick random 1- 99999999] bad things happen in the Panther folder. Bad things.


sparks wrote:

no malicious code has been submitted to the Panther site as of yet, I do carefully check every single project before I upload it, but yes, it worries me too. Even so, that's the price to pay for more control.

You should be glad you didn't accidentally run it and delete your files  tongue

I am so happy i was able to delete the script before it went insane.  big_smile






__________________________________________________________________________
This was a great idea! Now i can link to Scratch pages without having to worry about hacked browsers.... and linking to terrible sites....
At least Sparks checks the Panther uploads!!!  big_smile

Last edited by bbbeb (2010-09-14 11:19:51)


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

Offline

 

#9 2010-09-14 11:37:26

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

Re: Scratch website block for the win!

midnightleopard wrote:

For instance do:

Code:

openWebsiteOn: t1 
    Cursor wait showWhile: [ScratchPlugin primOpenURL: 'http://scratch.mit.edu/' , t1]

Cursor wait showWhile: just shows the wait cursor while the bit in square brackets is being performed. It isn't really necessary.


/* No comment */

Offline

 

#10 2010-09-14 14:48:05

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

Re: Scratch website block for the win!

TheSuccessor wrote:

midnightleopard wrote:

For instance do:

Code:

openWebsiteOn: t1 
    Cursor wait showWhile: [ScratchPlugin primOpenURL: 'http://scratch.mit.edu/' , t1]

Cursor wait showWhile: just shows the wait cursor while the bit in square brackets is being performed. It isn't really necessary.

It makes the "link" experience more real  tongue


nXIII

Offline

 

#11 2010-09-14 15:21:34

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

Re: Scratch website block for the win!

nXIII wrote:

TheSuccessor wrote:

midnightleopard wrote:

For instance do:

Code:

openWebsiteOn: t1 
    Cursor wait showWhile: [ScratchPlugin primOpenURL: 'http://scratch.mit.edu/' , t1]

Cursor wait showWhile: just shows the wait cursor while the bit in square brackets is being performed. It isn't really necessary.

It makes the "link" experience more real  tongue

well, i suppose so.  tongue
i think the best would be to hve your own custom cursor for links. i don't know what the best would be though  smile

Offline

 

#12 2010-09-14 15:26:09

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

Re: Scratch website block for the win!

bbbeb wrote:

When you put a clear file [pick random 1- 99999999] bad things happen in the Panther folder. Bad things.

You are refering to the Panther glitch where trying to clear a non existant file will create it instead.


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

Offline

 

#13 2010-09-14 15:28:43

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

Re: Scratch website block for the win!

sparks wrote:

bbbeb wrote:

When you put a clear file [pick random 1- 99999999] bad things happen in the Panther folder. Bad things.

You are refering to the Panther glitch where trying to clear a non existant file will create it instead.

Exactly.

Then why didnt you create a function to [Make file []]?!?!?!\
{end offtopic}

Last edited by bbbeb (2010-09-14 15:29:34)


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

Offline

 

#14 2010-09-14 15:34:17

Daffy22
Scratcher
Registered: 2008-12-15
Posts: 500+

Re: Scratch website block for the win!

sparks wrote:

bbbeb wrote:

When you put a clear file [pick random 1- 99999999] bad things happen in the Panther folder. Bad things.

You are refering to the Panther glitch where trying to clear a non existant file will create it instead.

we're did you learn to spell?!  big_smile   roll


http://img201.imageshack.us/img201/1784/logosmalle.png
"Spectacular - 5 Star" -  CNET.com Editor.

Offline

 

#15 2010-09-14 15:39:08

midnightleopard
Scratcher
Registered: 2007-09-13
Posts: 1000+

Re: Scratch website block for the win!

Yeah. Please could you not Threadjack this? Thank you!
And yes, the cursor waitwhileshow thing makes it look cooler! I think you can change it in the skin to make it look different. I might try to do a 'search google for' block.


http://pwp.wizards.com/5103673563/Scorecards/Landscape.png

Offline

 

#16 2010-09-14 15:43:34

midnightleopard
Scratcher
Registered: 2007-09-13
Posts: 1000+

Re: Scratch website block for the win!

I just made [search google for...] block! It's amazing! Will post it later.


http://pwp.wizards.com/5103673563/Scorecards/Landscape.png

Offline

 

#17 2010-09-14 15:47:35

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

Re: Scratch website block for the win!

Daffy22 wrote:

sparks wrote:

bbbeb wrote:

When you put a clear file [pick random 1- 99999999] bad things happen in the Panther folder. Bad things.

You are refering to the Panther glitch where trying to clear a non existant file will create it instead.

we're did you learn to spell?!  big_smile   roll

But 'where' is correct...
Admittedly, 'in which' would be a better choice, not 'we're.' However, you could point out the misspelling of 'referring' and 'existent.'


nXIII

Offline

 

#18 2010-09-14 15:50:22

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

Re: Scratch website block for the win!

nXIII wrote:

Daffy22 wrote:

sparks wrote:

You are refering to the Panther glitch where trying to clear a non existant file will create it instead.

we're did you learn to spell?!  big_smile   roll

But 'where' is correct...
Admittedly, 'in which' would be a better choice, not 'we're.' However, you could point out the misspelling of 'referring' and 'existent.'

NXIII i caught you!
Finally!
Lol.
Is it possible to make a (file [string] exists) and a [make file [] ] block?
Just want to know  tongue

Last edited by bbbeb (2010-09-14 15:50:29)


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

Offline

 

#19 2010-09-14 15:55:49

Daffy22
Scratcher
Registered: 2008-12-15
Posts: 500+

Re: Scratch website block for the win!

nXIII wrote:

Daffy22 wrote:

sparks wrote:


You are refering to the Panther glitch where trying to clear a non existant file will create it instead.

we're did you learn to spell?!  big_smile   roll

But 'where' is correct...
Admittedly, 'in which' would be a better choice, not 'we're.' However, you could point out the misspelling of 'referring' and 'existent.'

Where:
EG. Where did you last see it?
so it should be we're - short for We are so thats what  it should be  big_smile


http://img201.imageshack.us/img201/1784/logosmalle.png
"Spectacular - 5 Star" -  CNET.com Editor.

Offline

 

#20 2010-09-14 15:56:48

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

Re: Scratch website block for the win!

bbbeb wrote:

nXIII wrote:

Daffy22 wrote:

we're did you learn to spell?!  big_smile   roll

But 'where' is correct...
Admittedly, 'in which' would be a better choice, not 'we're.' However, you could point out the misspelling of 'referring' and 'existent.'

NXIII i caught you!

Oh, I read your post wrong. I thought there was an implied full stop or semicolon between the boldy-red 'we're' and the 'did you learn....' Now I realize you were using the incorrect word to emphasize the other misspellings. Sorry.

Last edited by nXIII (2010-09-14 15:56:57)


nXIII

Offline

 

#21 2010-09-14 15:59:32

Daffy22
Scratcher
Registered: 2008-12-15
Posts: 500+

Re: Scratch website block for the win!

nXIII wrote:

bbbeb wrote:

nXIII wrote:


But 'where' is correct...
Admittedly, 'in which' would be a better choice, not 'we're.' However, you could point out the misspelling of 'referring' and 'existent.'

NXIII i caught you!

Oh, I read your post wrong. I thought there was an implied full stop or semicolon between the boldy-red 'we're' and the 'did you learn....' Now I realize you were using the incorrect word to emphasize the other misspellings. Sorry.

lol, yeah!  big_smile   big_smile


http://img201.imageshack.us/img201/1784/logosmalle.png
"Spectacular - 5 Star" -  CNET.com Editor.

Offline

 

#22 2010-09-14 18:51:23

midnightleopard
Scratcher
Registered: 2007-09-13
Posts: 1000+

Re: Scratch website block for the win!

http://knowyourmeme.com/i/000/063/372/original/Bad_Dudes.jpg?1280677065
[/sort of an inside joke]
seriously guys


http://pwp.wizards.com/5103673563/Scorecards/Landscape.png

Offline

 

#23 2010-09-14 20:38:39

midnightleopard
Scratcher
Registered: 2007-09-13
Posts: 1000+

Re: Scratch website block for the win!

hey check it out again, I changed it... a lot... a ton... it now does google, yahoo, youtube, and more.


http://pwp.wizards.com/5103673563/Scorecards/Landscape.png

Offline

 

#24 2010-09-15 19:25:35

midnightleopard
Scratcher
Registered: 2007-09-13
Posts: 1000+

Re: Scratch website block for the win!

^bump^


http://pwp.wizards.com/5103673563/Scorecards/Landscape.png

Offline

 

#25 2010-09-17 04:11:12

ssss
Scratcher
Registered: 2007-07-29
Posts: 1000+

Re: Scratch website block for the win!

It doesn't work.  What do you do first?


Hey.  It's me SSSS, back from the dead!  smile

Offline

 

Board footer