Skip to content

Commit 514963f

Browse files
authored
Merge pull request #27 from kiccer/test
优化代码,使运行更高效
2 parents bbf023a + 78ccd41 commit 514963f

File tree

1 file changed

+11
-13
lines changed

1 file changed

+11
-13
lines changed

Soldier76.lua

+11-13
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@
55
-- 参考地址: https://github.com/kiccer/Soldier76#%E5%88%9D%E6%AC%A1%E4%BD%BF%E7%94%A8
66
userInfo = {
77

8+
-- 是否输出调试信息,关闭后可以减小 CPU 计算压力。建议调试时开启,调试完毕后关闭。(1 - 开启 | 0 - 关闭)
9+
debug = 1,
10+
11+
-- CPU 负载等级,建议输入 1 ~ 30 之间的数字,不能小于 1 。值越小,压枪效果越好,值越大,帧数越高。(过分掉帧会直接影响压枪效果,请在保证帧数的情况下减小该值)
12+
cpuLoad = 5,
13+
814
-- 灵敏度调整
915
sensitivity = {
1016
-- 开镜
@@ -191,8 +197,8 @@ pubg = {
191197
gunIndex = 1, -- 选中枪械下标
192198
counter = 0, -- 计数器
193199
xCounter = 0, -- x计数器
194-
sleep = 5, -- 频率设置 (这里不能设置成0,调试会出BUG)
195-
sleepRandom = { 5, 10 }, -- 防检测随机延迟
200+
sleep = userInfo.cpuLoad, -- 频率设置 (这里不能设置成0,调试会出BUG)
201+
sleepRandom = { userInfo.cpuLoad, userInfo.cpuLoad + 5 }, -- 防检测随机延迟
196202
startTime = 0, -- 鼠标按下时记录脚本运行时间戳
197203
prevTime = 0, -- 记录上一轮脚本运行时间戳
198204
scopeX1 = 1, -- 基瞄压枪倍率 (裸镜、红点、全息、侧瞄)
@@ -773,8 +779,9 @@ end
773779

774780
--[[ autputLog render ]]
775781
function pubg.outputLogRender ()
782+
if userInfo.debug == 0 then return false end
776783
ClearLog()
777-
local outputScriptMessage = table.concat({
784+
OutputLogMessage(table.concat({
778785
"\n>> [\"", pubg.renderDom.combo_key, "\"] = \"", pubg.renderDom.cmd, "\" <<\n",
779786
pubg.renderDom.separator,
780787
pubg.outputLogGunSwitchTable(),
@@ -783,16 +790,7 @@ function pubg.outputLogRender ()
783790
pubg.renderDom.separator,
784791
pubg.renderDom.autoLog,
785792
pubg.renderDom.separator,
786-
})
787-
OutputLogMessage(outputScriptMessage)
788-
789-
-- local file = io.open('C:\\Soldier76_outputScriptMessage.json', 'w+')
790-
-- file:write(table.concat({
791-
-- "{\n",
792-
-- "\toutputScriptMessage: '", outputScriptMessage, "'\n",
793-
-- "}\n",
794-
-- }))
795-
-- file:close()
793+
}))
796794
end
797795

798796
--[[ Output switching table ]]

0 commit comments

Comments
 (0)