查看: 940|回复: 2

求罗技LUA格式能用的压枪宏!!!

[复制链接]
发表于 2020-10-1 23:11 | 显示全部楼层 |阅读模式
r297082809 2020-10-1 23:11 940 2 显示全部楼层
求罗技LUA格式能用的压枪宏
谢谢大佬了。以前的LUA不能用了。

发表于 2020-10-2 19:36 | 显示全部楼层
zhc111111 2020-10-2 19:36 显示全部楼层
我想要一个连点压枪
回复

使用道具 举报

发表于 2020-10-4 18:59 | 显示全部楼层
  1. -------------开关热键----------------------------------------
  2. off = 7----关闭
  3. on = 8----开启
  4. ----想修改为其他罗技键盘按键直接改数字即可
  5. ----如果想修改为鼠标键的话,请下拉修改第59行和第108行的参数,然后再改为对应鼠标键即可。
  6. ----不知道对应键数字是几的话,看下方信息框中“arg=”后边对应的数字。
  7. ------------------------------------------------------------

  8. -------------全自动武器参数-----------------------------------
  9. zyx = 2----首发Y向强度
  10. xyz = 0----X向强度
  11. xzy = 6----Y向强度
  12. yxz = 8----压枪延迟
  13. ------------------------------------------------------------

  14. -------------半自动武器参数-----------------------------------
  15. single = 1----开火键(鼠标G键,默认8为G8既G502左键旁边俩键前边那个键)
  16. yzx = 15----首发Y向强度
  17. zzz = 11----Y向强度
  18. ------------------------------------------------------------

  19. ------------------------------------------------------------
  20. ------------------------------------------------------------
  21. -------------以下所有参数如无特殊需求--------------------------
  22. --------------------请勿更改---------------------------------
  23. ------------------------------------------------------------
  24. ------------------------------------------------------------
  25. local norecoil = false
  26. local click = false
  27. ------------------------------------------------------------
  28. function OnEvent(event, arg)
  29.   OutputLogMessage("event = %s, arg = %d\n", event, arg)
  30. ------------------------------------------------------------
  31.         EnablePrimaryMouseButtonEvents(true)
  32. ------------------------------------------------------------
  33. ------------------------------------------------------------
  34. -------------no recoil--------------------------------------
  35. ------------------------------------------------------------
  36. ------------------------------------------------------------
  37. if (event == "MOUSE_BUTTON_PRESSED" and arg == on) then
  38.                         ----↑如果想用鼠标开关的话"G_PRESSED"改为"MOUSE_BUTTON_PRESSED"
  39.                         ----↓如果改了的话第108行还有一处需要修改,切记!!!
  40.         norecoil = true
  41.                 if (norecoil == true) then
  42.                         OutputLogMessage("norecoil\n")
  43.                 end
  44. end

  45. if (event == "MOUSE_BUTTON_PRESSED" and arg == 1 and norecoil) then
  46.         Sleep(17)
  47.         MoveMouseRelative(0, zyx)
  48.         repeat
  49.                 MoveMouseRelative(xyz, xzy)
  50.                 Sleep(yxz)
  51.         until not IsMouseButtonPressed(1)
  52. end

  53. ----------------------------------------------
  54. --------------single参数-----------------------
  55. ----------------------------------------------
  56. if (event == "MOUSE_BUTTON_PRESSED" and arg == single and norecoil) then
  57.         PressMouseButton(1)
  58.         Sleep(20)
  59.         ReleaseMouseButton(1)
  60.         MoveMouseRelative(0, yzx)
  61.         click = true
  62.         SetMKeyState(3)
  63. end

  64. if (event == "MOUSE_BUTTON_RELEASED" and arg == single) then
  65.         click = false
  66. end

  67. if (event == "M_RELEASED" and arg == 3 and click) then
  68.         PressMouseButton(1)
  69.         Sleep(20)
  70.         ReleaseMouseButton(1)
  71.         MoveMouseRelative(0, zzz)
  72.                 if click then
  73.                         SetMKeyState(3)
  74.                 end
  75. end
  76. ------------------------------------------------------------
  77. ------------------------------------------------------------
  78. ---------------mouse----------------------------------------
  79. ------------------------------------------------------------
  80. ------------------------------------------------------------
  81.         if (event == "MOUSE_BUTTON_PRESSED" and arg == off) then
  82.                                 ----↑就这个位置也需要把"G_PRESSED"改为"MOUSE_BUTTON_PRESSED"
  83.                         norecoil = false
  84.                         click = false
  85.                                 if (norecoil == false and click == false) then
  86.                                         OutputLogMessage("mouse\n")
  87.                                 end
  88.         end
  89. ------------------------------------------------------------
  90. ------------------------------------------------------------
  91. ------------------------------------------------------------
  92. ------------------------------------------------------------
  93. ------------------------------------------------------------
  94. end
复制代码

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则 返回列表 发新帖

快速回复 返回顶部 返回列表