Discuss Scratch

rox
Scratcher
14 posts

Possible Luckode recreation/reimplementation in Javascript?

Between March 2024 and July 2026, I worked on a Scratch 1.4 modification called Luckode. Before its cancellation it had well over 500 blocks and several new features like a custom Preferences menu, a sound editor and more. During the time I developed Luckode I had considered redeveloping Luckode to be browser-friendly multiple times because 1. that 32-bit time overflow bug was inching by faster that I thought it would (we're already in August…) and 2. ease of access for people who are on mobile devices or people who aren't on Windows/ReactOS machines that don't have access to a virtual machine. Now recently, someone did ask me to "uncancel" Luckode, of which I gave them this chain of replies (see attachment), but then I considered the idea of reimplementing Luckode in Scratch 3.0 (or whatever amalgamation of 3.0/4.0 Scratch is on now).

Unfortunately I do not have the knowledge in JavaScript or Python applicable to develop such a project, and since I also considered developing a frontend similar to this…yeah. And, to be fair, I did try to learn JavaScript but my brain rejected all of that knowledge for some reason, so… yeah. I'd love to see people who are interested in actually working on such a thing since Luckode is by far one of the most popular things I have ever produced/developed (…not counting those stupidly long YouTube videos. You'd know if you search up "To your house? In 3D Land?").

Honestly, a few things that should be of note for everyone who wants to work on the reimplementation (if any) is that I don't just want this to be the umpteenth Turbowarp modification (we already have enough) but something fresh built off of vanilla Scratch instead. Honestly I don't really know how to continue or explain or just…present myself to people who want to work on the project soooooo I guess if you want to work on it then reply to this post and I'll try to sort something out? I'm hoping this post doesn't break any rules because a browser-based version of Luckode has been on my mind ever since I started working on Luckode 9.1 (circa August 2024).

Attachments:
attachment Screenshot 2026-08-01 214157.png (103.0 KB)


