FileName = "jgyc.config" function TC() --退出功能 -- recover(); local config = qx0 .. "-" .. gj0 .. "-" .. fy0 .. "|" .. qx1 .. "-" .. gj1 .. "-" .. fy1 storeConfig(config) os.exit() end function open() if qx0 == nil then qx0 = 12000 end if fy0 == nil then fy0 = 50 end if gj0 == nil then gj0 = 400 end local data = gg.prompt({"统一修改值(空或0默认为100000)","原气血:","原攻击:","原防御:","是否加速"},{[1]=100000,[2] = qx0,[3] = gj0,[4] = fy0,[5]=1},{[1] = 'number',[2] = 'number',[3] = 'number',[4] = 'number',[5] = 'number'}) if data== nil then return end local xg = data[1] if xg == nil or xg == 0 then xg = 100000 end local str = data[2] .. ";" .. data[3] .. ";" .. data[4] .. "::41" gg.clearResults() gg.setRanges(gg.REGION_ANONYMOUS) gg.searchNumber(str, gg.TYPE_DWORD, false, gg.SIGN_EQUAL, 0, -1) local num = gg.getResultCount() srcdata = gg.getResults(num) if (srcdata ~= nil) then qx0 = srcdata[1].value gj0 = srcdata[2].value fy0 = srcdata[3].value gg.editAll(xg, gg.TYPE_DWORD) gg.toast("修改成功,注意恢复修改") else gg.toast("未搜索到相关数据"..str) end gg.clearResults() if tonumber(data[5]) == 1 then local str = "100~120;-1~0;1;0~1;1;2~3::25" gg.setRanges(gg.REGION_ANONYMOUS) gg.searchNumber(str, gg.TYPE_DWORD, false, gg.SIGN_EQUAL, 0, -1) gg.refineNumber("2", gg.TYPE_DWORD, false, gg.SIGN_GREATER_OR_EQUAL, 0, -1) gg.refineNumber("99", gg.TYPE_DWORD, false, gg.SIGN_LESS_OR_EQUAL, 0, -1) srcdata = gg.getResults(gg.getResultCount()) if (srcdata ~= nil) then gg.editAll("5", gg.TYPE_DWORD) gg.toast("加速修改成功") else gg.toast("未搜索到加速数据"..str) end end end function openless() if qx1 == nil then qx1 = 12000 end if fy1 == nil then fy1 = 50 end if gj1 == nil then gj1 = 400 end local data = gg.prompt({"统一修改值(空或0默认为100000)","原气血:","原攻击:","原防御:","是否加速"},{[1]=100000,[2] = qx1,[3] = gj1,[4] = fy1,[5]=1},{[1] = 'number',[2] = 'number',[3] = 'number',[4] = 'number',[5] = 'number'}) if data== nil then return end local xg = data[1] if xg == nil or xg == 0 then xg = 100000 end local str = data[2] .. ";" .. data[3] .. ";" .. data[4] .. "::41" gg.clearResults() gg.setRanges(gg.REGION_ANONYMOUS) gg.searchNumber(str, gg.TYPE_DWORD, false, gg.SIGN_EQUAL, 0, -1) local num = gg.getResultCount() srcdata1 = gg.getResults(num) if (srcdata1 ~= nil) then qx1 = srcdata1[1].value gj1 = srcdata1[2].value fy1 = srcdata1[3].value gg.editAll(xg, gg.TYPE_DWORD) gg.toast("修改成功,注意恢复修改") else gg.toast("未搜索到相关数据"..str) end gg.clearResults() if tonumber(data[5]) == 1 then local str = "100~120;-1~0;1;0~1;1;2~3::25" gg.setRanges(gg.REGION_ANONYMOUS) gg.searchNumber(str, gg.TYPE_DWORD, false, gg.SIGN_EQUAL, 0, -1) gg.refineNumber("2", gg.TYPE_DWORD, false, gg.SIGN_GREATER_OR_EQUAL, 0, -1) gg.refineNumber("99", gg.TYPE_DWORD, false, gg.SIGN_LESS_OR_EQUAL, 0, -1) srcdata = gg.getResults(gg.getResultCount()) if (srcdata ~= nil) then gg.editAll("5", gg.TYPE_DWORD) gg.toast("加速修改成功") else gg.toast("未搜索到加速数据"..str) end end end function recover() if srcdata ~= nil then gg.setValues(srcdata) end if srcdata1 ~= nil then gg.setValues(srcdata1) end gg.toast("恢复成功") end function loadConfig() local f = io.open(FileName,"r") if(f == nil )then return nil end local config = f:read() f:close() return config end function storeConfig(config) local f = io.open(FileName,"w") f:write(config) f:close() end function Split(szFullString, szSeparator) local nFindStartIndex = 1 local nSplitIndex = 1 local nSplitArray = {} while true do local nFindLastIndex = string.find(szFullString, szSeparator, nFindStartIndex) if not nFindLastIndex then nSplitArray[nSplitIndex] = string.sub(szFullString, nFindStartIndex, string.len(szFullString)) break end nSplitArray[nSplitIndex] = string.sub(szFullString, nFindStartIndex, nFindLastIndex - 1) nFindStartIndex = nFindLastIndex + string.len(szSeparator) nSplitIndex = nSplitIndex + 1 end return nSplitArray end function Main0() --功能主菜单 SN = gg.choice({ "关卡:修改血攻防", "无尽:修改血攻防", "恢复", "退出脚本", }, 1) if SN==1 then open() elseif SN==2 then openless() elseif SN==3 then recover() elseif SN==4 then TC() end XGCK = -1 end local config = loadConfig() if config ~= nil then local datas = Split(config,"|") local data1 = datas[1] if data1 ~= nil then Split(config,"-") qx0 = (data1[1] or 12000) + 0 gj0 = (data1[2] or 400) + 0 fy0 = (data1[3] or 50) + 0 else qx0 = 12000 gj0 = 400 fy0 = 50 end local data2 = datas[2] if data1 ~= nil then Split(config,"-") qx1 = (data2[1] or 12000) + 0 gj1 = (data2[2] or 400) + 0 fy1 = (data2[3] or 50) + 0 else qx1 = 12000 gj1 = 400 fy1 = 50 end else qx0 = 12000 gj0 = 400 fy0 = 50 qx1 = 12000 gj1 = 400 fy1 = 50 end while true do if gg.isVisible(true) then XGCK = 1 gg.setVisible(false) end gg.clearResults() if XGCK == 1 then Main0() end end