-- ========================================== -- 速度之星 - 高颜值 UI 助手 (内置完美适配版) -- ========================================== -- ⚙️ 配置区 local TargetPackage = "com.eec6e1e69aeee6f6" 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 else return "⚠️ 选错进程", false end end -- 核心功能:极速修改 local function ExecuteModify() local procText, isRight = GetProcessStatus() if not isRight then gg.alert("🚫 警告:当前进程不正确!\n\n当前选中:\n" .. procText .. "\n\n目标包名:\n" .. TargetPackage .. "\n\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("✅ 极速覆盖成功!") 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 类型,有时候内置环境 Float 会出bug 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请确保你已经进入了比赛,且游戏正在跑动中!") end end end -- 进程设置功能 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 procIcon = isRight and "🟢 已绑定" or "🔴 异常" local cacheIcon = cacheCount > 0 and ("🟢 已抓取 ("..cacheCount..")") or "⚪ 未抓取" local titleUI = "▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬\n" .. " 🏎️ 速度之星 - 加速助手 \n" .. "▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬\n" .. " 🖥️ 进程: " .. procIcon .. "\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) -- 💡 核心修复:内置脚本不要立刻弹UI,等游戏加载一下 -- 如果你不想看到提示,可以把下面这行 toast 删掉 gg.toast("✅ 脚本已静默启动,点击悬浮窗唤醒菜单") -- 死循环潜伏(完全不占用游戏启动时间) while true do -- 当玩家点击修改器悬浮窗时,拦截并弹UI if gg.isVisible() then gg.setVisible(false) if not IsHooked then IsHooked = true ShowUI() IsHooked = false end end gg.sleep(100) end