Skip to content

Commit

Permalink
Merge pull request #98 from kiccer/test
Browse files Browse the repository at this point in the history
update
  • Loading branch information
kiccer authored May 31, 2020
2 parents 37ff5f0 + 76f3f78 commit bf511b1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
:--: | ---
`default` | 使用游戏初始默认的设置,即点击右键开镜,长按右键瞄准。(单纯点击操作时需要按住左shift)
`recommend` | 使用此脚本推荐设置,即长按右键开镜,长按左ctrl瞄准。(脚本默认使用该设置)
`ctrlmode` | 此模式需要修改游戏设置为快速开镜,ctrl按住时为蹲下。(此模式没有腰射)
`custom` | 自定义设置,使用在 `customAimingSettings` 中设置的判断条件。

### 启动控制
Expand Down
20 changes: 13 additions & 7 deletions Soldier76.lua
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ userInfo = {
-- 启动控制 (capslock - 使用大写锁定键控制 | numlock - 小键盘锁定键控制 | G_bind - 使用指令控制) | Start up control
startControl = "capslock",

-- 瞄准设置 (default - 使用游戏默认设置 | recommend - 使用脚本推荐设置 | custom - 自定义设置) | Aiming setting
-- 瞄准设置 (default - 使用游戏默认设置 | recommend - 使用脚本推荐设置 | custom - 自定义设置 | ctrlmode - 下蹲模式) | Aiming setting
aimingSettings = "recommend",

-- 当 aimingSettings = "custom" ,需要在此处设置自定义判断条件,通常配合 IsMouseButtonPressed 或 IsModifierPressed 使用,使用方法请查阅 G-series Lua API 参考文档.docx
Expand Down Expand Up @@ -257,6 +257,8 @@ function pubg.isAimingState (mode)
return IsMouseButtonPressed(3) and not IsModifierPressed("lshift")
elseif userInfo.aimingSettings == "default" then
return not IsModifierPressed("lshift") and not IsModifierPressed("lalt")
elseif userInfo.aimingSettings == "ctrlmode" then
return IsMouseButtonPressed(3) and not IsModifierPressed("lshift")
elseif userInfo.aimingSettings == "custom" then
return userInfo.customAimingSettings.ADS()
end
Expand All @@ -272,6 +274,8 @@ function pubg.isAimingState (mode)
end
elseif userInfo.aimingSettings == "default" then
return IsMouseButtonPressed(3)
elseif userInfo.aimingSettings == "ctrlmode" then
return false
elseif userInfo.aimingSettings == "custom" then
return userInfo.customAimingSettings.Aim()
end
Expand Down Expand Up @@ -420,9 +424,9 @@ pubg["UMP45"] = function ()
ballistic = {
{1, 0},
{5, 70},
{10, 94},
{15, 97},
{35, 106},
{10, 97},
{15, 100},
{35, 109},
}
})

Expand Down Expand Up @@ -627,7 +631,7 @@ function pubg.auto (options)
local x = math.ceil((pubg.currentTime - pubg.startTime) / (options.interval * (pubg.bulletIndex - 1)) * d) - pubg.xCounter
local y = math.ceil((pubg.currentTime - pubg.startTime) / (options.interval * (pubg.bulletIndex - 1)) * options.ballistic[pubg.bulletIndex]) - pubg.counter
-- 4-fold pressure gun mode
local realY = pubg.getRealY(y)
local realY = pubg.getRealY(options, y)
MoveMouseRelative(x, realY)
-- Whether to issue automatically or not
if options.autoContinuousFiring == 1 then
Expand Down Expand Up @@ -659,15 +663,17 @@ function pubg.autoSleep (isTest)
end

--[[ get real y position ]]
function pubg.getRealY (y)
function pubg.getRealY (options, y)
local realY = y

if pubg.isAimingState("ADS") then
realY = y * pubg[pubg.scope_current]

elseif pubg.isAimingState("Aim") then
realY = y * userInfo.sensitivity.Aim * pubg.generalSensitivityRatio
end

if userInfo.aimingSettings == "ctrlmode" and IsModifierPressed("lctrl") then
realY = realY * 0.8
end

return realY
Expand Down

0 comments on commit bf511b1

Please sign in to comment.