pwiter wrote:
midnightleopard wrote:
sures. Okay. I'm learning JavaScript... I already am a python wizard so I got it's syntax down pretty well. I would highly recomend godaddy.com as a host. It has php, mysql databases, domain name, no ads, and very cheap (like five bucks a year.)
What's this to!
It's a webhost. very good.
Offline
pwiter wrote:
I keep forgetting to ask you guys this, but can I join your team? I have some knowlegde of PHP, I know HTML, I know a little VBscript, and some javascript! I am currently learning asp and asp.net. If I can join I will be active for about 30 min on sunday and sat. but about 1hr on mon-friday. I'll be more active when I clear some stuff out of my way.
EDIT--------------------------------------------------------------------------------------------------------------------
Oh yeah, I know Python!
Appication Here!!!!!!!!!![blocks]<when I receive[ read
<forever>
<set{
}to( 999999)>
<end>[/blocks]
Last edited by pwiter (2010-10-11 09:13:31)
Offline
I am not really in charge of this thing but I would let you in. You know python too? Finally someone else!
Offline
Oh sorry my post didnt come through. Yes I accept Pwiter!
Last edited by johnnydean1 (2010-10-11 12:00:25)
Offline
BLARG!!!!
<?php
$class_id = array(
1 => "UndefinedObject",
2 => "True",
3 => "False",
4 => "SmallInteger",
5 => "SmallInteger16",
6 => "LargePositiveInteger",
7 => "LargeNegativeInteger",
8 => "Float",
9 => "String",
10 => "Symbol",
11 => "ByteArray",
12 => "SoundBuffer",
13 => "Bitmap",
20 => "Array",
21 => "OrderedCollection",
22 => "Set",
23 => "IdentitySet",
24 => "Dictionary",
25 => "IdentityDictionary",
30 => "Color",
31 => "TranslucentColor",
32 => "Point",
33 => "Rectangle",
34 => "Form",
35 => "ColorForm",
99 => "ObjectRef",
100 => "Morph",
101 => "BorderedMorph",
102 => "RectangleMorph",
103 => "EllipseMorph",
104 => "AlignmentMorph",
105 => "StringMorph",
106 => "UpdatingStringMorph",
107 => "SimpleSliderMorph",
108 => "SimpleButtonMorph",
109 => "SampledSound",
110 => "ImageMorph",
111 => "SketchMorph",
123 => "SensorBoardMorph",
124 => "ScratchSpriteMorph",
125 => "ScratchStageMorph",
140 => "ChoiceArgMorph",
141 => "ColorArgMorph",
142 => "ExpressionArgMorph",
145 => "SpriteArgMorph",
147 => "BlockMorph",
148 => "CommandBlockMorph",
149 => "CBlockMorph",
151 => "HatBlockMorph",
153 => "ScratchScriptsMorph",
154 => "ScratchSliderMorph",
155 => "WatcherMorph",
157 => "SetterBlockMorph",
158 => "EventHatMorph",
160 => "VariableBlockMorph",
162 => "ImageMedia",
163 => "MovieMedia",
164 => "SoundMedia",
165 => "KeyEventHatMorph",
166 => "BooleanArgMorph",
167 => "EventTitleMorph",
168 => "MouseClickEventHatMorph",
169 => "ExpressionArgMorphWithMenu",
170 => "ReporterBlockMorph",
171 => "MultilineStringMorph",
172 => "ToggleButton",
173 => "WatcherReadoutFrameMorph",
174 => "WatcherSliderMorph");
$file = array();
$objects = array();
foreach (str_split(file_get_contents($_GET["project"])) as $byte)
{
array_push($file,ord($byte));
}
if (read_header())
{
if (next_string(2) == 0)
{
die("This project is too old!");
}
else
{
//$project_info = next_length(next_uint(4));
next_uint(4);
read_object();
}
}
else
{
die("This file is not a Scratch file!");
}
function next_byte()
{
static $i = 0;
$n = $GLOBALS["file"][$i];
$i++;
return $n;
}
function next_length($length)
{
$array = array();
for ($i = 1; $i <= $length; $i++)
{
array_push($array,next_byte());
}
return $array;
}
function read_header()
{
return next_string(8) == "ScratchV";
}
function next_string($length)
{
$string = "";
foreach (next_length($length) as $byte)
{
$string = $string . chr($byte);
}
return $string;
}
function next_uint($length)
{
$int = 0;
$i = 1;
foreach (array_reverse(next_length($length)) as $byte)
{
$int += $byte * $i;
$i *= 256;
}
return $int;
}
function next_int($length)
{
$int = 0;
$i = 1;
foreach (next_length($length) as $byte)
{
$int += $byte * $i;
$i *= 256;
}
return $int;
}
function read_obj_header()
{
return next_string(4) == 'ObjS' && next_byte() == 1 && next_string(4) == 'Stch' && next_byte() == 1;
}
function read_object()
{
if (read_obj_header())
{
$size = next_uint(4);
//$class_name = $GLOBALS["class_id"][next_byte()];
echo("The object has " . $size . " fields.<br/>");
//is a " . $class_name . " and
$fields = array();
for ($i = 1; $i <= $size; $i++)
{
$field = read_field();
array_push($fields,$field);
}
return array($class_name,$fields);
}
else
{
die("Not an Object!");
}
}
function read_field()
{
$class_ID = next_byte();
$class_name = $GLOBALS["class_id"][$class_ID];
//echo("get_" . $class_name . "() " . $class_ID . "<br/>");
$result = eval("get_" . $class_name . "();");
echo($result[0]);
return $result;
}
function get_ObjectRef()
{
return array("ObjectRef",array(next_uint(3)));
}
function get_UndefinedObject()
{
return array("UndefinedObject",array());
}
function get_True()
{
return array("True",array());
}
function get_False()
{
return array("False",array());
}
function get_SmallInteger()
{
return array("SmallInteger",array(next_int(4)));
}
function get_SmallInteger16()
{
return array("SmallInteger16",array(next_int(2)));
}
function get_String()
{
echo("???");
$size = next_uint(4);
echo("???: " . $size);
exit;
return array("String",array(next_string($size)));
}
function get_Dictionary()
{
$size = next_uint(4);
$result = array();
for ($i = 1; $i <= $size; $i++)
{
$key = read_field();
$value = read_field();
array_push($result,$key,$value);
//print_r($key);
//echo("'s value: ");
//print_r($value);
//echo("<br/>");
//print_r($result);
echo "<br/>";
}
return array("Dictionary",array(next_string(next_uint(4))));
}
?>I can't figure out why it doesn't work...
EDIT: BTW, I need to make a function for every type of data.
Last edited by MathWizz (2010-10-11 12:07:57)
Offline
MathWizz wrote:
BLARG!!!!
Code:
<?php $class_id = array( 1 => "UndefinedObject", 2 => "True", 3 => "False", 4 => "SmallInteger", 5 => "SmallInteger16", 6 => "LargePositiveInteger", 7 => "LargeNegativeInteger", 8 => "Float", 9 => "String", 10 => "Symbol", 11 => "ByteArray", 12 => "SoundBuffer", 13 => "Bitmap", 20 => "Array", 21 => "OrderedCollection", 22 => "Set", 23 => "IdentitySet", 24 => "Dictionary", 25 => "IdentityDictionary", 30 => "Color", 31 => "TranslucentColor", 32 => "Point", 33 => "Rectangle", 34 => "Form", 35 => "ColorForm", 99 => "ObjectRef", 100 => "Morph", 101 => "BorderedMorph", 102 => "RectangleMorph", 103 => "EllipseMorph", 104 => "AlignmentMorph", 105 => "StringMorph", 106 => "UpdatingStringMorph", 107 => "SimpleSliderMorph", 108 => "SimpleButtonMorph", 109 => "SampledSound", 110 => "ImageMorph", 111 => "SketchMorph", 123 => "SensorBoardMorph", 124 => "ScratchSpriteMorph", 125 => "ScratchStageMorph", 140 => "ChoiceArgMorph", 141 => "ColorArgMorph", 142 => "ExpressionArgMorph", 145 => "SpriteArgMorph", 147 => "BlockMorph", 148 => "CommandBlockMorph", 149 => "CBlockMorph", 151 => "HatBlockMorph", 153 => "ScratchScriptsMorph", 154 => "ScratchSliderMorph", 155 => "WatcherMorph", 157 => "SetterBlockMorph", 158 => "EventHatMorph", 160 => "VariableBlockMorph", 162 => "ImageMedia", 163 => "MovieMedia", 164 => "SoundMedia", 165 => "KeyEventHatMorph", 166 => "BooleanArgMorph", 167 => "EventTitleMorph", 168 => "MouseClickEventHatMorph", 169 => "ExpressionArgMorphWithMenu", 170 => "ReporterBlockMorph", 171 => "MultilineStringMorph", 172 => "ToggleButton", 173 => "WatcherReadoutFrameMorph", 174 => "WatcherSliderMorph"); $file = array(); $objects = array(); foreach (str_split(file_get_contents($_GET["project"])) as $byte) { array_push($file,ord($byte)); } if (read_header()) { if (next_string(2) == 0) { die("This project is too old!"); } else { //$project_info = next_length(next_uint(4)); next_uint(4); read_object(); } } else { die("This file is not a Scratch file!"); } function next_byte() { static $i = 0; $n = $GLOBALS["file"][$i]; $i++; return $n; } function next_length($length) { $array = array(); for ($i = 1; $i <= $length; $i++) { array_push($array,next_byte()); } return $array; } function read_header() { return next_string(8) == "ScratchV"; } function next_string($length) { $string = ""; foreach (next_length($length) as $byte) { $string = $string . chr($byte); } return $string; } function next_uint($length) { $int = 0; $i = 1; foreach (array_reverse(next_length($length)) as $byte) { $int += $byte * $i; $i *= 256; } return $int; } function next_int($length) { $int = 0; $i = 1; foreach (next_length($length) as $byte) { $int += $byte * $i; $i *= 256; } return $int; } function read_obj_header() { return next_string(4) == 'ObjS' && next_byte() == 1 && next_string(4) == 'Stch' && next_byte() == 1; } function read_object() { if (read_obj_header()) { $size = next_uint(4); //$class_name = $GLOBALS["class_id"][next_byte()]; echo("The object has " . $size . " fields.<br/>"); //is a " . $class_name . " and $fields = array(); for ($i = 1; $i <= $size; $i++) { $field = read_field(); array_push($fields,$field); } return array($class_name,$fields); } else { die("Not an Object!"); } } function read_field() { $class_ID = next_byte(); $class_name = $GLOBALS["class_id"][$class_ID]; //echo("get_" . $class_name . "() " . $class_ID . "<br/>"); $result = eval("get_" . $class_name . "();"); echo($result[0]); return $result; } function get_ObjectRef() { return array("ObjectRef",array(next_uint(3))); } function get_UndefinedObject() { return array("UndefinedObject",array()); } function get_True() { return array("True",array()); } function get_False() { return array("False",array()); } function get_SmallInteger() { return array("SmallInteger",array(next_int(4))); } function get_SmallInteger16() { return array("SmallInteger16",array(next_int(2))); } function get_String() { echo("???"); $size = next_uint(4); echo("???: " . $size); exit; return array("String",array(next_string($size))); } function get_Dictionary() { $size = next_uint(4); $result = array(); for ($i = 1; $i <= $size; $i++) { $key = read_field(); $value = read_field(); array_push($result,$key,$value); //print_r($key); //echo("'s value: "); //print_r($value); //echo("<br/>"); //print_r($result); echo "<br/>"; } return array("Dictionary",array(next_string(next_uint(4)))); } ?>I can't figure out why it doesn't work...
EDIT: BTW, I need to make a function for every type of data.![]()
in your evals, use a "return get_" . $classname . "();" (the return is important)
But I would just use a switch() statement with the class id.
Offline
nXIII wrote:
MathWizz wrote:
BLARG!!!!
Code:
[Code removed]I can't figure out why it doesn't work...
EDIT: BTW, I need to make a function for every type of data.![]()
in your evals, use a "return get_" . $classname . "();" (the return is important)
But I would just use a switch() statement with the class id.
Aha! Thank you!
Offline
Ok Pwiter what languages do you know (HTML , JScript)
Offline
johnnydean1 wrote:
Ok Pwiter what languages do you know (HTML , JScript)
I have some knowlegde of PHP, I know HTML, I know a little VBscript, and some javascript! I am currently learning asp and asp.net.Also Python
Offline
Ok you think you can help mathWizz decode a .sb file?
Offline
My output so far:
http://localhost/reader.php?project=project.sb wrote:
The object has 36 fields.
Dictionary
ObjectRef
ObjectRef
Array ( [0] => ObjectRef [1] => Array ( [0] => 2 ) ) 's value: Array ( [0] => ObjectRef [1] => Array ( [0] => 3 ) )
ObjectRef
ObjectRef
Array ( [0] => ObjectRef [1] => Array ( [0] => 4 ) ) 's value: Array ( [0] => ObjectRef [1] => Array ( [0] => 5 ) )
ObjectRef
ObjectRef
Array ( [0] => ObjectRef [1] => Array ( [0] => 6 ) ) 's value: Array ( [0] => ObjectRef [1] => Array ( [0] => 7 ) )
ObjectRef
ObjectRef
Array ( [0] => ObjectRef [1] => Array ( [0] => 8 ) ) 's value: Array ( [0] => ObjectRef [1] => Array ( [0] => 9 ) )
ObjectRef
ObjectRef
Array ( [0] => ObjectRef [1] => Array ( [0] => 10 ) ) 's value: Array ( [0] => ObjectRef [1] => Array ( [0] => 11 ) )
ObjectRef
ObjectRef
Array ( [0] => ObjectRef [1] => Array ( [0] => 12 ) ) 's value: Array ( [0] => ObjectRef [1] => Array ( [0] => 13 ) )
ObjectRef
ObjectRef
Array ( [0] => ObjectRef [1] => Array ( [0] => 14 ) ) 's value: Array ( [0] => ObjectRef [1] => Array ( [0] => 15 ) )
ObjectRef
ObjectRef
Array ( [0] => ObjectRef [1] => Array ( [0] => 16 ) ) 's value: Array ( [0] => ObjectRef [1] => Array ( [0] => 17 ) )
String
String
Array ( [0] => String [1] => Array ( [0] => os-version ) ) 's value: Array ( [0] => String [1] => Array ( [0] => NT ) )
String
String
Array ( [0] => String [1] => Array ( [0] => history ) ) 's value: Array ( [0] => String [1] => Array ( [0] => 2010-9-29 19:41:07 save project 2010-10-5 08:57:33 save project MathWizz 2010-10-6 10:36:02 save project 2010-10-7 20:44:08 save project ) )
String
String
Array ( [0] => String [1] => Array ( [0] => platform ) ) 's value: Array ( [0] => String [1] => Array ( [0] => Win32 ) )
String
String
Array ( [0] => String [1] => Array ( [0] => language ) ) 's value: Array ( [0] => String [1] => Array ( [0] => en ) )
String
String
Array ( [0] => String [1] => Array ( [0] => scratch-version ) ) 's value: Array ( [0] => String [1] => Array ( [0] => 1.4 of 30-Jun-09 ) )
String
ColorForm
SmallInteger16
SmallInteger16
SmallInteger16
UndefinedObject
ObjectRef
Array ( [0] => String [1] => Array ( [0] => thumbnail ) ) 's value:
ObjectRef
String
Array ( [0] => ObjectRef [1] => Array ( [0] => 19 ) ) 's value: Array ( [0] => String [1] => Array ( [0] => author ) )
Fatal error: Call to undefined function get_() in C:\xampp\htdocs\reader.php(188) : eval()'d code on line 1
ColorForms aren't working very well right now.
Offline
MathWizz wrote:
My output so far:
http://localhost/reader.php?project=project.sb wrote:
The object has 36 fields.
Dictionary
ObjectRef
ObjectRef
Array ( [0] => ObjectRef [1] => Array ( [0] => 2 ) ) 's value: Array ( [0] => ObjectRef [1] => Array ( [0] => 3 ) )
ObjectRef
ObjectRef
Array ( [0] => ObjectRef [1] => Array ( [0] => 4 ) ) 's value: Array ( [0] => ObjectRef [1] => Array ( [0] => 5 ) )
ObjectRef
ObjectRef
Array ( [0] => ObjectRef [1] => Array ( [0] => 6 ) ) 's value: Array ( [0] => ObjectRef [1] => Array ( [0] => 7 ) )
ObjectRef
ObjectRef
Array ( [0] => ObjectRef [1] => Array ( [0] => 8 ) ) 's value: Array ( [0] => ObjectRef [1] => Array ( [0] => 9 ) )
ObjectRef
ObjectRef
Array ( [0] => ObjectRef [1] => Array ( [0] => 10 ) ) 's value: Array ( [0] => ObjectRef [1] => Array ( [0] => 11 ) )
ObjectRef
ObjectRef
Array ( [0] => ObjectRef [1] => Array ( [0] => 12 ) ) 's value: Array ( [0] => ObjectRef [1] => Array ( [0] => 13 ) )
ObjectRef
ObjectRef
Array ( [0] => ObjectRef [1] => Array ( [0] => 14 ) ) 's value: Array ( [0] => ObjectRef [1] => Array ( [0] => 15 ) )
ObjectRef
ObjectRef
Array ( [0] => ObjectRef [1] => Array ( [0] => 16 ) ) 's value: Array ( [0] => ObjectRef [1] => Array ( [0] => 17 ) )
String
String
Array ( [0] => String [1] => Array ( [0] => os-version ) ) 's value: Array ( [0] => String [1] => Array ( [0] => NT ) )
String
String
Array ( [0] => String [1] => Array ( [0] => history ) ) 's value: Array ( [0] => String [1] => Array ( [0] => 2010-9-29 19:41:07 save project 2010-10-5 08:57:33 save project MathWizz 2010-10-6 10:36:02 save project 2010-10-7 20:44:08 save project ) )
String
String
Array ( [0] => String [1] => Array ( [0] => platform ) ) 's value: Array ( [0] => String [1] => Array ( [0] => Win32 ) )
String
String
Array ( [0] => String [1] => Array ( [0] => language ) ) 's value: Array ( [0] => String [1] => Array ( [0] => en ) )
String
String
Array ( [0] => String [1] => Array ( [0] => scratch-version ) ) 's value: Array ( [0] => String [1] => Array ( [0] => 1.4 of 30-Jun-09 ) )
String
ColorForm
SmallInteger16
SmallInteger16
SmallInteger16
UndefinedObject
ObjectRef
Array ( [0] => String [1] => Array ( [0] => thumbnail ) ) 's value:
ObjectRef
String
Array ( [0] => ObjectRef [1] => Array ( [0] => 19 ) ) 's value: Array ( [0] => String [1] => Array ( [0] => author ) )
Fatal error: Call to undefined function get_() in C:\xampp\htdocs\reader.php(188) : eval()'d code on line 1ColorForms aren't working very well right now.
![]()
Why not a switch statement?
Offline
nXIII wrote:
MathWizz wrote:
My output so far:
http://localhost/reader.php?project=project.sb wrote:
The object has 36 fields.
Dictionary
ObjectRef
ObjectRef
Array ( [0] => ObjectRef [1] => Array ( [0] => 2 ) ) 's value: Array ( [0] => ObjectRef [1] => Array ( [0] => 3 ) )
ObjectRef
ObjectRef
Array ( [0] => ObjectRef [1] => Array ( [0] => 4 ) ) 's value: Array ( [0] => ObjectRef [1] => Array ( [0] => 5 ) )
ObjectRef
ObjectRef
Array ( [0] => ObjectRef [1] => Array ( [0] => 6 ) ) 's value: Array ( [0] => ObjectRef [1] => Array ( [0] => 7 ) )
ObjectRef
ObjectRef
Array ( [0] => ObjectRef [1] => Array ( [0] => 8 ) ) 's value: Array ( [0] => ObjectRef [1] => Array ( [0] => 9 ) )
ObjectRef
ObjectRef
Array ( [0] => ObjectRef [1] => Array ( [0] => 10 ) ) 's value: Array ( [0] => ObjectRef [1] => Array ( [0] => 11 ) )
ObjectRef
ObjectRef
Array ( [0] => ObjectRef [1] => Array ( [0] => 12 ) ) 's value: Array ( [0] => ObjectRef [1] => Array ( [0] => 13 ) )
ObjectRef
ObjectRef
Array ( [0] => ObjectRef [1] => Array ( [0] => 14 ) ) 's value: Array ( [0] => ObjectRef [1] => Array ( [0] => 15 ) )
ObjectRef
ObjectRef
Array ( [0] => ObjectRef [1] => Array ( [0] => 16 ) ) 's value: Array ( [0] => ObjectRef [1] => Array ( [0] => 17 ) )
String
String
Array ( [0] => String [1] => Array ( [0] => os-version ) ) 's value: Array ( [0] => String [1] => Array ( [0] => NT ) )
String
String
Array ( [0] => String [1] => Array ( [0] => history ) ) 's value: Array ( [0] => String [1] => Array ( [0] => 2010-9-29 19:41:07 save project 2010-10-5 08:57:33 save project MathWizz 2010-10-6 10:36:02 save project 2010-10-7 20:44:08 save project ) )
String
String
Array ( [0] => String [1] => Array ( [0] => platform ) ) 's value: Array ( [0] => String [1] => Array ( [0] => Win32 ) )
String
String
Array ( [0] => String [1] => Array ( [0] => language ) ) 's value: Array ( [0] => String [1] => Array ( [0] => en ) )
String
String
Array ( [0] => String [1] => Array ( [0] => scratch-version ) ) 's value: Array ( [0] => String [1] => Array ( [0] => 1.4 of 30-Jun-09 ) )
String
ColorForm
SmallInteger16
SmallInteger16
SmallInteger16
UndefinedObject
ObjectRef
Array ( [0] => String [1] => Array ( [0] => thumbnail ) ) 's value:
ObjectRef
String
Array ( [0] => ObjectRef [1] => Array ( [0] => 19 ) ) 's value: Array ( [0] => String [1] => Array ( [0] => author ) )
Fatal error: Call to undefined function get_() in C:\xampp\htdocs\reader.php(188) : eval()'d code on line 1ColorForms aren't working very well right now.
![]()
Why not a switch statement?
No reason in particular... I might change it...
Offline
I made a dev site for this. www.htmltop.orangeserve.com
I'll try to make it up to date for us!
It's to keep us up to date on what your doing!
Last edited by pwiter (2010-10-13 16:50:29)
Offline
pwiter wrote:
I made a dev site for this. www.htmltop.orangeserve.com
I'll try to make it up to date for us!
I emailed you...
Offline
pwiter wrote:
I made a dev site for this. www.htmltop.orangeserve.com
I'll try to make it up to date for us!
There's already a site. There's a link in my sig.
Offline
ScratchReallyROCKS wrote:
pwiter wrote:
I made a dev site for this. www.htmltop.orangeserve.com
I'll try to make it up to date for us!There's already a site. There's a link in my sig.
It doesn't support php though right?
Offline
MathWizz wrote:
ScratchReallyROCKS wrote:
pwiter wrote:
I made a dev site for this. www.htmltop.orangeserve.com
I'll try to make it up to date for us!There's already a site. There's a link in my sig.
It doesn't support php though right?
It supports php, but it puts the .html extension after every page url.
Offline
Shall we make up a name to call the viewer. I don't think the title can include Scratch however.
Offline