Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <ImageSearch.au3>
- HotKeySet("{PAUSE}", "Terminate")
- $Title = 'Diablo III' ; The Name Of The Game...
- $Full = WinGetTitle ($Title) ; Get The Full Title..
- $HWnD = WinGetHandle ($Full) ; Get The Handle
- $mLeft="left"
- $mRight="right"
- $repair=0
- $haveRare=0
- $diabloStarted=0
- $diabloPath = IniRead("Options.ini","variables","DiabloPath","GTFO")
- $accountName=ClipPut(IniRead("Options.ini","variables","AccName","GTFO"))
- $accountPassword=IniRead("Options.ini","variables","Pass","GTFO")
- Func login()
- While 1
- $started=startD3($diabloPath)
- If $started=1 Then
- ExitLoop
- Else
- KillD3()
- EndIf
- WEnd
- Sleep(200)
- putAccPass($accountName,$accountPassword)
- Sleep(8000)
- While 1
- $checkMisspell=checkIfMisspelled()
- If $checkMisspell=1 Then
- putAccPass($accountName,$accountPassword)
- Else
- ExitLoop
- EndIf
- WEnd
- $times=0
- Do
- Sleep(3000)
- $logged=checkIfLoggedSuccess()
- If $logged=1 Then
- ExitLoop
- Else
- $error=checkError()
- If $error=1 Then
- Sleep(1000)
- putAccPass($accountName,$accountPassword)
- EndIf
- EndIf
- $times=$times+1
- Until $times=5
- If $times=5 Then
- KillD3()
- Sleep(2000)
- return 0
- Else
- return 1
- EndIf
- EndFunc
- Func checkIfMisspelled()
- $x=0
- $y=0
- $res= _ImageSearch("D3Images\BlackLogin1024x768.JPG",0,$x,$y,40)
- If $res=1 Then
- return 1
- EndIf
- EndFunc
- Func startD3($diabloPath)
- Run($diabloPath & " -launch")
- Sleep(15000)
- $x=0
- $y=0
- $a=0
- Do
- $res= _ImageSearch("D3Images\LoginName1024x768.JPG",0,$x,$y,100)
- If $res=1 Then
- return 1
- Else
- Sleep(3000)
- EndIf
- $a=$a+1
- Until $a=10
- return 0
- EndFunc
- Func putAccPass($accountName, $accountPassword)
- $willPutLogin=IniRead("Options.ini","Logging","UseLogin","GTFO")
- WinActivate("Diablo III")
- Sleep(200)
- $x=0
- $y=0
- ;$res= _ImageSearch("D3Images\LoginName1024x768.JPG",0,$x,$y,100)
- ;If $res=1 Then
- ControlClick ($HWnD, '','', "left", 1, 596, 418)
- Sleep(50)
- If $willPutLogin=1 Then
- ControlSend($HWnD,'','',"{BACKSPACE}")
- $a=0
- Do
- Sleep(1)
- ControlSend($HWnD,'','',"{BACKSPACE}")
- $a=$a+1
- Until $a=30
- Sleep(100)
- ;ControlSend($HWnD,'','',"^v")
- Send("{CTRLDOWN}")
- Sleep(20)
- Send("v")
- Sleep(20)
- Send("{CTRLUP}")
- ;ClipGet()
- EndIf
- Sleep(400)
- ControlSend($HWnD,'','',"{TAB}")
- Sleep(200)
- $a=0
- Do
- Sleep(1)
- ControlSend($HWnD,'','',"{BACKSPACE}")
- $a=$a+1
- Until $a=30
- Sleep(200)
- ControlSend($HWnD,'','',$accountPassword)
- Sleep(700)
- ControlClick ($HWnD, '','', "left", 1, 592,605)
- ;EndIf
- EndFunc
- Func checkError()
- WinActivate("Diablo III")
- Sleep(200)
- $x=0
- $y=0
- $res= _ImageSearch("D3Images\Error1024x768.JPG",0,$x,$y,80)
- If $res=1 Then
- Sleep(100)
- ControlSend($HWnD,'','',"{ESC}")
- Sleep(500)
- return 1
- EndIf
- EndFunc
- Func checkIfLoggedSuccess()
- WinActivate("Diablo III")
- Sleep(200)
- $x=0
- $y=0
- $res= _ImageSearch("D3Images\ChangeQuest1024x768.JPG",0,$x,$y,90)
- If $res=1 Then
- return 1
- Else
- return 0
- EndIf
- EndFunc
- Func KillD3()
- Do
- $sPID = ProcessExists("Diablo III.exe")
- Run(@ComSpec & " /c taskkill /F /PID " & $sPID & " /T", @SystemDir, @SW_HIDE)
- Sleep(1000)
- Until $sPID <> 8088
- EndFunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement