zorket wrote:
thesuccessor wrote:
self randomFrom: 1 to: 6, I think but I haven't got Scratch open so I can't be sure.
We can gain more codes by opening squeak. In the pick random code where I just checked, contains something else.
what do you mean by that??
Offline
LS97 wrote:
randalpik wrote:
I can't figure out how to make the Graphic effect reporter block... can someone help?
Here it is just quickly. i've got hw to do now!
Code:
getEffect: t1 filterPack ifNil: [^ 0]. 'blur' = t1 ifTrue: [^ filterPack blur]. 'brightness' = t1 ifTrue: [^ filterPack brightnessShift]. 'fisheye' = t1 ifTrue: [^ filterPack fisheye]. 'color' = t1 ifTrue: [^ filterPack hueShift]. 'colour' = t1 ifTrue: [^ filterPack hueShift]. 'mosaic' = t1 ifTrue: [^ filterPack mosaicCount]. 'pixelate' = t1 ifTrue: [^ filterPack pixelateCount]. 'pointillize' = t1 ifTrue: [^ filterPack pointillizeSize]. 'saturation' = t1 ifTrue: [^ filterPack saturationShift]. 'transparency' = t1 | ('ghost' = t1) ifTrue: [^ self transparency]. 'whirl' = t1 ifTrue: [^ filterPack whirl]Hope it helps.
where do you put it?
Offline
gog1 wrote:
LS97 wrote:
randalpik wrote:
I can't figure out how to make the Graphic effect reporter block... can someone help?
Here it is just quickly. i've got hw to do now!
Code:
getEffect: t1 filterPack ifNil: [^ 0]. 'blur' = t1 ifTrue: [^ filterPack blur]. 'brightness' = t1 ifTrue: [^ filterPack brightnessShift]. 'fisheye' = t1 ifTrue: [^ filterPack fisheye]. 'color' = t1 ifTrue: [^ filterPack hueShift]. 'colour' = t1 ifTrue: [^ filterPack hueShift]. 'mosaic' = t1 ifTrue: [^ filterPack mosaicCount]. 'pixelate' = t1 ifTrue: [^ filterPack pixelateCount]. 'pointillize' = t1 ifTrue: [^ filterPack pointillizeSize]. 'saturation' = t1 ifTrue: [^ filterPack saturationShift]. 'transparency' = t1 | ('ghost' = t1) ifTrue: [^ self transparency]. 'whirl' = t1 ifTrue: [^ filterPack whirl]Hope it helps.
where do you put it?
i would suggest ScriptableScratchMorph -> looks ops
Offline
OK change giveCircleSecondThing to this:
giveCircleSecondThing ^ 2.718281828459045235360287471352662497757247093699959574966 967627724076630353547594571382178525166427427466391932003059 921817413596629043572900334295260595630738132328627943490763 233829880753195251019011573834187930702154089149934884167509 244761460668082264800168477411853742345442437107539077744992 069551702761838606261331384583000752044933826560297606737113 200709328709127443747047230696977209310141692836819025515108 657463772111252389784425056953696770785449969967946864454905 987931636889230098793127736178215424999229576351482208269895 193668033182528869398496465105820939239829488793320362509443 117301238197068416140397019837679320683282376464804295311802 328782509819455815301756717361332069811250996181881593041690 351598888519345807273866738589422879228499892086805825749279 610484198444363463244968487560233624827041978623209002160990 235304369941849146314093431738143640546253152096183690888707 016768396424378140592714563549061303107208510383750510115747 704171898610687396965521267154688957035035402123407849819334 321068170121005627880235193033224745015853904730419957777093 503660416997329725088687696640355570716226844716256079882651 787134195124665201030592123667719432527867539855894489697096 409754591856956380236370162112047742722836489613422516445078 182442352948636372141740238893441247963574370263755294448337 998016125492278509257782562092622648326277933386566481627725 164019105900491644998289315056604725802778631864155195653244 258698294695930801915298721172556347546396447910145904090586 298496791287406870504895858671747985466775757320568128845920 541334053922000113786300945560688166740016984205580403363795 376452030402432256613527836951177883863874439662532249850654 995886234281899707733276171783928034946501434558897071942586 398772754710962953741521115136835062752602326484728703920764
Last edited by bbbeb (2010-11-01 18:00:48)
Offline
bbbeb wrote:
OK change giveCircleSecondThing to this:
Code:
giveCircleSecondThing ^ 2.718281828459045235360287471352662497757247093699959574966 967627724076630353547594571382178525166427427466391932003059 921817413596629043572900334295260595630738132328627943490763 233829880753195251019011573834187930702154089149934884167509 244761460668082264800168477411853742345442437107539077744992 069551702761838606261331384583000752044933826560297606737113 200709328709127443747047230696977209310141692836819025515108 657463772111252389784425056953696770785449969967946864454905 987931636889230098793127736178215424999229576351482208269895 193668033182528869398496465105820939239829488793320362509443 117301238197068416140397019837679320683282376464804295311802 328782509819455815301756717361332069811250996181881593041690 351598888519345807273866738589422879228499892086805825749279 610484198444363463244968487560233624827041978623209002160990 235304369941849146314093431738143640546253152096183690888707 016768396424378140592714563549061303107208510383750510115747 704171898610687396965521267154688957035035402123407849819334 321068170121005627880235193033224745015853904730419957777093 503660416997329725088687696640355570716226844716256079882651 787134195124665201030592123667719432527867539855894489697096 409754591856956380236370162112047742722836489613422516445078 182442352948636372141740238893441247963574370263755294448337 998016125492278509257782562092622648326277933386566481627725 164019105900491644998289315056604725802778631864155195653244 258698294695930801915298721172556347546396447910145904090586 298496791287406870504895858671747985466775757320568128845920 541334053922000113786300945560688166740016984205580403363795 376452030402432256613527836951177883863874439662532249850654 995886234281899707733276171783928034946501434558897071942586 398772754710962953741521115136835062752602326484728703920764
Too long for it to process.
Offline
zorket wrote:
bbbeb wrote:
OK change giveCircleSecondThing to this:
Code:
giveCircleSecondThing ^ 2.718281828459045235360287471352662497757247093699959574966 967627724076630353547594571382178525166427427466391932003059 921817413596629043572900334295260595630738132328627943490763 233829880753195251019011573834187930702154089149934884167509 244761460668082264800168477411853742345442437107539077744992 069551702761838606261331384583000752044933826560297606737113 200709328709127443747047230696977209310141692836819025515108 657463772111252389784425056953696770785449969967946864454905 987931636889230098793127736178215424999229576351482208269895 193668033182528869398496465105820939239829488793320362509443 117301238197068416140397019837679320683282376464804295311802 328782509819455815301756717361332069811250996181881593041690 351598888519345807273866738589422879228499892086805825749279 610484198444363463244968487560233624827041978623209002160990 235304369941849146314093431738143640546253152096183690888707 016768396424378140592714563549061303107208510383750510115747 704171898610687396965521267154688957035035402123407849819334 321068170121005627880235193033224745015853904730419957777093 503660416997329725088687696640355570716226844716256079882651 787134195124665201030592123667719432527867539855894489697096 409754591856956380236370162112047742722836489613422516445078 182442352948636372141740238893441247963574370263755294448337 998016125492278509257782562092622648326277933386566481627725 164019105900491644998289315056604725802778631864155195653244 258698294695930801915298721172556347546396447910145904090586 298496791287406870504895858671747985466775757320568128845920 541334053922000113786300945560688166740016984205580403363795 376452030402432256613527836951177883863874439662532249850654 995886234281899707733276171783928034946501434558897071942586 398772754710962953741521115136835062752602326484728703920764Too long for it to process.
well, in fact, the program will only process it to about 20 decimal places (i think its about that) then round it. so no use in making it longer!
(that's why you dont use it for math)
Offline
If you return it as a string you can get the entire thing. And e has (almost) nothing to do with circles. Random fact: e^(iπ) = -1. I found a proof in Professor Stewart's Cabinet of Mathematical Curiosities. (Or maybe Hoard of Mathematical Treasures.) They're both good books. I recommend them.
Last edited by TheSuccessor (2010-11-02 14:31:23)
Offline
TheSuccessor wrote:
If you return it as a string you can get the entire thing. And e has (almost) nothing to do with circles. Random fact: e^(iπ) = -1. I found a proof in Professor Stewart's Cabinet of Mathematical Curiosities. (Or maybe Hoard of Mathematical Treasures.) They're both good books. I recommend them.
Oh yea, what is it... e^iθ = i cos θ - sin θ? I forget....
Offline
I used to think math was no fun,
'Cause I couldn't see how it was done.
Now Euler's my hero,
For I see why zero
Equals e to the iπ plus one.
Offline
me450 wrote:
a new block
bounceCode:
bounce self rotationDegrees: rotationDegrees + 180blockspec
Code:
('bounce' #- #bounce)
unfortunately, the bounce script you're looking for is a bit more complicated than that. many good projects already use the proper version, you might want to try and look for it for then translating it into squeak!
Offline
fudgepop wrote:
how do you make a <i recive []> Block? i need it to finish a LOT of projects
Place it in control.
Blockspec:
('I receive %e' #b #seesBroadcast:)
Code under other ops:
seesBroadcast: t1 | t2 | t2 _ ScratchEvent allInstances. t2 reverseDo: [:t3 | t3 name = t1 ifTrue: [^ true]. nil]. ^ false
Credit to rubics cube guy238 for the code.
Do not upload, for 2 reasons:
1. It becomes obsolete!
2. It doesn't work online (really.)
Last edited by zorket (2010-11-04 19:03:40)
Offline
[blocks]<<goto URL( )in a new browser>[/blocks]
would be awesome!
Offline
ScratchPlugin primOpenUrl: 'http://web.address/'
Offline
[Tutorial - Compile to exe with custom blocks]
1. Download latest BYOB
2. go to BYOB folder
3. Look for BYOB Development.BAT
4. change shortcut to open that file
5. open BYOB via shortcut of batch file
6. Shift click edit
7. turn fill screen off
8. add all your custom blocks and use BYOBS compiler to compile your projects
Offline
me450 wrote:
[REQUEST]
could someone please make a import and export list block
Thanks
just use the write to file and join list blocks in bingo 1.3 and combine them!
Last edited by LS97 (2010-11-11 11:25:17)
Offline
Here's my tutorial:
1.) Open scratch, shift click in the loop in R:
Open the editor.
Then click on the white space that appears, go to open-browser.
2.) The browser should look like:
You really should be working on 1.4.
Go above, and click scratch objects.
[Scratch sprite morph for sprite only blocks, Scratch stage morph for stage blocks only, and ScriptableScratchMorph for both, go to ScriptableScratchMorph in the example, please]
Then you go LOW and press class. then go to the third pane, click blockspecs//scratch. In the 4th pane, blockspecs.
3.) Here's a really hard step. You have to locate yourself where the blockspec goes!
Alright. If you are following the tutorial, you should be in ScriptableScratchMorph.
Find 'control'. look across the line, and you will see a #-. Use a #- when you want to put a space in. And you will find a ('repeat %n' #c #doRepeat 10).
The block contents is first in the brackets. There have to be brackets for strings, always. example: 'repeat %n' ________________________ The #c tells what type of block this is. Here is a list: #- no arguments (command or 'stack' block) #r Reporter block (the round ones) #b boolean block (diamond shaped) #c C shaped block (like the forever block) #t Time block (like wait X secs) #W 'when' hat block (obsolete) #S start button click hat block #K key-activated hat block #E event hat block (broadcast) #s special form (hard to code) Credit to ls97 for this list. ______________________ The #doRepeat 10 is the command. It has to be exact to the name of the code.
You also might be wondering what the %n is doing there.
This indicates a numberical inserter. Here is a list of them:
a: attribute of another sprite, such as X position or size. b: a boolean inserter c: a colour picker that shows the menu. C: a colour picker that doesn't d: the sprite direction menu/numerical inserter. D: the menu for midi drums e: The broadcast message menu f: math function menu (with sin, abs, etc.) g: menu for the different graphic effects. h: numerical sensor board selector menu H: boolean sensor board selector menu i: midi instrument menu/numerical inserter k: menu for the names of the different keys, used in the key sensor blocks. l: menu with the costume names of the given sprite. L: list name menu. m: sprite list n: numerical inserter N: note name menu/inserter s: string inserter S: sound selector menu v: variable labels menu y: menu used to delete either a number of the last value or all of a list.
Credit to ls97 and billyedward for this list.
Alright, for the tutorial, were gonna make the ( report (hello) ) block. Add the blockspec: ('report %s' #r #report: 'hello') Place it in control or operators.
4.) Now were going to move on to codes. Some blocks already have the code installed.
For the ( report (hello) ) block were doing, there is a place were gonna put this code.
Click on instance in the 2nd pane low. In the third pane, other ops, and the 4th, add new code or replace any code. Use the code for the ( report (hello) ) block:
report: t1 ^ t1
this is the short code. Accept.
I'm gonna help you figure out more stuff. Here's an extra-long helpers code:
report: t1 | t2 t3 | t1 _ t2 t2 _ t3 t3 = t1 ifTrue: [^ t1]
The | t2 t3| adds the variables t2 and t3 to the code.
t1 _ t2 makes t2 equal t1.
t2 _ t3 makes t3 equal t2.
t3 = t1 ifTrue: [^ t1] checks if t3 = t1, if it does, it does the command inside [], and ^ makes it report t1 (the string)
There you go! With a little practice, you can make your own blocks! Oh, I almost forgot. Close the green code, and turn fill screen on with the first in step 1. If you are positive you want this block permonant, use the shift-click methood and click save-image.
With this tutorial, there are no bondaries for blocks.
You can even make a [if touching (a sprite), die] block!!!
Offline
zorket wrote:
really long tutorial
Zorket, you use a lot of space for every tutorial. Makybe you could make a thread for these?
Offline
LS97 wrote:
me450 wrote:
[REQUEST]
could someone please make a import and export list block
Thanksjust use the write to file and join list blocks in bingo 1.3 and combine them!
ok
ill try that
EDIT:
i need a password to open bingo's image
EDIT:
found a thread NXIII posted it
its sunny
Last edited by me450 (2010-11-12 00:46:44)
Offline
me450 wrote:
LS97 wrote:
me450 wrote:
[REQUEST]
could someone please make a import and export list block
Thanksjust use the write to file and join list blocks in bingo 1.3 and combine them!
ok
ill try that
EDIT:
i need a password to open bingo's image
you dont need a password to combine blocks... Squeak isnt always the simplest answer to everything!
what a nice 1000th post
Last edited by LS97 (2010-11-12 11:32:43)
Offline