代码拉取完成,页面将自动刷新
同步操作将从 LookOutTheBush/PUBG 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
import time
import pydirectinput
from contants import c_contants
from equipment import getCurrentWepone
pydirectinput.PAUSE = 0
def changeOpen():
c_mouse.openFlag = not c_mouse.openFlag
def moveMouse():
curWepone = getCurrentWepone()
if(curWepone.name == 'none'):
return
basic = curWepone.basic
speed = curWepone.speed
startTime = round(time.perf_counter(), 3) * 1000
if curWepone.model == 'auto':
for i in range(curWepone.maxBullets):
if not canFire():
break
holdK = 1.0
if c_contants.hold:
holdK = curWepone.hold
postureK = curWepone.posture_states[c_contants.posture]
moveSum = int(round(basic[i] * curWepone.k * holdK * postureK, 2))
moveItem = int(round(moveSum/speed*15, 2))
while True:
if moveSum > moveItem:
pydirectinput.move(xOffset=0, yOffset=moveItem, relative=True)
moveSum -= moveItem
elif moveSum > 0:
pydirectinput.move(xOffset=0, yOffset=moveSum, relative=True)
moveSum = 0
elapsed = (round(time.perf_counter(), 3) * 1000 - startTime)
if not canFire() or elapsed > (i+1)*speed + 10:
if moveSum > 0:
pydirectinput.move(xOffset=0, yOffset=moveSum, relative=True)
break
time.sleep(0.01)
else:
for i in range(curWepone.maxBullets):
if not canFire():
break
holdK = 1
if c_contants.hold:
holdK = curWepone.hold
moveSum = int(round(basic[i] * curWepone.k * holdK, 2))
i += 1
while True:
if(moveSum > 10):
pydirectinput.move(xOffset=0, yOffset=10, relative=True)
moveSum -= 10
elif(moveSum > 0):
pydirectinput.move(xOffset=0, yOffset=moveSum, relative=True)
moveSum = 0
elapsed = (round(time.perf_counter(), 3) * 1000 - startTime)
if not canFire() or elapsed > (i+1)*speed + 10:
break
time.sleep(0.01)
pydirectinput.click()
def handlePressed():
if not canFire():
return
c_contants.pool.submit(moveMouse)
# 鼠标点击事件
def onClick(x, y, button, pressed):
if 'left' == button.name:
c_mouse.leftPressed = pressed
handlePressed()
return not c_contants.exitFlag
#按下f1测试程序生效
def testMouse():
if c_mouse.openFlag:
for i in range(10):
pydirectinput.moveRel(xOffset=0, yOffset=10)
time.sleep(0.1)
# 是否可以开火
def canFire():
return c_mouse.leftPressed and c_mouse.openFlag and not c_contants.exitFlag and not c_contants.bagOpen
class c_mouse():
leftPressed = False
openFlag = True
def __init__(self):
pass
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。