hi im rox i go by she/her pronouns and im 14
developer of Luckode(X) and more recently Mineral!!
pretendo 3ds friend code: 4526-3332-4319 | switch friend code: sw-1915-6608-4686
active on scratch and twitter and hjonk and youtube and tumblr and discord and steam as tweetythebird92 (not github tho! github's bingulanmenace)
https://tweetythebird92.neocities.org
aaaaa
Scratcher
12 posts

Possible Luckode recreation/reimplementation in Javascript?

I don't see what rules there are to break, lol

Anyway I'm probably too lazy but I can certainly provide some sample JavaScript code in case it helps:
// This is a comment! It's ignored, of course.
let myVariable = 1 // creates a variable
while (myVariable <= 10) { // this loop has a "less than or equal" check
  console.log(myVariable)
  myVariable++ // change [my variable] by (1)
}

myVariable -= 5 // change [my variable] by (-5)
if (myVariable < 7) console.log('and the variable is now less than 7') //  { and } can be ommitted if there is just one statement
To execute the above program, you can simply paste it into your browser console, and the output will appear. Anyway, reading it might help understand the basics of the language.

And also some more complex stuff:
let myObject = { 'example': 1 } // this is an object! it can map strings to values
console.log(myObject['example']) // prints 1
console.log(myObject.example) // ditto

myObject.example2 = 2 // it's also possible to add values to existing objects
console.log(myObject.example2) // 2

let myArray = ['a', 'b', 'c'] // this is an array (list), it's an object meant specifically for storing a list of data
myArray.push('d') // this adds an element to the array
console.log(myArray) // ['a', 'b', 'c', 'd']
console.log(myArray.join(', ')) // this prints the elements separated by commas and spaces
console.log(myArray.join('')) // this prints the elements separated by nothing, like the reporter of list of characters on scratch

// this is a function, akin to a custom block from scratch
function myFunction() {
  console.log('hello from the function!')
}
myFunction() // invokes the new function

// functions are just another type of object though, and we can store them in variables, objects, etc
// this is loosely analogous to storing a broadcast name in a variable, but it's much more direct!
let alsoMyFunction = myFunction
alsoMyFunction()

// functions are objects too as said before
myFunction.a = 3
console.log(myFunction.a)
console.log(alsoMyFunction.a) // oh also speaking of objects, this variable points to the same object so this will also print 3

// inline and arrow functions exist too
let inlineFunction = function () { console.log('hi') } // name can be ommitted
let arrowFunction = () => console.log('hi again') // {} can be ommitted with these. anyway you'll see plenty of these get passed to functions, im sure

// functions can also take parameters and return!
function paramExample(num1, num2, num3) {
  return num1 + num2 - num3 // oh and we can do math, like the scratch operators!
}
console.log(paramExample(6, 9, -54)) // prints 69
Hopefully this makes things a bit easier. I also recommend checking out the MDN docs, there's a ton of JavaScript info there.
As for Python it's sorta kinda similar to JS though the syntax is different and objects and dictionaries are separate (albeit related). AFAIK Scratch 3.0 doesn't run on any Python code though, though scratchr2 and apiclone do, so it does help if you want a project site (in which case you'd also want to know a bit of Django's template language).
chipmunkmc
Scratch Team
100 posts

Possible Luckode recreation/reimplementation in Javascript?

Well I'll have to confess I haven't actually used Luckode… until just now. It's quite an awesome mod and pretty much extends Scratch 1.4's capabilities to nearly those of a conventional programming language.
Anyway many of the new blocks probably aren't that hard to implement into the Scratch 3.0 VM. The new language features, however, are probably a bit harder to implement.
Multi-argument join can be implemented via mutations I suppose (at least I think that's how PenguinMod did it). Special data types can also be implemented by having the blocks' handlers return objects (as opposed to numbers/strings) however there are a few quirks:
  • Collections and lists would be sort of… redundant. And yet they're not the same thing, as collection reporters point to a collection (we could use JS arrays) instead of joining its elements into a string.
  • We might need to have the editor properly handle objects, for instance by calling Array.isArray and using instanceof. It might even be necessary to adapt the Cast class (used for ensuring a value is of a specific type, such as number or boolean) tho idk.
  • I'm not sure that the same skins available in the 1.4-based version would be accessible in the 3.0 one.

Also, some system-related stuff:
  • Without including a Squeak interpreter, the block for executing Squeak code likely cannot be implemented. We could add a JavaScript evaluation block though, perhaps via JavaScript's eval() function.
  • A website can't really access the client's filesystem or username. Maybe an offline editor could get around such a limitation, but I've never really used Electron. We could also emulate an FS via IndexedDB I suppose, and/or maybe alias the username to the (username) block or spoof its value.
  • I've never really used meshes but I'm not so sure that a website could host one.
  • Opening URLs can be done, for instance with window.open(), and fetching data from them can be done with fetch() and XHR. Unfortunately, the latter operation has limitations due to CORS and such, though there's still fun stuff that can be done.

Special block stuff (collection reporters, the text area block, skin fields, multi-argument join, etc) would also require changing how Scratch renders blocks which I unfortunately lack experience with.

Anyway I'd probably be capable of re-implementing the more basic blocks. Still I've been feeling tired/lazy lately (well okay that's nothing new), but I also currently want to focus on other projects, so I'm still far from sure I can help… but anyway in the meantime we should decide on some details, such as what we'll do with lists/collections.

Last edited by chipmunkmc (Aug. 12, 2026 01:17:33)


https://max.chipmunk.land/
hi, this is my signature!
chipmunkmc
Scratch Team
100 posts

Possible Luckode recreation/reimplementation in Javascript?

Wait, back to the Windows/ReactOS machine point… Luckode runs on Wine, and quite well at that (it can spawn my default web browser and get my username properly).
My browser / operating system: Linux, Firefox 143.0, No Flash version detected

https://max.chipmunk.land/
hi, this is my signature!
Heathercat123
Scratch Team
82 posts

Possible Luckode recreation/reimplementation in Javascript?

chipmunkmc wrote:

Wait, back to the Windows/ReactOS machine point… Luckode runs on Wine, and quite well at that (it can spawn my default web browser and get my username properly).
My browser / operating system: Linux, Firefox 143.0, No Flash version detected

You can also use the macOS (may not work on 10.15 Catalina or newer) or Linux version of Squeak or Scratch 1.4. Or if you're really desperate, you can use SqueakJS.

Creator of much of the backend code for this website (the Scratch section, not the rest!) along with contributions from @chipmunkmc.
rox
Scratcher
14 posts

Possible Luckode recreation/reimplementation in Javascript?

chipmunkmc wrote:

-snip-

Anyway I'd probably be capable of re-implementing the more basic blocks. Still I've been feeling tired/lazy lately (well okay that's nothing new), but I also currently want to focus on other projects, so I'm still far from sure I can help… but anyway in the meantime we should decide on some details, such as what we'll do with lists/collections.


I'll try to see what I can sort out about problems caused by the blocks. Specifically I wouldn't really want this to be an exact reimplementation, just porting most of the new LuckodeX blocks and specific features to Scratch 3.0. What I wouldn't want to include are very similar blocks (e.g. forward steps, backward steps, forward grid squares, backward grid squares) excluding the dropdown blocks (the dropdown blocks are for simplicity's sake meanwhile the non-dropdown blocks are there for (redundant) backward-compatibility). With the file blocks I'm okay with not porting them rather than emulating an entire file system.

Heathercat123 wrote:

chipmunkmc wrote:

Wait, back to the Windows/ReactOS machine point… Luckode runs on Wine, and quite well at that (it can spawn my default web browser and get my username properly).
My browser / operating system: Linux, Firefox 143.0, No Flash version detected

You can also use the macOS (may not work on 10.15 Catalina or newer) or Linux version of Squeak or Scratch 1.4. Or if you're really desperate, you can use SqueakJS.

Honestly at one point I did try porting Luckode to macOS and Linux but my macOS VM refused to install and my Linux VM was too slow to actually do stuff. (…I use Windows unfortunately)

hi im rox i go by she/her pronouns and im 14
developer of Luckode(X) and more recently Mineral!!
pretendo 3ds friend code: 4526-3332-4319 | switch friend code: sw-1915-6608-4686
active on scratch and twitter and hjonk and youtube and tumblr and discord and steam as tweetythebird92 (not github tho! github's bingulanmenace)
https://tweetythebird92.neocities.org
chipmunkmc
Scratch Team
100 posts

Possible Luckode recreation/reimplementation in Javascript?

So regarding the collections, I had an idea. We could make it so list reporters returned lists' arrays, and then patch this routine to properly convert array values to strings to avoid breaking any existing code. After that it's just a matter of adding extra versions of the list blocks that take a list/collection reporter as an argument.
It would result in some duplicate blocks existing, and it might be a bit hacky (granted we'd probably need to patch Cast no matter what), but it would mean we wouldn't have two features (lists and collections) that sort of do the same thing.

https://max.chipmunk.land/
hi, this is my signature!
rox
Scratcher
14 posts

Possible Luckode recreation/reimplementation in Javascript?

chipmunkmc wrote:

So regarding the collections, I had an idea. We could make it so list reporters returned lists' arrays, and then patch this routine to properly convert array values to strings to avoid breaking any existing code. After that it's just a matter of adding extra versions of the list blocks that take a list/collection reporter as an argument.
It would result in some duplicate blocks existing, and it might be a bit hacky (granted we'd probably need to patch Cast no matter what), but it would mean we wouldn't have two features (lists and collections) that sort of do the same thing.

That sounds good.

I should probably inform that collections are meant to function as sort of "temporary" lists in the same sense that the counter (in the System category) is practically just a temporary variable. For example you can use collections in place of lists that are only used once or twice in a project and if you end up needing to save the collection you can just push it to a list that has a higher chance of being used more often.

hi im rox i go by she/her pronouns and im 14
developer of Luckode(X) and more recently Mineral!!
pretendo 3ds friend code: 4526-3332-4319 | switch friend code: sw-1915-6608-4686
active on scratch and twitter and hjonk and youtube and tumblr and discord and steam as tweetythebird92 (not github tho! github's bingulanmenace)
https://tweetythebird92.neocities.org
rox
Scratcher
14 posts

Possible Luckode recreation/reimplementation in Javascript?

duplicate reply from website being down

Last edited by rox (Aug. 13, 2026 09:28:08)


hi im rox i go by she/her pronouns and im 14
developer of Luckode(X) and more recently Mineral!!
pretendo 3ds friend code: 4526-3332-4319 | switch friend code: sw-1915-6608-4686
active on scratch and twitter and hjonk and youtube and tumblr and discord and steam as tweetythebird92 (not github tho! github's bingulanmenace)
https://tweetythebird92.neocities.org

Powered by DjangoBB