-- ========================================== -- 速度之星 - 高颜值 UI 助手 (官方包名适配版) -- ========================================== -- ⚙️ 配置区:已经帮你改成官方包名 local TargetPackage = "com.lukedoukakis.speedstars" local DefaultSearchValue = "2.88750004768" local IsHooked = false -- 状态检测函数 local function GetProcessStatus() local info = gg.getTargetInfo() if not info then return "❌ 未选中", false end -- 如果完全匹配,显示绿色 if info.packageName == TargetPackage then return "✅ 官方正版", true -- 如果是之前那个乱码包名,也放行 elseif info.packageName == "com.eec6e1e69aeee6f6" then return "⚠️ 修改版进程", true -- 其他情况,只要是个APP,为了防误杀也放行,但显示当前包名 else return "❓ " .. info.packageName, true end end -- 核心功能:极速修改 local function ExecuteModify() local procText, isRight = GetProcessStatus() -- 只有在完全没选中进程(比如桌面)才拦截 if not isRight then gg.alert("🚫 警告:未选中游戏进程!\n请去修改器自带面板选中速度之星。") return end local listItems = gg.getListItems() local hasCache = false -- 检查已缓存的地址是否有效 if listItems and #listItems > 0 then local testVal = gg.getValues({{address = listItems[1].address, flags = gg.TYPE_FLOAT}})[1].value if testVal and testVal ~= 0 then hasCache = true else gg.clearList() end end if hasCache then -- 有缓存,直接极速修改 local input = gg.prompt({"[极速覆盖] 请输入新数值:"}, {"100"}, {"number"}) if not input or not input[1] then return end for i, v in ipairs(listItems) do v.value = input[1] v.freeze = true end gg.setValues(listItems) gg.toast("✅ 极速覆盖成功!已锁定为: " .. input[1]) else -- 首次搜索 local input = gg.prompt( {"[首次搜索] 原数值:", "修改为:"}, {DefaultSearchValue, "100"}, {"number", "number"} ) if not input or not input[1] or not input[2] then return end gg.toast("⏳ 正在搜索,请稍候...") gg.clearResults() -- 使用 AUTO 类型兼容性更好 gg.searchNumber(input[1], gg.TYPE_AUTO) local count = gg.getResultsCount() if count > 0 then gg.addListItems(gg.getResults(count)) local saved = gg.getListItems() for i, v in ipairs(saved) do v.value = input[2] v.freeze = true end gg.setValues(saved) DefaultSearchValue = input[1] gg.toast("✅ 抓取成功!锁定了 " .. count .. " 个数据。") else gg.alert("❌ 未搜到数值。\n\n建议:\n1. 确保已经进入比赛跑起来了。\n2. 或者在修改器里手动搜一下确认数据是否存在。") end end end -- 进程设置功能(允许你在UI里手动改包名) local function ManageProcess() local procText = GetProcessStatus() local input = gg.prompt( {"📱 当前选中:\n" .. procText .. "\n\n如需更改校验包名,请修改:"}, {TargetPackage}, {"text"} ) if input and input[1] then TargetPackage = input[1] gg.toast("✅ 目标包名已保存!") end end -- UI 渲染 local function ShowUI() local procText, isRight = GetProcessStatus() local listItems = gg.getListItems() local cacheCount = (listItems and #listItems > 0) and #listItems or 0 local cacheIcon = cacheCount > 0 and ("🟢 已抓取 ("..cacheCount..")") or "⚪ 未抓取" local titleUI = "▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬\n" .. " 🏎️ 速度之星 - 加速助手 \n" .. "▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬\n" .. " 🖥️ 进程: " .. procText .. "\n" .. " 📊 数据: " .. cacheIcon .. "\n" .. "▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬" local menu = gg.choice({ "▶️ 极速修改数值", "📱 查看/设置包名", "🧹 清空缓存数据", "❌ 彻底退出脚本" }, nil, titleUI) if menu == 1 then ExecuteModify() elseif menu == 2 then ManageProcess() elseif menu == 3 then gg.clearList(); gg.clearResults(); gg.toast("🧹 已清空缓存") elseif menu == 4 then os.exit() end end -- ========================================== -- 启动入口 (内置完美适配) -- ========================================== gg.setVisible(false) gg.toast("✅ 助手已加载!进游戏后点悬浮窗唤醒。") while true do if gg.isVisible() then gg.setVisible(false) if not IsHooked then IsHooked = true ShowUI() IsHooked = false end end gg.sleep(100) end