Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #cs
- Witch Doctor Cellar Farming Bot - Version 0.7.20120701 [1920x1080 ONLY]
- Developed by Avatar88343 @ Ownedcore (v0.1~v0.4) and andygongyb @ Ownedcore (since v0.5)
- Other contributers:
- Beta tester: liquidsystem @ Ownedcore
- What it does:
- *This bot will travel to the cellar in Act 1, kill the mobs, collect the gold and items, and repair your gear.
- Newbiew Info:
- This is a script that runs on AutoIt. You run this bot by Downloading AutoIt from the web (it's free) and installing it.
- You then paste all this code into any text editor (such as notepad) and save it anywhere on your hard drive. Follow the Select
- steps below to configure this bot before you run it.
- Special Instructions for 1920 x 1080:
- 1.) Set your game resolution to 1920x1080 (required)
- 2.) Set the display mode to Fullscreen Windowed (Don't forget!)
- 3.) Follow the Instructions (for all resolutions) section below
- Special Instructions for 800 x 600:
- 1.)Exit Diablo 3
- 2.)Go to your document folder and locate the Diablo III folder
- 3.)Open the D3Prefs file in any editor (such as notepad)
- 4.)Change the following settings to the ones listed below
- "DisplayModeFlags "0"
- DisplayModeWindowMode "1"
- DisplayModeWinLeft "428"
- DisplayModeWinTop "162"
- DisplayModeWinWidth "800"
- DisplayModeWinHeight "600"
- DisplayModeUIOptWidth "800"
- DisplayModeUIOptHeight "600"
- DisplayModeWidth "800"
- DisplayModeHeight "600"
- DisplayModeRefreshRate "75"
- DisplayModeBitDepth "32""
- 5.) Follow the Instructions (for all resolutions) section below
- Instructions (for all resolutions)
- 1.) Bind your middle mouse button to Move (found in Key Bindings Option)
- 2.) Set your build to this http://us.battle.net/d3/en/calculator/witch-doctor#aZQPkU!VZW!acbbba
- 3.) Start Act 1, Quest 6 - Talk to Alaric
- 4.) Hire the Scoundrel
- 5.) Teleport to The Old Ruins using the waypoint and run left until you reach a checkpoint
- 6.) Log out of the game
- 7.) Press F2 to start the bot! Space is used to pause and resume the bot
- 8.) Press shift + \ to turn off the bot
- NOTE:
- *Please make sure you are running the correct resolution settings!
- *You must be running the game in Fullscreen Windoed mode if you're using 1080P
- *You WILL need to edit the values below the comments for better results
- FEATURES:
- *Supports 1080P Fullscreen Windowed and 800x600 Windowed (V. 0.5 only supports 1080P currently)
- *Automatic looting of Rare, Legendary, and Set items
- *Also able to loot blue items, tomes, and gems
- *Optionally sells blue items when the bag is full
- *Repairs Items when damaged
- *Detects death and responds accordingly
- *Detects connection lost and automatically reconnect (not tested)
- *Randomization for increased safety
- *Added ability to find Cellar during bad runs
- IN DEVELOPMENT:
- *Multi-resolution support (need people to help)
- *Stash use
- *Improved combat
- *Speed improvements
- *Multiple routes to improve safety
- *45 min timeout bug
- *Edit d3config
- *Salvage lv60 blue items automatically
- **Based on the code by notAres and mackus101. Special thanks to them!
- #ce
- #RequireAdmin
- #include <GUIConstantsEx.au3>
- #include <WindowsConstants.au3>
- ;======THESE VALUES CAN BE EDITED WITH THE GUI ===================================
- $R = 0 ; Leave this as 0 if you are using 1080P. Change it to 1 if you're using 800 x 600
- $ComputerLag = 500 ; Additional delay time for switching between scenes
- $RunSpeed = 10 ; Enter your character's run speed here
- $LootRares = True ; Whether or not to loot rare and legendary items
- $LootBlues = True ; Whether or not to loot blue items
- $LootGems = True ; Whether or not to loot gems
- $LoorSquareGems = False ; Set to False if you want only flawless gems
- $LootPotions = True ; Whether or not to loot potions
- $LootTomes = True ; Whether or not to loot Tome of Secret
- $LootGold = True ; Whether or to collect gold that is missed during the first collection attempt
- $Repair = True ; Orders the bot to repair when items are damaged
- $SellBlues = True ; Orders the bot to sell blue items when the bag is full
- $Skill3CoolDown = 20000 ; Cool down time in ms of the key 3 skill
- $Skill4CoolDown = 12000 ; Cool down time in ms of the key 4 skill
- $RightClickCoolCown = 8000 ; Cool down time in ms of the right click skill
- $LootDelayMult = 5.5 ; Scaler for calculating the delay to run to an item
- $RunDelayMult = 1.1 ; Scaler for calculating the delay to run to a position
- $CastSpeedMult = 1.1 ; Scaler for calculating casting speed
- $FastLoot = True ; Set to False if the char TP to town before finishing looting
- $Password = "your password" ; put your password here
- ;======================================================================
- Global $Resume[2][2] ; Location of the Resume Button
- Global $Leave[2][2] ; Location of the in-game leave button
- Global $GameLobbyCode[2][3] ; Contains X, Y, and Hex color of Resume button so we can see if we're there
- Global $GameScreenCode[2][3] ; Contains X, Y, and Hex color used to check if we are in an unpaused game
- Global $Loc1[2][2] ; First movement
- Global $Loc2[2][2] ; Second movement
- Global $Loc3[2][2] ; Third movement ttt
- Global $CellarLocation[2][2] ; Cellar door location
- Global $CellarLocation2[2] ; Location of cellar during bad runs (ugly workaround for now)
- Global $AltCellar = False
- Global $MagicLetter[5] ; Blue vow pics
- Global $RareLetter[5] ; Rare vow pics
- Global $LegLetter[5] ; Legendary vow pics
- Global $SetLetter[5] ; Set vow pics
- Global $Loc5[2][2] ; Cellar hallway
- Global $Loc6[2][2] ; Cellar doorway
- Global $MonsterLoc[2][2] ; Initial boss location
- Global $MonsterSearch[2][4] ; Bounds of where we will find our monsters
- Global $GoldLoot1[2][2] ; First place to run when looting
- Global $GoldLoot2[2][2] ; Second place to run when looting
- Global $GoldLoot3[2][2] ; Third place to run when looting
- Global $LootingArea[2][4] ; looting bounds (TL X, TL Y, BR X, BR Y)
- Global $CharHitBox[2][4] ; Hitbox around user's character
- Global $DeathBounds[2][4] ; Used to detect the % sign in the death text
- Global $RepairCoords[2][4][2] ; Four clicks needed to repair
- Global $RepairCheck[2][2] ; Used to check for repair icon
- Global $CellarOffset[2] ; Used to improve cellar clicking with 1080P/800x600
- Global $CellarIcon ; Used to find the yellow cellar icon on the minimap (future use)
- Global $pngLoc[2] ; Absolute path of the folder containing pics for image search
- Global $LostConnectionOkBtn[2][2] ; The coordinate of the OK button of the "lost connection" window
- Global $LostConnectionText0[2][4] ; Image search area of the "lost connection" text
- Global $LostConnectionText1[2][4]
- Global $LostConnectionText2[2][4]
- Global $CharLoc[2][2] ; Location where the character stands
- Global $CastLoc[2][2] ; Location to cast Grasp of the Dead in the cellar
- Global $SellCoords[2][2] ; Coordinate of the sell button
- Global $SlotOffset[2] ; Length of each slot in the item window
- Global $ItemStartCoord0[2][4] ; Pixel search area of the first slot on the second column in item window
- Global $ItemStartCoord1[2][4]
- Global $BagFullCoords[2][4] ; Image search area of the bag full message
- Global $IdleCursorCoords[2][2] ; Coordinate of where the cursor should go for not covering any item name
- Global $TristramTextCoord[2][4] ; Pixel search area of the Tristram text
- Global $RuinTextCoord[2][4] ; Pixel search area of the Ruin text
- Global $CellarTextCoord[2][4] ; Pixel search area of the Cellar text
- Global $ResumeBtnCoord[2][4] ; Image search area of the resume text
- Global $LoginFailText[2][4]
- Global $LeaveGameText[2][4]
- Global $PwdInput[2][2]
- Global $OkBtn0[2][2]
- Global $OkBtn1[2][2]
- Global $NeedReset
- Global $CellarPixel
- Global $BagFull
- Global $HasBlue
- Global $Timer0
- Global $Timer1
- Global $Moved
- Global $Skill3Timer
- Global $Skill4Timer
- Global $RightClickTimer
- Global $Gem
- ActivateGUI()
- ;Check for people that can't read instructions
- If Int($R) < 0 Or Int($R) > 1 Then
- MsgBox(4096, "A wild illiterate appears appears!", "Aha! I caught you! You did not read the instructions. You need to configure the bot!")
- terminate()
- EndIf
- ;Clculate run speed
- Global $RunTime = 30 * (100 - $RunSpeed) + 2000 ;Length of time to run in 800x600
- ;All locations are N dimensional arrays. [0][x] is for 1080P and [1][x] is for 800x600
- ;1080P
- $MagicLetter[0] = "blueA.png"
- $MagicLetter[1] = "blueE.png"
- $MagicLetter[2] = "blueI.png"
- $MagicLetter[3] = "blueO.png"
- $MagicLetter[4] = "blueU.png"
- $RareLetter[0] = "rareA.png"
- $RareLetter[1] = "rareE.png"
- $RareLetter[2] = "rareI.png"
- $RareLetter[3] = "rareO.png"
- $RareLetter[4] = "rareU.png"
- $LegLetter[0] = "legendaryA.png"
- $LegLetter[1] = "legendaryE.png"
- $LegLetter[2] = "legendaryI.png"
- $LegLetter[3] = "legendaryO.png"
- $LegLetter[4] = "legendaryU.png"
- $SetLetter[0] = "setA.png"
- $SetLetter[1] = "setE.png"
- $SetLetter[2] = "setI.png"
- $SetLetter[3] = "setO.png"
- $SetLetter[4] = "setU.png"
- ;1920x1080
- $pngLoc[0] = "F:\Program Files (x86)\Diablo III\pics\1920x1080\" ; Location of the .PNGs (NO SUBFOLDERS - ALL PNGS GO HERE)
- $Resume[0][0] = 319
- $Resume[0][1] = 416
- $GameLobbyCode[0][0] = 319
- $GameLobbyCode[0][1] = 416
- $GameLobbyCode[0][2] = 4065536
- $GameScreenCode[0][0] = 1119
- $GameScreenCode[0][1] = 1044
- $GameScreenCode[0][2] = 0xDEFDFE
- $LostConnectionOkBtn[0][0] = 957
- $LostConnectionOkBtn[0][1] = 630
- $LostConnectionText0[0][0] = 765
- $LostConnectionText0[0][1] = 493
- $LostConnectionText0[0][2] = 853
- $LostConnectionText0[0][3] = 525
- $LostConnectionText1[0][0] = 765
- $LostConnectionText1[0][1] = 493
- $LostConnectionText1[0][2] = 864
- $LostConnectionText1[0][3] = 525
- $LostConnectionText2[0][0] = 765
- $LostConnectionText2[0][1] = 493
- $LostConnectionText2[0][2] = 812
- $LostConnectionText2[0][3] = 517
- $ResumeBtnCoord[0][0] = 155
- $ResumeBtnCoord[0][1] = 406
- $ResumeBtnCoord[0][2] = 242
- $ResumeBtnCoord[0][3] = 428
- $CharLoc[0][0] = 944
- $CharLoc[0][1] = 507
- $CastLoc[0][0] = 590
- $CastLoc[0][1] = 290
- $SellCoords[0][0] = 517
- $SellCoords[0][1] = 238
- $SlotOffset[0] = 48
- $ItemStartCoord0[0][0] = 1460
- $ItemStartCoord0[0][1] = 631
- $ItemStartCoord0[0][2] = 1462
- $ItemStartCoord0[0][3] = 633
- $ItemStartCoord1[0][0] = 1460
- $ItemStartCoord1[0][1] = 625
- $ItemStartCoord1[0][2] = 1468
- $ItemStartCoord1[0][3] = 632
- $BagFullCoords[0][0] = 1060
- $BagFullCoords[0][1] = 125
- $BagFullCoords[0][2] = 1120
- $BagFullCoords[0][3] = 160
- $IdleCursorCoords[0][0] = 400
- $IdleCursorCoords[0][1] = 300
- $TristramTextCoord[0][0] = 1790
- $TristramTextCoord[0][1] = 7
- $TristramTextCoord[0][2] = 1900
- $TristramTextCoord[0][3] = 30
- $RuinTextCoord[0][0] = 1830
- $RuinTextCoord[0][1] = 7
- $RuinTextCoord[0][2] = 1900
- $RuinTextCoord[0][3] = 30
- $CellarTextCoord[0][0] = 1820
- $CellarTextCoord[0][1] = 7
- $CellarTextCoord[0][2] = 1900
- $CellarTextCoord[0][3] = 30
- $DeathBounds[0][0] = 1390
- $DeathBounds[0][1] = 492
- $DeathBounds[0][2] = 1450
- $DeathBounds[0][3] = 543
- $PwdInput[0][0] = 809
- $PwdInput[0][1] = 706
- $OkBtn1[0][0] = 957
- $OkBtn1[0][1] = 854
- $LoginFailText[0][0] = 760
- $LoginFailText[0][1] = 485
- $LoginFailText[0][2] = 816
- $LoginFailText[0][3] = 506
- $LeaveGameText[0][0] = 903
- $LeaveGameText[0][1] = 127
- $LeaveGameText[0][2] = 965
- $LeaveGameText[0][3] = 151
- ;800x600
- $pngLoc[1] = "F:\Program Files (x86)\Diablo III\pics\800x600\" ; Need people to make those pics
- $Resume[1][0] = 174
- $Resume[1][1] = 232
- $GameLobbyCode[1][0] = 174
- $GameLobbyCode[1][1] = 232
- $GameLobbyCode[1][2] = 4262400
- $GameScreenCode[1][0] = 486
- $GameScreenCode[1][1] = 578
- $GameScreenCode[1][2] = 0x6C9BFF
- ; Need people working on the following coordinates
- $LostConnectionOkBtn[1][0] = 0
- $LostConnectionOkBtn[1][1] = 0
- $LostConnectionText0[1][0] = 0
- $LostConnectionText0[1][1] = 0
- $LostConnectionText0[1][2] = 0
- $LostConnectionText0[1][3] = 0
- $LostConnectionText1[1][0] = 0
- $LostConnectionText1[1][1] = 0
- $LostConnectionText1[1][2] = 0
- $LostConnectionText1[1][3] = 0
- $LostConnectionText2[1][0] = 0
- $LostConnectionText2[1][1] = 0
- $LostConnectionText2[1][2] = 0
- $LostConnectionText2[1][3] = 0
- $ResumeBtnCoord[1][0] = 0
- $ResumeBtnCoord[1][1] = 0
- $ResumeBtnCoord[1][2] = 0
- $ResumeBtnCoord[1][3] = 0
- $CharLoc[1][0] = 0
- $CharLoc[1][0] = 0
- $CastLoc[1][0] = 0
- $CastLoc[1][1] = 0
- $SellCoords[1][0] = 0
- $SellCoords[1][1] = 0
- $SlotOffset[1] = 0
- $ItemStartCoord0[1][0] = 0
- $ItemStartCoord0[1][1] = 0
- $ItemStartCoord0[1][2] = 0
- $ItemStartCoord0[1][3] = 0
- $ItemStartCoord1[1][0] = 0
- $ItemStartCoord1[1][1] = 0
- $ItemStartCoord1[1][2] = 0
- $ItemStartCoord1[1][3] = 0
- $BagFullCoords[1][0] = 0
- $BagFullCoords[1][1] = 0
- $BagFullCoords[1][2] = 0
- $BagFullCoords[1][3] = 0
- $IdleCursorCoords[1][0] = 0
- $IdleCursorCoords[1][1] = 0
- $IdleCursorCoords[1][0] = 0
- $IdleCursorCoords[1][1] = 0
- $TristramTextCoord[1][0] = 0
- $TristramTextCoord[1][1] = 0
- $TristramTextCoord[1][2] = 0
- $TristramTextCoord[1][3] = 0
- $RuinTextCoord[1][0] = 0
- $RuinTextCoord[1][1] = 0
- $RuinTextCoord[1][2] = 0
- $RuinTextCoord[1][3] = 0
- $CellarTextCoord[1][0] = 0
- $CellarTextCoord[1][1] = 0
- $CellarTextCoord[1][2] = 0
- $CellarTextCoord[1][3] = 0
- $DeathBounds[1][0] = 0
- $DeathBounds[1][1] = 0
- $DeathBounds[1][2] = 0
- $DeathBounds[1][3] = 0
- $OkBtn0[1][0] = 400
- $OkBtn0[1][1] = 352
- $PwdInput[1][0] = 318
- $PwdInput[1][1] = 390
- $OkBtn1[1][0] = 401
- $OkBtn1[1][1] = 474
- $LoginFailText[1][0] = 0
- $LoginFailText[1][1] = 0
- $LoginFailText[1][2] = 0
- $LoginFailText[1][3] = 0
- $LeaveGameText[1][0] = 0
- $LeaveGameText[1][1] = 0
- $LeaveGameText[1][2] = 0
- $LeaveGameText[1][3] = 0
- ;1920x1080
- $Leave[0][0] = 969
- $Leave[0][1] = 582
- ;800x600
- $Leave[1][0] = 397
- $Leave[1][1] = 322
- ;1920x1080
- $Loc1[0][0] = 500 ;First movement
- $Loc1[0][1] = 250
- $Loc2[0][0] = 1 ;Second movement
- $Loc2[0][1] = 370
- $Loc3[0][0] = 400 ;Third Movement
- $Loc3[0][1] = 600
- ;800x600
- $Loc1[1][0] = 8 ;First movement
- $Loc1[1][1] = 146
- $Loc2[1][0] = 7 ;Second movement
- $Loc2[1][1] = 300
- $Loc3[1][0] = 8 ;Third Movement
- $Loc3[1][1] = 300
- ;1080P
- $CellarLocation[0][0] = 307 ;Cellar door location
- $CellarLocation[0][1] = 74
- ;800x600
- $CellarLocation[1][0] = 499 ;Cellar door location
- $CellarLocation[1][1] = 148
- $CellarLocation2[0] = 439
- $CellarLocation2[1] = 145
- $AltCellarLocation = False
- ;Cellar offset
- $CellarOffset[0] = 33;
- $CellarOffset[1] = 10;
- ;1080P
- $Loc5[0][0] = 116 ;Walk down hallway
- $Loc5[0][1] = 986
- $Loc6[0][0] = 756 ;enter hallway
- $Loc6[0][1] = 308
- ;800x600
- $Loc5[1][0] = 3 ;Walk down hallway
- $Loc5[1][1] = 504
- $Loc6[1][0] = 255 ;enter hallway
- $Loc6[1][1] = 190
- ;1080P
- $MonsterLoc[0][0] = 577
- $MonsterLoc[0][1] = 183
- ;800x600
- $MonsterLoc[1][0] = 188
- $MonsterLoc[1][1] = 111
- ;1920x1080
- $MonsterSearch[0][0] = 162
- $MonsterSearch[0][1] = 29
- $MonsterSearch[0][2] = 1248
- $MonsterSearch[0][3] = 446
- ;800x600
- $MonsterSearch[1][0] = 40
- $MonsterSearch[1][1] = 53
- $MonsterSearch[1][2] = 424
- $MonsterSearch[1][3] = 191
- ;1920x1080
- $GoldLoot1[0][0] = 402
- $GoldLoot1[0][1] = 306
- $GoldLoot2[0][0] = 1260
- $GoldLoot2[0][1] = 351
- $GoldLoot3[0][0] = 911
- $GoldLoot3[0][1] = 694
- ;800x600
- $GoldLoot1[1][0] = 96
- $GoldLoot1[1][1] = 181
- $GoldLoot2[1][0] = 560
- $GoldLoot2[1][1] = 191
- $GoldLoot3[1][0] = 349
- $GoldLoot3[1][1] = 418
- ;1080P
- $LootingArea[0][0] = 300
- $LootingArea[0][1] = 220
- $LootingArea[0][2] = 1600
- $LootingArea[0][3] = 800
- ;800x600
- $LootingArea[1][0] = 75
- $LootingArea[1][1] = 90
- $LootingArea[1][2] = 630
- $LootingArea[1][3] = 400
- ;1080P
- $CharHitBox[0][0] = 790
- $CharHitBox[0][1] = 315
- $CharHitBox[0][2] = 1200
- $CharHitBox[0][3] = 730
- ;800x600
- $CharHitBox[1][0] = 304
- $CharHitBox[1][1] = 190
- $CharHitBox[1][2] = 468
- $CharHitBox[1][3] = 323
- ;1080P
- $RepairCoords[0][0][0] = 1690
- $RepairCoords[0][0][1] = 102
- $RepairCoords[0][1][0] = 930
- $RepairCoords[0][1][1] = 136
- $RepairCoords[0][2][0] = 517
- $RepairCoords[0][2][1] = 483
- $RepairCoords[0][3][0] = 223
- $RepairCoords[0][3][1] = 592
- ;800x600
- $RepairCoords[1][0][0] = 691
- $RepairCoords[1][0][1] = 88
- $RepairCoords[1][1][0] = 505
- $RepairCoords[1][1][1] = 52
- $RepairCoords[1][2][0] = 282
- $RepairCoords[1][2][1] = 261
- $RepairCoords[1][3][0] = 157
- $RepairCoords[1][3][1] = 329
- ;1080P
- $RepairCheck[0][0] = 1507
- $RepairCheck[0][1] = 36
- ;800x600
- $RepairCheck[1][0] = 573
- $RepairCheck[1][1] = 21
- Opt('MouseCoordMode', 2)
- Opt('PixelCoordMode', 2)
- HotKeySet("{DELETE}", "Terminate")
- HotKeySet('{PAUSE}', 'Pause')
- Global $Paused
- ; Bot starts paused. press space to start.
- Pause()
- ; Assume having blue when the script starts
- $HasBlue = True
- $NeedReset = False
- Sleep(400) ; Please put a random small number here which will confuse Wardon's harsh function
- AdlibRegister("CheckDisCon", 3000)
- AdlibRegister("CheckGameErr", 3000)
- Func TimeOut()
- Local $gX, $gY
- $NeedReset = True
- If (Not _ImageSearchArea($pngLoc[$R] & "resume.png", 1, $ResumeBtnCoord[$R][0], $ResumeBtnCoord[$R][1], _
- $ResumeBtnCoord[$R][2], $ResumeBtnCoord[$R][3], $gX, $gY, 90)) And _
- (Not _ImageSearchArea($pngLoc[$R] & "leaving.png", 1, $LeaveGameText[$R][0], $LeaveGameText[$R][1], _
- $LeaveGameText[$R][2], $LeaveGameText[$R][3], $gX, $gY, 90)) Then
- LeaveGame()
- AdlibUnRegister("TimeOut")
- Sleep(12000)
- EndIf
- EndFunc ;==>TimeOut
- Func CheckDisCon()
- Local $gX, $gY
- If _ImageSearchArea($pngLoc[$R] & "your.png", 1, $LostConnectionText2[$R][0], $LostConnectionText2[$R][1], _
- $LostConnectionText2[$R][2], $LostConnectionText2[$R][3], $gX, $gY, 40) Then
- AdlibUnRegister("CheckDisCon")
- AdlibUnRegister("TimeOut")
- Click($LostConnectionOkBtn[$R][0], $LostConnectionOkBtn[$R][1])
- Sleep(2000)
- Click($PwdInput[$R][0], $PwdInput[$R][1])
- Sleep(500)
- Send($Password)
- Sleep(500)
- Do
- Click($LostConnectionOkBtn[$R][0], $LostConnectionOkBtn[$R][1])
- Sleep(1000)
- Click($OkBtn1[$R][0], $OkBtn1[$R][1])
- Sleep(1000)
- Until Not _ImageSearchArea($pngLoc[$R] & "cannot.png", 1, $LoginFailText[$R][0], $LoginFailText[$R][1], _
- $LoginFailText[$R][2], $LoginFailText[$R][3], $gX, $gY, 40)
- Sleep(5000)
- $NeedReset = True
- AdlibRegister("CheckDisCon", 3000)
- EndIf
- EndFunc ;==>CheckDisCon
- Func CheckGameErr()
- Local $gX, $gY
- If _ImageSearchArea($pngLoc[$R] & "game.png", 1, $LostConnectionText0[$R][0], $LostConnectionText0[$R][1], _
- $LostConnectionText0[$R][2], $LostConnectionText0[$R][3], $gX, $gY, 40) Or _
- _ImageSearchArea($pngLoc[$R] & "therewas.png", 1, $LostConnectionText1[$R][0], $LostConnectionText1[$R][1], _
- $LostConnectionText1[$R][2], $LostConnectionText1[$R][3], $gX, $gY, 40) Then
- Click($LostConnectionOkBtn[$R][0], $LostConnectionOkBtn[$R][1])
- $NeedReset = True
- EndIf
- EndFunc ;==>CheckGameErr
- If $LoorSquareGems Then
- $Gem = "square.png"
- Else
- $Gem = "flawless.png"
- EndIf
- WinActivate('Diablo III')
- While 1
- If WinActive('Diablo III') Then
- Local $gX
- Local $gY
- Local $Count
- Local $HasPotion = False
- $AltCellarLocation = False
- $BagFull = False
- $NeedReset = False
- AdlibRegister("TimeOut", 150000)
- ;Make sure that we are in the character selection screen ( we are looking at a spot in the Resume game button)
- While 1
- If _ImageSearchArea($pngLoc[$R] & "resume.png", 1, $ResumeBtnCoord[$R][0], _
- $ResumeBtnCoord[$R][1], $ResumeBtnCoord[$R][2], _
- $ResumeBtnCoord[$R][3], $gX, $gY, 90) Then
- ExitLoop
- EndIf
- WinActive('Diablo III')
- If $NeedReset = True Then
- $NeedReset = False
- AdlibUnRegister("TimeOut")
- ContinueLoop 2
- EndIf
- WEnd
- ;Resume the game
- For $Count = 5 To 0 Step -1
- Click($Resume[$R][0], $Resume[$R][1])
- Sleep(100)
- Next
- ;Make sure that we are in the game
- While 1
- If _ImageSearchArea($pngLoc[$R] & "ruins.png", 1, $RuinTextCoord[$R][0], _
- $RuinTextCoord[$R][1], $RuinTextCoord[$R][2], _
- $RuinTextCoord[$R][3], $gX, $gY, 90) Then
- ExitLoop
- EndIf
- WinActive('Diablo III')
- If $NeedReset = True Then
- $NeedReset = False
- AdlibUnRegister("TimeOut")
- ContinueLoop 2
- EndIf
- WEnd
- Sleep(200 + $ComputerLag)
- ;Custom running for the 800x600. Sometimes I wonder if it's faster to just buy everyone a 1080P monitor...
- If Int($R) == 1 Then
- MouseMove(11, 220)
- Send("{4}")
- Sleep(400)
- MouseDown("middle")
- Sleep($RunTime)
- MouseUp("middle")
- Sleep(2000)
- #cs $CellarIcon = PixelSearch(630, 70, 741, 149, 0x71341A, 5)
- if not @error then
- ConsoleWrite("Foundtheseller" & @LF)
- EndIf
- #ce
- Else
- Move($Loc1[$R][0], $Loc1[$R][1])
- Sleep(Round(1200 * $RunDelayMult))
- Send("{4}")
- $Skill4Timer = TimerInit()
- Sleep(Round(500 * $RunDelayMult))
- Move($Loc2[$R][0], $Loc2[$R][1])
- Sleep(Round(2100 * $RunDelayMult))
- Move($Loc3[$R][0], $Loc3[$R][1])
- Sleep(Round(1000 * $RunDelayMult))
- EndIf
- If $NeedReset = True Then
- $NeedReset = False
- AdlibUnRegister("TimeOut")
- ContinueLoop
- EndIf
- ;Check to see if the cellar is there ```````
- MouseMove($CellarLocation[$R][0], $CellarLocation[$R][1])
- Send("{2}")
- Sleep(400)
- If Int($R) = 1 Then
- $CellarPixel = PixelSearch($CellarLocation[$R][0] - 30, $CellarLocation[$R][1] - 30, _
- $CellarLocation[$R][0] + 20, $CellarLocation[$R][1] + 20, 0x93D7F9, 8)
- If @error Then
- MouseMove($CellarLocation2[0], $CellarLocation2[1])
- Sleep(300)
- $CellarPixel = PixelSearch($CellarLocation2[0] - 30, $CellarLocation2[1] - 30, _
- $CellarLocation2[0] + 20, $CellarLocation2[1] + 20, 0x93D7F9, 8)
- If Not @error Then
- $AltCellarLocation = True
- EndIf
- EndIf
- Else
- $CellarPixel = PixelSearch($CellarLocation[$R][0] - $CellarOffset[$R], $CellarLocation[$R][1] _
- - $CellarOffset[$R], $CellarLocation[$R][0] + 4, $CellarLocation[$R][1] + 4, 0x334FB7, 6)
- EndIf
- If $NeedReset = True Then
- $NeedReset = False
- ContinueLoop
- EndIf
- ;Leave the game if the Cellar is not there
- If @error Then
- BlowSkills($CharLoc[$R][0], $CharLoc[$R][1])
- leaveGame()
- AdlibUnRegister("TimeOut")
- ContinueLoop
- EndIf
- ;Enter the cellar
- If $R > 0 And $AltCellar Then
- Click($CellarLocation2[$R][0] - 4, $CellarLocation2[$R][1] - 4)
- Else
- If Not $AltCellarLocation Then
- Click($CellarLocation[$R][0], $CellarLocation[$R][1])
- Else
- Click($CellarLocation2[0], $CellarLocation2[1])
- EndIf
- EndIf
- $Timer0 = TimerInit()
- While _ImageSearchArea($pngLoc[$R] & "cellar.png", 1, $CellarTextCoord[$R][0], _
- $CellarTextCoord[$R][1], $CellarTextCoord[$R][2], _
- $CellarTextCoord[$R][3], $gX, $gY, 90) = 0
- If TimerDiff($Timer0) > 7500 Then
- BlowSkills($CharLoc[$R][0], $CharLoc[$R][1])
- leaveGame()
- AdlibUnRegister("TimeOut")
- ContinueLoop 2
- EndIf
- If $NeedReset = True Then
- $NeedReset = False
- AdlibUnRegister("TimeOut")
- ContinueLoop 2
- EndIf
- WEnd
- Sleep(500 + $ComputerLag)
- ;Inside the celler now - Move to the doorway
- Move($Loc5[$R][0], $Loc5[$R][1])
- Sleep(Round(2600 * $RunDelayMult))
- Move($Loc6[$R][0], $Loc6[$R][1])
- Sleep(Round(1600 * $RunDelayMult))
- BlowSkills($CastLoc[$R][0], $CastLoc[$R][1])
- ;Kill all the enemies inside
- $Count = 5
- While 1
- $MonsterBar = PixelSearch($MonsterSearch[$R][0], $MonsterSearch[$R][1], _
- $MonsterSearch[$R][2], $MonsterSearch[$R][3], 0xEE0000, 10)
- If @error Then
- ConsoleWrite("Didn't find any, attacking to discover potential enemies" & @LF)
- Attack($MonsterLoc[$R][0], $MonsterLoc[$R][1])
- Sleep(500)
- $MonsterBar = PixelSearch($MonsterSearch[$R][0], $MonsterSearch[$R][1], _
- $MonsterSearch[$R][2], $MonsterSearch[$R][3], 0xEE0000, 10)
- If @error Then
- $Count -= 1
- If $Count < 0 Then
- ConsoleWrite("No monsters found - Moving on")
- ExitLoop
- Else
- ContinueLoop
- EndIf
- EndIf
- EndIf
- $Count = 1
- If TimerDiff($Skill3Timer) > ($Skill3CoolDown + 500) Then
- $Skill3Timer = TimerInit()
- MouseMove($MonsterBar[0], $MonsterBar[1], 0)
- Send("{3}")
- ElseIf TimerDiff($RightClickTimer) > ($RightClickCoolCown + 500) Then
- $RightClickTimer = TimerInit()
- MouseClick("right", $MonsterBar[0], $MonsterBar[1])
- Else
- For $i = 4 To 0 Step -1
- Attack($MonsterBar[0], $MonsterBar[1])
- Sleep(100)
- Next
- EndIf
- If $NeedReset = True Then
- $NeedReset = False
- AdlibUnRegister("TimeOut")
- ContinueLoop 2
- EndIf
- WEnd
- ;Loot the gold and attack anything we missed
- $Timer0 = TimerInit()
- Move($GoldLoot1[$R][0], $GoldLoot1[$R][1])
- While TimerDiff($Timer0) < Round(1800 * $RunDelayMult)
- If $LootPotions Then
- If _ImageSearchArea($pngLoc[$R] & "potion.png", 1, $LootingArea[$R][0], $LootingArea[$R][1], _
- $LootingArea[$R][2], $LootingArea[$R][3], $gX, $gY, 90) Then
- $HasPotion = True
- EndIf
- EndIf
- If $NeedReset = True Then
- $NeedReset = False
- AdlibUnRegister("TimeOut")
- ContinueLoop 2
- EndIf
- WEnd
- AttackNearbyMonsters()
- $Timer0 = TimerInit()
- Move($GoldLoot2[$R][0], $GoldLoot2[$R][1])
- While TimerDiff($Timer0) < Round(1400 * $RunDelayMult)
- If $LootPotions Then
- If _ImageSearchArea($pngLoc[$R] & "potion.png", 1, $LootingArea[$R][0], $LootingArea[$R][1], _
- $LootingArea[$R][2], $LootingArea[$R][3], $gX, $gY, 90) Then
- $HasPotion = True
- EndIf
- EndIf
- If $NeedReset = True Then
- $NeedReset = False
- AdlibUnRegister("TimeOut")
- ContinueLoop 2
- EndIf
- WEnd
- AttackNearbyMonsters()
- $Timer0 = TimerInit()
- Move($GoldLoot3[$R][0], $GoldLoot3[$R][1])
- While TimerDiff($Timer0) < Round(1400 * $RunDelayMult)
- If $LootPotions Then
- If _ImageSearchArea($pngLoc[$R] & "potion.png", 1, $LootingArea[$R][0], $LootingArea[$R][1], _
- $LootingArea[$R][2], $LootingArea[$R][3], $gX, $gY, 90) Then
- $HasPotion = True
- EndIf
- EndIf
- If $NeedReset = True Then
- $NeedReset = False
- AdlibUnRegister("TimeOut")
- ContinueLoop 2
- EndIf
- WEnd
- AttackNearbyMonsters()
- ;Check to see if we died
- If CheckForDeath() Then
- LeaveGame()
- ContinueLoop
- AdlibUnRegister("TimeOut")
- EndIf
- If $FastLoot Then
- Send("t")
- $Timer1 = TimerInit()
- $Moved = False
- EndIf
- ;Loot items
- If $LootGems Then
- $BagFull = LootGems()
- EndIf
- If $LootGold Then
- LootGold()
- EndIf
- If $LootPotions And $HasPotion Then
- LootPotions()
- EndIf
- If $LootBlues And $BagFull = False Then
- $Count = LootItemWrapper($MagicLetter, $BagFull, 10)
- If $Count Then
- $HasBlue = True
- EndIf
- EndIf
- If $LootRares Then
- $Count = LootItemWrapper($RareLetter, $BagFull, 10)
- $Count = LootItemWrapper($SetLetter, $BagFull, 10)
- $Count = LootItemWrapper($LegLetter, $BagFull, 10)
- EndIf
- If $LootTomes Then
- LootTomes()
- EndIf
- ;Teleport to town
- Send("{t}")
- $Timer0 = TimerInit()
- While _ImageSearchArea($pngLoc[$R] & "tristram.png", 1, $TristramTextCoord[$R][0], _
- $TristramTextCoord[$R][1], $TristramTextCoord[$R][2], _
- $TristramTextCoord[$R][3], $gX, $gY, 90) = 0
- If TimerDiff($Timer0) > 30000 Then
- LeaveGame()
- AdlibUnRegister("TimeOut")
- ContinueLoop 2
- EndIf
- If $NeedReset = True Then
- $NeedReset = False
- AdlibUnRegister("TimeOut")
- ContinueLoop 2
- EndIf
- WEnd
- Sleep(1000 + $ComputerLag)
- If $NeedReset = True Then
- $NeedReset = False
- AdlibUnRegister("TimeOut")
- ContinueLoop
- EndIf
- RepairOrSellItems()
- If $NeedReset = True Then
- $NeedReset = False
- AdlibUnRegister("TimeOut")
- ContinueLoop
- EndIf
- ;Leave the game
- LeaveGame()
- AdlibUnRegister("TimeOut")
- EndIf
- WEnd
- Exit -1
- Func CheckForRepair()
- $RepairNeeded = PixelSearch($RepairCheck[$R][0], $RepairCheck[$R][1], $RepairCheck[$R][0] + 5, _
- $RepairCheck[$R][1] + 5, 0xFFE801, 10)
- If Not @error Then
- Return True
- Else
- Return False
- EndIf
- EndFunc ;==>CheckForRepair
- Func RepairOrSellItems()
- Local $NeedRepair
- Local $xx
- Local $yy
- Local $sell
- $NeedRepair = CheckForRepair()
- ; Repair the gears when needed
- If ($NeedRepair And $Repair) Or ($BagFull And $SellBlues And $HasBlue) Then
- Move($RepairCoords[$R][0][0], $RepairCoords[$R][0][1])
- Sleep(Round(3300 * $RunDelayMult))
- MouseMove($RepairCoords[$R][1][0], $RepairCoords[$R][1][1])
- Sleep(400)
- Click($RepairCoords[$R][1][0], $RepairCoords[$R][1][1])
- Sleep(Round(2000 * $RunDelayMult))
- If $NeedRepair And $Repair Then
- Click($RepairCoords[$R][2][0], $RepairCoords[$R][2][1])
- Sleep(Random(700 - 900))
- Click($RepairCoords[$R][3][0], $RepairCoords[$R][3][1])
- Sleep(500)
- EndIf
- ; If the bag is full, sell the blues
- If ($BagFull And $SellBlues And $HasBlue) Then
- Click($SellCoords[$R][0], $SellCoords[$R][1])
- $HasBlue = False
- Sleep(500)
- For $xx = 0 To 8 Step 1
- For $yy = 0 To 5 Step 1
- ; An item recently picked up has blue frame arround the slots
- $sell = PixelSearch($ItemStartCoord0[$R][0] + $xx * $SlotOffset[$R], _
- $ItemStartCoord0[$R][1] + $yy * $SlotOffset[$R], _
- $ItemStartCoord0[$R][2] + $xx * $SlotOffset[$R], _
- $ItemStartCoord0[$R][3] + $yy * $SlotOffset[$R], 0x0000FF, 10)
- If Not @error Then
- MouseClick("right", $sell[0], $sell[1])
- Else
- ; Otherwise the color of the frame is lighter
- $sell = PixelSearch($ItemStartCoord1[$R][0] + $xx * $SlotOffset[$R], _
- $ItemStartCoord1[$R][1] + $yy * $SlotOffset[$R], _
- $ItemStartCoord1[$R][2] + $xx * $SlotOffset[$R], _
- $ItemStartCoord1[$R][3] + $yy * $SlotOffset[$R], 0x182A5B, 30)
- If Not @error Then
- MouseClick("right", $sell[0], $sell[1])
- EndIf
- EndIf
- Next
- Next
- EndIf
- Sleep(300)
- Send("{esc}")
- EndIf
- EndFunc ;==>RepairOrSellItems
- Func Terminate()
- Exit 0
- EndFunc ;==>Terminate
- Func LeaveGame()
- Send("{esc}")
- Sleep(400)
- Click($Leave[$R][0], $Leave[$R][1])
- EndFunc ;==>LeaveGame
- Func Pause()
- $Paused = Not $Paused
- While $Paused
- Sleep(100)
- ToolTip('Paused... (Press PAUSE to run it)', 0, 0)
- WEnd
- ToolTip("")
- EndFunc ;==>Pause
- Func Click($x, $y)
- MouseClick('left', Random($x - 3, $x + 3), Random($y - 3, $y + 3), 1, 2)
- EndFunc ;==>Click
- Func Move($x, $y)
- MouseClick('middle', Random($x - 3, $x + 3), Random($y - 3, $y + 3), 1, 2)
- EndFunc ;==>Move
- Func Attack($x, $y)
- Send("{SHIFTDOWN}")
- Sleep(20)
- MouseClick('left', Random($x - 3, $x + 3), Random($y - 3, $y + 3), 1, 2)
- Sleep(20)
- Send("{SHIFTUP}")
- EndFunc ;==>Attack
- Func Rest($z)
- Sleep(Random($z, $z + 25))
- EndFunc ;==>Rest
- Func CheckForDeath()
- Return _ImageSearchArea($pngLoc[$R] & "percent.png", 1, $DeathBounds[$R][0], $DeathBounds[$R][1], _
- $DeathBounds[$R][2], $DeathBounds[$R][3], $gX, $gY, 60)
- EndFunc ;==>CheckForDeath
- Func CalcDist($x, $y)
- Local $dx = $x - $CharLoc[$R][0]
- Local $dy = $y - $CharLoc[$R][1]
- Return Sqrt($dx ^ 2 + $dy ^ 2)
- EndFunc ;==>CalcDist
- Func LootItemWrapper(ByRef $Array, ByRef $BagFull, $Attempt)
- Local $Count = 0
- Local $TmpBagFull
- If (TimerDiff($Timer1) > 3000) And ($Moved = False) And $FastLoot Then
- Move($CharLoc[$R][0], $CharLoc[$R][1])
- $Moved = True
- EndIf
- $TmpBagFull = LootItem($Array, $Count, $Attempt)
- If $TmpBagFull Then
- $BagFull = True
- EndIf
- If ($Moved = True) And $FastLoot Then
- Send("t")
- $Timer1 = TimerInit()
- $Moved = False
- EndIf
- Return $Count
- EndFunc ;==>LootItemWrapper
- Func LootItem(ByRef $Array, ByRef $Count, ByRef $LootAttempts)
- Local $i
- Local $gX
- Local $gY
- Local $Found = 0
- Local $Timer
- Local $Delay
- For $i = 0 To 4
- MouseMove($IdleCursorCoords[$R][0], $IdleCursorCoords[$R][0], 0)
- If _ImageSearchArea($pngLoc[$R] & $Array[$i], 1, $LootingArea[$R][0], $LootingArea[$R][1], _
- $LootingArea[$R][2], $LootingArea[$R][3], $gX, $gY, 70) Then
- Click($gX, $gY)
- $Moved = True
- $Delay = Round($LootDelayMult * CalcDist($gX, $gY))
- $Timer = TimerInit()
- While TimerDiff($Timer) < $Delay
- If _ImageSearchArea($pngLoc[$R] & "item.png", 1, $BagFullCoords[$R][0], $BagFullCoords[$R][1], _
- $BagFullCoords[$R][2], $BagFullCoords[$R][3], $gX, $gY, 120) Then
- Return True
- EndIf
- WEnd
- $Found = 1
- $Count += 1
- EndIf
- Next
- $LootAttempts -= 1
- If ($LootAttempts = 0) Or ($Found = 0) Then
- Return False
- Else
- Return LootItem($Array, $Count, $LootAttempts)
- EndIf
- EndFunc ;==>LootItem
- Func LootGems()
- Local $gX = 0
- Local $gY = 0
- Local $Attempt = 10
- Local $Timer
- Local $Delay
- MouseMove($IdleCursorCoords[$R][0], $IdleCursorCoords[$R][0], 0)
- If (TimerDiff($Timer1) > 3500) And ($Moved = False) And $FastLoot Then
- Move($CharLoc[$R][0], $CharLoc[$R][1])
- $Moved = True
- EndIf
- While _ImageSearchArea($pngLoc[$R] & $Gem, 1, $LootingArea[$R][0], $LootingArea[$R][1], _
- $LootingArea[$R][2], $LootingArea[$R][3], $gX, $gY, 120) And $Attempt
- MouseClick("left", $gX, $gY, 1, 0)
- $Moved = True
- $Delay = Round($LootDelayMult * CalcDist($gX, $gY))
- $Timer = TimerInit()
- While TimerDiff($Timer) < $Delay
- If _ImageSearchArea($pngLoc[$R] & "item.png", 1, $BagFullCoords[$R][0], $BagFullCoords[$R][1], _
- $BagFullCoords[$R][2], $BagFullCoords[$R][3], $gX, $gY, 120) Then
- If $Moved = True Then
- Send("t")
- $Timer1 = TimerInit()
- $Moved = False
- EndIf
- Return True
- EndIf
- WEnd
- MouseMove($IdleCursorCoords[$R][0], $IdleCursorCoords[$R][0], 0)
- $Attempt -= 1
- WEnd
- If ($Moved = True) And $FastLoot Then
- Send("t")
- $Timer1 = TimerInit()
- $Moved = False
- EndIf
- Return False
- EndFunc ;==>LootGems
- Func LootTomes()
- Local $gX = 0
- Local $gY = 0
- Local $Attempt = 10
- MouseMove($IdleCursorCoords[$R][0], $IdleCursorCoords[$R][0], 0)
- If (TimerDiff($Timer1) > 3500) And ($Moved = False) And $FastLoot Then
- Move($CharLoc[$R][0], $CharLoc[$R][1])
- $Moved = True
- EndIf
- While _ImageSearchArea($pngLoc[$R] & "tome.png", 1, $LootingArea[$R][0], $LootingArea[$R][1], _
- $LootingArea[$R][2], $LootingArea[$R][3], $gX, $gY, 100) And $Attempt
- MouseClick("left", $gX, $gY, 1, 0)
- $Moved = True
- Sleep(Round($LootDelayMult * CalcDist($gX, $gY)))
- MouseMove($IdleCursorCoords[$R][0], $IdleCursorCoords[$R][0], 0)
- $Attempt -= 1
- WEnd
- If ($Moved = True) And $FastLoot Then
- Send("t")
- $Timer1 = TimerInit()
- $Moved = False
- EndIf
- EndFunc ;==>LootTomes
- Func LootPotions()
- Local $gX = 0
- Local $gY = 0
- Local $Attempt = 10
- MouseMove($IdleCursorCoords[$R][0], $IdleCursorCoords[$R][0], 0)
- If (TimerDiff($Timer1) > 3500) And ($Moved = False) And $FastLoot Then
- Move($CharLoc[$R][0], $CharLoc[$R][1])
- $Moved = True
- EndIf
- While _ImageSearchArea($pngLoc[$R] & "potion.png", 1, $LootingArea[$R][0], $LootingArea[$R][1], _
- $LootingArea[$R][2], $LootingArea[$R][3], $gX, $gY, 100) And $Attempt
- MouseClick("left", $gX, $gY, 1, 0)
- $Moved = True
- Sleep(Round($LootDelayMult * CalcDist($gX, $gY)))
- MouseMove($IdleCursorCoords[$R][0], $IdleCursorCoords[$R][0], 0)
- $Attempt -= 1
- WEnd
- If ($Moved = True) And $FastLoot Then
- Send("t")
- $Timer1 = TimerInit()
- $Moved = False
- EndIf
- EndFunc ;==>LootPotions
- Func LootGold()
- Local $gX = 0
- Local $gY = 0
- Local $Attempt = 10
- MouseMove($IdleCursorCoords[$R][0], $IdleCursorCoords[$R][0], 0)
- If (TimerDiff($Timer1) > 3500) And ($Moved = False) And $FastLoot Then
- Move($CharLoc[$R][0], $CharLoc[$R][1])
- $Moved = True
- EndIf
- While _ImageSearchArea($pngLoc[$R] & "gold.png", 1, $LootingArea[$R][0], $LootingArea[$R][1], _
- $LootingArea[$R][2], $LootingArea[$R][3], $gX, $gY, 100) And $Attempt
- MouseClick("middle", $gX, $gY + 20, 1, 0)
- $Moved = True
- Sleep(Round($LootDelayMult * CalcDist($gX, $gY + 20)))
- MouseMove($IdleCursorCoords[$R][0], $IdleCursorCoords[$R][0], 0)
- $Attempt -= 1
- WEnd
- If ($Moved = True) And $FastLoot Then
- Send("t")
- $Timer1 = TimerInit()
- $Moved = False
- EndIf
- EndFunc ;==>LootGold
- Func BlowSkills($x, $y)
- MouseMove($x, $y, 2)
- ;Cast Voodoo and Grasp of the Dead to ensure safety
- Send("{1}")
- Sleep(Round(500 * $CastSpeedMult))
- Send("{3}")
- $Skill3Timer = TimerInit()
- Sleep(Round(500 * $CastSpeedMult))
- MouseClick("right", $x, $y)
- $RightClickTimer = TimerInit()
- EndFunc ;==>BlowSkills
- Func AttackNearbyMonsters()
- While 1
- $MonsterData = PixelSearch($CharHitBox[$R][0], $CharHitBox[$R][1], $CharHitBox[$R][2], $CharHitBox[$R][3], 0xEE0000, 10)
- If @error Then
- ExitLoop
- EndIf
- If TimerDiff($Skill4Timer) > ($Skill4CoolDown + 500) Then
- Send("{4}")
- $Skill4Timer = TimerInit()
- EndIf
- If TimerDiff($Skill3Timer) > ($Skill3CoolDown + 500) Then
- MouseMove($MonsterData[0], $MonsterData[1], 0)
- Send("{3}")
- $Skill3Timer = TimerInit()
- ElseIf TimerDiff($RightClickTimer) > ($RightClickCoolCown + 500) Then
- MouseClick("right", $MonsterData[0], $MonsterData[1], 1, 1)
- $RightClickTimer = TimerInit()
- Else
- For $i = 7 To 0 Step -1
- Attack($MonsterData[0], $MonsterData[1])
- Sleep(100)
- Next
- EndIf
- WEnd
- EndFunc ;==>AttackNearbyMonsters
- Func CheckForNearbyMonsters()
- $MonsterData = PixelSearch($CharHitBox[$R][0], $CharHitBox[$R][1], $CharHitBox[$R][2], $CharHitBox[$R][3], 0xEE0000, 10)
- If @error Then
- Return False
- Else
- Return True
- EndIf
- EndFunc ;==>CheckForNearbyMonsters
- Func _ImageSearchArea($findImage, $resultPosition, $x1, $y1, $right, $bottom, ByRef $x, ByRef $y, $tolerance)
- $findImage = "*TRANSBLACK " & $findImage
- If $tolerance > 0 Then $findImage = "*" & $tolerance & " " & $findImage
- If @AutoItX64 Then
- $result = DllCall("ImageSearchDLL_x64.dll", "str", "ImageSearch", "int", $x1, "int", $y1, "int", $right, "int", $bottom, "str", $findImage)
- Else
- $result = DllCall("ImageSearchDLL.dll", "str", "ImageSearch", "int", $x1, "int", $y1, "int", $right, "int", $bottom, "str", $findImage)
- EndIf
- If $result = "0" Then Return 0
- ; Otherwise get the x,y location of the match and the size of the image to
- ; compute the centre of search
- $Array = StringSplit($result[0], "|")
- If (UBound($Array) >= 4) Then
- $x = Int(Number($Array[2]))
- $y = Int(Number($Array[3]))
- If $resultPosition = 1 Then
- $x = $x + Int(Number($Array[4]) / 2)
- $y = $y + Int(Number($Array[5]) / 2)
- EndIf
- Return 1
- EndIf
- EndFunc ;==>_ImageSearchArea
- Func ActivateGUI()
- ;setup the UI
- $Waiting = True
- $Form1 = GUICreate("D3 Witch Doctor bot by Avatar88343 and Andygongyb", 500, 320, -1, -1)
- GUICtrlCreateLabel("Warning: the script is for education only, not approved for any form of commercial use", _
- 25, 30, 550, -1)
- GUICtrlCreateLabel("Hotkeys:" & @CRLF & @TAB & "Terminate:" & @TAB & "DELETE" & @CRLF _
- & @TAB & "Pause:" & @TAB & @TAB & "PAUSE", 25, 50, 550, -1)
- GUICtrlCreateLabel("Game Resolution", 25, 100, 100, -1)
- $ResCombo = GUICtrlCreateCombo("", 25, 115, 200, -1)
- GUICtrlSetData($ResCombo, "1920 x 1080|800 x 600", "Select your Res")
- GUICtrlCreateLabel("Character run speed (for 800x600)", 275, 100, 200, -1)
- $RunInput = GUICtrlCreateInput("0", 275, 115, 200, -1)
- $LootRareCheck = GUICtrlCreateCheckbox("Loot rares/legs/sets", 25, 160)
- GUICtrlSetState($LootRareCheck, $GUI_CHECKED)
- $LootBluesCheck = GUICtrlCreateCheckbox("Loot blues", 150, 160)
- GUICtrlSetState($LootBluesCheck, $GUI_CHECKED)
- $LootGemsCheck = GUICtrlCreateCheckbox("Loot gems", 275, 160)
- GUICtrlSetState($LootGemsCheck, $GUI_CHECKED)
- $LootPotionsCheck = GUICtrlCreateCheckbox("Loot potions", 400, 160)
- GUICtrlSetState($LootPotionsCheck, $GUI_CHECKED)
- $LootTomesCheck = GUICtrlCreateCheckbox("Loot tomes of secret", 25, 190)
- GUICtrlSetState($LootTomesCheck, $GUI_CHECKED)
- $LootGoldCheck = GUICtrlCreateCheckbox("Collect the gold carefully (slower)", 275, 190)
- GUICtrlSetState($LootGoldCheck, $GUI_CHECKED)
- $RepairCheckbox = GUICtrlCreateCheckbox("Repair gears when needed", 25, 220)
- GUICtrlSetState($RepairCheckbox, $GUI_CHECKED)
- $SellBluesCheckbox = GUICtrlCreateCheckbox("Sell blue item when the bag is full", 275, 220)
- GUICtrlSetState($SellBluesCheckbox, $GUI_CHECKED)
- $StartButton = GUICtrlCreateButton("Start", 175, 260, 150, 33)
- GUISetState(@SW_SHOW)
- ;Wait for them to press start
- While $Waiting
- $Action = GUIGetMsg()
- If $Action = $GUI_EVENT_CLOSE Then Terminate()
- If $Action = $StartButton Then ExitLoop
- Sleep(50)
- WEnd
- ;Get the values
- $SelectedRes = GUICtrlRead($ResCombo)
- If $SelectedRes = "1920 x 1080" Then
- $R = 0
- ElseIf $SelectedRes = "800 x 600" Then
- $R = 1
- Else
- MsgBox(0, "Error", "You did not select a resolution! Try again")
- Terminate()
- EndIf
- $RunSpeed = Int(GUICtrlRead($RunInput))
- $LootRares = GUICtrlRead($LootRareCheck) = $GUI_CHECKED
- $LootBlues = GUICtrlRead($LootBluesCheck) = $GUI_CHECKED
- $LootGems = GUICtrlRead($LootGemsCheck) = $GUI_CHECKED
- $LootPotions = GUICtrlRead($LootPotionsCheck) = $GUI_CHECKED
- $LootTomes = (GUICtrlRead($LootTomesCheck) = $GUI_CHECKED)
- $LootGold = GUICtrlRead($LootGoldCheck) = $GUI_CHECKED
- $Repair = GUICtrlRead($RepairCheckbox) = $GUI_CHECKED
- $SellBlues = (GUICtrlRead($SellBluesCheckbox) = $GUI_CHECKED) And $LootBlues
- GUISetState(@SW_HIDE)
- EndFunc ;==>ActivateGUI
Add Comment
Please, Sign In to add comment