Discuss Scratch
- Discussion Forums
- » Advanced Topics
- » GitHub revisited
- RokCoder
- Scratcher
1000+ posts
GitHub revisited
My GitHub tool-chain is now at the point where I use it for all of my Scratch projects. By running a batch file it -
- downloads the latest sb3 for a project
- converts all scripts into text
- extracts all assets (costumes and sound effects)
- opens GitHub Desktop
- asks for a commit comment and commits everything to GitHub
The set-up is extremely simply (assuming you're already a GitHub user). The GitHub repository contains everything you need (which is basically a batch file) and includes full set-up instructions.
It makes it absolutely trivial to (a) ensure you always have backups and (b) track back if problems have been introduced or you want to see how and when changes have been made. The following examples make this clearer.
Examples of commits demonstrating how useful this is
Commit comment: Fixed sound channel 0 (noise) pitch control
Commit comment: Increased the contrast of the project's thumbnail
Example taken from a commit that involved variable values changing
Last edited by RokCoder (May 21, 2021 15:02:18)
- Chiroyce
- Scratcher
1000+ posts
GitHub revisited
Wow that's cool! Automating tasks saves a ton of time!
April Fools' topics:
— New Buildings in Scratch's headquarters
— Give every Scratcher an M1 MacBook Air
— Scratch should let users edit other Scratchers' projects
— Make a statue for Jeffalo
— Scratch Tech Tips™
— Make a Chiroyce statue emoji
<img src=“x” onerror=“alert('XSS vulnerability discovered')”>
this is a test sentence
- Paddle2See
- Scratch Team
1000+ posts
GitHub revisited
Are you using this just to make backups / compare versions? Because the Terms of Use are pretty clear about not sharing projects created with other tools.
4.4 You may only submit user-generated projects that were created with (1) the Scratch website editor or (2) an unmodified copy of the Scratch editor compiled from the source code described in Section 5.3. You may not upload any projects that were created, by you or by anyone else, with a modified version of the Scratch editor.
Scratch Team Member, kayak and pickleball enthusiast, cat caregiver.
This is my forum signature! On a forum post, it is okay for Scratchers to advertise in their forum signature. The signature is the stuff that shows up below the horizontal line on the post. It will show up on every post I make.
(credit to Za-Chary)
;
- Raihan142857
- Scratcher
1000+ posts
GitHub revisited
Why is that in the TOS? Isn't the TOS outdated? Does this mean you can't share projects that were programmed in Turbowarp? Are you using this just to make backups / compare versions? Because the Terms of Use are pretty clear about not sharing projects created with other tools.4.4 You may only submit user-generated projects that were created with (1) the Scratch website editor or (2) an unmodified copy of the Scratch editor compiled from the source code described in Section 5.3. You may not upload any projects that were created, by you or by anyone else, with a modified version of the Scratch editor.
I use scratch.
GF: I'll dump you. BF: hex dump or binary dump?
- colinmacc
- Scratcher
1000+ posts
GitHub revisited
Why is that in the TOS? Isn't the TOS outdated? Does this mean you can't share projects that were programmed in Turbowarp? Are you using this just to make backups / compare versions? Because the Terms of Use are pretty clear about not sharing projects created with other tools.4.4 You may only submit user-generated projects that were created with (1) the Scratch website editor or (2) an unmodified copy of the Scratch editor compiled from the source code described in Section 5.3. You may not upload any projects that were created, by you or by anyone else, with a modified version of the Scratch editor.
It sounds like it, yes.
Also anyone who uses a certain browser extension is breaking the TOU…?
- gosoccerboy5
- Scratcher
1000+ posts
GitHub revisited
well technically they're still using the scratch editor. also referencing It sounds like it, yes.https://scratch.mit.edu/discuss/topic/284272/, you're still allowed to use browser extensions.
Also anyone who uses a certain browser extension is breaking the TOU…?
I think Turbowarp is kind of a grey area though
- RokCoder
- Scratcher
1000+ posts
GitHub revisited
It serves two purposes - Are you using this just to make backups / compare versions? Because the Terms of Use are pretty clear about not sharing projects created with other tools.
- It backs up the sb3 in addition to all individual assets (graphics and/or sound files) so you can always roll back to whichever version you want
- It parses the JSON scripts into pseudo code so that they can be used effectively in a source control environment
The first post in the thread shows that it's solely for development purposes allowing you to use GitHub for Scratch projects in the same way you would use it for conventional computer languages. As far as I can see it doesn't contravene any TOU.
Delete the whole post if you must. I made the tool for my own use. It just so happens that I find it so extremely useful that I felt I would offer it to other Scratchers.
- colinmacc
- Scratcher
1000+ posts
GitHub revisited
well technically they're still using the scratch editor. also referencing It sounds like it, yes.https://scratch.mit.edu/discuss/topic/284272/, you're still allowed to use browser extensions.
Also anyone who uses a certain browser extension is breaking the TOU…?
I think Turbowarp is kind of a grey area though
But it modifies the scratch editor though. That’s literally what it does.
- gosoccerboy5
- Scratcher
1000+ posts
GitHub revisited
I guess you're right. But it modifies the scratch editor though. That’s literally what it does.
- Maximouse
- Scratcher
1000+ posts
GitHub revisited
It doesn't modify the editor's source code, which appears to be what the part of ToU is about. And I don't think it's “pretty clear”: it only allows projects created with the online editor (“the Scratch website editor”) or Scratch 1.4 (“an unmodified copy of the Scratch editor compiled from the source code described in Section 5.3” – section 5.3 contains a link to the 1.4 source code). This means that any project created using any version of the offline editor other than 1.4 is technically against the rules. I don't think people often report projects for not being made using Scratch.well technically they're still using the scratch editor. also referencing It sounds like it, yes.https://scratch.mit.edu/discuss/topic/284272/, you're still allowed to use browser extensions.
Also anyone who uses a certain browser extension is breaking the TOU…?
I think Turbowarp is kind of a grey area though
But it modifies the scratch editor though. That’s literally what it does.
Last edited by Maximouse (July 24, 2021 08:51:15)
- Greg8128
- Scratcher
500+ posts
GitHub revisited
Are you using this just to make backups / compare versions? Because the Terms of Use are pretty clear about not sharing projects created with other tools.4.4 You may only submit user-generated projects that were created with (1) the Scratch website editor or (2) an unmodified copy of the Scratch editor compiled from the source code described in Section 5.3. You may not upload any projects that were created, by you or by anyone else, with a modified version of the Scratch editor.
What exactly is the point of this rule, anyway? It seems difficult to enforce in practice if the project isn't too much different from a “regular” project. I assume that its main purpose is to preserve equality by making sure that nobody can gain an advantage from “hacked” blocks or tools like a preprocessor.
Therefore, I think that if the tool doesn't provide abilities in excess of those of the Scratch editor, and doesn't produce a “broken” project, then nobody will be able to tell and nobody will have any reason to care. You could also argue that a text-based format for Scratch makes it much easier to use tools like find-and-replace or even a general-purpose preprocessor. However, if the tool greatly impacts how Scratch code is produced then there should be telltale signs of its use.
However, this is just my interpretation; the ST's interpretation is obviously more important.
- NFlex23
- Scratcher
1000+ posts
GitHub revisited
I just used this for StackLisp, and it's pretty cool! https://github.com/MystPi/stacklisp
Also, is your sb3 to txt program open-source? I would love to take a look at it.
Also, is your sb3 to txt program open-source? I would love to take a look at it.
Help improve the Advanced Topics (Really!)
Before you create a topic:
Always search for duplicates or other similar topics before making an umbrella topic, e.g., “The Mac Topic”.
- Is it about something you are planning on making but haven't made yet? If so, please wait to post until you have created a working prototype. This is a key factor to keeping the ATs as clean as possible.
- The ATs aren't technical support. It is perfectly valid to ask questions about things related to programming, but not issues with external websites, apps, or devices. Most sites have their own support system; try asking there!
- Is it related to something you are making in Scratch? (This includes OSes and other Scratch projects) If so, please post in Collaboration, Show and Tell, or another similar forum.
- Is your topic questionably “advanced”? Try browsing the other forums to see if your topic fits better in one of those.
- Issues with Scratch itself should be put in Bugs and Glitches.
- RokCoder
- Scratcher
1000+ posts
GitHub revisited
https://github.com/MystPi/stacklispI'm glad you've found it useful. I have to admit that I'd hate to work on any large Scratch project without using this. The sb3-to-txt repository isn't open source at this point. I just used this for StackLisp, and it's pretty cool!
Also, is your sb3 to txt program open-source? I would love to take a look at it.
- ThemeAndReality
- Scratcher
13 posts
GitHub revisited
Thanks for making & sharing this. It's really useful, and I've been having a good play. The ability to version control scripts is great! I have a few observations…
I'm getting an HTTP 403 error when using the sb3-to-txt autosave function. The scripts are generated, but it then fails inside the buildSB3 function:
GET https://cdn.projects.scratch.mit.edu/531881458/ 403 (Forbidden)
I've tried your BBC emulator project in addition to some of my shared projects - same result. Could this be something on my side?
I also noticed a few things in the generated scripts:
One last observation - I (foolishly) used colons in some sprite names. The resulting scripts.zip includes filenames including those colons. 7zip extracts them ok, replacing the colons with underscores. But Python's shutil.unpack_archive generates a blank file, whose name is truncated (from the colon onwards). The easy answer is to not use colons in sprite names… but it may be worth substituting them (and other non-filename chars) in the generated script files/zip?
I'm getting an HTTP 403 error when using the sb3-to-txt autosave function. The scripts are generated, but it then fails inside the buildSB3 function:
GET https://cdn.projects.scratch.mit.edu/531881458/ 403 (Forbidden)
I've tried your BBC emulator project in addition to some of my shared projects - same result. Could this be something on my side?
I also noticed a few things in the generated scripts:
- ‘Change’ is spelt wrong in “Looks.ChengeSizeBy(x);”
- The ‘Play Note () for () Beats’ Scratch 3 block generates “Music.PlayNote(note ?? - probably legacy function from Scratch 2.0, 1);”
- Event broadcasts use double quotes around the message name, whereas receives do not, e.g.:
Event.Broadcast(“title screen”);
WhenBroadcastReceived(title screen)
I guess message names are like variable names so shouldn't use quotes in either context?
One last observation - I (foolishly) used colons in some sprite names. The resulting scripts.zip includes filenames including those colons. 7zip extracts them ok, replacing the colons with underscores. But Python's shutil.unpack_archive generates a blank file, whose name is truncated (from the colon onwards). The easy answer is to not use colons in sprite names… but it may be worth substituting them (and other non-filename chars) in the generated script files/zip?
- RokCoder
- Scratcher
1000+ posts
GitHub revisited
It's great to hear it's being used! On a large project I couldn't get by without it but it didn't get a great deal of traction with others. Understandable I suppose considering the general demographic. Thanks for making & sharing this. It's really useful, and I've been having a good play. The ability to version control scripts is great!
From memory I think this is something I need to fix on my side (possibly broken when the Scratch API was updated). I'll try to get a little time to look into it today. I'm getting an HTTP 403 error when using the sb3-to-txt autosave function. The scripts are generated, but it then fails inside the buildSB3 function:
GET https://cdn.projects.scratch.mit.edu/531881458/ 403 (Forbidden)
I've tried your BBC emulator project in addition to some of my shared projects - same result. Could this be something on my side?
Great feedback - thanks! I
I also noticed a few things in the generated scripts:
- ‘Change’ is spelt wrong in “Looks.ChengeSizeBy(x);”
- The ‘Play Note () for () Beats’ Scratch 3 block generates “Music.PlayNote(note ?? - probably legacy function from Scratch 2.0, 1);”
- Event broadcasts use double quotes around the message name, whereas receives do not, e.g.:
Event.Broadcast(“title screen”);
WhenBroadcastReceived(title screen)
I guess message names are like variable names so shouldn't use quotes in either context?
I'll have a ponder about this… I
One last observation - I (foolishly) used colons in some sprite names. The resulting scripts.zip includes filenames including those colons. 7zip extracts them ok, replacing the colons with underscores. But Python's shutil.unpack_archive generates a blank file, whose name is truncated (from the colon onwards). The easy answer is to not use colons in sprite names… but it may be worth substituting them (and other non-filename chars) in the generated script files/zip?
- Discussion Forums
- » Advanced Topics
- » GitHub revisited