AutoHotKey脚本:用热键(hotkey)和热字符串(hotstring)简化war3秘籍输入

今天研究了一下AutoHotKey工具,发现我的懒病真是越来越严重了,现在玩war3打电脑竟然连几个秘籍都不想花精力输入了。我写了一个脚本,具备以下两个功能:

  1. 利用热字符串(Hotstring)简化秘籍的输入,比如在输入框中输入radar,AutoHostKey会自动将其转换为“iseedeadpeople”

  2. 利用热键(Hotkey)在开局阶段快速输入指定的一组秘籍,包括:增加资源、无敌、地图全开、魔法无限、人口无限、快速建造

我用的AutoHotKey版本为1.1.23.05,脚本文件 war3cheat.ahk 代码如下:

; 快速输入魔兽争霸III秘籍
; Tsybius2014 2016/04/23

; 魔兽争霸III秘籍(混乱之治 & 冰封王座)
resx = greedisgood 1000000     ;加1000000单位金钱和木材
money = keysersoze 1000000     ;加1000000单位金钱
wood = leafittome 1000000      ;加1000000单位木材
power = whosyourdaddy          ;神话模式
radar = iseedeadpeople         ;地图全开
magic = thereisnospoon         ;法力无限
food = pointbreak              ;人口无限(最高100)
fast = warpten                 ;快速建造
win = allyourbasearebelongtous ;快速胜利
lose = somebodysetupusthebomb  ;快速失败

#IfWinActive Warcraft III
  ; 常规缩写
  ::resx::greedisgood 1000000
  ::money::keysersoze 1000000
  ::wood::leafittome 1000000
  ::power::whosyourdaddy
  ::radar::iseedeadpeople
  ::magic::thereisnospoon
  ::food::pointbreak
  ::fast::warpten
  ::win::allyourbasearebelongtous
  ::lose::somebodysetupusthebomb
  ; 组合输入 - 开局适用
  ^t::
    Send, {enter}%resx%{space}{enter}
    Send, {enter}%power%{space}{enter}
    Send, {enter}%radar%{space}{enter}
    Send, {enter}%magic%{space}{enter}
    Send, {enter}%food%{space}{enter}
    Send, {enter}%fast%{space}{enter}
  Return
#IfWinActive

双击此脚本运行即可,这些热键与热字符串只会在魔兽争霸III(war3)程序中起作用。

脚本既可用于混乱之治,也可用于冰封王座。但只能用于“单人模式”中的“自定义游戏”中。

下图为游戏开始时按下Ctrl+T后连续输入6个秘籍的效果图:

AutoHotKey脚本:用热键(hotkey)和热字符串(hotstring)简化war3秘籍输入_第1张图片

END

你可能感兴趣的:(快捷键,魔兽,秘籍,war3,AutoHostKey)