I will leave the forum thing ATM as I only use this one!
And yes midnightleopard you can join if you commit to what you say.
Offline
Okay! jonneydean1, Daffy22 and MidnightLeopard are now moderators! (let me know if I forgot to add permissions to the moderator group)
Offline
Ok lets get started on the .sb decoding. Lets do this in any language to start off with, then convert it to JScript HTML and PHP
Offline
johnnydean1 wrote:
Ok lets get started on the .sb decoding. Lets do this in any language to start off with, then convert it to JScript HTML and PHP
Well, It's done in one language already...
Offline
Alright! So, how are we going to approach this? we should start one step at a time. Let's start with decoding a sprite. I am not sure what you mean. So open a .sb file in notepad? is that what we're decoding?
if so, we should start by making a project with absolutely nothing in it. No sprites, costumes, blocks, sounds, or notes. Then we should add a single pixel dot sprite and see the difference in the code. Then we should keep doing that until we can decode how sprites are coded in the file. We could then do the same thing but with a sound, then a block, then a script.
Better ideas anyone?
Offline
midnightleopard wrote:
Alright! So, how are we going to approach this? we should start one step at a time. Let's start with decoding a sprite. I am not sure what you mean. So open a .sb file in notepad? is that what we're decoding?
if so, we should start by making a project with absolutely nothing in it. No sprites, costumes, blocks, sounds, or notes. Then we should add a single pixel dot sprite and see the difference in the code. Then we should keep doing that until we can decode how sprites are coded in the file. We could then do the same thing but with a sound, then a block, then a script.
Better ideas anyone?
The problem is, .sb files are binary, so they're not readable in notepad.
Offline
ScratchReallyROCKS wrote:
midnightleopard wrote:
Alright! So, how are we going to approach this? we should start one step at a time. Let's start with decoding a sprite. I am not sure what you mean. So open a .sb file in notepad? is that what we're decoding?
if so, we should start by making a project with absolutely nothing in it. No sprites, costumes, blocks, sounds, or notes. Then we should add a single pixel dot sprite and see the difference in the code. Then we should keep doing that until we can decode how sprites are coded in the file. We could then do the same thing but with a sound, then a block, then a script.
Better ideas anyone?The problem is, .sb files are binary, so they're not readable in notepad.
I'd recommend notepad++, a free, open-source text editor with syntax highlighting and lots of other amazing stuff!
Offline
nXIII wrote:
ScratchReallyROCKS wrote:
midnightleopard wrote:
Alright! So, how are we going to approach this? we should start one step at a time. Let's start with decoding a sprite. I am not sure what you mean. So open a .sb file in notepad? is that what we're decoding?
if so, we should start by making a project with absolutely nothing in it. No sprites, costumes, blocks, sounds, or notes. Then we should add a single pixel dot sprite and see the difference in the code. Then we should keep doing that until we can decode how sprites are coded in the file. We could then do the same thing but with a sound, then a block, then a script.
Better ideas anyone?The problem is, .sb files are binary, so they're not readable in notepad.
I'd recommend notepad++, a free, open-source text editor with syntax highlighting and lots of other amazing stuff!
![]()
Actually, you see the scripts when you scroll down to the bottom of a scratch project in notepad!
Offline
ScratchReallyROCKS wrote:
nXIII wrote:
ScratchReallyROCKS wrote:
The problem is, .sb files are binary, so they're not readable in notepad.
I'd recommend notepad++, a free, open-source text editor with syntax highlighting and lots of other amazing stuff!
![]()
Actually, you see the scripts when you scroll down to the bottom of a scratch project in notepad!
I still recommend it!
I'm now converting a 500-line Java file to JavaScript. Not as easy as it might sound.
EDIT: I was doing that, now I'm going back to converting it to PHP.
Last edited by nXIII (2010-09-29 19:23:17)
Offline
nXIII wrote:
ScratchReallyROCKS wrote:
nXIII wrote:
I'd recommend notepad++, a free, open-source text editor with syntax highlighting and lots of other amazing stuff!![]()
Actually, you see the scripts when you scroll down to the bottom of a scratch project in notepad!
I still recommend it!
![]()
I know. I got the Mac version.
Offline
cool, but my notepad opens .sb files. It's all crazy wierd unicode characters. nXIII, are you on the team?
Offline
So scripts are at the bottom? Lemme ask some questions. What are we doing? what .sb file are we decoding? I've been opening it with notepad. Should I be doing something else?
Offline
midnightleopard wrote:
So scripts are at the bottom? Lemme ask some questions. What are we doing? what .sb file are we decoding? I've been opening it with notepad. Should I be doing something else?
Notepad won't work. Try nXIII's suggestion.
Offline
Ill have a look at whats saved.
Offline
Daffy22 wrote:
true, notepad++ will decode it so we can understand it however HTML or JS or PHP can't do what notepad++ does. I'll do some research.
![]()
Actually, I had a lot of success with a PHP file_get_contents() call.
Offline
If notepad++ is open source, look at its source code and find out what it does.
Offline
TheSuccessor wrote:
If notepad++ is open source, look at its source code and find out what it does.
mmm it's written in C++ or VBS or something else not HTML or PHP
Offline
Here:
Bottom of Scratch File wrote:
Hat Block
¯¯¯¯¯¯¯¯¯
EventHatMorph Scratch-StartClicked = Flag
KeyEventHatMorph space = Key 'space' Hat
MouseClickEventHatMorph Scratch-MouseClickEvent = When ### clicked
EventHatMorph {input} = When {input} recieved
C Blocks
¯¯¯¯¯¯¯¯
doForever = forever
doRepeat = repeat
doForeverIf = forever if
doIf = if
doUntil = repeat until
Branch Blocks
¯¯¯¯¯¯¯¯¯¯¯¯¯
doIfElse = if else
< blocks >
¯¯¯¯¯¯¯¯¯
= {input1} {input2} = <{input1}={input2}>
< {input1} {input2} = <{input1}<{input2}>
> {input1} {input2} = <{input1}>{input2}>
list:contains: {input2} = <list ## contains {input2}>
mousePressed = <mouse pressed>
keyPressed: {input1} = <key {input1} pressed>
isLoud = < loud? >
sensorPressed: {input1} = <sensor {input1}?>
< < > blocks < > >
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
& blocktype1 {input1}{input2} (if not blocktype2 = blocktype1 then blocktype2) {input3}{input4} = < < > and < > >
| blocktype1 {input1}{input2} (if not blocktype2 = blocktype1 then blocktype2) {input3}{input4} = < < > or < > >
not blocktype1 {input1}{input2} = < not <> >
( blocks )
¯¯¯¯¯¯¯¯¯
+ = ( + )
- = ( - )
* = ( * )
/ = ( / )
\\ = ( mod )
randomFrom:to: = (pick random ## to ##)
concatenate:with: {input1} {input2} = (join {input1} with {input2})
letter:of: {input2} = (letter ## of {input2})
stringLength: {input1} = (length of {input1})
volume = (volume)
tempo = (tempo)
timer = (timer)
soundLevel = (loudness)
sensor: {input1} = ( {input1} sensor value)
answer = (answer)
mouseX = (mouse X)
mouseY = (mouse Y)
backgroundIndex = (background no.)
readVariable = (read var ##)
contentsOfList: = (read list ##)
getLine:ofList: = (read line ## of list ##)
lineCountOfList: = (no. lines of list ##)
[ blocks ]
¯¯¯¯¯¯¯¯¯
wait:elapsed:from: = wait block
broadcast: {input1} = broadcast {input1}
doBroadcastAndWait {input1} = broadcast and wait {input1}
doWaitUntil (and same rule as & block) = wait until
doReturn = stop script
stopAll = stop all
doAsk {input1} = ask {input1} and wait
timerReset = reset timer
showBackground: = change background to
nextBackground = next background
changeGraphicEffect:by: {name to change} = change effect {name to change} by ##
setGraphicEffect:to: {name to change} = set effect {name to change} to ##
filterReset = clear effects
playSound: = play sound ##
doPlaySoundAndWait = play sound ## and wait
stopAllSounds = stop all sounds
drum:duration:elapsed:from: = play drum ## for ##
rest:elapsed:from: = rest ## beats
noteOn:duration:elapsed:from: = play note ## for ##
midiInstrument: = set instrument to ##
changeVolumeBy: = change volume by ##
setVolumeTo: = set volume to ##
changeTempoBy: = change tempo by ##
setTempoTo: = set tempo to ##
clearPenTrails = clear
setVar:to: {input2} = set var ## to {input2}
changeVar:by: = change var ## by ##
showVariable: = show var ##
hideVariable: = hide var ##
append:toList: {input1} = add {input1} to list ##
deleteLine:ofList: = delete line ## of list ##
insert:at:ofList: {input1} = insert {input1} at ## of list ##
setLine:ofList:to: {input3} = replace line ## of list ## with {input3}
Last edited by johnnydean1 (2010-09-30 17:05:19)
Offline
nXIII wrote:
ScratchReallyROCKS wrote:
nXIII wrote:
I'd recommend notepad++, a free, open-source text editor with syntax highlighting and lots of other amazing stuff!
![]()
Actually, you see the scripts when you scroll down to the bottom of a scratch project in notepad!
I still recommend it!
![]()
I'm now converting a 500-line Java file to JavaScript. Not as easy as it might sound.
EDIT: I was doing that, now I'm going back to converting it to PHP.
So what stage are you at?
Offline
johnnydean1 wrote:
Here:
Bottom of Scratch File wrote:
Hat Block
¯¯¯¯¯¯¯¯¯
EventHatMorph Scratch-StartClicked = Flag
KeyEventHatMorph space = Key 'space' Hat
MouseClickEventHatMorph Scratch-MouseClickEvent = When ### clicked
EventHatMorph {input} = When {input} recieved
C Blocks
¯¯¯¯¯¯¯¯
doForever = forever
doRepeat = repeat
doForeverIf = forever if
doIf = if
doUntil = repeat until
Branch Blocks
¯¯¯¯¯¯¯¯¯¯¯¯¯
doIfElse = if else
< blocks >
¯¯¯¯¯¯¯¯¯
= {input1} {input2} = <{input1}={input2}>
< {input1} {input2} = <{input1}<{input2}>
> {input1} {input2} = <{input1}>{input2}>
list:contains: {input2} = <list ## contains {input2}>
mousePressed = <mouse pressed>
keyPressed: {input1} = <key {input1} pressed>
isLoud = <loud?>
sensorPressed: {input1} = <sensor {input1}?>
< < > blocks < > >
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
& blocktype1 {input1}{input2} (if not blocktype2 = blocktype1 then blocktype2) {input3}{input4} = < < > and < > >
| blocktype1 {input1}{input2} (if not blocktype2 = blocktype1 then blocktype2) {input3}{input4} = < < > or < > >
not blocktype1 {input1}{input2} = < not <> >
( blocks )
¯¯¯¯¯¯¯¯¯
+ = ( + )
- = ( - )
* = ( * )
/ = ( / )
\\ = ( mod )
randomFrom:to: = (pick random ## to ##)
concatenate:with: {input1} {input2} = (join {input1} with {input2})
letter:of: {input2} = (letter ## of {input2})
stringLength: {input1} = (length of {input1})
volume = (volume)
tempo = (tempo)
timer = (timer)
soundLevel = (loudness)
sensor: {input1} = ( {input1} sensor value)
answer = (answer)
mouseX = (mouse X)
mouseY = (mouse Y)
backgroundIndex = (background no.)
readVariable = (read var ##)
contentsOfList: = (read list ##)
getLine:ofList: = (read line ## of list ##)
lineCountOfList: = (no. lines of list ##)
[ blocks ]
¯¯¯¯¯¯¯¯¯
wait:elapsed:from: = wait block
broadcast: {input1} = broadcast {input1}
doBroadcastAndWait {input1} = broadcast and wait {input1}
doWaitUntil (and same rule as & block) = wait until
doReturn = stop script
stopAll = stop all
doAsk {input1} = ask {input1} and wait
timerReset = reset timer
showBackground: = change background to
nextBackground = next background
changeGraphicEffect:by: {name to change} = change effect {name to change} by ##
setGraphicEffect:to: {name to change} = set effect {name to change} to ##
filterReset = clear effects
playSound: = play sound ##
doPlaySoundAndWait = play sound ## and wait
stopAllSounds = stop all sounds
drum:duration:elapsed:from: = play drum ## for ##
rest:elapsed:from: = rest ## beats
noteOn:duration:elapsed:from: = play note ## for ##
midiInstrument: = set instrument to ##
changeVolumeBy: = change volume by ##
setVolumeTo: = set volume to ##
changeTempoBy: = change tempo by ##
setTempoTo: = set tempo to ##
clearPenTrails = clear
setVar:to: {input2} = set var ## to {input2}
changeVar:by: = change var ## by ##
showVariable: = show var ##
hideVariable: = hide var ##
append:toList: {input1} = add {input1} to list ##
deleteLine:ofList: = delete line ## of list ##
insert:at:ofList: {input1} = insert {input1} at ## of list ##
setLine:ofList:to: {input3} = replace line ## of list ## with {input3}
whats this then?
Offline
Daffy22 wrote:
whats this then?
![]()
Yeah what is that code? it's all the blocks in scratch not just scripts.
Offline
midnightleopard wrote:
Daffy22 wrote:
whats this then?
![]()
Yeah what is that code? it's all the blocks in scratch not just scripts.
Well if you open a scratch project in Notepad and scroll down to the bottom you see all your blocks. This is a conversion chart that I made that can turn that into normal blocks.
Last edited by johnnydean1 (2010-09-30 17:02:26)
Offline
Ok using my file can someone make a HTML/PHP/JScript (Manily JScript/HTML) version of this. So it can get that info, then store it in 2 arrays. The first being the stuff before the '=' and the second being the stuff after the '=' in each line.
Offline