Advertisement
Guest User

Logging1024x768.au3

a guest
Jun 11th, 2012
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.35 KB | None | 0 0
  1. #include <ImageSearch.au3>
  2.  
  3. HotKeySet("{PAUSE}", "Terminate")
  4. $Title = 'Diablo III' ; The Name Of The Game...
  5. $Full = WinGetTitle ($Title) ; Get The Full Title..
  6. $HWnD = WinGetHandle ($Full) ; Get The Handle
  7. $mLeft="left"
  8. $mRight="right"
  9. $repair=0
  10. $haveRare=0
  11. $diabloStarted=0
  12.  
  13.  
  14. $diabloPath = IniRead("Options.ini","variables","DiabloPath","GTFO")
  15. $accountName=ClipPut(IniRead("Options.ini","variables","AccName","GTFO"))
  16. $accountPassword=IniRead("Options.ini","variables","Pass","GTFO")
  17.  
  18. Func login()
  19. While 1
  20. $started=startD3($diabloPath)
  21. If $started=1 Then
  22. ExitLoop
  23. Else
  24. KillD3()
  25. EndIf
  26. WEnd
  27. Sleep(200)
  28. putAccPass($accountName,$accountPassword)
  29. Sleep(8000)
  30. While 1
  31. $checkMisspell=checkIfMisspelled()
  32. If $checkMisspell=1 Then
  33. putAccPass($accountName,$accountPassword)
  34. Else
  35. ExitLoop
  36. EndIf
  37. WEnd
  38. $times=0
  39. Do
  40. Sleep(3000)
  41. $logged=checkIfLoggedSuccess()
  42. If $logged=1 Then
  43. ExitLoop
  44. Else
  45. $error=checkError()
  46. If $error=1 Then
  47. Sleep(1000)
  48. putAccPass($accountName,$accountPassword)
  49. EndIf
  50. EndIf
  51. $times=$times+1
  52. Until $times=5
  53. If $times=5 Then
  54. KillD3()
  55. Sleep(2000)
  56. return 0
  57. Else
  58. return 1
  59. EndIf
  60. EndFunc
  61.  
  62.  
  63. Func checkIfMisspelled()
  64. $x=0
  65. $y=0
  66. $res= _ImageSearch("D3Images\BlackLogin1024x768.JPG",0,$x,$y,40)
  67. If $res=1 Then
  68. return 1
  69. EndIf
  70. EndFunc
  71.  
  72. Func startD3($diabloPath)
  73. Run($diabloPath & " -launch")
  74. Sleep(15000)
  75. $x=0
  76. $y=0
  77. $a=0
  78. Do
  79. $res= _ImageSearch("D3Images\LoginName1024x768.JPG",0,$x,$y,100)
  80. If $res=1 Then
  81. return 1
  82. Else
  83. Sleep(3000)
  84. EndIf
  85. $a=$a+1
  86. Until $a=10
  87. return 0
  88. EndFunc
  89.  
  90. Func putAccPass($accountName, $accountPassword)
  91. $willPutLogin=IniRead("Options.ini","Logging","UseLogin","GTFO")
  92. WinActivate("Diablo III")
  93. Sleep(200)
  94. $x=0
  95. $y=0
  96. ;$res= _ImageSearch("D3Images\LoginName1024x768.JPG",0,$x,$y,100)
  97. ;If $res=1 Then
  98. ControlClick ($HWnD, '','', "left", 1, 596, 418)
  99. Sleep(50)
  100. If $willPutLogin=1 Then
  101. ControlSend($HWnD,'','',"{BACKSPACE}")
  102. $a=0
  103. Do
  104. Sleep(1)
  105. ControlSend($HWnD,'','',"{BACKSPACE}")
  106. $a=$a+1
  107. Until $a=30
  108. Sleep(100)
  109. ;ControlSend($HWnD,'','',"^v")
  110. Send("{CTRLDOWN}")
  111. Sleep(20)
  112. Send("v")
  113. Sleep(20)
  114. Send("{CTRLUP}")
  115. ;ClipGet()
  116. EndIf
  117. Sleep(400)
  118. ControlSend($HWnD,'','',"{TAB}")
  119. Sleep(200)
  120. $a=0
  121. Do
  122. Sleep(1)
  123. ControlSend($HWnD,'','',"{BACKSPACE}")
  124. $a=$a+1
  125. Until $a=30
  126. Sleep(200)
  127. ControlSend($HWnD,'','',$accountPassword)
  128. Sleep(700)
  129. ControlClick ($HWnD, '','', "left", 1, 592,605)
  130. ;EndIf
  131. EndFunc
  132.  
  133. Func checkError()
  134. WinActivate("Diablo III")
  135. Sleep(200)
  136. $x=0
  137. $y=0
  138. $res= _ImageSearch("D3Images\Error1024x768.JPG",0,$x,$y,80)
  139. If $res=1 Then
  140. Sleep(100)
  141. ControlSend($HWnD,'','',"{ESC}")
  142. Sleep(500)
  143. return 1
  144. EndIf
  145. EndFunc
  146.  
  147. Func checkIfLoggedSuccess()
  148. WinActivate("Diablo III")
  149. Sleep(200)
  150. $x=0
  151. $y=0
  152. $res= _ImageSearch("D3Images\ChangeQuest1024x768.JPG",0,$x,$y,90)
  153. If $res=1 Then
  154. return 1
  155. Else
  156. return 0
  157. EndIf
  158. EndFunc
  159.  
  160. Func KillD3()
  161. Do
  162. $sPID = ProcessExists("Diablo III.exe")
  163. Run(@ComSpec & " /c taskkill /F /PID " & $sPID & " /T", @SystemDir, @SW_HIDE)
  164. Sleep(1000)
  165. Until $sPID <> 8088
  166. EndFunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement