Advertisement
kazmadan

brettbot_v1.1

Jun 8th, 2012
199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.99 KB | None | 0 0
  1. ;Brettbot 1.0
  2. ;Resolution: 1920x1080 Fullscreen / Fullscreen Windowed
  3. ;Sword of the Stranger + Royal Crypts Checkpoint
  4. ;Move bound to Mouse3
  5. ;Teleport on [Right Click]
  6. ;Frost Armor with Final Rune on [4]
  7. ;~20 yard pickup strongly suggested
  8. ;Base movespeed (decrease sleep in Move() for higher MS
  9. ;
  10. ;Start/Pause toggle: [DEL] - begins paused
  11. ;Quit: [END]
  12. ;
  13. ;;;;;
  14.  
  15.  
  16.  
  17.  
  18. Func Terminate()
  19. Exit 0
  20. EndFunc
  21.  
  22. Opt('MouseCoordMode', 0)
  23. Opt('PixelCoordMode', 0)
  24.  
  25. HotKeySet('{END}', "Terminate")
  26. ;HotKeySet('{END}', 'Quit')
  27. HotKeySet('{DEL}', 'Pause')
  28.  
  29. Global $Paused
  30. $default_resolutionX = 1920
  31. $default_resolutionY = 1080
  32. $loadtime = 5000 ; time in ms the script waits for the game to load before it starts pathfinding.
  33. $x_ratio = @Desktopwidth / $default_resolutionX
  34. $y_ratio = @Desktopheight / $default_resolutionY
  35. $Dead = False
  36. $Window = False
  37. $yellow = 0xFFF000 ; yellow color code
  38. $red = 0xD90000 ; red color code
  39.  
  40. ;bot starts paused. press DEL to start.
  41. Pause()
  42.  
  43. WinActivate('Diablo III')
  44. While 1
  45. If WinActive('Diablo III') Then
  46. ;start
  47. $i = 0 ;resets item pickup counter
  48. Sleep(Random(500, 1000))
  49. Click(234, 413);resume
  50. Sleep(Random(1500, 1600))
  51. Send("{4 down}") ;Holds the 4 key down while loading game
  52. Sleep(2500) ;load time
  53.  
  54. Call("CheckRepair") ;looking to repair, repairs and restarts if detected
  55.  
  56. Move(1804, 1003);First click towards waypoint
  57. Sleep(1550)
  58. Move(1599, 649);near the waypoint
  59. Sleep(1150)
  60. Move(1513, 81);aiming for the gate
  61. Sleep(2300) ;a bit of extra wait time for the coffin drop
  62. Sleep(Random(1,100))
  63. MouseClick( "right",1095, 337, 1, Random(0, 1)) ;teleport past gate
  64. Sleep(600)
  65. Move(1348, 453);post-blink move to the right
  66. Sleep(300)
  67. Move(1448, 123);heading towards the center
  68. Sleep(1800)
  69. Move( 854, 193) ;move into the west corner
  70. Sleep(900)
  71. Move( 806, 401) ;move more in west corner
  72. Move( 1260, 211) ;move into west hallway entrance
  73. Sleep(1000)
  74. Move( 215, 67) ;down west hallway
  75. Sleep(2800)
  76. Move(1141, 395) ; Turn
  77. Move(1898, 1059) ;New Up
  78. Sleep(1450)
  79. Move( 1664, 571);mouth of north corner
  80. Sleep(1400)
  81. Move( 1256, 350);into north corner
  82. Sleep(400)
  83. Move( 1300, 605);end of north corner
  84. Sleep(Random(50, 150))
  85. MouseClick( "right", 1676, 957, 1, Random(0, 1));blinking past the center
  86. Sleep(500)
  87. Move(1482, 892) ;post blink move to the east corner
  88. Sleep(700)
  89. Move(618, 667) ;extra corner point
  90. Sleep(400)
  91. Move(669, 498) ;get left pot cluster in east corner
  92. Move( 930, 932);move into east hall entrance
  93. Sleep(300)
  94. Move( 1673, 1036) ;head down east hall
  95. Sleep(1100)
  96. Move( 1698, 946) ;head down east hall
  97. Sleep(300)
  98. Send("{4 up}") ;Releases the 4 key
  99. Sleep(400)
  100. Send("{4 down}") ;Holds the 4 key down
  101. Sleep(400)
  102. Move(1375, 752) ;last bit of east hall
  103. Sleep(400)
  104. Move( 700, 676) ;turn
  105. Move( 209, 12) ;head to east hall entrance
  106. Sleep(3300)
  107. Move( 165, 306) ;south corner pots
  108. Sleep(Random(1900, 2000))
  109. MouseClick( "right", 107, 419, 1, Random(0, 1)) ;last bit of gold from south corner pots / run away
  110. Sleep(200)
  111. Send("{4 up}") ;Releases the 4 key
  112. Sleep(Random(400, 500))
  113. Send("t") ;tping
  114. Sleep(Random(8200, 8250));channel time + load time
  115.  
  116. $Pixeltest = PixelGetColor(758, 918) ;checks if you're in town
  117. If Hex($Pixeltest, 6) == "62969B" Then
  118. Send("{Escape}") ;menu
  119. Sleep(300)
  120. Click(970, 578) ;quit
  121. Sleep(3000) ;waits a short time for in-town quitting
  122. Else ;town portal not successful
  123. Send("{Escape}") ;menu
  124. Sleep(300)
  125. Click(970, 578) ;quit
  126. Sleep(Random(13000, 13050)) ;long wait for hard quit
  127. Endif
  128.  
  129. EndIf
  130. WEnd
  131.  
  132. Func Pause()
  133. $Paused = Not $Paused
  134. While $Paused
  135. Sleep(100)
  136. ToolTip('Paused...', 0, 0)
  137. WEnd
  138. ToolTip("")
  139. EndFunc ;==>Pause
  140.  
  141. Func Move($x, $y)
  142. Call("CheckLoot")
  143. MouseClick('middle', Random($x - 2, $x + 2), Random($y - 2, $y + 2), 1, Random(0, 1))
  144. Sleep(Random(750, 850))
  145. EndFunc ;==>Move
  146.  
  147.  
  148. Func Click($x, $y)
  149. MouseClick('left', Random($x - 4, $x + 4), Random($y - 4, $y + 4), 1, Random(0, 2))
  150. Sleep(Random(1000, 1500))
  151. EndFunc ;==>Click
  152.  
  153. Func CheckLoot()
  154. ;Sleep(Random(100,200))
  155. $Pixel4 = PixelSearch(Round(270*$x_ratio), 0, Round(1690*$x_ratio), Round(900*$y_ratio), 0xBF642F, 1) ;searches main window for color of legendary lootz
  156. If Not @error Then
  157. MouseClick ('left', $Pixel4[0], $Pixel4[1])
  158. Sleep(Random(300,600))
  159. $i+= 1
  160. If $i < 10 Then
  161. Call("CheckLoot")
  162. EndIf
  163. EndIf
  164. $Pixel5 = PixelSearch(Round(270*$x_ratio), 0, Round(1690*$x_ratio), Round(900*$y_ratio), 0xFFFF00, 1) ; rare lootz (also f3f45b)
  165. If Not @error Then
  166. MouseClick ('left', $Pixel5[0], $Pixel5[1])
  167. Sleep(Random(300,600))
  168. $i+= 1
  169. If $i < 10 Then
  170. Call("CheckLoot")
  171. EndIf
  172. EndIf
  173. $Pixel6 = PixelSearch(Round(270*$x_ratio), 0, Round(1690*$x_ratio), Round(900*$y_ratio), 0x00FF00, 1) ; set lootz
  174. If Not @error Then
  175. MouseClick ('left', $Pixel6[0], $Pixel6[1])
  176. Sleep(Random(300,600))
  177. $i+= 1
  178. If $i < 10 Then
  179. Call("CheckLoot")
  180. EndIf
  181. EndIf
  182. EndFunc
  183.  
  184.  
  185. Func CheckDead()
  186. Call("CheckWindow")
  187. $Pixeltest = PixelGetColor(Round(740*$x_ratio), Round(850*$y_ratio))
  188. If Hex($Pixeltest, 6) == "0C0404" OR Hex($Pixeltest, 6) == "310000" Then
  189. If Not $Window Then
  190. $Dead = True
  191. Sleep(100)
  192. Send("{Escape}")
  193. Sleep(10)
  194. MouseClick("left", Round(956*$x_ratio),Round(579*$y_ratio)) ;button to leave game
  195. Sleep(12500)
  196. Sleep($loadtime)
  197. MouseClick("left", Round(230*$x_ratio),Round(416*$y_ratio)) ;button to resume game from main menu
  198. Sleep($loadtime)
  199. ElseIf $Window Then
  200. MouseClick("left", Round(230*$x_ratio),Round(416*$y_ratio)) ;button to resume game from main menu
  201. Sleep(Random(1500, 1600))
  202. Send("{4 down}") ;Holds the 4 key down
  203. Sleep(2500) ;load time
  204. $Window = False
  205. EndIf
  206. ; ElseIf Hex($Pixeltest, 6) == "0C0000" OR Hex($Pixeltest, 6) == "030101" Then
  207. ; Sleep(10000)
  208. ; If Not $Window Then
  209. ; $Dead = True
  210. ; Sleep($loadtime)
  211. ; MouseClick("left", Round(230*$x_ratio),Round(416*$y_ratio)) ;button to resume game from main menu
  212. ; Sleep($loadtime)
  213. ; ElseIf $Window Then
  214. ; MouseClick("left", Round(230*$x_ratio),Round(416*$y_ratio)) ;button to resume game from main menu
  215. ; Sleep($loadtime)
  216. ; $Window = False
  217. ; EndIf
  218. Else
  219. $Dead = False
  220. EndIf
  221. EndFunc
  222.  
  223.  
  224.  
  225. Func CheckWindow()
  226. $Pixeltest2 = PixelGetColor(Round(1580*$x_ratio), Round(100*$y_ratio))
  227. If Hex($Pixeltest2, 6) == "653B23" Then
  228. Sleep(200)
  229. Send("{V}") ;close any open windows
  230. $Window = True
  231. Else
  232. $Window = False
  233. EndIf
  234. Sleep(300)
  235. EndFunc
  236.  
  237.  
  238.  
  239. Func CheckRepair()
  240. Sleep(1000)
  241. $RepairArea = PixelSearch(Round(1480*$x_ratio), 0, Round(1900*$x_ratio), Round(50*$y_ratio), $yellow)
  242. If Not @error Then
  243. Call("DoRepair")
  244. EndIf
  245. $RepairAreaRed = PixelSearch(Round(1480*$x_ratio), 0, Round(1900*$x_ratio), Round(50*$y_ratio), $red)
  246. If Not @error Then
  247. Call("DoRepair")
  248. EndIf
  249. EndFunc
  250.  
  251. Func DoRepair()
  252. Sleep(100)
  253. Send("{4 up}") ;Releases the 4 key
  254. Sleep(1000)
  255. Send("t")
  256. Sleep(8000)
  257. MouseClick("left", Round(1480*$x_ratio),Round(281*$y_ratio)) ;begin movement towards merchant
  258. Sleep(1500)
  259. MouseClick("left", Round(1316*$x_ratio),Round(206*$y_ratio)) ;moves to get merchant in screen
  260. Sleep(1500)
  261. MouseClick("left", Round(845*$x_ratio),Round(225*$y_ratio)) ;NPC Merchant to the right of cain's home
  262. Sleep(1200)
  263. MouseClick("left", Round(521*$x_ratio),Round(506*$y_ratio)) ;button to open up repair menu
  264. Sleep(400)
  265. MouseClick("left", Round(260*$x_ratio),Round(595*$y_ratio)) ;button to pay for repairs
  266. Sleep(100)
  267. Call("CheckDead")
  268. Call("CheckWindow")
  269. If Not $Dead Then
  270. Send("{ESCAPE}") ;closes repair tab
  271. Sleep(100)
  272. Send("{ESCAPE}") ;menu
  273. Sleep(10)
  274. MouseClick("left", Round(956*$x_ratio),Round(579*$y_ratio)) ;button to leave game
  275. Sleep($loadtime)
  276. MouseClick("left", Round(230*$x_ratio),Round(416*$y_ratio)) ;button to resume game from main menu
  277. Sleep(Random(1500, 1600))
  278. Send("{4 down}") ;Holds the 4 key down
  279. Sleep(4500) ;load time
  280. EndIf
  281. EndFunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement