Heres what I'm using...
Code:
;AutoStart
$gameLoc = "E:\Diablo III\" ;Location of Diablo 3 executable
$gameAutoStart = False ; Set this to true to start game from desktop or recover from closed game
$gameStartTime = 9000 ;Change depending on computer/internet speed
$gamePassword = "Your Password" ;Symbols go in brackets "Password1{!}"
$gameExecutable = "Diablo III.exe"
Code:
If FileExists($ini) Then
Call("ReadINI")
Call("CreateINI")
Else
Call("CreateINI")
EndIf
Code:
If $gameAutoStart == True Then Call("IsGameOpen")
Code:
Func ReadINI()
$gameAutoStart = IniRead($ini, "Auto Start", "Auto Start", $gameAutoStart)
$gameLoc = IniRead($ini, "Auto Start", "Game Location", $gameLoc)
$gameStartTime = IniRead($ini, "Auto Start", "Game Start Time", $gameStartTime)
$gamePassword = IniRead($ini, "Auto Start", "Password", $gamePassword)
$gameExecutable = IniRead($ini, "Auto Start", "Task Manager Executable Name", $gameExecutable)
EndFunc ;==>ReadINI
Func CreateINI()
IniWrite($ini, "Auto Start", "Auto Start", $gameAutoStart)
IniWrite($ini, "Auto Start", "Game Location", $gameLoc)
IniWrite($ini, "Auto Start", "Game Start Time", $gameStartTime)
IniWrite($ini, "Auto Start", "Password", $gamePassword)
IniWrite($ini, "Auto Start", "Task Manager Executable Name", $gameExecutable)
EndFunc ;==>CreateINI
Code:
Func IsGameOpen()
If ProcessExists($gameExecutable) = True Then
$size = WinGetClientSize("[CLASS:D3 Main Window Class]")
ElseIf ProcessExists($gameExecutable) = False Then
GUICtrlSetData($lblStatus, "Status: Starting Game Client")
Run($gameLoc & $gameExecutable & " -launch")
Sleep($gameStartTime)
WinActivate("Diablo III")
Send($gamePassword)
Sleep(1000)
Send("{ENTER}")
sleep($gameStartTime)
$size = WinGetClientSize("[CLASS:D3 Main Window Class]")
EndIf
EndFunc