- Lua 98.7%
- Python 1%
- JavaScript 0.3%
Writing down how the suites fit together surfaced a real defect: the two
turtle runners each trusted exactly one signal from their child processes,
and each was blind to what the other caught.
JAQP trusted output only -> a test printing a clean summary and then
exiting 1 was reported PASS.
DeepDig trusted exit code only -> a suite printing 'failed: 2' while exiting
0 was reported PASS.
Both now require a clean exit status AND a zero-failure summary, and name
which signal failed. Verified by injecting each fault: previously PASS, now
correctly FAIL, and a clean run of both is still green.
.claude/testing.md records the suite map, the working-directory and
summary-string traps, why an uncalled suite is invisible, and how orphaned
work hides in stale feature branches. Linked from CLAUDE.md and .claude/README.md.
|
||
|---|---|---|
| .claude | ||
| AppStore | ||
| ATMCooking | ||
| Billboard | ||
| CC-Template | ||
| CC-VSCode | ||
| DeepDig | ||
| Documentation | ||
| JAQP | ||
| Jukebox | ||
| Midi | ||
| Mpod | ||
| MusicKit | ||
| Radio | ||
| self-dev | ||
| .gitignore | ||
| .luarc.json | ||
| CLAUDE.md | ||
| README.md | ||
| run_all_tests.lua | ||
| test_no_audio.lua | ||
| verify_live_install.lua | ||
Sponge's Scripts
Lua programs for CC: Tweaked (and a little Advanced Peripherals), developed against All The Mods 10. Music players, a wireless radio network, turtle miners, big scrolling signs, and an app store to install them all.
Everything here is tested headlessly against a mock CC API before it ever
reaches a world: 12 suites, over 2200 assertions (including the two turtle
miners, which simulate a whole world offline), run with
lua run_all_tests.lua. verify_live_install.lua goes further and runs the
real installers against a real filesystem, downloading from the real URLs.
On older Minecraft (1.12.2 packs such as RLCraft): streaming audio needs CC: Tweaked 1.100.0, which requires Minecraft 1.13+. Those packs are frozen on CC:T 1.89.2, so Mpod, Jukebox and Radio cannot run there and the App Store will say so rather than letting you install them. Use the MIDI Player instead: it makes music with note blocks and works on every version.
Start here: the App Store
One command on a fresh computer, and you can install everything else from a menu, no URLs to remember.
wget run https://git.unityailab.com/Sponge/SpongesScripts/raw/branch/main/AppStore/install.lua
Then run appstore.
It groups programs by what they run on (Turtle / Computer / Phone), detects what's already installed, offers install, update and uninstall, and can update itself so new programs appear without touching each computer by hand.
Everything, at a glance
| Program | Runs on | What it does |
|---|---|---|
| AppStore | any | Installs everything else. Categories, search, updates. |
| Radio | computer + pocket | Shared music stations over wireless. One host, unlimited listeners. |
| Jukebox | advanced computer | Full music player; mirrors to a monitor. |
| Mpod | noisy pocket computer | Pocket music player, iPod style, with a Radio app. |
| MIDI Player | any + speaker | Note block music from MIDI files. Works on every CC version, including Minecraft 1.12.2. |
| Billboard | computer + monitor | Huge scrolling text on remote screens. |
| DeepDig | mining turtle | Quarries, strip mines, staircases, ore hunting. |
| JAQP | mining turtle | Square quarry with a walkable staircase. |
| ATMCooking | crafty turtle | Automated fries. Not packaged yet; copy fries.lua by hand. |
Support folders, not programs: MusicKit (shared libraries), CC-Template (project skeleton with autocomplete), CC-VSCode (VS Code extension), Documentation (vendored upstream references), Examples (reference projects).
Install commands
Every program can also be installed directly, without the store. Run these in game on the computer that will use them.
App Store (recommended first)
wget run https://git.unityailab.com/Sponge/SpongesScripts/raw/branch/main/AppStore/install.lua
Radio -- a station, or a listener
wget run https://git.unityailab.com/Sponge/SpongesScripts/raw/branch/main/Radio/install.lua
Jukebox -- music player for an advanced computer
wget run https://git.unityailab.com/Sponge/SpongesScripts/raw/branch/main/Jukebox/install.lua
Mpod -- pocket music player
wget run https://git.unityailab.com/Sponge/SpongesScripts/raw/branch/main/Mpod/install.lua
MIDI Player -- note block music, works on every CC version
wget run https://git.unityailab.com/Sponge/SpongesScripts/raw/branch/main/Midi/install.lua
Billboard -- scrolling text on monitors
wget run https://git.unityailab.com/Sponge/SpongesScripts/raw/branch/main/Billboard/install.lua
DeepDig -- turtle mining
wget run https://git.unityailab.com/Sponge/SpongesScripts/raw/branch/main/DeepDig/install.lua
JAQP -- turtle quarry
wget run https://git.unityailab.com/Sponge/SpongesScripts/raw/branch/main/JAQP/install.lua
What each one needs, and how to run it
Radio -- radio
A radio station. The host fetches music from the internet and broadcasts it over wireless; everyone tuned in hears the same thing at the same time. Ten stations, so people who dislike one can tune elsewhere. Listeners can request songs and vote to skip, but can't pause or skip on their own.
- Host: a computer with a modem. No speaker needed (it's a transmitter).
- Listener: a computer or pocket computer with a modem and a speaker.
- Listeners need no internet access: the host does the fetching.
- Also installs
radio_check, a diagnostic that reports your hardware, whether the relay answers, and every station it can hear.
MIDI Player -- midiplay
Music from MIDI files, played through note blocks rather than streamed audio, so it works on every version of CC: Tweaked, including the 1.89.2 that Minecraft 1.12.2 packs like RLCraft are stuck on.
- Needs a speaker, or a Noisy Pocket Computer. No internet once songs are on.
- Add music in game with
getmidi: paste a link to a.midfile and it downloads, converts and adds it, then deletes the MIDI. Any MIDI type works (.mid,.midi,.smf,.kar,.rmi). - Or convert in bulk on your own PC with
lua midi2cc.lua song.midand copy the.ccminto/midi/songs. - The display adapts to a pocket computer, a computer, or a monitor for the whole room.
Songs are about 3 bytes per note, so a 1 MB computer holds tens of songs.
Jukebox -- jukebox
The full-size music player. Search with scrolling results, a queue you can reorder, play/pause/skip, loop, shuffle, volume, and a spectrum visualiser. Attach a monitor and the interface appears there too, laid out for its size, while the computer keeps the keyboard for typing searches.
- An advanced computer and a speaker. Monitor optional.
Mpod -- mpod
A pocket music player with a home screen of apps, including a Radio app for tuning into a station. Page 2 of the home screen holds the App Store and anything you install through it.
The installer offers two modes. Portable gives you the mpod command and
leaves the computer usable for everything else. Boot player (kiosk) starts
Mpod on boot so the pocket computer becomes a dedicated music player; there is
no mpod command in that mode, and you leave it by deleting /startup.lua.
- An Advanced Noisy Pocket Computer (the noisy variant has the speaker).
Billboard -- billboard
Broadcast a message from one computer and show it, huge and scrolling, on any number of remote screens. Includes a draggable speed slider, ten named networks, and optional signing so nobody can hijack your screens.
- Two computers with modems, and a monitor on each display.
DeepDig -- deepdig
Quarries, strip mines, staircases and targeted ore hunting, with fuel management that won't strand the turtle at the bottom of a hole. Saves progress, so it survives reboots and chunk unloads.
- A mining turtle with fuel.
JAQP -- jaqp (GUI) or JAQP (direct)
Mines a square NxN pit layer by layer, optionally cutting a walkable perimeter staircase. Refuels itself and resumes after a reboot.
- A mining turtle. A dump chest is recommended.
Requirements
- CC: Tweaked 1.100.0+ for the music programs (they use
cc.audio.dfpwm). - HTTP enabled in the CC config (on by default) for anything that installs itself or streams music. Radio listeners are the exception: they need none.
- Advanced (colour) computers for the music programs and the store. The turtle programs are happy on basic ones.
- Music streams through a shared community relay, the same one used by terreng's streaming player. Nothing to self-host; please be kind to it.
Getting out of trouble
Anything that can auto-start on boot always installs an escape hatch: on
boot you get a 3-second "press any key for the shell" countdown, and the program
is run once rather than in a relaunch loop, so quitting or Ctrl+T always
lands you back at CraftOS. To remove auto-start entirely, delete /startup.lua
(your previous one, if any, is at /startup.lua.bak).
For the radio specifically, radio_check tells you apart the three failures
that look identical from the outside: wrong station number, wrong key, and out
of range.
For developers
lua run_all_tests.lua # everything: 12 suites, offline (~2 min)
lua verify_live_install.lua # the real thing: downloads and installs for real
cd Radio && lua run_tests.lua # one project
verify_live_install.lua is the closest thing to an in-game test that runs
outside Minecraft. It downloads the actual files from the actual URLs that
wget run uses, runs the real installers against a temporary disk under a
CC API shim, and checks that every file lands where the App Store catalog says,
that all 58 installed Lua files compile, that the config matches the answers
given, and that a host and a listener built from the installed Radio files
exchange signed messages correctly (with the shipped SHA-256 checked against the
published NIST vector). It skips itself when offline.
The tests load the real program files under a mock CC: Tweaked API and assert against what actually gets drawn, clicked and transmitted. A simulated rednet runs real hosts and clients against each other. Repo-wide guards check that shared libraries copied into each program haven't drifted, that installers ship every file they need, and that no event loop can quit the program on a hardware check.
Read CLAUDE.md and .claude/ before writing Lua here. The most important
thing: CC: Tweaked is Lua 5.2, with no integer subtype and no bitwise
operators (use bit32).
Layout: each project is a folder with its own README.md, install.lua,
run_tests.lua, and a lib/ where it needs one.
Credits
Music streaming engine and relay by terreng (MIT). Everything else by Sponge.