@@ -31,7 +31,7 @@ userInfo = {
31
31
autoPressAimKey = " " ,
32
32
33
33
-- 是否自动连发 (单发模式变全自动 1 - 开启, 0 - 关闭)
34
- autoContinuousFiring = 1 , -- 默认为 1
34
+ -- autoContinuousFiring = 1, -- 默认为 1
35
35
36
36
-- 启动控制 (capslock - 使用大写锁定键控制 | numlock - 小键盘锁定键控制 | G_bind - 使用指令控制)
37
37
startControl = " capslock" ,
@@ -51,31 +51,31 @@ userInfo = {
51
51
end ,
52
52
},
53
53
54
- -- 支持的枪械,排列顺序即是配置顺序,可以自行调整,不需要的枪械请设置为0,需要的设置为1。
54
+ -- 支持的枪械,排列顺序即是配置顺序,可以自行调整,不需要的枪械请设置为 0 ,需要的设置为 1 ,需要单独启用自动连发的设置为 2
55
55
canUse = {
56
56
[" .45" ] = {
57
- { " UMP45" , 1 }, -- 基础镜 + 扩容,Bizon (基础镜即可),Vector (补偿 + 基础镜 + 扩容) | Reddot + Mag,Bizon (Reddot),Vector (Komp + Reddot + Mag)
58
- { " Tommy Gun" , 1 }, -- 扩容 | Mag
57
+ { " UMP45" , 2 }, -- 基础镜 + 扩容,Bizon (基础镜即可),Vector (补偿 + 基础镜 + 扩容) | Reddot + Mag,Bizon (Reddot),Vector (Komp + Reddot + Mag)
58
+ { " Tommy Gun" , 2 }, -- 扩容 | Mag
59
59
},
60
60
[" 9mm" ] = {
61
- { " Vector" , 1 }, -- 基础镜 + 扩容 | Reddot + Mag
62
- { " Micro UZI" , 1 }, -- 扩容 | Mag
61
+ { " Vector" , 2 }, -- 基础镜 + 扩容 | Reddot + Mag
62
+ { " Micro UZI" , 2 }, -- 扩容 | Mag
63
63
},
64
64
[" 5.56" ] = {
65
- { " M416" , 1 }, -- 补偿 + 基础镜 + 直角 + 枪托 + 扩容 | Komp + Reddot + Triangular grip + Gunstock + Mag
66
- { " SCAR-L" , 1 }, -- 补偿 + 基础镜 + 直角 + 扩容 | Komp + Reddot + Triangular grip + Mag
67
- { " QBZ" , 1 }, -- 补偿 + 基础镜 + 直角 + 扩容 | Komp + Reddot + Triangular grip + Mag
68
- { " G36C" , 1 }, -- 补偿 + 基础镜 + 直角 + 扩容 | Komp + Reddot + Triangular grip + Mag
69
- { " M16A4" , 1 }, -- 补偿 + 基础镜 + 枪托 + 扩容 | Komp + Reddot + Gunstock + Mag
65
+ { " M416" , 2 }, -- 补偿 + 基础镜 + 直角 + 枪托 + 扩容 | Komp + Reddot + Triangular grip + Gunstock + Mag
66
+ { " SCAR-L" , 2 }, -- 补偿 + 基础镜 + 直角 + 扩容 | Komp + Reddot + Triangular grip + Mag
67
+ { " QBZ" , 2 }, -- 补偿 + 基础镜 + 直角 + 扩容 | Komp + Reddot + Triangular grip + Mag
68
+ { " G36C" , 2 }, -- 补偿 + 基础镜 + 直角 + 扩容 | Komp + Reddot + Triangular grip + Mag
69
+ { " M16A4" , 2 }, -- 补偿 + 基础镜 + 枪托 + 扩容 | Komp + Reddot + Gunstock + Mag
70
70
},
71
71
[" 7.62" ] = {
72
- { " AKM" , 1 }, -- 补偿 + 基础镜 + 扩容 | Komp + Reddot + Mag
73
- { " Beryl M762" , 1 }, -- 补偿 + 基础镜 + 直角 + 扩容 | Komp + Reddot + Triangular grip + Mag
74
- { " DP-28" , 1 }, -- 基础镜 | Reddot
72
+ { " AKM" , 2 }, -- 补偿 + 基础镜 + 扩容 | Komp + Reddot + Mag
73
+ { " Beryl M762" , 2 }, -- 补偿 + 基础镜 + 直角 + 扩容 | Komp + Reddot + Triangular grip + Mag
74
+ { " DP-28" , 2 }, -- 基础镜 | Reddot
75
75
},
76
76
},
77
77
78
- -- G键自定义绑定
78
+ -- G键自定义绑定,多余的组合键可以删除
79
79
-- 可绑定指令请参考: https://github.com/kiccer/Soldier76#%E6%8C%87%E4%BB%A4%E5%88%97%E8%A1%A8
80
80
G_bind = {
81
81
-- G
@@ -92,12 +92,12 @@ userInfo = {
92
92
[" lalt + G3" ] = " " ,
93
93
[" lalt + G4" ] = " " ,
94
94
[" lalt + G5" ] = " " ,
95
- [" lalt + G6" ] = " scopeX1 " ,
96
- [" lalt + G7" ] = " scopeX3 " ,
97
- [" lalt + G8" ] = " scopeX4 " ,
98
- [" lalt + G9" ] = " scopeX2 " ,
95
+ [" lalt + G6" ] = " " ,
96
+ [" lalt + G7" ] = " " ,
97
+ [" lalt + G8" ] = " " ,
98
+ [" lalt + G9" ] = " " ,
99
99
[" lalt + G10" ] = " " ,
100
- [" lalt + G11" ] = " scopeX6 " ,
100
+ [" lalt + G11" ] = " " ,
101
101
-- lctrl + G
102
102
[" lctrl + G3" ] = " " ,
103
103
[" lctrl + G4" ] = " " ,
@@ -142,7 +142,7 @@ userInfo = {
142
142
[" rshift + G3" ] = " " ,
143
143
[" rshift + G4" ] = " " ,
144
144
[" rshift + G5" ] = " " ,
145
- [" rshift + G6" ] = " " ,
145
+ [" rshift + G6" ] = " fast_discard " ,
146
146
[" rshift + G7" ] = " " ,
147
147
[" rshift + G8" ] = " " ,
148
148
[" rshift + G9" ] = " " ,
@@ -278,7 +278,7 @@ pubg["M16A4"] = function ()
278
278
return pubg .execOptions ({
279
279
ratio = 1 ,
280
280
interval = 108 ,
281
- autoContinuousFiring = 1 ,
281
+ -- autoContinuousFiring = 1,
282
282
ballistic = {
283
283
{1 , 0 },
284
284
{2 , 140 },
@@ -299,7 +299,7 @@ pubg["SCAR-L"] = function ()
299
299
return pubg .execOptions ({
300
300
ratio = 1 ,
301
301
interval = 102 ,
302
- autoContinuousFiring = 1 ,
302
+ -- autoContinuousFiring = 1,
303
303
ballistic = {
304
304
{1 , 0 },
305
305
{2 , 140 },
@@ -321,7 +321,7 @@ pubg["Beryl M762"] = function ()
321
321
return pubg .execOptions ({
322
322
ratio = 1 ,
323
323
interval = 93 ,
324
- autoContinuousFiring = 1 ,
324
+ -- autoContinuousFiring = 1,
325
325
ballistic = {
326
326
{1 , 0 },
327
327
{2 , 140 },
@@ -344,7 +344,7 @@ pubg["Tommy Gun"] = function ()
344
344
return pubg .execOptions ({
345
345
ratio = 1 ,
346
346
interval = 94 ,
347
- autoContinuousFiring = 1 ,
347
+ -- autoContinuousFiring = 1,
348
348
ballistic = {
349
349
{1 , 0 },
350
350
{5 , 71 },
@@ -361,7 +361,7 @@ pubg["G36C"] = function ()
361
361
return pubg .execOptions ({
362
362
ratio = 1 ,
363
363
interval = 91 ,
364
- autoContinuousFiring = 1 ,
364
+ -- autoContinuousFiring = 1,
365
365
ballistic = {
366
366
{1 , 0 },
367
367
{2 , 135 },
@@ -380,7 +380,7 @@ pubg["Vector"] = function ()
380
380
return pubg .execOptions ({
381
381
ratio = 1 ,
382
382
interval = 61 ,
383
- autoContinuousFiring = 1 ,
383
+ -- autoContinuousFiring = 1,
384
384
ballistic = {
385
385
{1 , 0 },
386
386
{5 , 52 },
@@ -398,7 +398,7 @@ pubg["Micro UZI"] = function ()
398
398
return pubg .execOptions ({
399
399
ratio = 1 ,
400
400
interval = 56 ,
401
- autoContinuousFiring = 1 ,
401
+ -- autoContinuousFiring = 1,
402
402
ballistic = {
403
403
{1 , 0 },
404
404
{2 , 80 },
@@ -417,7 +417,7 @@ pubg["UMP45"] = function ()
417
417
return pubg .execOptions ({
418
418
ratio = 1 ,
419
419
interval = 100 ,
420
- autoContinuousFiring = 1 ,
420
+ -- autoContinuousFiring = 1,
421
421
ballistic = {
422
422
{1 , 0 },
423
423
{5 , 69 },
@@ -434,7 +434,7 @@ pubg["AKM"] = function ()
434
434
return pubg .execOptions ({
435
435
ratio = 1 ,
436
436
interval = 107 ,
437
- autoContinuousFiring = 1 ,
437
+ -- autoContinuousFiring = 1,
438
438
ballistic = {
439
439
{1 , 0 },
440
440
{2 , 157 },
@@ -452,7 +452,7 @@ pubg["M416"] = function ()
452
452
return pubg .execOptions ({
453
453
ratio = 1 ,
454
454
interval = 93 ,
455
- autoContinuousFiring = 1 ,
455
+ -- autoContinuousFiring = 1,
456
456
ballistic = {
457
457
{1 , 0 },
458
458
{2 , 132 },
@@ -472,7 +472,7 @@ pubg["QBZ"] = function ()
472
472
return pubg .execOptions ({
473
473
ratio = 1 ,
474
474
interval = 99 ,
475
- autoContinuousFiring = 1 ,
475
+ -- autoContinuousFiring = 1,
476
476
ballistic = {
477
477
{1 , 0 },
478
478
{2 , 125 },
@@ -492,7 +492,7 @@ pubg["DP-28"] = function ()
492
492
return pubg .execOptions ({
493
493
ratio = 1 ,
494
494
interval = 116 ,
495
- autoContinuousFiring = 1 ,
495
+ -- autoContinuousFiring = 1,
496
496
ballistic = {
497
497
{1 , 0 },
498
498
{7 , 106 },
@@ -563,7 +563,7 @@ function pubg.execOptions (options)
563
563
amount = # ballisticConfig2 , -- Number of bullets
564
564
interval = options .interval , -- Time of each bullet
565
565
ballistic = ballisticConfig2 , -- ballistic data
566
- autoContinuousFiring = options .autoContinuousFiring
566
+ -- autoContinuousFiring = options.autoContinuousFiring
567
567
}
568
568
569
569
end
@@ -580,13 +580,18 @@ function pubg.init ()
580
580
local gunCount = 0
581
581
582
582
for j = 1 , # userInfo .canUse [type ] do
583
+ local gunName = userInfo .canUse [type ][j ][1 ]
584
+ local gunState = userInfo .canUse [type ][j ][2 ]
583
585
584
- if userInfo .canUse [type ][j ][2 ] == 1 then
585
- local gunName = userInfo .canUse [type ][j ][1 ]
586
+ if gunState >= 1 then
586
587
-- one series
587
588
gunCount = gunCount + 1 -- Accumulative number of firearms configuration files
588
589
pubg .gun [type ][gunCount ] = gunName -- Adding available firearms to the Arsenal
589
590
pubg .gunOptions [type ][gunCount ] = pubg [gunName ]() -- Get firearms data and add it to the configuration library
591
+ -- 单独设置连发
592
+ pubg .gunOptions [type ][gunCount ].autoContinuousFiring = ({ 0 , 0 , 1 })[
593
+ math.max (1 , math.min (gunState , 100 )) + 1
594
+ ]
590
595
-- all canUse
591
596
pubg .allCanUse_count = pubg .allCanUse_count + 1 -- Total plus one
592
597
pubg .allCanUse [pubg .allCanUse_count ] = gunName -- All available firearms
@@ -644,7 +649,7 @@ function pubg.auto (options)
644
649
local realY = pubg .getRealY (y )
645
650
MoveMouseRelative (x , realY )
646
651
-- Whether to issue automatically or not
647
- if userInfo . autoContinuousFiring == 1 and options .autoContinuousFiring == 1 then
652
+ if options .autoContinuousFiring == 1 then
648
653
PressAndReleaseMouseButton (1 )
649
654
end
650
655
@@ -738,7 +743,7 @@ function pubg.setGun (gunName)
738
743
local selected = false
739
744
740
745
for j = 1 , # userInfo .canUse [type ] do
741
- if userInfo .canUse [type ][j ][2 ] = = 1 then
746
+ if userInfo .canUse [type ][j ][2 ] > = 1 then
742
747
gunIndex = gunIndex + 1
743
748
allCanUse_index = allCanUse_index + 1
744
749
if userInfo .canUse [type ][j ][1 ] == gunName then
@@ -811,17 +816,24 @@ function pubg.fastPickup ()
811
816
PressAndReleaseKey (" tab" )
812
817
Sleep (10 + pubg .sleep )
813
818
PressAndReleaseMouseButton (1 )
819
+
814
820
local lastItemCp = {
815
821
300 / 2560 * 65535 ,
816
822
1210 / 1440 * 65535
817
823
}
818
824
local itemHeight = 83 / 1440 * 65535
819
- for i = 1 , 13 do
820
- MoveMouseTo (lastItemCp [1 ], lastItemCp [2 ] - itemHeight * (i - 1 ))
821
- PressMouseButton (1 )
822
- MoveMouseTo (32767 , 32767 )
823
- ReleaseMouseButton (1 )
825
+
826
+ -- 重复 3 次动作,强化拾取成功率
827
+ for i = 1 , 3 do
828
+ for j = 1 , 13 do
829
+ MoveMouseTo (lastItemCp [1 ], lastItemCp [2 ] - itemHeight * (j - 1 ))
830
+ PressMouseButton (1 )
831
+ MoveMouseTo (32767 , 32767 )
832
+ ReleaseMouseButton (1 )
833
+ end
824
834
end
835
+
836
+ Sleep (10 + pubg .sleep )
825
837
MoveMouseTo (lastItemCp [1 ], lastItemCp [2 ])
826
838
PressAndReleaseKey (" tab" )
827
839
end
@@ -941,10 +953,14 @@ function pubg.runCmd (cmd)
941
953
942
954
if pubg .ok then
943
955
local cmdGroup = string .split (cmd , ' |' )
956
+
944
957
for i = 1 , # cmdGroup do
945
958
local _cmd = cmdGroup [i ]
946
- switch [_cmd ](_cmd )
959
+ if switch [_cmd ] then
960
+ switch [_cmd ](_cmd )
961
+ end
947
962
end
963
+
948
964
end
949
965
end
950
966
@@ -979,7 +995,7 @@ function pubg.outputLogGunSwitchTable ()
979
995
local gunCount = 0
980
996
981
997
for j = 1 , # userInfo .canUse [type ] do
982
- if userInfo .canUse [type ][j ][2 ] = = 1 then
998
+ if userInfo .canUse [type ][j ][2 ] > = 1 then
983
999
local gunName = userInfo .canUse [type ][j ][1 ]
984
1000
local tag = gunName == pubg .gun [pubg .bulletType ][pubg .gunIndex ] and " => " or " "
985
1001
gunCount = gunCount + 1
@@ -1077,6 +1093,21 @@ function pubg.OnEvent_NoRecoil (event, arg, family)
1077
1093
end
1078
1094
end
1079
1095
1096
+ -- [[ processing instruction ]]
1097
+ function pubg .modifierHandle (modifier )
1098
+ local cmd = userInfo .G_bind [modifier ]
1099
+ pubg .renderDom .combo_key = modifier -- Save combination keys
1100
+
1101
+ if (cmd ) then
1102
+ pubg .renderDom .cmd = cmd -- Save instruction name
1103
+ pubg .runCmd (cmd ) -- Execution instructions
1104
+ else
1105
+ pubg .renderDom .cmd = " "
1106
+ end
1107
+
1108
+ pubg .outputLogRender () -- Call log rendering method to output information
1109
+ end
1110
+
1080
1111
--[[ Listener method ]]
1081
1112
function OnEvent (event , arg , family )
1082
1113
@@ -1090,29 +1121,31 @@ function OnEvent (event, arg, family)
1090
1121
1091
1122
-- Switching arsenals according to different types of ammunition
1092
1123
if event == " MOUSE_BUTTON_PRESSED" and arg >= 3 and arg <= 11 and family == " mouse" and pubg .ok then
1093
- local modifier = " G"
1124
+ local modifier = " G" .. arg
1094
1125
local list = { " lalt" , " lctrl" , " lshift" , " ralt" , " rctrl" , " rshift" }
1095
1126
for i = 1 , # list do
1096
1127
if IsModifierPressed (list [i ]) then
1097
1128
modifier = list [i ] .. " + " .. modifier
1098
1129
break
1099
1130
end
1100
1131
end
1101
- modifier = modifier .. arg -- Get the combination key
1102
- pubg .renderDom .combo_key = modifier -- Save combination keys
1103
- pubg .renderDom .cmd = userInfo .G_bind [modifier ] -- Save instruction name
1104
- pubg .runCmd (userInfo .G_bind [modifier ]) -- Execution instructions
1105
- pubg .outputLogRender () -- Call log rendering method to output information
1132
+ -- modifier = modifier .. arg -- Get the combination key
1133
+ -- pubg.renderDom.combo_key = modifier -- Save combination keys
1134
+ -- pubg.renderDom.cmd = userInfo.G_bind[modifier] -- Save instruction name
1135
+ -- pubg.runCmd(userInfo.G_bind[modifier]) -- Execution instructions
1136
+ -- pubg.outputLogRender() -- Call log rendering method to output information
1137
+ pubg .modifierHandle (modifier )
1106
1138
end
1107
1139
1108
1140
if event == " G_PRESSED" and arg >= 1 and arg <= 12 and pubg .ok then
1109
1141
-- if not pubg.runStatus() and userInfo.startControl ~= "G_bind" then return false end
1110
- local modifier = " F"
1111
- modifier = modifier .. arg -- Get the combination key
1112
- pubg .renderDom .combo_key = modifier -- Save combination keys
1113
- pubg .renderDom .cmd = userInfo .G_bind [modifier ] -- Save instruction name
1114
- pubg .runCmd (userInfo .G_bind [modifier ]) -- Execution instructions
1115
- pubg .outputLogRender () -- Call log rendering method to output information
1142
+ local modifier = " F" .. arg
1143
+ -- modifier = modifier .. arg -- Get the combination key
1144
+ -- pubg.renderDom.combo_key = modifier -- Save combination keys
1145
+ -- pubg.renderDom.cmd = userInfo.G_bind[modifier] -- Save instruction name
1146
+ -- pubg.runCmd(userInfo.G_bind[modifier]) -- Execution instructions
1147
+ -- pubg.outputLogRender() -- Call log rendering method to output information
1148
+ pubg .modifierHandle (modifier )
1116
1149
end
1117
1150
1118
1151
-- Script deactivated event
0 commit comments