complete tutorial for watcher:
- open browser
- follow the path: Scratch-Blocks -> CommandBlockMorph -> private -> canBecomeWatcher
- add this to the beginning of the code (not including title!) :
(#( #info:fromZip: #synonym: #wordOfTheDay: #jokeOfTheDay: #askYahoo #scratchrInfo:forUser: ) includes: selector) ifTrue: [^ true].
you should be fine now. the watchers should appear in front of the block when you restart scratfch.
Offline
if you would like to have those same menus (instead of string arguments) that netScratch has, you can edit the uncoloredArgMorphFor: code in the same category (private) and add those codes (%z, %j, %w etc.). then add the menu names. it's a bit more complicated, tell me if you want it or not and i'll make a clearer tutorial.
Offline
thanks you!(i will give u credit if i finish this!!!)
i think the port would look better if i had the %g blocks, thanks!
Last edited by dav09 (2010-06-29 06:33:19)
Offline
you cant make the #g, but you can make the %z %w and %j.
here's how:
go to scratch-objects -> commandblockmorph -> private -> uncoloredargmorphfor:
and you'll see some frightening code. there, you'll find a list of $x = code ifTrue: [^ something]. all in alphabetical order.
add
$z = code ifTrue: [^ ChoiceOrExpressionArgMorph new getOptionsSelector: zipNames; choice: 'city'].
in the right alphabetical place.
now, back to ScriptableScratchMorph, add a method called zipNames like this:
zipNames
^ #( 'city' 'state' temperature' )
and all of that stuff following this template. then do the same thing from the beginning for the other two, %j and %w (which in the uncoloredArgMorphFor are $j and $w).
Offline
ok thanks
had the 2nd part done already(but a little differant)
ps, i think u mean scratch blocks, not objects.
the weather block should work now right?
Last edited by dav09 (2010-06-29 10:15:44)
Offline
@dav09:
yeah that's what i meant. and the weather block should work, if you did the method right in the first place (the one called by the blockSpec)
Offline
yeah i did the block spec right, you have really helped me with squeak programing Thanks
Offline
you're welcome!
but are you going to release this mod, or will you keep it to yourself?
oh and i noticed, you were actually the first one to post on this thread after me! you're still here after 32 pages! thanks for the loyalty
Last edited by LS97 (2010-06-29 13:11:01)
Offline
huh? i know lua scripting but just the basics and im working on a pdf tutorial
but ive never done smalll talk
-----------------------------------------------------------------------------------------
~ironmannn~
<when[ 51productions ]key pressed>
<broadcast[ 51 productions loaded
<if><( <{ load }> <=> 90 )>
Last edited by ironmannn (2010-06-29 15:06:08)
Offline
LS97 wrote:
you're welcome!
but are you going to release this mod, or will you keep it to yourself?
oh and i noticed, you were actually the first one to post on this thread after me! you're still here after 32 pages! thanks for the loyalty
i hope to release it when i finish, and i will giv u some credit also, since u did help... alot!
Yeah the first post helped me also
Last edited by dav09 (2010-06-29 15:52:26)
Offline
dav09 wrote:
LS97 wrote:
you're welcome!
but are you going to release this mod, or will you keep it to yourself?
oh and i noticed, you were actually the first one to post on this thread after me! you're still here after 32 pages! thanks for the loyaltyi hope to release it when i finish, and i will giv u some credit also, since u did help... alot!
you're very kind. looking forward to seeing it!
Offline
im sorry to bother u again but its still not workin? I have block specks and the other instance blocks matching. when i try select temperature in it comes up where a variable (in the corner would usuall be) sprite 1 %r of %s, it should be temperature :?
And if i double click the block it wont work, just error
Offline
the %r of %s is normal, unfortunately i still can't find the code that replaces that with the argument. but if the block says error it's a problem with the blockSpec, not any code i've given you. can't help more than that. and have a nice holiday, i'm leaving
Offline
(post 1500!)ok bye... have a nice time...
Last edited by dav09 (2010-06-30 12:36:50)
Offline
LS97's in Antarctica!?
Offline
How do you make the block like a [blocks]<stop all>[/blocks] block? And TheSuccessor, where did you get the idea of antarctica? And while we're at it, why are we talking about this?
Last edited by celloguy123 (2010-07-05 12:35:51)
Offline
the stop all broadcasts a message that stops all scripts.
Offline
celloguy123 wrote:
... And TheSuccessor, where did you get the idea of antarctica? And while we're at it, why are we talking about this?
any questions?
Offline
LS97 wrote:
The link block
Ok, finally some time to add the greatest block of all. the block links the user to a webpage, program or file as long as the path or URL is given. add in the blockspecs in the control section some kind of block code (choose whatever you want, you know how to do it). and add in the corresponding instance ops:Code:
Cursor wait showWhile: [ScratchPlugin primOpenURL: t1]So little code for such a great block... and remember to click accept!
I tried making my own Block Spec - but it just made the Control section unopenable. Can you give the Spec? Also, can you add some blocks with drop-down boxes? (Including (get {date}) ) Thanks .
Offline
whizzer wrote:
LS97 wrote:
The link block
Ok, finally some time to add the greatest block of all. the block links the user to a webpage, program or file as long as the path or URL is given. add in the blockspecs in the control section some kind of block code (choose whatever you want, you know how to do it). and add in the corresponding instance ops:Code:
Cursor wait showWhile: [ScratchPlugin primOpenURL: t1]So little code for such a great block... and remember to click accept!
I tried making my own Block Spec - but it just made the Control section unopenable. Can you give the Spec? Also, can you add some blocks with drop-down boxes? (Including (get {date}) ) Thanks .
Oh, sorry I found it here: http://scratch.mit.edu/forums/viewtopic.php?pid=371891#p371891 .
Offline
This forum's sort of jammed now LS97's not here. Surely we can do something?
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.
What's the Block Spec? I seem to be having trouble creating one... and where do you put the code?
Offline
whizzer 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.
What's the Block Spec? I seem to be having trouble creating one... and where do you put the code?
the block spec is ('effect %g' #r #getEffect:)
Offline
Sparkyasa wrote:
nXIII wrote:
Sparkyasa wrote:
What's the code for the (ascii for[])?
um... asciiFor:
What's the Squeak code for it? And where should I put the code?
Incredibly, I've found that that code is already there . You only need to add the Block Spec.
Offline
LS97 wrote:
you cant make the #g, but you can make the %z %w and %j.
here's how:
go to scratch-blocks -> commandblockmorph -> private -> uncoloredargmorphfor:
and you'll see some frightening code. there, you'll find a list of $x = code ifTrue: [^ something]. all in alphabetical order.
add$z = code ifTrue: [^ ChoiceOrExpressionArgMorph new getOptionsSelector: zipNames; choice: 'city'].
in the right alphabetical place.
now, back to ScriptableScratchMorph, add a method called zipNames like this:zipNames
^ #( 'city' 'state' temperature' )and all of that stuff following this template. then do the same thing from the beginning for the other two, %j and %w (which in the uncoloredArgMorphFor are $j and $w).
Offline