Code:
#include <MsgBoxConstants.au3>
HotKeySet("{F9}", "start")
HotKeySet("{F10}", "stop")
Global $WinTitle = findWildstarWindowName()
Global $Show = 0
Global $Loop = 0
While 1
Sleep(2000)
WEnd
Func findWildstarWindowName()
Local $aList = WinList()
For $i = 1 To $aList[0][0]
If $aList[$i][0] <> "" And BitAND(WinGetState($aList[$i][1]), 2) Then
If StringInStr($aList[$i][0], "Wildstar") Then
return $aList[$i][0]
EndIf
EndIf
Next
return False
EndFunc
Func start()
$Show = 0
ToolTip("Script started", 0, 0)
Sleep(2000)
ToolTip("", 0, 0)
If @error Then
MsgBox(0, "Error", "Could not find Wildstar")
Else
While $Show == 0
ControlSend($WinTitle,"","","w")
Sleep(5000)
WEnd
EndIf
EndFunc
Func stop()
$Show = 1
ToolTip("Script stopped", 0, 0)
Sleep(3000)
ToolTip("", 0, 0)
EndFunc