- Open TurboWarp
- Click the extension button (+) at the bottom left
- Scroll down and click "Custom Extension"
- Click "Choose Extension File"
- Select
line-us-extension.js
If you're making changes and want faster iteration:
-
Start a local server in this directory:
# Python 3 python3 -m http.server 8080 # Python 2 python -m SimpleHTTPServer 8080 # Node.js (if you have http-server installed) npx http-server -p 8080
-
In TurboWarp's custom extension dialog, enter:
http://localhost:8080/line-us-extension.js
- Copy the contents of
line-us-extension.js - In TurboWarp's custom extension dialog, click "Paste Extension Code"
- Paste the code
- Extension Structure: Converted from function wrapper to ES6 class
- Block Definitions: Updated to Scratch 3.0
getInfo()format - Async Handling: All functions now return Promises instead of using callbacks
- Menu System: Updated to new menu format
- Color Scheme: Added extension colors
- Extension loads without errors
- All blocks appear in the block palette
- Connection block works (test with Line-us robot if available)
- Movement commands function properly
- Pen up/down commands work
- Speed settings apply correctly
- G-code sending works
- Disconnection works properly
- Projects using this extension cannot be uploaded to scratch.mit.edu
- Requires TurboWarp's unsandboxed extension environment
- WebSocket connections require Line-us robot on same network
Extension won't load:
- Check browser console for JavaScript errors
- Ensure you're using TurboWarp, not regular Scratch
- Make sure file path is correct if using local server
Can't connect to Line-us:
- Verify Line-us is on same network
- Check Line-us hostname/IP address
- Ensure Line-us firmware supports WebSocket connections