IniRead, TF1, config.ini, EasyText, TF1, t/y
IniRead, TF2, config.ini, EasyText, TF2, tReason?
IniRead, TF3, config.ini, EasyText, TF3, t/cancel
IniRead, TF4, config.ini, EasyText, TF4, t/medkit
IniRead, TF5, config.ini, EasyText, TF5, t/squad
IniRead, TF6, config.ini, EasyText, TF6, t/squad 1
IniRead, TF7, config.ini, EasyText, TF7, t/squad 2
IniRead, TF8, config.ini, EasyText, TF8, t/ratio
IniRead, TF9, config.ini, EasyText, TF9, t/accuracy
IniRead, TF10, config.ini, EasyText, TF10, tHello!
Menu, Tray, NoStandard
Menu, Tray, Add, Change Text, MakeGui
Menu, Tray, Add
Menu, Tray, Add, Exit, Exit
TimerOff := 1
Return
F11::
MakeGui:
Loop, 10
{
b_index := a_index - 1
Gui, Add, Text, x64 y10 w50 h20, Team
Gui, Add, Text, % "x12 y" . b_index * 30 + 40 . " w50 h20", Text%a_index%
Gui, Add, Checkbox, % "x72 y" . b_index * 30 + 40 . " w20 h20 vTFC" . a_index
If (SubStr(TF%a_index%,1,1) = "y")
GuiControl,, TFC%a_index%, 1
Gui, Add, Edit, % "x92 y" . b_index * 30 + 40 . " w370 h20 vTF" . a_index, % SubStr(TF%a_index%,2)
}
Gui, Add, Button, gUpdateText, Update Text
Gui, Show, x292 y165 h379 w479, EasyText
Return
F1::
F2::
F3::
F4::
F5::
F6::
F7::
F8::
F9::
F10::
PrepareText := T%A_ThisLabel%
If (PrepareText != "" && TimerOff)
{
IfWinActive, ahk_class Ace of Spades
{
ReplaceChars := "!#+^"
Loop, Parse, ReplaceChars
StringReplace, PrepareText, PrepareText, %A_LoopField%, {%A_LoopField%}
SendInput, %PrepareText%{ENTER}
TimerOff := 0
SetTimer, FixTimer, -5000
}
}
Return
FixTimer:
TimerOff := 1
Return
GuiClose:
UpdateText:
Gui, Submit, NoHide
Gui, Destroy
Loop, 10
{
TFC%a_index% := TFC%a_index% ? "y" : "t"
IniWrite, % TFC%a_index% . TF%a_index%, config.ini, EasyText, TF%a_index%
TF%a_index% := TFC%a_index% . TF%a_index%
}
Return
Exit:
ExitApp