Last active
June 10, 2026 02:45
-
-
Save r33drichards/9fba5e8d140e6313dd53fd64550d10a4 to your computer and use it in GitHub Desktop.
does this CC computer load Lua 5.1 bytecode? (CC:T 1.109+ blocks it)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- bctest — does this computer's Lua load 5.1 bytecode? CC:Tweaked >= 1.109.0 | |
| -- refuses binary chunks, which disables wasmcraft's jit (compiled) mode — the | |
| -- engine then falls back to the interpreter automatically. This prints which | |
| -- world you're in. The probe chunk is a minimal valid 5.1 proto: "return 42". | |
| local bc = "\27\76\117\97\81\0\1\4\4\4\8\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\2\2\2\0\0\0\1\0\0\0\30\0\0\1\1\0\0\0\3\0\0\0\0\0\0\69\64\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" | |
| local f, lerr = (loadstring or load)(bc) | |
| if type(f) == "function" then | |
| local okrun, v = pcall(f) | |
| if okrun and v == 42 then | |
| print("bytecode loading WORKS (got " .. tostring(v) .. ") - jit mode available") | |
| return | |
| end | |
| print("chunk loaded but ran wrong: " .. tostring(v)) | |
| else | |
| print("bytecode loading BLOCKED: " .. tostring(lerr)) | |
| print("(CC:T >= 1.109 behavior - wasmcraft will use the interpreter instead)") | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment