OOPS. :-( Something went wrong. WHAT shall i do it said: cant locate .scorses and .changes files i think i'll have to reinstall scratch
Offline
comp500 wrote:
LS97 wrote:
The http://www.freeimagehosting.net/uploads/db8cb97ba8.gifblock
Another request of SeptimusHeap.
Put this code in both Sprite and Stage Morph blockSpecs in the sensing category:Code:
('%s mouse down?' #b #mousePressed: 'left')then into the instance, into ScriptableScratchMorph, and into 'sensing ops'.
replace the 'mousePressed' code with the one below.Code:
mousePressed: t1 t1 = 'left' ifTrue: [^ Sensor redButtonPressed]. t1 = 'right' ifTrue: [^ Sensor yellowButtonPressed]. t1 = 'middle' ifTrue: [^ Sensor blueButtonPressed]. t1 = 'any' ifTrue: [^ Sensor anyButtonPressed]. t1 = 'left ' ifTrue: [^ Sensor redButtonPressed]. t1 = 'right ' ifTrue: [^ Sensor yellowButtonPressed]. t1 = 'middle ' ifTrue: [^ Sensor blueButtonPressed]. t1 = 'any ' ifTrue: [^ Sensor anyButtonPressed]. ^ Sensor redButtonPressedThen click accept and it should be fine. you'll find the new block in the sensing category. you can put left, right, middle or any into the box and it'll give you the respective sensor button boolean.
Doesn't work
make sure its not in the 'scriptable scratch morph'
Offline
Joeman592 wrote:
comp500 wrote:
LS97 wrote:
The http://www.freeimagehosting.net/uploads/db8cb97ba8.gifblock
Another request of SeptimusHeap.
Put this code in both Sprite and Stage Morph blockSpecs in the sensing category:Code:
('%s mouse down?' #b #mousePressed: 'left')then into the instance, into ScriptableScratchMorph, and into 'sensing ops'.
replace the 'mousePressed' code with the one below.Code:
mousePressed: t1 t1 = 'left' ifTrue: [^ Sensor redButtonPressed]. t1 = 'right' ifTrue: [^ Sensor yellowButtonPressed]. t1 = 'middle' ifTrue: [^ Sensor blueButtonPressed]. t1 = 'any' ifTrue: [^ Sensor anyButtonPressed]. t1 = 'left ' ifTrue: [^ Sensor redButtonPressed]. t1 = 'right ' ifTrue: [^ Sensor yellowButtonPressed]. t1 = 'middle ' ifTrue: [^ Sensor blueButtonPressed]. t1 = 'any ' ifTrue: [^ Sensor anyButtonPressed]. ^ Sensor redButtonPressedThen click accept and it should be fine. you'll find the new block in the sensing category. you can put left, right, middle or any into the box and it'll give you the respective sensor button boolean.
Doesn't work
make sure its not in the 'scriptable scratch morph'
It works i restarted scratch
Offline
comp500 wrote:
Joeman592 wrote:
comp500 wrote:
Doesn't workmake sure its not in the 'scriptable scratch morph'
It works i restarted scratch
Huh its there but it always says false
Offline
comp500 wrote:
comp500 wrote:
Joeman592 wrote:
make sure its not in the 'scriptable scratch morph'It works i restarted scratch
Huh its there but it always says false
Only left-click works
Offline
LS97 wrote:
The 'Get time/date' block
http://www.freeimagehosting.net/uploads/209a5b329a.gif
Here we go!
The get time/date block reports the time, date, hour, etc. without the user having to insert it manually.
Copy this line of code into a space between two blocks in the 'control' section of blockSpecs in ScriptableScratchMorph.Code:
('get %s' #r #getTime: 'date')Then go to the instance section, then to 'other ops' and replace the code of broadcast: with the following
Code:
getTime: t1 t1 = 'date' ifTrue: [^ Date today]. t1 = 'short date' ifTrue: [^ Date today printFormat: #(1 2 3 $- 2 2 )]. t1 = 'time' ifTrue: [^ Time now]. t1 = 'seconds' ifTrue: [^ Time now seconds]. t1 = 'minutes' ifTrue: [^ Time now minutes]. t1 = 'hours' ifTrue: [^ Time now hours]. t1 = 'day' ifTrue: [^ Date today weekday]. t1 = 'help' ifTrue: [^ 'type date, short date, time, seconds, minutes, day, hours']. ^ 'Error!'then right-click and click accept. type your initials and you're ready to use the new block!
This one works!!! It is soo cool
Offline
LS97 wrote:
The key_pressed reporter block
a great block that saves you the fuss of making 30 scripts for each different key. just add this to a forever if and youre done with your scripting for a text program! add the block wherever you want, and add this code into the corresponding instance ops.Code:
(Sensor keyPressed: 65) ifTrue: [^ 'a']. (Sensor keyPressed: 66) ifTrue: [^ 'b']. (Sensor keyPressed: 67) ifTrue: [^ 'c']. (Sensor keyPressed: 68) ifTrue: [^ 'd']. (Sensor keyPressed: 69) ifTrue: [^ 'e']. (Sensor keyPressed: 70) ifTrue: [^ 'f']. (Sensor keyPressed: 71) ifTrue: [^ 'g']. (Sensor keyPressed: 72) ifTrue: [^ 'h']. (Sensor keyPressed: 73) ifTrue: [^ 'i']. (Sensor keyPressed: 74) ifTrue: [^ 'j']. (Sensor keyPressed: 75) ifTrue: [^ 'k']. (Sensor keyPressed: 76) ifTrue: [^ 'l']. (Sensor keyPressed: 77) ifTrue: [^ 'm']. (Sensor keyPressed: 78) ifTrue: [^ 'n']. (Sensor keyPressed: 79) ifTrue: [^ 'o']. (Sensor keyPressed: 80) ifTrue: [^ 'p']. (Sensor keyPressed: 81) ifTrue: [^ 'q']. (Sensor keyPressed: 82) ifTrue: [^ 'r']. (Sensor keyPressed: 83) ifTrue: [^ 's']. (Sensor keyPressed: 84) ifTrue: [^ 't']. (Sensor keyPressed: 85) ifTrue: [^ 'u']. (Sensor keyPressed: 86) ifTrue: [^ 'v']. (Sensor keyPressed: 87) ifTrue: [^ 'w']. (Sensor keyPressed: 88) ifTrue: [^ 'x']. (Sensor keyPressed: 89) ifTrue: [^ 'y']. (Sensor keyPressed: 90) ifTrue: [^ 'z']. (Sensor keyPressed: 32) ifTrue: [^ 'space']. (Sensor keyPressed: 1) ifTrue: [^ 'home']. (Sensor keyPressed: 4) ifTrue: [^ 'end']. (Sensor keyPressed: 5) ifTrue: [^ 'insert']. (Sensor keyPressed: 9) ifTrue: [^ 'tab']. (Sensor keyPressed: 11) ifTrue: [^ 'page up']. (Sensor keyPressed: 12) ifTrue: [^ 'page down']. (Sensor keyPressed: 127) ifTrue: [^ 'delete']. ^ 'none'Pretty long eh? don't be discouraged it's worth it!
Where shall i put this code? i put the block spec in sensing and i used your spec.
Offline
comp500 wrote:
comp500 wrote:
comp500 wrote:
It works i restarted scratchHuh its there but it always says false
Only left-click works
no, put the block into a 'say []' and do a forever loop. then try pressing the different mouse buttons (and change text in it (left, right, middle) to check all three.
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!
What is the block spec? is it something like this:
('open %s' #s #gotoopen)
Comp500
Offline
LS97 wrote:
comp500 wrote:
comp500 wrote:
Huh its there but it always says falseOnly left-click works
no, put the block into a 'say []' and do a forever loop. then try pressing the different mouse buttons (and change text in it (left, right, middle) to check all three.
Ok.
Offline
comp500 wrote:
LS97 wrote:
comp500 wrote:
Only left-click worksno, put the block into a 'say []' and do a forever loop. then try pressing the different mouse buttons (and change text in it (left, right, middle) to check all three.
Ok.
It works i have to put it full screen Yipee i can now work on my OS!!
Offline
comp500 wrote:
comp500 wrote:
LS97 wrote:
no, put the block into a 'say []' and do a forever loop. then try pressing the different mouse buttons (and change text in it (left, right, middle) to check all three.Ok.
It works i have to put it full screen Yipee i can now work on my OS!!
These blocks don't work online, or when downloaded by other people.
Offline
randalpik wrote:
These blocks don't work online, or when downloaded by other people.
unless you include the image in a ZIP folder and upload it to a site
Offline
comp500 wrote:
What is the block spec? is it something like this:
Code:
('open %s' #s #gotoopen)Comp500
yes, that's pretty close. you can have this:
('link to %s' #- #openLink: 'http://scratch.mit.edu')
but obviously the title of the actual block code has to be openLink: t1
Offline
Zorbak42 wrote:
Joeman592 wrote:
Zorbak42 wrote:
I can give you code for change costume # by (). PutCode:
changeCostumeIndexBy: t1 self costumeIndex: self costumeIndex + t1in looks ops of ScriptableScratchMorph instance,
Code:
('change costume by %n' #- #changeCostumeIndexBy: 1)in SpriteMorph blockSpecs, and
Code:
('change background by %n' #- #changeBackgroundIndexBy: 1)in StageMorph blockSpecs. Hope it helps!
THANK YOU SOOOOOOOO MUCH!
You're welcome. I've heard the I receive block is impossible to make, I'm not sure if this is true, but I don't think anyone has it. I'll try to make a bounce block now... ...Almost got it. An error message appeared saying t1 and t2 are undefined or something.
Code:
bounce | t1 t2 t3 t4 | t3 _ self rotationDegrees degreesToRadians cos. t4 _ self rotationDegrees degreesToRadians sin negated. t1 left < t2 left ifTrue: [t3 _ t3 abs]. t1 right > t2 right ifTrue: [t3 _ t3 abs negated]. t1 top < t2 top ifTrue: [t4 _ t4 abs negated]. t1 bottom > t2 bottom ifTrue: [t4 _ t4 abs]. self rotationDegrees: (t4 negated asFloat arcTan: t3) radiansToDegrees. self position: self position + (t1 amountToTranslateWithin: t2)If you find out what's wrong, please let me know. Bounce, if touching, if I can figure out what's wrong with bounce, I might be able to do that. Think nothing, you can just use the say nothing, it will stop what it's thinking too.
Code:
('say nothing' #- #sayNothing)
What is the spec? I'll try to work it out if you tell me.Anyway the name is defined wrong so i'll tell you if you tell me the spec.
Offline
Zorbak42 wrote:
Joeman592 wrote:
Zorbak42 wrote:
I can give you code for change costume # by (). PutCode:
changeCostumeIndexBy: t1 self costumeIndex: self costumeIndex + t1in looks ops of ScriptableScratchMorph instance,
Code:
('change costume by %n' #- #changeCostumeIndexBy: 1)in SpriteMorph blockSpecs, and
Code:
('change background by %n' #- #changeBackgroundIndexBy: 1)in StageMorph blockSpecs. Hope it helps!
THANK YOU SOOOOOOOO MUCH!
You're welcome. I've heard the I receive block is impossible to make, I'm not sure if this is true, but I don't think anyone has it. I'll try to make a bounce block now... ...Almost got it. An error message appeared saying t1 and t2 are undefined or something.
Code:
bounce | t1 t2 t3 t4 | t3 _ self rotationDegrees degreesToRadians cos. t4 _ self rotationDegrees degreesToRadians sin negated. t1 left < t2 left ifTrue: [t3 _ t3 abs]. t1 right > t2 right ifTrue: [t3 _ t3 abs negated]. t1 top < t2 top ifTrue: [t4 _ t4 abs negated]. t1 bottom > t2 bottom ifTrue: [t4 _ t4 abs]. self rotationDegrees: (t4 negated asFloat arcTan: t3) radiansToDegrees. self position: self position + (t1 amountToTranslateWithin: t2)If you find out what's wrong, please let me know. Bounce, if touching, if I can figure out what's wrong with bounce, I might be able to do that. Think nothing, you can just use the say nothing, it will stop what it's thinking too.
Code:
('say nothing' #- #sayNothing)
What is the spec? I'll try to work it out if you tell me.Anyway the name is defined wrong so i'll tell you if you tell me the spec.
Offline
('pen down' #r #penDown) reports if pen is down
Last edited by electrified123 (2010-05-07 13:45:23)
Offline
('pen color' #r #penColor) pen color reporter ('pen size' #r #penSize) pen size reporter
Offline
Can anybody do (erasor down) etc. and (permanent marker down) etc. ?
Offline
(If on edge, teleport) code:
| t1 t2 t3 t4 | t3 _ self referencePosition x. t4 _ self referencePosition y. t3 abs = 240 ifTrue: [t1 _ -1 * (t3 - (t3 / 240)). t2 _ t4] ifFalse: [t1 _ t3. t2 _ t4]. t4 abs = 180 ifTrue: [t2 _ -1 * (t4 - (t4 / 180))]. self referencePosition: t1 @ t2
Works, but a bit crude. Can anyone improve it?
Last edited by TheSuccessor (2010-05-07 15:17:46)
Offline
TheSuccessor wrote:
Can anybody do (erasor down) etc. and (permanent marker down) etc. ?
I don't see the need for that... you can just change the pen size and color
Offline
randalpik wrote:
TheSuccessor wrote:
Can anybody do (erasor down) etc. and (permanent marker down) etc. ?
I don't see the need for that... you can just change the pen size and color
no, you need a 'set pen to eraser'
Offline
nXIII wrote:
randalpik wrote:
TheSuccessor wrote:
Can anybody do (erasor down) etc. and (permanent marker down) etc. ?
I don't see the need for that... you can just change the pen size and color
no, you need a 'set pen to eraser'
Why don't you just have "set pen color to white"
Offline