Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #cs
- ADD detection of character screen and loading screen done
- Witch Doctor Cellar Farming Bot - Version 0.2 Revision by cib v2, ImageSearch for autoit used, follow instructions below to download it and install
- Developed by Avatar88343 @ Ownedcore
- Revision by cib V2, ImageSearch need, follow instructions below to download it and install
- HELL / INFERNO, LOOT GEMS, LEGEND, RARE, SET, TOME BLUE, CONECTION ERROR HANDLED, INFINITE AUTO LOGIN SUPPORT, NOTHING TO DO JUST LOOK AT YOUR BOT AND SELL UR INVENTORY WHEN FULL
- !!! FRENCH VERSION IF YOU WANT TO USE WITH ANOTHER LANGUAGE U GOT TO CHANGE THE IMAGE SEARCH PNGS IN THE DIRECTORY WITH ONES ACCORDING TO YOUR LANGUAGE !!!!
- !!! U CAN REPLACE THEMS WITH THE ONE IN THE IMAGESEARCH PACKAGE FOR ENGLISH VERSION !!!!
- What it does:
- *This bot will travel to the cellar in Act 1, kill the mobs, collect the gold, the rare legend and set items, potions, blue tomes, and repair your gear.
- *It fully support randomly disconnect, has an autologin feature !! and handled this fucking error message popup !!
- ;~ *Tested in Hell and Inferno, making 200-220K / hour in Inferno with a 210% GF Gear
- *Need at leat 9K of dps !!
- *Death less times with the use of minions
- *Bot Log feature, you can trace what happens and tweak it for better result
- Instructions:
- 1.) Bind your middle mouse button to Move (found in Key Bindings Option)
- 1.a) Ensure T is bound to teleport to town
- 1.b) Ensure show items names is always on, to do this go to option/game desactivate reveal item names when it drops and change show item name to always
- 1.c) Ensure Shift key is set to stay in place when casting
- 2.) Set your build to this http://us.battle.net/d3/en/calculator/witch-doctor#ZhiTPU!VgW!abcZba
- 3.) Set your game resolution to 1920x1080 Fullscreen windowed (required)
- 3.) Start Act 1, Quest 6 - Talk to Alaric
- 4.) Hire the sorceress and set all her spells to the right column, ( give her good stuff too it's better )
- 5.) Teleport to The Old Ruins using the waypoint and run left until you reach a checkpoint
- 6.) Log out of the game (disconnect to the login screen)
- 7.) Install Imagesearch for AutoIt, folowwing instructions below
- 7.a) Put in the pngs folder the pngs you want to use for items detection ( set to work with pngs of diablo 3 french version )
- 7.b) Change the png folder variable in the Imagesearch looting variables according to your system
- 7.c) If u change pngs in the foldr u need to change variables in the Imagesearch looting variables according to
- ( total number of pngs, setup the png array with the appropriate files located in the png folder)
- 8.) Type your diablo 3 password in the $motdepasse variable for autologin, and fill the diablo 3 login screen battle net account with your email, this script doesn't support password length more than 19 characters
- 9.) Save the script !
- 10.) Ensure diablo 3 is in at loginscreen, not really need, it should work if u're in the character screen, but do not start it when in game.
- 11.) Run the script and Press NumPAd+ to start the bot! NumPad+ is used to pause and resume the bot
- 12.) You can read the log in the file c:|bot.log, realtime update, this file is flush at each start
- 13.) Press Numpad- to exit the bot
- Installing imagesearch for autoit
- ;Download: http://www.mediafire.com/?vtx9l1woj61h8r6 (1.4a new link)
- ;If your Windows installation is x64, use the 64-bit native AutoIt and the x64 directory in the archive
- ;Extract and copy AutoIt3 folder to Program Files directory
- ;Extract and copy all dlls to C:\Windows\ directory (optionally copy the MSVCR dlls to System32 as well)
- ;Extract pics directory anywhere and update the $directory var - INCLUDE TRAILING BACKSLASH: C:\pics\
- ;If you are running anything but fullscreen mode, the size of letters will mismatch and not loot anything. Resize or make your own pngs.
- NOTE:
- *1920 x 1080 fullscreen windowed is the only resolution currently supported (800x600 is not supported in this revision)
- *You must be running the game in Fullscreen Windoed mode
- *You may need to edit the values below the comments for better results
- *Based on the code by notAres and mackus101. Special thanks to them!
- #ce
- ;======EDIT THESE VALUES ACCORDINLY ===================================
- $R = 0 ;0 for 1920x1080 dont change this, only supported 1920
- $ComputerLag = 1100 ;Increase this by 100-5000 if you have a slow PC. Gently tune it down until timings are right
- $Repair = True ;Orders the bot to repair when items are damaged
- $UseStash = False ;Not currently supported
- ;======================================================================
- #include <Date.au3>
- #include <File.au3>
- ;ImageSearch Looting Variables ---------------------------------------------------------------------------------------------
- #include <ImageSearch.au3> ; IF U GOT ERROR ON THIS LINE THEN IMAGESEARCH FOR AUTOIT HASN'T BEEN INSTALL CORRECTLY
- Global $directory = "C:\gamez\Diablo III\autobit\pics\" ; CHANGE THIS! Point it to the directory with the imagesearch pngs, dont forget the \ at the end, keep it in "" <------ NEED TO CHANGE THIS
- Global $file = ""
- Global $urlString = ""
- Global $totalItems = 10 ; set this variable to the number of pngs contains in $directory <------ CHANGE THIS IF U CHANGE THE PNGS
- Global $pick[$totalItems]
- Global $i = 0, $gX = 0, $gY = 0
- $pick[0] = "grim02.png" ; set all variables to the names of the pngs contains in $directory, dont forget the "" <------ CHANGE THIS IF U CHANGE THE PNGS
- $pick[1] = "gem01.png" ;<------ CHANGE THIS IF U CHANGE THE PNGS
- $pick[2] = "gem02.png" ;<------ CHANGE THIS IF U CHANGE THE PNGS
- $pick[3] = "gem03.png" ;<------ CHANGE THIS IF U CHANGE THE PNGS
- $pick[4] = "gem04.png" ;<------ CHANGE THIS IF U CHANGE THE PNGS
- $pick[5] = "potion.png" ;<------ CHANGE THIS IF U CHANGE THE PNGS
- $pick[6] = "legendaryE.png" ;<------ CHANGE THIS IF U CHANGE THE PNGS
- $pick[7] = "legendaryU.png" ;<------ CHANGE THIS IF U CHANGE THE PNGS
- $pick[8] = "setE.png" ;<------ CHANGE THIS IF U CHANGE THE PNGS
- $pick[9] = "setU.png" ;<------ CHANGE THIS IF U CHANGE THE PNGS
- ; -----------------------------------------------------------------------------------------
- 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][2] ;Location of cellar during bad runs (ugly workaround for now)
- Global $AltCellar = False
- 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][2] ; Used to detect the "You Have Died" text
- Global $RepairCheck[2][2] ; Used to check for repair icon
- Global $RepairCords[2][4][2] ; Four clicks needed to repair
- Global $CellarOffset[2]
- ;Global $MonsterData[2]
- Global $furl = "c:\bot.log" ; log file url
- Global $ErrorReport = 0
- Global $ErrorPass = 0
- Global $ErrorPassMax = 1000
- Global $motdepasse = "ur password here" ; !!!!!!!!!!!!!!!!!!!!! TYPE YOUR DIABLO 3 PASSWORD HERE KEEP IT BETWEEN "" !!!!!!!!!!!!!!!!!!!!!! <------ NEED TO CHANGE THIS
- Global $restartloop = 0
- Global $loginpassed = 0
- Global $logintestpass = 1
- ;All locations are N dimensional arrays. [0][x] is for 1080P and [1][x] is for 800x600
- ;1080P
- $Resume[0][0] = 319
- $Resume[0][1] = 416
- $GameLobbyCode[0][0] = 319
- $GameLobbyCode[0][1] = 416
- $GameLobbyCode[0][2] = 4065536 ;dec
- $GameScreenCode[0][0] = 1119
- $GameScreenCode[0][1] = 1044
- $GameScreenCode[0][2] = 0xDEFDFE
- ;800x600
- $Resume[1][0] = 142
- $Resume[1][1] = 251
- $GameLobbyCode[1][0] = 0 ;Undefined
- $GameLobbyCode[1][1] = 0
- $GameLobbyCode[1][2] = 0
- $GameScreenCode[1][0] = 0
- $GameScreenCode[1][1] = 0
- $GameScreenCode[1][2] = 0
- ;1080P
- $Leave[0][0] = 1042
- $Leave[0][1] = 582
- ;800x600
- $Leave[1][0] = 400
- $Leave[1][1] = 342
- ;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] = 38 ;Cellar door location
- $CellarLocation[1][1] = 98
- $CellarLocation2[1][0] = 10 ;Location of cellar during bad runs
- $CellarLocation2[1][1] = 34
- $CellarOffset[0] = 33;
- $CellarOffset[1] = 14;
- ;1080P
- $loc5[0][0] = 116 ;Walk down hallway
- $loc5[0][1] = 986
- $loc6[0][0] = 740 ;enter hallway
- $loc6[0][1] = 295
- ;$loc6[0][0] = 776 ;enter hallway
- ;$loc6[0][1] = 328
- ;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] = 590
- $MonsterLoc[0][1] = 261
- ;800x600
- $MonsterLoc[1][0] = 188
- $MonsterLoc[1][1] = 111
- ;1920x1080
- $MonsterSearch[0][0] = 10
- $MonsterSearch[0][1] = 90
- $MonsterSearch[0][2] = 1500
- $MonsterSearch[0][3] = 750
- ;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] = 15
- $LootingArea[0][1] = 20
- $LootingArea[0][2] = 1550
- $LootingArea[0][3] = 890
- ;800x600
- $LootingArea[1][0] = 75
- $LootingArea[1][1] = 90
- $LootingArea[1][2] = 630
- $LootingArea[1][3] = 360
- ;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 (NOT DONEEEEEEEEEEEEE)
- $DeathBounds[0][0] = 538
- $DeathBounds[0][1] = 335
- ;800x600
- $DeathBounds[1][0] = 210
- $DeathBounds[1][1] = 180
- ;1080P
- $RepairCords[0][0][0] = 1690
- $RepairCords[0][0][1] = 102
- $RepairCords[0][1][0] = 930
- $RepairCords[0][1][1] = 136
- $RepairCords[0][2][0] = 517
- $RepairCords[0][2][1] = 483
- $RepairCords[0][3][0] = 223
- $RepairCords[0][3][1] = 592
- ;800x600
- $RepairCords[1][0][0] = 691
- $RepairCords[1][0][1] = 88
- $RepairCords[1][1][0] = 505
- $RepairCords[1][1][1] = 52
- $RepairCords[1][2][0] = 282
- $RepairCords[1][2][1] = 261
- $RepairCords[1][3][0] = 157
- $RepairCords[1][3][1] = 329
- ;1080P
- $RepairCheck[0][0] = 1507
- $RepairCheck[0][1] = 36
- ;800x600
- $RepairCheck[1][0] = 573
- $RepairCheck[1][1] = 21
- HotKeySet("{NUMPADSUB}", "Terminate")
- HotKeySet("{NUMPADMULT}","InGameplayScreen")
- HotKeySet("{NUMPADADD}","Pause")
- Opt('MouseCoordMode', 2)
- Opt('PixelCoordMode', 2)
- ;HotKeySet('{SPACE}', 'Pause')
- Global $Paused
- ; ################################################################### MAIN CODE ######################################################################
- FileDelete ( $furl )
- Local $botlogflush = FileWriteLine ( $furl, " ########### INIT BOT ####### " )
- ;bot starts paused. press P to start.
- Pause()
- Local $file = FileOpen($furl, 1)
- $fwrite = _FileWriteLog($file, " ############ BOT START #############")
- FileClose($file)
- $LootAttempts = 0
- $GemLootAttempts = 0
- WinActivate('Diablo III')
- Sleep(300)
- While 1
- While $restartloop == 0
- $loginpassed = 0
- While $loginpassed == 0
- if Errortest() Then
- Local $file = FileOpen($furl, 1)
- $fwrite = _FileWriteLog($file, " !!!!!!!!!!! ERROR DETECTION STEP 01 !!!!! ")
- FileClose($file)
- If IsOnLoginScreen() Then
- $ErrorReport = 0
- ExitLoop 2
- EndIf
- If InGameLobby() Then
- $ErrorReport = 0
- ExitLoop
- EndIf
- EndIf
- If IsOnLoginScreen() Then
- ToolTip("SENDING MOT DE PASSE", 10, 100)
- Sleep(800)
- Click(1112, 704)
- Sleep(300)
- Click(1112, 704)
- Sleep(800)
- Send("{BACKSPACE 20}")
- Sleep(50)
- Send($motdepasse)
- Sleep(50)
- Send("{ENTER}")
- Sleep(300)
- ToolTip("MOT DE PASSE SEND", 10, 120)
- $loadpass = 0
- While IsLoginScreenLoading()
- ToolTip("Loading ....... pass " & $loadpass & "/300", 10, 120)
- $loadpass +=1
- If $loadpass >= 300 Then
- Local $file = FileOpen($furl, 1)
- $fwrite = _FileWriteLog($file, " LOGIN TIMEOUT 5min")
- FileClose($file)
- $restartloop = 1
- ExitLoop
- EndIf
- Sleep(1000)
- WEnd
- if Errortest() Then
- ToolTip("ERROR APPEND AFTER PASSWORD TYPE IN loadpass" & $loadpass, 10, 150)
- Local $file = FileOpen($furl, 1)
- $fwrite = _FileWriteLog($file, " !!!!!!!!! ERROR APPEND AFTER PASSWORD TYPE IN !!!!!!! pass " & $loadpass)
- FileClose($file)
- $restartloop = 1
- $loadpass +=1
- Sleep(500)
- EndIf
- IF $loadpass == 0 Then
- $restartloop = 1
- EndIf
- If $restartloop == 1 Then
- ExitLoop 2
- EndIf
- if InGameLobby() Then
- ToolTip("SUCCESSFUL LOGIN", 10, 150)
- Local $file = FileOpen($furl, 1)
- $fwrite = _FileWriteLog($file, " Succesfull Login")
- FileClose($file)
- ExitLoop ; exiting WEnd
- EndIf
- EndIf
- if InGameLobby() Then
- ToolTip("IN GAME LOBBY", 10, 150)
- Local $file = FileOpen($furl, 1)
- $fwrite = _FileWriteLog($file, " IN GAME LOBBY")
- FileClose($file)
- ExitLoop
- EndIf
- $logintestpass += 1
- ToolTip("LOGIN PASS" & $logintestpass, 10, 150)
- Local $file = FileOpen($furl, 1)
- $fwrite = _FileWriteLog($file," LOGIN PASS " & $logintestpass)
- FileClose($file)
- Sleep(Random(2000,3000))
- WEnd
- While $ErrorReport == 0 And $ErrorPass < $ErrorPassMax
- #cs
- ;Make sure that we are in the character selection screen ( we are looking at a spot in the Resume game button)
- for $i = 6 To 0 step -1
- if InGameLobby() Then
- ExitLoop
- EndIf
- if Errortest() Then
- Local $file = FileOpen($furl, 1)
- $fwrite = _FileWriteLog($file, " ERROR APPEND IN LOBBY TEST")
- FileClose($file)
- ExitLoop
- EndIf
- Sleep(600)
- if $i == 1 Then
- ;MsgBox(4096, "Error Resuming Game", "You don't seem to be in the lobby. Bot will now exit", 50)
- Local $file = FileOpen($furl, 1)
- $fwrite = _FileWriteLog($file, " IN LOBBY TEST TIMEOUT TRYING TO RELOGIN")
- FileClose($file)
- $ErrorReport = 1
- ;Terminate()
- ExitLoop
- EndIf
- Next
- #ce
- $AltCellar = False
- $LootAttempts = 0
- $GemLootAttempts = 0
- Click($Resume[$R][0], $Resume[$R][1]) ;Resume the game
- for $i = 6 To 0 step -1 ;Make sure that we are in the game
- if InGameplayScreen() Then
- ExitLoop
- EndIf
- if Errortest() Then
- Local $file = FileOpen($furl, 1)
- $fwrite = _FileWriteLog($file, " ERROR APPEND IN INGAME TEST 01")
- FileClose($file)
- $restartloop = 0
- ExitLoop 2
- EndIf
- sleep(1000)
- if $i == 1 Then
- ;MsgBox(4096, "Error Starting the Game", "The game did not properly load...", 50)
- Local $file = FileOpen($furl, 1)
- $fwrite = _FileWriteLog($file, " IN GAME TEST TIMEOUT TRYING TO RELOGIN")
- FileClose($file)
- ;Terminate()
- $ErrorReport = 1
- ExitLoop
- EndIf
- Next
- Local $file = FileOpen($furl, 1)
- $fwrite = _FileWriteLog($file, " ---------- ENTERING GAME -----------") ; Write to the logfile passing the filehandle returned by FileOpen.
- FileClose($file)
- ;Get close to the cellar
- Sleep(500)
- Move($Loc1[$R][0], $Loc1[$R][1])
- Sleep(400)
- Send("{4}")
- Sleep(700)
- if $R > 0 Then
- sleep(500)
- EndIf
- Move($Loc2[$R][0], $Loc2[$R][1])
- Sleep(1100)
- Move($Loc3[$R][0], $Loc3[$R][1])
- ;Check to see if it's there
- MouseMove($CellarLocation[$R][0], $CellarLocation[$R][1])
- Sleep(700)
- $CellarPixel = PixelSearch($CellarLocation[$R][0]-$CellarOffset[$R], $CellarLocation[$R][1]-$CellarOffset[$R],$CellarLocation[$R][0]+4,$CellarLocation[$R][1]+4, 0x334FB7,8)
- ;Sometimes the 800x600 path gets buggy and we need to adjust...
- if @error AND $R > 0 Then
- MouseMove($CellarLocation2[$R][0],$CellarLocation2[$R][1])
- Sleep(350)
- $CellarPixel = PixelSearch(6, 18,9,23, 0x334FB7,6)
- if not @error Then
- $AltCellar = True
- EndIf
- EndIf
- ;Leave the game if the Cellar is not there
- if @error Then
- Send("{3}")
- Sleep(200)
- Send("{2}")
- Sleep(200)
- ConsoleWrite("Did not find the cellar " & @LF)
- Local $file = FileOpen($furl, 1)
- $fwrite = _FileWriteLog($file, " NO CELLAR FOUND")
- FileClose($file)
- SnareNearbyEnemies()
- leaveGame()
- Sleep(12000)
- ContinueLoop
- EndIf
- Local $file = FileOpen($furl, 1)
- $fwrite = _FileWriteLog($file, " ENTERING CELLAR") ; Write to the logfile passing the filehandle returned by FileOpen.
- FileClose($file)
- ;Enter the cellar
- ConsoleWrite("Found the cellar" & @LF)
- ; if not $AltCellar Then
- if $R > 0 AND $AltCellar Then
- Click($CellarLocation2[$R][0] - 4, $CellarLocation2[$R][1] - 4)
- Else
- Click($CellarLocation[$R][0], $CellarLocation[$R][1])
- endif
- ;else
- ; Click($CellarLocation2[$R][0], $CellarLocation2[$R][1])
- ;EndIf
- Sleep(1800 + $ComputerLag)
- ;Check to see if we died
- if CheckForDeath() Then
- ContinueLoop
- EndIf
- ;Inside the celler now - Move to the doorway and summon minions
- Send("{2}")
- Sleep(200)
- Send("{3}")
- Sleep(600)
- Move($Loc5[$R][0], $Loc5[$R][1])
- Sleep(1700)
- Move($Loc6[$R][0], $Loc6[$R][1])
- Sleep(300)
- ;Cast spell 1 on the pack
- MouseMove(611, 247)
- Send ("{SHIFTDOWN}")
- Sleep(150)
- MouseClick("left")
- Sleep(50)
- Send ("{SHIFTUP}")
- MouseMove(611, 247)
- Sleep(150)
- Send("{1}")
- Sleep(500)
- Send("{1}")
- Sleep(500)
- Send("{1}")
- Sleep(500)
- Send("{1}")
- Sleep(500)
- Send("{4}")
- Sleep(250)
- ;Kill all the enemies inside
- 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)
- Attack($MonsterLoc[$R][0]-20,$MonsterLoc[$R][1]-10)
- sleep(500)
- Attack($MonsterLoc[$R][0]+30,$MonsterLoc[$R][1]+10)
- Sleep(400)
- $MonsterBar = PixelSearch($MonsterSearch[$R][0], $MonsterSearch[$R][1], $MonsterSearch[$R][2], $MonsterSearch[$R][3], 0xEE0000, 10)
- if @error Then
- ConsoleWrite("No monsters found - Moving on")
- ExitLoop
- EndIf
- EndIf
- ;if CheckForNearbyMonsters() Then
- ;send("{4}")
- ;EndIf
- for $i = 7 To 0 step -1
- Attack($MonsterBar[0], $MonsterBar[1])
- Sleep(100)
- Next
- WEnd
- ToolTip('Looting Gold...', 0, 150)
- Local $file = FileOpen($furl, 1)
- $fwrite = _FileWriteLog($file, " LOOTING GOLD")
- FileClose($file)
- ;Loot the gold and attack anything we missed
- sleep(300)
- Move(437, 338)
- Sleep(900)
- Move(1322, 315)
- Sleep(500)
- Move(838, 762)
- Sleep(500)
- AttackNearbyMonsters()
- ToolTip("")
- ;Loot items
- Sleep(350)
- Loot()
- $LootAttemps = 0
- ;Check to see if we died
- if CheckForDeath() Then
- ContinueLoop
- EndIf
- ;Teleport to town
- send("{t}")
- sleep(8000)
- ;Repair if needed
- if $Repair then
- RepairItems()
- EndIf
- ;Leave the game
- LeaveGame()
- Sleep(1000)
- WEnd
- $ErrorReport = 0
- $ErrorPass += 1
- If $ErrorPass >= $ErrorPassMax Then
- Local $file = FileOpen($furl, 1)
- $fwrite = _FileWriteLog($file, " ERROR PASS MAX REACHED EXITING BOT")
- FileClose($file)
- Terminate()
- EndIf
- WEnd
- $restartloop = 0
- $logintestpass = 0
- Local $file = FileOpen($furl, 1)
- $fwrite = _FileWriteLog($file, " --------- RESTARTING MAIN LOOP ----------")
- FileClose($file)
- ToolTip("Restarting loop in 5sec",10, 150)
- Sleep(Random (3000, 6000))
- WEnd
- ; #################################################### FUNCTIONS CODE ####################################################
- 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
- Func RepairItems()
- if not CheckForRepair() Then
- Return
- EndIf
- Local $file = FileOpen($furl, 1)
- $fwrite = _FileWriteLog($file, " REPAIR ITEMS") ; Write to the logfile passing the filehandle returned by FileOpen.
- FileClose($file)
- Move($RepairCords[$R][0][0] , $RepairCords[$R][0][1])
- Sleep(2700+$ComputerLag)
- MouseMove($RepairCords[$R][1][0] , $RepairCords[$R][1][1])
- Sleep(400)
- Click($RepairCords[$R][1][0] , $RepairCords[$R][1][1])
- sleep(2200+$ComputerLag)
- click($RepairCords[$R][2][0] , $RepairCords[$R][2][1])
- Sleep(Random(700-900))
- Click($RepairCords[$R][3][0] , $RepairCords[$R][3][1])
- Sleep(500)
- send("{esc}")
- EndFunc
- Func LeaveGame()
- Local $file = FileOpen($furl, 1)
- $fwrite = _FileWriteLog($file, " ---------- LEAVING GAME -----------") ; Write to the logfile passing the filehandle returned by FileOpen.
- FileClose($file)
- ;If $fwrite <> 1 Then
- ; MsgBox(0, "Error", "Unable to open file.")
- ; EndIf
- send("{esc}")
- Sleep(400)
- Click($Leave[$R][0], $Leave[$R][1])
- EndFunc
- Func Pause()
- $Paused = Not $Paused
- While $Paused
- Sleep(100)
- ToolTip('Paused...', 0, 0)
- WEnd
- ToolTip("")
- EndFunc ;
- Func SilentPause()
- $Paused = Not $Paused
- While $Paused
- Sleep(100)
- ;ToolTip('Paused...', 0, 0)
- WEnd
- ToolTip("")
- EndFunc ;
- Func Click($x, $y)
- MouseClick('left', Random($x - 3, $x + 3), Random($y - 3, $y + 3), 1, Random(0, 1))
- Sleep(Random(1000, 1500))
- EndFunc
- Func Move($x, $y)
- MouseClick('middle', Random($x - 3, $x + 3), Random($y - 3, $y + 3), 1, Random(0, 1))
- Sleep(Random(1000, 1500))
- EndFunc
- Func Attack($x, $y)
- MouseClick('right', Random($x - 3, $x + 3), Random($y - 3, $y + 3), 1, Random(0, 1))
- EndFunc
- Func Rest($z)
- Sleep(Random($z, $z+25))
- EndFunc
- Func CheckForDeath()
- $Death = PixelSearch($DeathBounds[$R][0], $DeathBounds[$R][0], $DeathBounds[$R][0]+4, $DeathBounds[$R][0]+4, 0xFFFFFF)
- if not @error Then
- Local $file = FileOpen($furl, 1)
- $fwrite = _FileWriteLog($file, " DEAAAAD") ; Write to the logfile passing the filehandle returned by FileOpen.
- FileClose($file)
- ConsoleWrite("Died" & @LF)
- LeaveGame()
- Sleep(12000)
- return True
- Else
- return False
- EndIf
- EndFunc
- #cs
- Func LootBlues()
- $LootAttempts=0
- While ($LootAttempts < 3)
- $lootpass = "LOOT BLUE PASS "
- $lootpass &= $LootAttempts
- ToolTip($lootpass, 0, 150)
- Send("!")
- Sleep(250)
- $Blue = PixelSearch($LootingArea[$R][0], $LootingArea[$R][1], $LootingArea[$R][2], $LootingArea[$R][3], 0x6969FF, 2) ;
- If not @error Then
- Click($Blue[0], $Blue[1])
- Sleep(Random(800,1000))
- EndIf
- $LootAttempts+=1
- WEnd
- ToolTip("")
- EndFunc
- #ce
- Func Loot()
- $LootAttempts=0 ; LOOT RARE DESACTIVATE IT IF U WANT
- While ($LootAttempts < 2)
- $lootpass = "LOOT RARE PASS "
- $lootpass &= $LootAttempts
- ToolTip($lootpass, 0, 150)
- Sleep(250)
- $Rare = PixelSearch($LootingArea[$R][0], $LootingArea[$R][1], $LootingArea[$R][2], $LootingArea[$R][3], 0xFFFF00, 6) ;
- If not @error Then
- Local $file = FileOpen($furl, 1)
- $fwrite = _FileWriteLog($file, " LOOTING 1 RARE")
- FileClose($file)
- Click($Rare[0], $Rare[1])
- Sleep(1600)
- EndIf
- $LootAttempts+=1
- WEnd
- For $gI = 0 to ($totalItems - 5) ; LOOT GEMS POTIONS
- $file = $pick[$gI]
- $urlString = $directory & $file
- ToolTip("SEARCHING " & $urlString, 10, 100)
- $Target = _ImageSearchArea($urlString,1,400,200,1520,800,$gX,$gY,80)
- sleep(50)
- If $Target Then
- Local $file = FileOpen($furl, 1)
- $fwrite = _FileWriteLog($file, " LOOTING 1 GEM OR TOME")
- FileClose($file)
- ToolTip("FIND " & $Target & " " & $urlString & " POS " & $gX & "-" & $gY, 10, 100)
- Click($gX, $gY)
- sleep(500)
- $Target = _ImageSearchArea($urlString,1,400,200,1520,800,$gX,$gY,80)
- Sleep(50)
- If $Target Then
- Local $file = FileOpen($furl, 1)
- $fwrite = _FileWriteLog($file, " LOOTING 1 GEM OR TOME")
- FileClose($file)
- Click($gX, $gY)
- sleep(500)
- $Target = _ImageSearchArea($urlString,1,400,200,1520,800,$gX,$gY,80)
- Sleep(50)
- If $Target Then
- Local $file = FileOpen($furl, 1)
- $fwrite = _FileWriteLog($file, " LOOTING 1 GEM OR TOME")
- FileClose($file)
- Click($gX, $gY)
- sleep(500)
- EndIf
- EndIf
- EndIf
- ToolTip("", 10, 100)
- Next
- For $gI = 6 to ($totalItems - 1) ; LOOT LEGEND AND SET GEAR
- $file = $pick[$gI]
- $urlString = $directory & $file
- ToolTip("SEARCHING " & $urlString, 10, 100)
- $Target = _ImageSearchArea($urlString,1,400,200,1520,800,$gX,$gY,40)
- sleep(50)
- If $Target Then
- Local $file = FileOpen($furl, 1)
- $fwrite = _FileWriteLog($file, " LOOTING 1 LEGEND OR SET")
- FileClose($file)
- ToolTip("FIND " & $Target & " " & $urlString & " POS " & $gX & "-" & $gY, 10, 100)
- Click($gX, $gY)
- sleep(500)
- $Target = _ImageSearchArea($urlString,1,400,200,1520,800,$gX,$gY,40)
- Sleep(50)
- If $Target Then
- Local $file = FileOpen($furl, 1)
- $fwrite = _FileWriteLog($file, " LOOTING 1 LEGEND OR SET")
- FileClose($file)
- Click($gX, $gY)
- sleep(500)
- EndIf
- EndIf
- ToolTip("", 10, 100)
- Next
- ToolTip("")
- EndFunc
- 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
- send("{4}")
- sleep(300)
- for $i = 10 To 0 step -1
- Attack($MonsterData[0], $MonsterData[1])
- Sleep(100)
- Next
- WEnd
- EndFunc
- 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
- Func SnareNearbyEnemies()
- $MonsterData = PixelSearch($CharHitBox[$R][0],$CharHitBox[$R][1],$CharHitBox[$R][2],$CharHitBox[$R][3], 0xEE0000, 10)
- if not @error Then
- MouseMove($MonsterData[0], $MonsterData[1])
- Sleep(350)
- Send("{3}")
- sleep(250)
- EndIf
- EndFunc
- Func InGameLobby()
- MouseMove($GameLobbyCode[$R][0],$GameLobbyCode[$R][1])
- Sleep(300)
- PixelSearch($GameLobbyCode[$R][0],$GameLobbyCode[$R][1],$GameLobbyCode[$R][0]+10,$GameLobbyCode[$R][1]+10, $GameLobbyCode[$R][2], 10)
- if not @error Then
- return True
- Else
- return False
- EndIf
- EndFunc
- Func ErrorTest()
- ToolTip("Testing Connexion Error Dectection", 10, 100)
- $file = "ok.png"
- $urlString = $directory & $file
- $Target = _ImageSearchArea($urlString,1,410,230,1940,880 ,$gX,$gY,10)
- If $Target == 1 Then
- ToolTip("Connexion Error detected", 10, 100)
- Local $file = FileOpen($furl, 1)
- $fwrite = _FileWriteLog($file, " !!!!!!!!!!!!!!!! ERROR DETECTED !!!!!!!!!!!!!!! PASS " & $ErrorPass)
- FileClose($file)
- $ErrorReport = 1
- Click($gX, $gY)
- Sleep(500)
- return True
- Else
- ToolTip("No connexion error", 10, 100)
- return False
- EndIf
- EndFunc
- Func IsOnLoginScreen()
- ToolTip("is on login screen", 10, 100)
- $file = "loginscreen.png"
- $urlString = $directory & $file
- $Target = _ImageSearchArea($urlString,1,980,280,1010,300,$gX,$gY,10)
- If $Target == 1 Then
- ToolTip("LOGIN SCREEN", 10, 100)
- Local $file = FileOpen($furl, 1)
- $fwrite = _FileWriteLog($file, "LOGIN SCREEN ENTER PASSWORD")
- FileClose($file)
- return True
- Else
- ToolTip("NO LOGIN", 10, 100)
- return False
- EndIf
- EndFunc
- Func IsLoginScreenLoading()
- ToolTip("IS LODAING SCREEN", 10, 100)
- $file = "loginscreenload.png"
- $urlString = $directory & $file
- $Target = _ImageSearchArea($urlString,1,1030,380,1070,415,$gX,$gY,10)
- If $Target == 1 Then
- ToolTip("LOADING SCREEN", 10, 100)
- return True
- Else
- ToolTip("NO LOADING", 10, 100)
- return False
- EndIf
- EndFunc
- Func InGameplayScreen()
- PixelSearch($GameScreenCode[$R][0],$GameScreenCode[$R][1],$GameScreenCode[$R][0]+4,$GameScreenCode[$R][1]+3, $GameScreenCode[$R][2], 10)
- if not @error Then
- return True
- Else
- return False
- EndIf
- EndFunc
- Func Terminate()
- Local $file = FileOpen($furl, 1)
- $fwrite = _FileWriteLog($file, " ############ BOT ENDED #############")
- FileClose($file)
- Exit 0
- EndFunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement