Code:
;Updated 5/24/2012
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_UseX64=y
#AutoIt3Wrapper_Res_requestedExecutionLevel=asInvoker
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
AutoItSetOption("WinTitleMatchMode", 3)
$Form1 = GUICreate("Focus3", 400, 200, @DesktopWidth - 410, @DesktopHeight - 275)
GUISetBkColor(0x0000FF)
GUISetState(@SW_SHOW)
HotKeySet("{F1}", "GetFocus")
HotKeySet("{F3}", "CloseAll")
HotKeySet("{F2}", "StartUp")
$PASSWORD = "Your Password here"
$Focus = False
$Exists = 0
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
Func CloseAll()
Close()
Exit
EndFunc
Func Close()
ControlClick("UntzBot v5.0x3 Lite", "SAVE", "Button4", "Left", 1)
Sleep(200)
WinClose("UntzBot v5.0x3 Lite")
Sleep(200)
$Exists = WinExists("DeathCheck")
If $Exists = 1 Then
Send("f")
EndIf
EndFunc
Func Focus()
While $Focus = True
$Exists = WinExists("Star Wars™: The Old Republic™")
if $Exists = 0 Then
Send("e")
Launch()
Else
WinActivate("Star Wars™: The Old Republic™")
Sleep(250)
ShowFocus()
EndIf
WEnd
EndFunc
Func GetFocus()
$Focus = Not $Focus
ShowFocus()
Focus()
EndFunc
Func ShowFocus()
If $Focus = True Then
ToolTip("SWTOR has focus.", @DesktopWidth/2, @DesktopHeight/2)
Else
ToolTip("")
EndIf
EndFunc
Func StartUp()
$Exists = WinExists("UntzBot v5.0x3 Lite")
if $Exists = 0 Then
Run("UntzBot50x3.exe", @ScriptDir)
Sleep(500)
If WinExists("UntzBot") Then
WinClose("UntzBot")
EndIf
ControlClick("UntzBot Login v5.0x3", "&FreeMode", "Button3", "Left", 2)
Sleep(200)
$result = ControlClick("UntzBot v5.0x3 Lite", "LOAD", "Button5", "Left", 2)
Sleep(200)
EndIf
$Exists = WinExists("DeathCheck")
If $Exists = 0 Then
Run("DeathCheck50x3.exe", @ScriptDir)
Sleep(200)
EndIf
WinMove("UntzBot v5.0x3 Lite", "", @DesktopWidth - 310, 5)
WinMove("DeathCheck", "", @DesktopWidth - 310, 600)
Sleep(300)
WinMove("Focus3", "", @DesktopWidth - 410, @DesktopHeight - 275)
EndFunc
Func Login()
$Size = WinGetClientSize("STAR WARS™: The Old Republic™")
While IsArray($Size) = 0
$Size = WinGetClientSize("STAR WARS™: The Old Republic™")
WEnd
WinMove("STAR WARS™: The Old Republic™", "", 0,0, $Size[0], $Size[1])
Sleep(1000)
MouseClick("Left", $Size[0]/2, $Size[1]/2)
Send($PASSWORD)
Sleep(200)
MouseClick("Left", $Size[0] * 3 /4, $Size[1] * 10 / 12)
Sleep(8000)
MouseClick("Left", $Size[0] * 3 /4, $Size[1] * 10 / 12)
EndFunc
Func CheckWin()
If WinExists("STAR WARS: The Old Republic") Then
While WinExists("STAR WARS: The Old Republic")
$pid = WinGetProcess("STAR WARS: The Old Republic")
ProcessClose($pid)
WEnd
EndIf
If WinExists("STAR WARS™: The Old Republic™") Then
WinActivate("STAR WARS™: The Old Republic™")
$Size = WinGetClientSize("STAR WARS™: The Old Republic™")
While IsArray($Size) = 0
$Size = WinGetClientSize("STAR WARS™: The Old Republic™")
WEnd
WinMove("STAR WARS™: The Old Republic™", "", 0,0, $Size[0], $Size[1])
PixelSearch(0,0,$Size[0]/2, $Size[1]/2, 0xFD2A2A)
If Not @error Then
$pid = WinGetProcess("STAR WARS™: The Old Republic™")
ProcessClose($pid)
Sleep(500)
Launch()
Else
Login()
EndIf
EndIf
EndFunc
Func Launch()
MouseClick("left", 35, 45, 2, 0)
Sleep(15000)
$Exists = WinExists("STAR WARS™: The Old Republic™")
While $Exists = 0
MouseClick("Right", 1400, 600)
Sleep(1000)
MouseClick("Left", 1400, 550)
MouseClick("left", 35, 45, 2, 0)
Sleep(15000)
$Exists = WinExists("STAR WARS™: The Old Republic™")
WEnd
Close()
Sleep(2000)
$Exists = WinExists("STAR WARS™: The Old Republic™")
If $Exists = 1 Then
WinActivate("STAR WARS™: The Old Republic™")
Login()
Else
While $Exists = 0
$Exists = WinExists("STAR WARS™: The Old Republic™")
Sleep(1000)
WEnd
WinActivate("STAR WARS™: The Old Republic™")
Login()
EndIf
Sleep(500)
StartUp()
Sleep(30000)
WinActivate("Star Wars™: The Old Republic™")
MouseClick("Left", 773, 508, 2)
Sleep(20000)
CheckWin()
If $Focus = True Then
Send("q")
EndIf
EndFunc