首页 > 解决方案 > 在记事本++中制作A​​HK脚本

问题描述

我正在尝试制作一个 ahk 脚本来尝试简化一次性使用的脚本。几乎我在一个游戏中一个接一个地运行超过 1000 个命令。目前我有这样的东西。我将所有命令都放在一个文本文件中,只是没有任何 ahk 编码。

.waypointadd 1 100234 40 -469
.waypointadd 2 99549 34 5
.waypointadd 3 100615 37 -160
.waypointadd 4 100817 27 -457
.waypointadd 5 100503.5 10.5 -647.5
.waypointadd 6 100494.5 10.5 -625.5

这会持续一段时间。我不熟悉使用表达式等,我非常想使它按回车键,键入命令,然后按回车键,然后转到下一个。我显然不能手动执行此操作。我尝试过使用一些基本的替换表达式和东西,但不确定如何做到这一点。

最后我希望它看起来像这样

send {enter}
send (command 1)
send {enter}
send {enter}
send (command 2)
send {enter}

标签: autohotkey

解决方案


你可以把它绑定到一个键上,比如......

1::
loop, 1 {
  send {enter}
  send (command 1)
  send {enter}
  send {enter}
  send (command 2)
  send {enter}
}

或在您按下某个键时执行一项功能。lmk 是否有帮助

doSomething() {
  send {enter}
  send (command 1)
  send {enter}
  send {enter}
  send (command 2)
  send {enter}
}

1::
doSomething()

推荐阅读