Before few month one guy from aok heaven gave me tip to program that can save much of time. I believe here are guys who use it already. I use autohotkey (autohotkey L) to speed up my work with AOK Trigger Studio. It is simple program where you can write your very simple scripts, which will do many of the job for you. Last days I did this way hundreds of triggers, conditions and effects and it help me a lot. It is more reliable to make things automatically then by hand, when man can do mistakes.
I will give here few script to show you how it works and what it can do. I am not ahk pro, but I use it this way.
Just to explain few things before I paste the examples.
AHK can switch between windows like between notepad (where you can have coordinates, names of units and there HP/AP or any values you need to work with) and AOK TS. If you have just on TS Window opened you just type
You type
If you copy text, you need to wait some time, this depends on program. AOK 1.0 is slower and contains some bugs, but I use it for copying triggers (or conditions or effects) from one TS window to second TS window. AOK 1.0.1 is faster if I want to edit triggers, conditions and effects. To copy trigger from TS 1.0, I wait 250 milisecond. To paste and insert text from clipboard, depending on the size of text, I wait very short time about 100 ms.
You can save the values from clipboard to variable by this command:
For example this loop
Sendinput command sends keystrokes on keyboard, but if you want to type for example "Elite Jaguar" in the select box during editing of effect or condition, you must use Sendraw.
So I use
To type the name of unit in the select box and find it. It types the value saved in variable with name "unit".
If you have a command like Sendinput, you type in the brackets the name of hotkey you need. So e.g. in notepad:
The most important to remember are these three hotkeys:
^ - ctrl
+ - shift
! - alt
If you type one of them, some next key in brackets {} must follow.
This site explains more:
http://www.autohotkey.com/docs/commands/Send.htm#SendInput
Yet two commands I use.msgBox will pause the AHK script until you click button OK, and that is very useful to break your script to find mistakes or to check correctness of your code.
My example of using AHK in TS:
A notepad window with this text I have open:
And in AOK TS 1.0.1 I have triggers which each contains two conditions and 4 effects with damage effect. The players are already set.
First I activate notepad Window and get Unit name and HP number. Saved in variables %unit% and %number%.
Then I activate the TS window, I open the trigger by numpad + and press e to select effect. I press enter (This is under the comment line:; #1). I select the unit because I type the name of it and press enter to confirm.
#2 I delete next trigger
#3 I edit next condition and paste negative number into resource and select the correct unit. I pause the script to check it and then continue. I can remove the msgBox to speed up whole process.
#4 In the last damage effect I insert positive value and edit the unit name.
I run these command very fast for 4 loops so there will be 4 triggers with 4 different units. I can do it similar for all lines of the notepad (40 units/triggers).
This script is very short, but I write it about hour, so save much more time. Other script take about 15-30 minutes and it saves at least one week of hard work.
ATS Objects Arranger - I send tutorial post: http://aok.heavengames.com/cgi-bin/aokcgi/display.cgi?action=st&fn=4&tn=41017&st=recent&f=4,41017,0,30
I will give here few script to show you how it works and what it can do. I am not ahk pro, but I use it this way.
Just to explain few things before I paste the examples.
AHK can switch between windows like between notepad (where you can have coordinates, names of units and there HP/AP or any values you need to work with) and AOK TS. If you have just on TS Window opened you just type
To Activate window with TS.
WinActivate,AOK Trigger Studio
You type
to activate your notepad window, from where you will get the numbers. You can get the number by search in file of just with copy/paste from your text selection (which is my favourite method, because it is very simple and quick to write).
WinActivate,numbers.txt
If you copy text, you need to wait some time, this depends on program. AOK 1.0 is slower and contains some bugs, but I use it for copying triggers (or conditions or effects) from one TS window to second TS window. AOK 1.0.1 is faster if I want to edit triggers, conditions and effects. To copy trigger from TS 1.0, I wait 250 milisecond. To paste and insert text from clipboard, depending on the size of text, I wait very short time about 100 ms.
You can save the values from clipboard to variable by this command:
Which is better if you want to work with loops. You need not to access Clipboard many times for same value, to you save it to variable name unit and they you can use it in a loop.
unit=%Clipboard%
For example this loop
Will do the commands in brackets 8 times (for 8 players). There is variable in the loop called A_index and it keeps actual value of the cycle.
Loop, 8
{
}
Sendinput command sends keystrokes on keyboard, but if you want to type for example "Elite Jaguar" in the select box during editing of effect or condition, you must use Sendraw.
So I use
Sendraw %unit%
To type the name of unit in the select box and find it. It types the value saved in variable with name "unit".
If you have a command like Sendinput, you type in the brackets the name of hotkey you need. So e.g. in notepad:
Will send the cursor on endof line pressing key End and then pressing ctrl+shift+left it will select text. Ctrl+c will copy it into clipboard.
SendInput {END}^+{LEFT}^c
The most important to remember are these three hotkeys:
+ - shift
! - alt
If you type one of them, some next key in brackets {} must follow.
This site explains more:
Yet two commands I use.
To wait 100 miliseconds
sleep, 100
to wait longer If I want to see what happens or
sleep, 1500
to see if the value was saved in Clipboard.
msgBox, %unit%
My example of using AHK in TS:
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
#s::
SetKeyDelay, 50
WinActivate,HP numbers 2.txt
SendInput ^{HOME}
loop, 4
{
WinActivate,HP numbers.txt
SendInput {DOWN}{END}^{LEFT}{LEFT}{SHIFT DOWN}{HOME}^{RIGHT}{SHIFT UP}^c
sleep 100
unit=%Clipboard%
SendInput {END}^+{LEFT}^c
number=%Clipboard%
sleep 100
WinActivate,AOK Trigger Studio
; #1
SendInput {NumPadAdd}e{ENTER}+{TAB 4}
SendRaw %unit%
SendInput {ENTER}
sleep, 100
; #2
SendInput e{DEL}
sleep, 100
; #3
SendInput {ENTER}+{TAB 1}-%number%
SendInput +{TAB 3}
SendRaw %unit%
SendInput {ENTER}
; #4
SendInput e{ENTER}+{TAB 1}%number%
SendInput +{TAB 3}
SendRaw %unit%
SendInput {ENTER}{DOWN}
msgBox, 1
}
return
A notepad window with this text I have open:
(columns divided by tabs; I don't know why but this site shows the columns joined into one column! there are tabs between "civ","elite unit","number" columns)
civelite unitnumber
azElite Jaguar16777141
britElite Longbowman16777176
byzElite Cataphract16777066
celtElite Woad Raider16777136
franElite Throwing Axeman16777156
gothElite Huskarl16777146
hunElite Tarkan16777066
chinElite Chu-ko-nu16777166
japElite Samurai16777136
korElite War Wagon16777016
mayElite Plumed Archer16777151
monElite Mangudai16777156
persElite War Elephant16776616
sarElite Mameluk16777136
spaElite Conq16777156
teutElite Teutonic Knight16777116
turkElite Janissary16777176
vikElite Berserk16777156
allScorpion16777176
allHeavy Scorpion16777166
allLight Cavalry16777156
allHussar16777141
allKnight16777116
allCavalier16777096
allPaladin16777056
allCamel16777116
allHeavy Camel16777096
allCavalry Archer16777166
allHeavy Cavalry Archer16777156
allArcher16777186
allCrossbowman16777181
allHand Cannoneer16777181
allEagle Warrior16777166
allPikeman16777161
allHaldarbier16777156
allLong Swordsman16777161
allTwo Handed Swordsman16777156
allChampion16777146
allMan-at-Arms16777171
And in AOK TS 1.0.1 I have triggers which each contains two conditions and 4 effects with damage effect. The players are already set.
First I activate notepad Window and get Unit name and HP number. Saved in variables %unit% and %number%.
Then I activate the TS window, I open the trigger by numpad + and press e to select effect. I press enter (This is under the comment line:; #1). I select the unit because I type the name of it and press enter to confirm.
#2 I delete next trigger
#3 I edit next condition and paste negative number into resource and select the correct unit. I pause the script to check it and then continue. I can remove the msgBox to speed up whole process.
#4 In the last damage effect I insert positive value and edit the unit name.
I run these command very fast for 4 loops so there will be 4 triggers with 4 different units. I can do it similar for all lines of the notepad (40 units/triggers).
This script is very short, but I write it about hour, so save much more time. Other script take about 15-30 minutes and it saves at least one week of hard work.
ATS Objects Arranger - I send tutorial post: http://aok.heavengames.com/cgi-bin/aokcgi/display.cgi?action=st&fn=4&tn=41017&st=recent&f=4,41017,0,30
[This message has been edited by rumburak24 (edited 08-01-2012 @ 04:43 AM).]