Fight'N Rage Script.ahk 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. #Requires AutoHotkey v2.0
  2. #include Notify.ahk
  3. #SingleInstance
  4. global toggleX := false ; 初始化 toggleX 变量,并声明为全局变量
  5. ; 只在 FIGHT_N_RAGE.exe 窗口激活时有效
  6. #HotIf WinActive("ahk_exe FIGHT_N_RAGE.exe")
  7. A::
  8. {
  9. Send("{Down down}") ; 按下向下方向键
  10. Sleep(50) ; 等待50毫秒
  11. Send("{Down up}") ; 松开向下方向键
  12. Send("{Up down}") ; 按下向上方向键
  13. Sleep(50) ; 等待50毫秒
  14. Send("{Up up}") ; 松开向上方向键
  15. Send("{Z down}") ; 按下Z键
  16. Sleep(100) ; 等待100毫秒
  17. Send("{Z up}") ; 松开Z键
  18. }
  19. ; 按下 X 键时,持续按下和松开 X 键,不会修改X键的默认行为
  20. ~X::
  21. {
  22. global toggleX ; 显式声明 toggleX 为全局变量
  23. if (toggleX) ; 如果 toggleX 为真,执行操作
  24. {
  25. while GetKeyState("X", "P") ; 判断是否按下 X 键
  26. {
  27. Send("{X down}") ; 持续按下 X 键
  28. Sleep(50) ; 每50毫秒模拟一次按下
  29. Send("{X up}") ; 松开 X 键
  30. Sleep(50) ; 每50毫秒模拟一次松开
  31. }
  32. }
  33. }
  34. ; 按下 F1 键来切换 X 键的启用/禁用状态
  35. F1::
  36. {
  37. global toggleX ; 显式声明 toggleX 为全局变量
  38. toggleX := !toggleX ; 切换 toggleX 的状态
  39. if (toggleX) {
  40. Notify.Show('Alert!', 'X连击未激活.', , , , 'theme=!')
  41. }
  42. else {
  43. Notify.Show('Alert!', 'X连击激活.', , , , 'theme=!')
  44. }
  45. Sleep(1000) ; 显示提示1秒钟
  46. ToolTip("") ; 隐藏提示
  47. }
  48. #HotIf ; 结束条件块
  49. ; 按下win+ C 弹出提示 任何时候都可以激活 没有前置条件
  50. #c::
  51. {
  52. MsgBox("You pressed Win-C while any window except Notepad is active.")
  53. Notify.Show('Info', 'X连击未激活.', , 'soundi', ,
  54. 'theme=idark style=edge show=slideNorth hide=slideSouth@250 pos=ct z=100')
  55. }
  56. return