lua - 脚本罗技
问题描述
如何在大写锁定中包含配置文件激活 (9) 以及如何包含 rapidfire?我也有一个罗技 g pro 键盘,我会放上大写锁以减少枪的后坐力
local recoil_mode -- possible values: false, 8, 7, 6
local recoil_loops = {
[8] = {
{x=-1, y=2, delay=7},
{x=1, y=2, delay=7},
{x=-1, y=3, delay=8},
{x=1, y=3, delay=5},
},
[7] = {
{x=0, y=5, delay=5},
{x=0, y=6, delay=7},
{x=0, y=7, delay=6},
{x=0, y=8, delay=4},
{x=0, y=9, delay=6},
{x=0, y=11, delay=5},
},
[6] = {
{x=0, y=8, delay=50},
{x=0, y=8, delay=50},
{x=0, y=8, delay=50},
{x=0, y=8, delay=50},
{x=0, y=9, delay=50},
{x=0, y=11, delay=50},
},
}
function OnEvent(event, arg)
if event == "PROFILE_ACTIVATED" then
OutputLogMessage("PROFILE_ACTIVATED")
EnablePrimaryMouseButtonEvents(true)
elseif event == "PROFILE_DEACTIVATED" then
OutputLogMessage("PROFILE_DEACTIVATED")
ReleaseMouseButton(1) -- to prevent it from being stuck on
elseif event == "MOUSE_BUTTON_PRESSED" and recoil_loops[arg] then
recoil_mode = recoil_mode ~= arg and arg
OutputLogMessage("Recoil mode is now "..tostring(recoil_mode))
elseif event == "MOUSE_BUTTON_PRESSED" and arg == 1 and recoil_mode then
local loop = recoil_loops[recoil_mode]
local j = 0
repeat
j = j % #loop + 1
if IsMouseButtonPressed(3) then -- only when RMB pressed
MoveMouseRelative(loop[j].x, loop[j].y)
end
Sleep(loop[j].delay)
until not IsMouseButtonPressed(1)
end
end
解决方案
推荐阅读
- python - 如何确定通过 HSV 颜色空间中的饱和度值检测到的黑色物体的外部轮廓
- markdown - 如何将 pandoc markown 的分页符添加到 RTF 输出?
- flutter - 如何在flutter和firebase中找到列的总值(总和)
- c# - 如果属性似乎没有名称,我如何告诉 NotifyPropertyChanged 方法哪个属性发生了变化?
- angular - 尝试使用 excel 作为我的 Angular 项目的数据库
- javascript - 我需要帮助来使用 Prismic、NodeJS 和 Express 设置语言 URL/slug
- css - Webpack css-loader + babel-loader,classNames uglify 问题
- here-api - 我如何简单地从 web 应用程序获取地理位置?
- xml - XML 相对路径导航
- python - 训练精度停留在 0.50+-