好友
阅读权限10
听众
最后登录1970-1-1
|
本帖最后由 Mercerbcxc 于 2023-10-27 05:05 编辑
最近在搞罗技宏 简单写了写 参考了一个pubg老宏的写法
大概这样
AK={{x=0, y=0, d=3}, {x=0, y=2, d=3}, {x=0, y=2, d=2}, {x=0, y=1 d=3}, {x=0, y=0, d=2}, {x=0, y=2, d=3}, {x=0, y=0, d=2}, {x=0, y=2 d=3},
i=0
xy=AKhd
然后重复运行下面压枪区的代码
i=i+1
MoveMouseRelative(xy[ i ].x, xy[ i ].y)
Sleep(xy[ i ].d)
可以正常运行 但是我怀疑延迟不对
当我用这套代码去套用现在市面上别人宏的压枪数据
发现 不能完美压枪
简单类别了一下 把过程录制了视频
发现 别人的宏 运行速度比我的快
虽然鼠标轨迹是一样的 但是当别人的压枪数据套用到我这里就是运行慢
别人的宏鼠标已经走完全程了 我的宏还有一段路程
很不解
试着寻找原因
下面给出别人的压枪代码
function OnEvent(event, arg)
if (wireless) then
Sleep(1)
end
while IsMouseButtonPressed(1) and flag2 == 1 do
if (indexWeapon == 17) then
click = true
SetMKeyState(3)
break
end
if moshi == 1 then
if (indexWeapon > 0 and indexWeapon < 17 and not IsModifierPressed(ShieldCode)) then
if indexPattern < #Wpattern[indexWeapon] then
if indexPattern == 1 then
timestart = GetRunningTime()
end
MoveMouseRelative(Wpattern[indexWeapon][indexPattern].x, Wpattern[indexWeapon][indexPattern].y)
backx = backx - Wpattern[indexWeapon][indexPattern].x
backy = backy - Wpattern[indexWeapon][indexPattern].y
timestart = timestart + Wpattern[indexWeapon][indexPattern].d
Sleep3(timestart)
indexPattern = indexPattern + 1
else
backx2 = math.floor(backx / 40)
backy2 = math.floor(backy / 40)
i = 0
while (i < round) do
tsleep = 2* math.sqrt(math.abs(backx) * math.abs(backx) + math.abs(backy) * math.abs(backy)) / round / speed
tsleep2 = math.floor(tsleep)
tsleep3 = tsleep3 + tsleep - tsleep2
if tsleep3 >= 1 then
tsleep3 = tsleep3 - 1
tsleep2 = tsleep2 + 1
end
Sleep2(tsleep2)
backx1 = backx1 + backx / 40 - backx2
backy1 = backy1 + backy / 40 - backy2
if (backx1 >= 1) then
backx1 = backx1 - 1
backx3 = backx2 + 1
else
backx3 = backx2
end
if (backy1 >= 1) then
backy1 = backy1 - 1
backy3 = backy2 + 1
else
backy3 = backy2
end
MoveMouseRelative(backx3, backy3)
i = i + 1
end
indexPattern = 1
backx = 0
backy = 0
backx1 = 0.00
backy1 = 0.00
tsleep3 = 0.00
flag2 = 0
Sleep(1000)
end
end
这个是瓦罗兰特的宏 后面那堆back应该是使用csgo宏模版保留下来的 应该不必在意
个人不太懂这一段
if (indexWeapon == 17) then
click = true
SetMKeyState(3)
break
这一段的timestart 的意图是什么
timestart = GetRunningTime()
以及压枪延迟这里的
timestart = timestart + Wpattern[indexWeapon][indexPattern].d
Sleep3(timestart)
这里使用了Sleep3 不解
宏的结尾处似乎是我问题的关键
结尾处的代码如下
function Sleep2(time)
start = GetRunningTime()
while (time + start > GetRunningTime())
do
end
end
function Sleep3(time)
while (time > GetRunningTime())
do
end
end
为什么别人的宏运行效率这么高 甚是不解 希望大佬指点一二
方便的话 希望能给我一个简易的宏 让我时候参照研究
下面是我的宏的完整代码
EnablePrimaryMouseButtonEvents(true)
AK= {{x=0,y=0,d=5},{x=0,y=0,d=5},{x=0,y=0,d=5},{x=0,y=0,d=5},{x=0,y=0,d=5},{x=0,y=6,d=18},{x=0,y=6,d=18},{x=0,y=7,d=18},{x=0,y=7,d=18},{x=0,y=7,d=18},{x=0,y=6,d=18},{x=0,y=7,d=18},{x=0,y=7,d=18},{x=0,y=7,d=18},{x=0,y=7,d=18},{x=0,y=6,d=18},{x=0,y=6,d=18},{x=0,y=7,d=18},{x=0,y=7,d=18},{x=0,y=7,d=18},{x=0,y=6,d=18},{x=0,y=6,d=18},{x=0,y=7,d=18},{x=0,y=7,d=18},{x=0,y=7,d=18},{x=0,y=12,d=18},{x=0,y=12,d=18},{x=0,y=12,d=18},{x=0,y=12,d=18},{x=0,y=12,d=18},{x=0,y=11,d=18},{x=0,y=11,d=18},{x=0,y=11,d=18},{x=0,y=12,d=18},{x=0,y=12,d=18},{x=0,y=10,d=18},{x=0,y=10,d=18},{x=0,y=11,d=18}}
xy=AK
i=0
function OnEvent(event, arg)
OutputLogMessage("event = %s, arg = %s\n", event, arg)
if (event == "MOUSE_BUTTON_PRESSED" and arg == 1) then
repeat
i=i+1
MoveMouseRelative( xy[ i ].x , xy[ i ].y )
Sleep( xy[ i ].d )
until not IsMouseButtonPressed(1)
i=0
end
end
下面是别人家的瓦罗兰特宏的下载链接
https://wwrt.lanzoue.com/in5AQ1cyrcqd
密码:8syd
https://pan.baidu.com/s/1GPi7dlpv8NZjZzsX6nSbaQ?pwd=6666
密码:6666
双网盘保险 qaq
还望有大佬解答一下我
|
免费评分
-
查看全部评分
|