loadYunLuaGroup("5C3C4E3813681C4C204C35346F1B4C2F7EFF612D2B22176FF346535E1C0B1E493339036EE15318") function init() stab = _ENV["分页"] ttitle = _ENV["标题"] xfcpic = _ENV["悬浮窗图标"] end local API = "http://loxl.top/api.php?api=kmlogon" local APPID = "10016" local isLogged = false local GAME_PKG = "com.Uys.xshy" local GAME_UID = "10631" local QQ_GROUP = "QQ企鹅群1087982634" function ultra(get) local ok, res = pcall(function() return gg.makeRequest(get) end) if not ok or not res or not res.content then return "" end return res.content end function cardLogin() gg.setVisible(false) gg.sleep(200) local hak = gg.prompt({"━━━━━━━━━━━━━━━━━━━━━━━━━━\n 🔑 卡 密 验 证\n━━━━━━━━━━━━━━━━━━━━━━━━━━\n\n请输入卡密"}, {""}, {"text"}) if hak == nil or hak[1] == "" then gg.setVisible(true) return end gg.toast("验证中...") local url = API .. "&app=" .. APPID .. "&kami=" .. hak[1] .. "&markcode=test" local HUT = ultra(url) if HUT == "" then gg.setVisible(true) gg.alert("网络错误") return end local code = HUT:match('"code":(%d+)') local msg = HUT:match('"msg":"([^"]+)"') if code == "200" then isLogged = true gg.alert("━━━━━━━━━━━━━━━━━━━━━━━━━━\n ✅ 验 证 成 功\n━━━━━━━━━━━━━━━━━━━━━━━━━━") else gg.alert("━━━━━━━━━━━━━━━━━━━━━━━━━━\n ❌ " .. (msg or "验证失败") .. "\n━━━━━━━━━━━━━━━━━━━━━━━━━━") end gg.setVisible(false) end function getLoginStatus() if isLogged then return "已验证" else return "未验证" end end function autoSelectProcess() local list = gg.getRangesList(GAME_UID) for i, v in ipairs(list) do if v.internalName:find(GAME_PKG) then gg.processToggle(v.start) return true end end return false end function getCurrentProcess() local p = gg.getTargetInfo() if p then return p.processName else return "未选择" end end function joinQQGroup() gg.copyText("1087982634") gg.alert("群号已复制: 1087982634\n\n请打开QQ手动加群") end local CACHE_DIR = gg.getFile():gsub("[^/]+$", "") .. "cache/" os.execute("mkdir -p " .. CACHE_DIR) local f1 = io.open(CACHE_DIR .. "config.lua", "r") local f2 = io.open(CACHE_DIR .. "functions.lua", "r") if f1 and f2 then f1:close() f2:close() dofile(CACHE_DIR .. "config.lua") dofile(CACHE_DIR .. "functions.lua") else gg.alert("━━━━━━━━━━━━━━━━━━━━━━━━━━\n ⏳ 首次加载中\n 请耐心等待...\n━━━━━━━━━━━━━━━━━━━━━━━━━━") local CLOUD_CONFIG = "https://raw.githubusercontent.com/565475gtddc/gg-script/main/config.lua" local CLOUD_FUNC = "https://raw.githubusercontent.com/565475gtddc/gg-script/main/functions.lua" local ok1, res1 = pcall(function() return gg.makeRequest(CLOUD_CONFIG) end) local ok2, res2 = pcall(function() return gg.makeRequest(CLOUD_FUNC) end) if ok1 and res1 and res1.content then local f = io.open(CACHE_DIR .. "config.lua", "w") f:write(res1.content) f:close() end if ok2 and res2 and res2.content then local f = io.open(CACHE_DIR .. "functions.lua", "w") f:write(res2.content) f:close() end dofile(CACHE_DIR .. "config.lua") dofile(CACHE_DIR .. "functions.lua") end local featureStates = {false, false, false, false, false, false, false} local modifiedData = {nil, nil, nil, nil, nil, nil, nil} function getActiveList() local active = {} for i = 1, 7 do if featureStates[i] then table.insert(active, FEATURE_NAMES[i]) end end if #active == 0 then return "未开启任何功能" else return "已开启: " .. table.concat(active, " · ") end end function enableFeature(index) if not isLogged then gg.alert("请先在设置页验证卡密") return end if gg.getTargetInfo() == nil then if not autoSelectProcess() then gg.alert("未找到游戏进程") return end end local data = functionData[index] if data then local ok, ttt = pcall(S_Pointer, data.t, data.tt, true) if not ok then gg.toast("功能开启失败") return end modifiedData[index] = {address = ttt, flags = data.flags, value = data.value, freeze = true} gg.addListItems({modifiedData[index]}) featureStates[index] = true gg.toast(FEATURE_NAMES[index] .. " 已开启") end end function disableFeature(index) if modifiedData[index] then gg.removeListItems({modifiedData[index]}) modifiedData[index] = nil end featureStates[index] = false gg.toast(FEATURE_NAMES[index] .. " 已关闭") end function allOn() if not isLogged then gg.alert("请先验证卡密") return end if gg.getTargetInfo() == nil then if not autoSelectProcess() then gg.alert("未找到游戏进程") return end end for i = 1, 7 do if not featureStates[i] then enableFeature(i) end end end function allOff() for i = 1, 7 do if featureStates[i] then disableFeature(i) end end end _ENV["悬浮窗图标"] = 'https://i.imgs.ovh/2026/05/23/af96563ffcf6093b09e4f1b363635d18.png' _ENV["标题"] = 'XH辅助' _ENV["分页"] = {'首页', '功能', '音乐', '修改', '设置'} init() uistart({ { CAtext('XH辅助', '#FF6B6B', '18sp', true), CAtext('作者: 屿', '#888888', '12sp', true), CAtext(''), CAtext(ANNOUNCEMENTS[math.random(1, #ANNOUNCEMENTS)], '#CCCCCC', '13sp'), CAtext(''), CAtext(getActiveList(), '#FF8E53', '12sp', true), CAtext(''), CAbutton('一键全开', function() allOn() end, '#FF6B6B'), CAbutton('一键全关', function() allOff() end, '#666666'), }, { CAswitch("一技能无冷却", function() enableFeature(1) end, function() disableFeature(1) end), CAswitch("二技能无冷却", function() enableFeature(2) end, function() disableFeature(2) end), CAswitch("无限奥义", function() enableFeature(3) end, function() disableFeature(3) end), CAswitch("密卷无冷却", function() enableFeature(4) end, function() disableFeature(4) end), CAswitch("通灵无冷却", function() enableFeature(5) end, function() disableFeature(5) end), CAswitch("替身无CD", function() enableFeature(6) end, function() disableFeature(6) end), CAswitch("改无敌", function() enableFeature(7) end, function() disableFeature(7) end), }, { CAtext('音乐功能开发中...', '#888888', '12sp', true), }, { CAtext('修改功能开发中...', '#888888', '12sp', true), }, { CAtext('作者: 屿', '#CCCCCC', '13sp'), CAtext(QQ_GROUP, '#FF8E53', '12sp'), CAtext(''), CAtext('卡密: ' .. getLoginStatus(), '#FF8E53', '12sp'), CAtext(''), CAbutton('输入卡密', function() cardLogin() end, '#FF6B6B'), CAtext(''), CAbutton('加入官方群', function() joinQQGroup() end, '#4CAF50'), CAtext(''), CAtext('游戏: ' .. getCurrentProcess(), '#4CAF50', '12sp'), CAtext(''), CAswitch("退出", function() allOff() Lock.unUi() end, function() end), }, }) Lock.Ui(invoke, nil, function(err) print(err) end)