ZERO_ 開頭的識別字都保留給巨集使用,請勿拿來當一般變數名稱。
在腳本開頭放上這段「墊片」。混淆時,整個 if not ZERO_OBFUSCATED then … end 區塊會被整段移除,
裡面的巨集呼叫則會被替換成真正的實作。
if not ZERO_OBFUSCATED then
function ZERO_ENCSTR(s, ...) return s end -- 綁定版多帶的 key/expr 直接忽略
function ZERO_ENCBUF(s, ...) return s end
function ZERO_ENCNUM(n, ...) return n end
function ZERO_REWRITE(e, ...) return e end
function ZERO_STACKALLOC(n) return table.create and table.create(n) or {} end
function ZERO_CRASH() end
function ZERO_PRECHECK(f, k) end
ZERO_LINE = 0
end
墊片必須宣告為全域(function ZERO_X 或 ZERO_X = ...);宣告成 local 不會被正確移除。
| 巨集 | 說明 |
|---|---|
ZERO_OBFUSCATED | 值。混淆時為 true。if ZERO_OBFUSCATED then A else B end 只會保留 A,B 會被整段移除。 |
ZERO_LINE | 值。會被替換成目前的行號(可用於除錯或環境校驗)。 |
ZERO_ENCSTR(s)ZERO_ENCSTR(s, key, expr)別名 ZERO_STRENC | 加密字串常數(RC4 常數池,用到才解)。 綁定版 (s, key, expr):key 為編譯期常數、expr 為執行期運算式;只有 expr==key 才解得出原文,否則解出垃圾且不報錯 → 離線 sandbox/解包 bot 拿不到正確 expr 就解不開。 |
ZERO_ENCNUM(n)ZERO_ENCNUM(n, {[expr]=int})別名 ZERO_NUMENC | 加密數字常數。 綁定版 keyTable 用 { [執行期運算式] = 預期整數 }(最多 8 組);每個運算式都要等於其預期整數才正確還原。 |
ZERO_ENCBUF(s)ZERO_ENCBUF(s, key, expr)別名 ZERO_BUFENC | 同 ZERO_ENCSTR,但回傳 buffer(Luau buffer.fromstring)。綁定語意相同。 |
ZERO_CRASH() | 硬化中止:靜默死迴圈+記憶體填塞。比 error 難繞——pcall 無法逃脫、無堆疊線索、dumper 拿不到輸出。 |
ZERO_REWRITE(expr)ZERO_REWRITE(expr, opts) | MBA 等式改寫(保值)。opts 可為 "fast"/"standard"/"strong"/"extreme" 或 { preset = "strong" };preset 越高改寫越深。只對無副作用的子運算式套用。 |
ZERO_STACKALLOC(size) | 預先配置 size 格陣列(Luau table.create;無此 API 退回一般表)。size 須為數字常數。 |
ZERO_PRECHECK(fn, key) | 前置白名單/反竄改/環境驗證。載入時執行 fn,結果不等於 key 就中止;fn 須為無參數匿名函式。key 可為單一整數或整數表 {a,b,c}。 |
-- 授權檢查:從你的端點取回序號,不符即中止(key 用來加密主體,離線改不動)
ZERO_PRECHECK(function() return tonumber(game:HttpGet("https://auth.example.net/")) or 0 end, 0x12345678)
-- 執行期金鑰(由環境算出,sandbox 算不出正確值)
local rk = 0
pcall(function() local p=game:GetService("Players").LocalPlayer rk=(p and p.UserId or 0)%0xFFFF end)
-- 敏感常數:綁定執行期金鑰(expr 要等於 key 才解得出)
local secret = ZERO_ENCSTR("這是一段不想被看見的字串", 0x5A17, rk)
local code = ZERO_ENCNUM(1337, { [rk] = rk })
local buf = ZERO_STACKALLOC(64)
local v = ZERO_REWRITE((a + b) - c, { preset = "strong" })
if 環境不對 then ZERO_CRASH() end
ZERO_ENCSTR(s,key,expr) / ZERO_ENCNUM(n,{...}))+ ZERO_PRECHECK;單參數版方便但常數本質可被靜態摺疊。發布時,系統預設會把整份腳本(含所有巢狀函式)編譯成位元碼,交由注入的直譯器執行。
支援:區域變數/upvalue、閉包、遞迴、多重回傳、varargs、方法呼叫、資料表、
if / while / repeat / for / generic-for、break / continue 與全部運算子。
--[[ @no-vm ]]。ZERO_PRECHECK 的函式不能有 upvalue(只能讀全域,例如 game、getgenv())。@no-obfuscate)已在本次更新中移除,改為全自動偵測。--[[ @no-vm ]]。先點一顆(會發亮),再按「儲存」就會照那顆發布;不選任何一顆 = 只儲存草稿。
| 按鈕 | 腳本內容 | 存取權 | 適合 |
|---|---|---|---|
| ① 混淆 + 保護 | 混淆後 | 需金鑰,瀏覽器一律擋 | 對外發佈、不想被抄(建議預設) |
| ② 混淆、不保護 | 混淆後 | 任何人都能拿 | 公開分享,但不想被看懂 |
| ③ 不混淆 + 保護 | 原始碼 | 需金鑰 | 自己/團隊內部用、要能直接改 |
| ④ 不混淆、不保護 | 原始碼 | 任何人都能拿 | 測試、備份、公開原始碼 |
「需金鑰」= 只有在 loadstring 帶對 ?key=... 才能下載;直接貼網址到瀏覽器只會看到 ACCESS DENIED 頁。 腳本卡片上的 Rotate Key 可隨時換金鑰(舊的立刻失效)。
| 指令 | 效果 | 什麼時候用 |
|---|---|---|
| (不加) | 自動:改名+字串加密+數值拆解;並自動決定要不要 VM | 平常都用這個 |
| --[[ @vm ]] | 強制整份 VM 化(保護最強) | 想要最高保護、且執行起來不卡 |
| --[[ @no-vm ]] | 不做 VM,只做改名+字串加密+數值拆解 | 腳本一跑就卡、或想縮小體積 |
| --[[ @no-rc4 ]] | 跳過 RC4:字串改用基本編碼(LCG 串流 XOR)。少了每次呼叫的 256 回合 KSA → 載入更快、保護略降 | 字串很多、載入偏慢 |
| --[[ @vm-lite ]] | 選擇性 VM 加強版:函式只要含任何迴圈或事件回呼(:Connect/task.spawn 等)就保留原生,只把冷碼丟進 VM | 要順又不想放棄 VM |
| --[[ @fast ]] | 效能優先組合 = 選擇性 VM + 不 RC4 + 不 Prometheus(仍保留改名+基本字串保護) | 只想順順跑 |
| --[[ @strong ]] | 保護優先組合 = 整份 VM + RC4 + Prometheus | 保護第一,可接受較慢 |
組合與優先序:組合是基準,個別旗標會覆蓋它(例:@strong + @no-rc4 → 仍整份 VM + Prometheus,但不 RC4)。 同時寫 @fast 與 @strong → @strong 勝;相反旗標(@vm/@no-vm、@prom/@no-prom)衝突會記錄在發布統計 macroConflict;未知的 @xxx 記在 macroUnknown。
自動規則(重點):大腳本也會 VM;只有偵測到高頻/無限迴圈(例:while true do ... wait())時才自動跳過 VM,因為那種迴圈每秒跑上萬次,丟進 VM 直譯器會像卡死。想硬開就加 @vm。
進階(可選、實驗性):--[[ @prom ]] 會在我們那層之外再加一層 Prometheus(AntiTamper); --[[ @prom-vm ]] 另外啟用 Prometheus 自帶 VM(需執行器支援 getfenv/unpack,且超過 60KB 會自動跳過以免伺服器超時)。 不確定就用預設就好。
直接寫在程式碼裡,發布時自動生效;平常不需要用,想要更精細的控制再用。
| 巨集 | 作用 | 例子 |
|---|---|---|
| ZERO_OBFUSCATED | 混淆時為 true,未混淆時為 nil。用來「只在混淆版才執行」的區塊 | if ZERO_OBFUSCATED then 防護碼 end |
| ZERO_LINE | 目前的行號(數字),適合除錯訊息 | warn("L"..ZERO_LINE) |
| ZERO_ENCSTR(s) ZERO_STRENC(s) | 把字串加密後才寫進檔案(檔案裡看不到原文) | local k = ZERO_ENCSTR("my key") |
| ZERO_ENCNUM(n) ZERO_NUMENC(n) | 把數字加密(檔案裡看不到原始數字) | local id = ZERO_ENCNUM(12345) |
| ZERO_ENCBUF(s) | 字串→加密 buffer(要對 byte 做處理時用) | local b = ZERO_ENCBUF("abc") |
| ZERO_REWRITE(e[, opts]) | MBA 等式改寫(保值);opts 可選 "fast/standard/strong/extreme" | local n = ZERO_REWRITE(100 + 23, "strong") |
| ZERO_STACKALLOC(n) | 預配 n 格陣列(table.create) | local t = ZERO_STACKALLOC(64) |
| ZERO_PRECHECK(f, k) | 前置檢查:只有 f()==k 才繼續,否則中止 | ZERO_PRECHECK(function() return 12345 end, 12345) |
| ZERO_CRASH() | 硬化中止:靜默死迴圈+填塞(pcall 逃不掉) | if bad then ZERO_CRASH() end |
🔒 執行期金鑰綁定(對抗離線解包):ZERO_ENCSTR(s, key, expr)、ZERO_ENCNUM(n, {[expr]=int}) —— 只有 expr==key 才解得出,sandbox 拿不到正確值就解出垃圾。詳見上方「二、巨集一覽」。
⚠️ 這些名稱不要自己取成別的,也不要 local 它們;原碼直接跑也可以(未混淆時它們會退化成無害的替代品)。
1) 面板設定(一次性):
① /rt-console.html → 選單選定腳本 ② 按「Discord Webhook 設定」→ 貼網址(只存 server,永不下發)
③(可選)「Discord Embed 回報」:啟用後日誌以欄位式卡片呈現,欄位可用佔位符
④「測試發送」→ 確認 Discord 有收到 → 按「儲存設定」(不按就不會生效)
2) 腳本內(貼上即用):
local F = YLI.flags
-- ① init(base=面板網址、script=shortcode、key=access key)
local ok = F.init({
base = "https://yli-panel.vercel.app/api",
script = "<shortcode>", key = "<access key>",
defaults = { AutoFarm = false }, -- flags 預設值(斷網時用)
})
if not ok then warn("oracle init fail(斷網或金鑰錯)") end
-- ② 簡單文字日誌(Embed 開啟時自動套面板模板)
F.log("dungeon_done", { floor = 3, secs = 121 })
-- ③ 執行紀錄(最常用):自動蒐集玩家/執行器/設備/名單
F.report() -- 可覆蓋欄位:F.report({ note = "VIP user" })
-- ④ 開場顯示(面板「開啟腳本時顯示」的內容)
local d = F.display()
if d then print(d.title .. ": " .. d.message) end
3) API 一覽:
F.init(cfg) 取 session+flags(失敗回 false);
F.log(event, data) 一條日誌→中控→Discord(失敗 false);
F.report(extra) 執行紀錄 embed(面板勾「自動回報」時 init 後自動延遲 8 秒送);
F.display() 開場顯示 {title,message,accent}(未啟用回 nil);
F.is(key[, default]) / F.onChange(key, fn) 讀旗標/監聽變更;
F.decide(state) 狀態上雲求決策(失敗 nil)。
4) Embed 佔位符(面板模板可用,server 端填): {player} {displayname} {userid} {executor} {device} {serverPlayers} {serverList} {execCount} {time} {scriptId} {script}
5) Anti-Spam 規則(違反即 429、不轉發):
同腳本+IP 每秒最多 3 次(滑動 5 秒窗)→ rt.log_rate_limited;
30 秒內完全相同的 event+data → rt.duplicate;
event 1-64 字元、data ≤6000 字元。日誌別寫迴圈內,遊戲事件觸發即可。