markyparky56 wrote:
Could you please tell me how to get other keys into the keypressed boolean block, itd really like to be able to use other keys other than the ones we have already.
Okay, let's get started: the FULL key pressed block tutorial:
First, let's see which keys we want to include:
Note: Some of these only apply to windows OS's.
Keys and Their ASCII
shift : 16
control (ctrl) : 17
alt : 18
enter : 13
backspace : 8
num lock : 144*
caps lock : 20
scroll lock : 145*
pause break : 3*
print screen : 44*
delete (del) : 46*
insert (ins) : 45*
home : 36*
end : 35*
page up : 33*
page down : 34*
left windows : 91
right window : 92
Function keys : 112-123**
Escape : 27
* I have tested these and they do not work due to them being harvested by other processes; the sensor does not receive them.
** f2 returns false until pressed but does not return false after that point. I have chosen not to include it.
OK, on to the code editing:
You need to modify the method called asciiFor: in ScriptableScratchMorph's category sensing ops. Add the following lines before ^ -1:
'shift' = t1 ifTrue: [^ 16].
'control' = t1 ifTrue: [^ 17].
'alt' = t1 ifTrue: [^ 18].
'backspace' = t1 ifTrue: [^ 8].
'caps lock' = t1 ifTrue: [^ 20].
'left windows' = t1 ifTrue: [^ 91].
'right windows' = t1 ifTrue: [^ 92].
'f1' = t1 ifTrue: [^ 112].
'f3' = t1 ifTrue: [^ 114].
'f4' = t1 ifTrue: [^ 115].
'f5' = t1 ifTrue: [^ 116].
'f6' = t1 ifTrue: [^ 117].
'f7' = t1 ifTrue: [^ 118].
'f8' = t1 ifTrue: [^ 119].
'f9' = t1 ifTrue: [^ 120].
'f10' = t1 ifTrue: [^ 121].
'f11' = t1 ifTrue: [^ 122].
'f12' = t1 ifTrue: [^ 123].
'escape' = t1 ifTrue: [^ 27].
Press Alt + s. This saves the changes.
Next, modify the method keyNames. Add the following after 'space':
'shift' 'control' 'alt' 'backspace' 'caps lock' 'left windows' 'right windows' 'f1' 'f3' 'f4' 'f5' 'f6' 'f7' 'f8' 'f9' 'f10' 'f11' 'f12' 'escape'
Press Alt + s.
Important Note: You must shift-click the R in the Scratch logo and select save image for end-user to save these changes so they stay in effect next time you use Scratch. Select yes when asked, then reopen Scratch (it should close)
Last edited by nXIII (2010-03-07 15:42:17)
Offline
Does this trick work on Scratch 1.4? My Scratch Browser doesn't have "Scratch" After "ScriptableScratchMorph". Keep in mind I have windows 7
Offline
EmperorEvil wrote:
Does this trick work on Scratch 1.4? My Scratch Browser doesn't have "Scratch" After "ScriptableScratchMorph". Keep in mind I have windows 7
select 'block specs' instead.
Offline
billyedward wrote:
Jonathanpb wrote:
billyedward wrote:
They're still up there:
[open Browser with URL []]
(if<>then[]else[]).
More coming soon!Oh, you're using projects?
Those guides aren't helping - I want to make my own blocks, whatever blocks I want, and I want those blocks to work. How do I do that?To teach you this, I really have to teach you how to use the whole squeak programming language. (search Google for 'squeak tutorial')
I will, however, make a tutorial explaining the basics of block making.
ARGH
I suppose I'll look for a tutorial then.
Sorry...
Offline
nXIII wrote:
markyparky56 wrote:
Could you please tell me how to get other keys into the keypressed boolean block, itd really like to be able to use other keys other than the ones we have already.
Okay, let's get started: the FULL key pressed block tutorial:
First, let's see which keys we want to include:
Note: Some of these only apply to windows OS's.Keys and Their ASCII
shift : 16
control (ctrl) : 17
alt : 18
enter : 13
backspace : 8
num lock : 144*
caps lock : 20
scroll lock : 145*
pause break : 3*
print screen : 44*
delete (del) : 46*
insert (ins) : 45*
home : 36*
end : 35*
page up : 33*
page down : 34*
left windows : 91
right window : 92
Function keys : 112-123**
Escape : 27
* I have tested these and they do not work due to them being harvested by other processes; the sensor does not receive them.
** f2 returns false until pressed but does not return false after that point. I have chosen not to include it.OK, on to the code editing:
You need to modify the method called asciiFor: in ScriptableScratchMorph's category sensing ops. Add the following lines before ^ -1:'shift' = t1 ifTrue: [^ 16].
'control' = t1 ifTrue: [^ 17].
'alt' = t1 ifTrue: [^ 18].
'backspace' = t1 ifTrue: [^ 8].
'caps lock' = t1 ifTrue: [^ 20].
'left windows' = t1 ifTrue: [^ 91].
'right windows' = t1 ifTrue: [^ 92].
'f1' = t1 ifTrue: [^ 112].
'f3' = t1 ifTrue: [^ 114].
'f4' = t1 ifTrue: [^ 115].
'f5' = t1 ifTrue: [^ 116].
'f6' = t1 ifTrue: [^ 117].
'f7' = t1 ifTrue: [^ 118].
'f8' = t1 ifTrue: [^ 119].
'f9' = t1 ifTrue: [^ 120].
'f10' = t1 ifTrue: [^ 121].
'f11' = t1 ifTrue: [^ 122].
'f12' = t1 ifTrue: [^ 123].
'escape' = t1 ifTrue: [^ 27].Press Alt + s. This saves the changes.
Next, modify the method keyNames. Add the following after 'space':'shift' 'control' 'alt' 'backspace' 'caps lock' 'left windows' 'right windows' 'f1' 'f3' 'f4' 'f5' 'f6' 'f7' 'f8' 'f9' 'f10' 'f11' 'f12' 'escape'
Press Alt + s.
Important Note: You must shift-click the R in the Scratch logo and select save image for end-user to save these changes so they stay in effect next time you use Scratch. Select yes when asked, then reopen Scratch (it should close)
Hey thanks!
Offline
I'm trying to make a distance block where you enter all the coordinates, but it always says error, and I can't understand the debug thing. Can someone help me? My function is this
dista: t1 n: t2 c: t3 e: t4
| t5 t6 t7 t8 t9 t10 |
t5 _ t1 - t2.
t6 _ t5 * t5.
t7 _ t2 - t4.
t8 _ t7 * t7.
t9 _ t8 + t6.
t10 _ t9 sqrt.
^ t10
Offline
climber59 wrote:
I'm trying to make a distance block where you enter all the coordinates, but it always says error, and I can't understand the debug thing. Can someone help me? My function is this
dista: t1 n: t2 c: t3 e: t4
| t5 t6 t7 t8 t9 t10 |
t5 _ t1 - t2.
t6 _ t5 * t5.
t7 _ t2 - t4.
t8 _ t7 * t7.
t9 _ t8 + t6.
t10 _ t9 sqrt.
^ t10
Are you sending four arguments to it in the blockSpecs?
Offline
nXIII wrote:
Are you sending four arguments to it in the blockSpecs?
Yes. Here is the blockSpecs code
('distance from x: %s y: %s to x: %s y: %s' #r #dista:n:c:e:)
Last edited by climber59 (2010-03-08 17:03:55)
Offline
climber59 wrote:
nXIII wrote:
Are you sending four arguments to it in the blockSpecs?
Yes. Here is the blockSpecs code
('distance from x: %s y: %s to x: %s y: %s' #r #dista:n:c:e
Use %n, since it is a number and not a string that you want.
Also, please copy and paste the error message in so I can try to figure it out.
Offline
midnightleopard wrote:
what do I need to have downloaded? what program(s)?
You need the scratch source code.
Offline
billyedward wrote:
Use %n, since it is a number and not a string that you want.
Thanks! That and fixing a wrong variable (t5 should have been t1 - t3 not t1 - t2) fixed it.
Offline
nXIII wrote:
markyparky56 wrote:
Could you please tell me how to get other keys into the keypressed boolean block, itd really like to be able to use other keys other than the ones we have already.
Okay, let's get started: the FULL key pressed block tutorial:
First, let's see which keys we want to include:
Note: Some of these only apply to windows OS's.Keys and Their ASCII
shift : 16
control (ctrl) : 17
alt : 18
enter : 13
backspace : 8
num lock : 144*
caps lock : 20
scroll lock : 145*
pause break : 3*
print screen : 44*
delete (del) : 46*
insert (ins) : 45*
home : 36*
end : 35*
page up : 33*
page down : 34*
left windows : 91
right window : 92
Function keys : 112-123**
Escape : 27
* I have tested these and they do not work due to them being harvested by other processes; the sensor does not receive them.
** f2 returns false until pressed but does not return false after that point. I have chosen not to include it.OK, on to the code editing:
You need to modify the method called asciiFor: in ScriptableScratchMorph's category sensing ops. Add the following lines before ^ -1:'shift' = t1 ifTrue: [^ 16].
'control' = t1 ifTrue: [^ 17].
'alt' = t1 ifTrue: [^ 18].
'backspace' = t1 ifTrue: [^ 8].
'caps lock' = t1 ifTrue: [^ 20].
'left windows' = t1 ifTrue: [^ 91].
'right windows' = t1 ifTrue: [^ 92].
'f1' = t1 ifTrue: [^ 112].
'f3' = t1 ifTrue: [^ 114].
'f4' = t1 ifTrue: [^ 115].
'f5' = t1 ifTrue: [^ 116].
'f6' = t1 ifTrue: [^ 117].
'f7' = t1 ifTrue: [^ 118].
'f8' = t1 ifTrue: [^ 119].
'f9' = t1 ifTrue: [^ 120].
'f10' = t1 ifTrue: [^ 121].
'f11' = t1 ifTrue: [^ 122].
'f12' = t1 ifTrue: [^ 123].
'escape' = t1 ifTrue: [^ 27].Press Alt + s. This saves the changes.
Next, modify the method keyNames. Add the following after 'space':'shift' 'control' 'alt' 'backspace' 'caps lock' 'left windows' 'right windows' 'f1' 'f3' 'f4' 'f5' 'f6' 'f7' 'f8' 'f9' 'f10' 'f11' 'f12' 'escape'
Press Alt + s.
Important Note: You must shift-click the R in the Scratch logo and select save image for end-user to save these changes so they stay in effect next time you use Scratch. Select yes when asked, then reopen Scratch (it should close)
When I tried to save the first code change, it said 'nothing more expected just before 'control'. HELP!!!
Offline
Scratchguy3 wrote:
nXIII wrote:
markyparky56 wrote:
Could you please tell me how to get other keys into the keypressed boolean block, itd really like to be able to use other keys other than the ones we have already.
Okay, let's get started: the FULL key pressed block tutorial:
First, let's see which keys we want to include:
Note: Some of these only apply to windows OS's.Keys and Their ASCII
shift : 16
control (ctrl) : 17
alt : 18
enter : 13
backspace : 8
num lock : 144*
caps lock : 20
scroll lock : 145*
pause break : 3*
print screen : 44*
delete (del) : 46*
insert (ins) : 45*
home : 36*
end : 35*
page up : 33*
page down : 34*
left windows : 91
right window : 92
Function keys : 112-123**
Escape : 27
* I have tested these and they do not work due to them being harvested by other processes; the sensor does not receive them.
** f2 returns false until pressed but does not return false after that point. I have chosen not to include it.OK, on to the code editing:
You need to modify the method called asciiFor: in ScriptableScratchMorph's category sensing ops. Add the following lines before ^ -1:'shift' = t1 ifTrue: [^ 16].
'control' = t1 ifTrue: [^ 17].
'alt' = t1 ifTrue: [^ 18].
'backspace' = t1 ifTrue: [^ 8].
'caps lock' = t1 ifTrue: [^ 20].
'left windows' = t1 ifTrue: [^ 91].
'right windows' = t1 ifTrue: [^ 92].
'f1' = t1 ifTrue: [^ 112].
'f3' = t1 ifTrue: [^ 114].
'f4' = t1 ifTrue: [^ 115].
'f5' = t1 ifTrue: [^ 116].
'f6' = t1 ifTrue: [^ 117].
'f7' = t1 ifTrue: [^ 118].
'f8' = t1 ifTrue: [^ 119].
'f9' = t1 ifTrue: [^ 120].
'f10' = t1 ifTrue: [^ 121].
'f11' = t1 ifTrue: [^ 122].
'f12' = t1 ifTrue: [^ 123].
'escape' = t1 ifTrue: [^ 27].Press Alt + s. This saves the changes.
Next, modify the method keyNames. Add the following after 'space':'shift' 'control' 'alt' 'backspace' 'caps lock' 'left windows' 'right windows' 'f1' 'f3' 'f4' 'f5' 'f6' 'f7' 'f8' 'f9' 'f10' 'f11' 'f12' 'escape'
Press Alt + s.
Important Note: You must shift-click the R in the Scratch logo and select save image for end-user to save these changes so they stay in effect next time you use Scratch. Select yes when asked, then reopen Scratch (it should close)When I tried to save the first code change, it said 'nothing more expected just before 'control'. HELP!!!
Worked fine for me...
Offline
I have worked in this area before (http://scratch.mit.edu/projects/mathguy/349196) and your ideas have sparked some more of mine. I am on a different computer that doesn't have scratch and am installing it :
Output folder: C:\program files\Scratch
Created uninstaller
Completed
I have worked with it with the standard version of squeak with the scratch image and will try the MIT version.
Some of my ideas are:
-while %b true (#c)
-set variable %vForBools to %b (#-)
... And I just forgot the rest. Darn.
Offline
mathguy wrote:
Some of my ideas are:
-while %b true (#c)
-set variable %vForBools to %b (#-)
What do these do? I only know the very basics of how to do it.
Offline
Would it be possible to make a block that created a sprite that looked like the stage did at that time(including pen marks, graphic effects and all)?
Offline
Scratchguy3 wrote:
nXIII wrote:
markyparky56 wrote:
Could you please tell me how to get other keys into the keypressed boolean block, itd really like to be able to use other keys other than the ones we have already.
Okay, let's get started: the FULL key pressed block tutorial:
First, let's see which keys we want to include:
Note: Some of these only apply to windows OS's.Keys and Their ASCII
shift : 16
control (ctrl) : 17
alt : 18
enter : 13
backspace : 8
num lock : 144*
caps lock : 20
scroll lock : 145*
pause break : 3*
print screen : 44*
delete (del) : 46*
insert (ins) : 45*
home : 36*
end : 35*
page up : 33*
page down : 34*
left windows : 91
right window : 92
Function keys : 112-123**
Escape : 27
* I have tested these and they do not work due to them being harvested by other processes; the sensor does not receive them.
** f2 returns false until pressed but does not return false after that point. I have chosen not to include it.OK, on to the code editing:
You need to modify the method called asciiFor: in ScriptableScratchMorph's category sensing ops. Add the following lines before ^ -1:'shift' = t1 ifTrue: [^ 16].
'control' = t1 ifTrue: [^ 17].
'alt' = t1 ifTrue: [^ 18].
'backspace' = t1 ifTrue: [^ 8].
'caps lock' = t1 ifTrue: [^ 20].
'left windows' = t1 ifTrue: [^ 91].
'right windows' = t1 ifTrue: [^ 92].
'f1' = t1 ifTrue: [^ 112].
'f3' = t1 ifTrue: [^ 114].
'f4' = t1 ifTrue: [^ 115].
'f5' = t1 ifTrue: [^ 116].
'f6' = t1 ifTrue: [^ 117].
'f7' = t1 ifTrue: [^ 118].
'f8' = t1 ifTrue: [^ 119].
'f9' = t1 ifTrue: [^ 120].
'f10' = t1 ifTrue: [^ 121].
'f11' = t1 ifTrue: [^ 122].
'f12' = t1 ifTrue: [^ 123].
'escape' = t1 ifTrue: [^ 27].Press Alt + s. This saves the changes.
Next, modify the method keyNames. Add the following after 'space':'shift' 'control' 'alt' 'backspace' 'caps lock' 'left windows' 'right windows' 'f1' 'f3' 'f4' 'f5' 'f6' 'f7' 'f8' 'f9' 'f10' 'f11' 'f12' 'escape'
Press Alt + s.
Important Note: You must shift-click the R in the Scratch logo and select save image for end-user to save these changes so they stay in effect next time you use Scratch. Select yes when asked, then reopen Scratch (it should close)When I tried to save the first code change, it said 'nothing more expected just before 'control'. HELP!!!
You probably forgot to add a closing bracket.
However, another typo could also have caused this.
If possible, could you copy and paste the block specs which are giving you trouble in here, so I can see?
Offline
Scratchguy3 wrote:
Would it be possible to make a block that created a sprite that looked like the stage did at that time(including pen marks, graphic effects and all)?
Yes.
I can make another how to make a new block tutorial, if you want...
Offline
billyedward wrote:
Scratchguy3 wrote:
nXIII wrote:
markyparky56 wrote:
Could you please tell me how to get other keys into the keypressed boolean block, itd really like to be able to use other keys other than the ones we have already.
Okay, let's get started: the FULL key pressed block tutorial:
First, let's see which keys we want to include:
Note: Some of these only apply to windows OS's.Keys and Their ASCII
shift : 16
control (ctrl) : 17
alt : 18
enter : 13
backspace : 8
num lock : 144*
caps lock : 20
scroll lock : 145*
pause break : 3*
print screen : 44*
delete (del) : 46*
insert (ins) : 45*
home : 36*
end : 35*
page up : 33*
page down : 34*
left windows : 91
right window : 92
Function keys : 112-123**
Escape : 27
* I have tested these and they do not work due to them being harvested by other processes; the sensor does not receive them.
** f2 returns false until pressed but does not return false after that point. I have chosen not to include it.OK, on to the code editing:
You need to modify the method called asciiFor: in ScriptableScratchMorph's category sensing ops. Add the following lines before ^ -1:'shift' = t1 ifTrue: [^ 16].
'control' = t1 ifTrue: [^ 17].
'alt' = t1 ifTrue: [^ 18].
'backspace' = t1 ifTrue: [^ 8].
'caps lock' = t1 ifTrue: [^ 20].
'left windows' = t1 ifTrue: [^ 91].
'right windows' = t1 ifTrue: [^ 92].
'f1' = t1 ifTrue: [^ 112].
'f3' = t1 ifTrue: [^ 114].
'f4' = t1 ifTrue: [^ 115].
'f5' = t1 ifTrue: [^ 116].
'f6' = t1 ifTrue: [^ 117].
'f7' = t1 ifTrue: [^ 118].
'f8' = t1 ifTrue: [^ 119].
'f9' = t1 ifTrue: [^ 120].
'f10' = t1 ifTrue: [^ 121].
'f11' = t1 ifTrue: [^ 122].
'f12' = t1 ifTrue: [^ 123].
'escape' = t1 ifTrue: [^ 27].Press Alt + s. This saves the changes.
Next, modify the method keyNames. Add the following after 'space':
Press Alt + s.
Important Note: You must shift-click the R in the Scratch logo and select save image for end-user to save these changes so they stay in effect next time you use Scratch. Select yes when asked, then reopen Scratch (it should close)When I tried to save the first code change, it said 'nothing more expected just before 'control'. HELP!!!
You probably forgot to add a closing bracket.
However, another typo could also have caused this.
If possible, could you copy and paste the block specs which are giving you trouble in here, so I can see?
Here:
asciiFor: t1
| t2 |
t1 size = 1 ifTrue: [^ t1 first asciiValue].
t2 _ t1 localized.
'space' localized = t2 ifTrue: [^ Character space asciiValue].
'enter' localized = t2 ifTrue: [^ Character cr asciiValue].
'up arrow' localized = t2 ifTrue: [^ 30].
'down arrow' localized = t2 ifTrue: [^ 31].
'right arrow' localized = t2 ifTrue: [^ 29].
'left arrow' localized = t2 ifTrue: [^ 28].
'up' = t1 ifTrue: [^ 30].
'down' = t1 ifTrue: [^ 31].
'right' = t1 ifTrue: [^ 29].
'left' = t1 ifTrue: [^ 28].
'shift' = t1 ifTrue: [^ 16].
'control' = t1 ifTrue: [^ 17].
'alt' = t1 ifTrue: [^ 18].
'backspace' = t1 ifTrue: [^ 8].
'caps lock' = t1 ifTrue: [^ 20].
'left windows' = t1 ifTrue: [^ 91].
'right windows' = t1 ifTrue: [^ 92].
'f1' = t1 ifTrue: [^ 112].
'f3' = t1 ifTrue: [^ 114].
'f4' = t1 ifTrue: [^ 115].
'f5' = t1 ifTrue: [^ 116].
'f6' = t1 ifTrue: [^ 117].
'f7' = t1 ifTrue: [^ 118].
'f8' = t1 ifTrue: [^ 119].
'f9' = t1 ifTrue: [^ 120].
'f10' = t1 ifTrue: [^ 121].
'f11' = t1 ifTrue: [^ 122].
'f12' = t1 ifTrue: [^ 123].
'escape' = t1 ifTrue: [^ 27].
^ -1
Offline
billyedward wrote:
Scratchguy3 wrote:
Would it be possible to make a block that created a sprite that looked like the stage did at that time(including pen marks, graphic effects and all)?
Yes.
I can make another how to make a new block tutorial, if you want...
PLEASE????????????????????????????!!!!!!!!!!!!!!!!!!!!!?????????????????????!!!!!!!!!!!!!!!!!
I NEED IT!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Offline
Isn't tat just like making its save the screen and insted of saving it, add it to a sprites costume?
Offline
markyparky56 wrote:
Isn't tat just like making its save the screen and insted of saving it, add it to a sprites costume?
Pretty much. It would replace the sprites costume though, and I wan't a block for it.
Offline