ScratchCraft is an extension for adacraft. It adds the ability to send commands from scratch into minecraft with the Computer Craft Mod. It should work in other scratch mods as well.
First things first you will need three things, a scratch project with the extension, a server, and minecraft with CC Tweaked installed.
- Open a compatible scratch mod, some of these include:
-
Click add extensions, scroll to the bottom and click custom extension, then put in the link "https://scratchcraft.modog500000.repl.co/stable.js"
-
Go to replit and create a new replit, you need to make an account if you dont have one. Make it a Node.Js project. Create or edit a file named index.js and add the code from server index(You can find this in the releases page of the github).
-
Launch minecraft with CC Tweaked installed, put down a computer and run "pastebin run 7keUMF7p" then the computer will restart. Click terminate in the top left, then run "edit startup" then in the startup the second line will say " local web = "" " put in the webview link(from your replit) in the quotation marks and replace https with wss. Ex: local web = "wss://scratchcraft.modog500000.repl.co" You will need this EXACT link later so copy it or hold onto it.
-
In scratch grab the Send data to block and in the link area put in your websocket "wss://scratchcraft.modog500000.repl.co" then any text must have return before it then any code in lua and it will run it. Do NOT send empty data or your script on the computer will crash. If it crashes then restart the computer.
Send data to WebSocket block
Block that tells you whether or not you are connected to a WebSocket, Will be more usefull when Send and Connect block are added.
Block that sends data with return concatenated to the front. TLDR sends a command that is forced to run as code in lua.
This block connects to a WebSocket server to use in other blocks.
This block sends data to the WebSocket saved from the connect block.
This block receives data from the WebSocket server.
Most of this extension was made by peicing parts together and bugtesting.
Rixxyx- Used their extension as a reference for making extensions
ogadaki and other contibuters to Adacraft- for the amazing platform that this extension was made for!