Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Region ;**** Directives created by AutoIt3Wrapper_GUI ****
- #AutoIt3Wrapper_Outfile=ISx86Area.exe
- #AutoIt3Wrapper_Outfile_x64=ISx64.exe
- #AutoIt3Wrapper_UseX64=n
- #AutoIt3Wrapper_Res_requestedExecutionLevel=asInvoker
- #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
- #include <ImageSearch.au3>
- #include <GUIConstantsEx.au3>
- #include <Debug.au3>
- $sTitle = "My Debug Report"
- _DebugSetup($sTitle)
- ;~ _DebugOut("Search for item:" & $gI)
- Global $Paused
- HotKeySet(",", "Start") ;script started by pressing -
- HotKeySet(".", "Pause") ;script paused by pressing =
- HotKeySet("x", "Stop") ;script stopped by pressing x
- Func Start()
- $Pause = False
- EndFunc ;==>Start
- Func Pause()
- $Pause = True
- EndFunc ;==>Pause
- Func Stop() ;to allow the script to stop
- Exit
- EndFunc ;==>Stop
- ;ImageSearch Looting Variables
- $directory = "D:\Tmp\Diablo\Png\" ; CHANGE THIS! Point it to the directory with the imagesearch pngs
- $totalItems = 20 ; This needs to match the number of pngs you are loading
- Global $General[2]
- $General[0] = "uare.png" ; Matches "Square" require tolerance >70
- $General[1] = "tome.png" ; Matches "Tome" require tolerance >100
- Global $Legendary[6]
- $Legendary[0] = "legendaryA.png" ; Matches "Legenday" require tolerance >70
- $Legendary[1] = "legendaryE.png" ;
- $Legendary[2] = "legendaryI.png" ;
- $Legendary[3] = "legendaryO.png" ;
- $Legendary[4] = "legendaryU.png" ;
- $Legendary[5] = "legendaryY.png" ;
- Global $Set[6]
- $Set[0] = "setA.png" ; Matches "Set" require tolerance >70
- $Set[1] = "setE.png" ;
- $Set[2] = "setI.png" ;
- $Set[3] = "setO.png" ;
- $Set[4] = "setU.png" ;
- $Set[5] = "setY.png" ;
- Global $Rare[6]
- $Rare[0] = "rareA.png" ; Matches "Rare"
- $Rare[1] = "rareE.png" ;
- $Rare[2] = "rareI.png" ;
- $Rare[3] = "rareO.png" ;
- $Rare[4] = "rareU.png" ;
- $Rare[5] = "rareY.png" ;
- ;Timers
- $walktime = 4500 ; time in ms the script waits for you to enter and load the cellar. Slow this down for slower move speeds and loading times
- $loadtime = 5000 ; time in ms the script waits for the game to load before it starts pathfinding. Slow this down for slower hard drives
- $tptime = 6900 ; time in ms the script waits for teleport before exiting the game
- ;Settings
- $Timer = False ; set this to true and the bot will randomly wait (5% chance) in town for 30-60 seconds before starting over
- $LootRares = True ; Change this to false if you don't want the bot to pick up rares (good for legendary/set only, recommend setting LootGems to False)
- $LootGems = False ; Change this to true if you want to pick up gems (messy, can fill up bag with whites/blues)
- ;Repairs colors
- $yellow = 0xFFF000 ; yellow color code (repair icon)
- $red = 0xD90000 ; red color code (repair icon)
- $Continue = True
- $Pause = True
- $Dead = False
- $Logout = False
- $Window = False
- $NeedRepair = False
- $default_resolutionX = 1920
- $default_resolutionY = 1080
- $x_ratio = @DesktopWidth / $default_resolutionX ; Change @Desktopwidth to a static number if you are running different resolutions ingame and on desktop
- $y_ratio = @DesktopHeight / $default_resolutionY ; Change @Desktopwidth to a static number if you are running different resolutions ingame and on desktop
- $i = 0
- $x = 0
- $currentArrayItem = 0
- $gX = 0
- $gY = 0
- Call("RestartRun")
- Func RestartRun()
- While $Continue
- If Not ($Pause) Then
- _DebugOut("Start Testing:")
- Call("pickItems")
- Sleep(5000)
- EndIf
- WEnd
- Call("RestartRun")
- EndFunc ;==>RestartRun
- Func pickItems()
- Sleep(6000)
- ;~ Loot Legenday
- For $gI = 0 To (5)
- $urlString = $directory & $Legendary[$gI]
- $Target = _ImageSearch($urlString, 1, $gX, $gY, 75)
- _DebugOut("Link:" & $urlString)
- While $i <= 3
- If $Target Then
- _DebugOut(" ===================================" )
- _DebugOut("ItemFound:" & $Target)
- _DebugOut("x=" & $gX)
- _DebugOut("y=" & $gY)
- MouseClick("left", $gX, $gY)
- Sleep(Random(1000, 1200))
- MouseMove(0, 100) ;Reset cursor position, it doesn't need to hover
- $Target = _ImageSearch($urlString, 1, $gX, $gY, 75)
- $i += 1
- Else
- ExitLoop
- EndIf
- WEnd
- Next
- ;~ Loot Set
- For $gI = 0 To (5)
- $urlString = $directory & $Set[$gI]
- $Target = _ImageSearch($urlString, 1, $gX, $gY, 75)
- _DebugOut("Link:" & $urlString)
- While $i <= 3
- If $Target Then
- _DebugOut(" ===================================" )
- _DebugOut("ItemFound:" & $Target)
- _DebugOut("x=" & $gX)
- _DebugOut("y=" & $gY)
- MouseClick("left", $gX, $gY)
- Sleep(Random(1000, 1200))
- MouseMove(0, 100) ;Reset cursor position, it doesn't need to hover
- $Target = _ImageSearch($urlString, 1, $gX, $gY, 75)
- $i += 1
- Else
- ExitLoop
- EndIf
- WEnd
- Next
- ;~ Loot Rare
- For $gI = 0 To (5)
- $urlString = $directory & $Rare[$gI]
- $Target = _ImageSearch($urlString, 1, $gX, $gY, 100)
- _DebugOut("Link:" & $urlString)
- While $i <= 5
- If $Target Then
- _DebugOut(" ===================================" )
- _DebugOut("ItemFound:" & $Target)
- _DebugOut("x=" & $gX)
- _DebugOut("y=" & $gY)
- MouseClick("left", $gX, $gY)
- Sleep(Random(1000, 1200))
- MouseMove(0, 100) ;Reset cursor position, it doesn't need to hover
- $Target = _ImageSearch($urlString, 1, $gX, $gY, 100)
- $i += 1
- Else
- ExitLoop
- EndIf
- WEnd
- Next
- ;~ Loot general
- For $gI = 0 To (1)
- $urlString = $directory & $General[$gI]
- $Target = _ImageSearch($urlString, 1, $gX, $gY, 115)
- _DebugOut("Link:" & $urlString)
- While $i <= 10
- If $Target Then
- _DebugOut(" ===================================" )
- _DebugOut("ItemFound:" & $Target)
- _DebugOut("x=" & $gX)
- _DebugOut("y=" & $gY)
- MouseClick("left", $gX, $gY)
- Sleep(Random(1000, 1200))
- MouseMove(0, 100) ;Reset cursor position, it doesn't need to hover
- $Target = _ImageSearch($urlString, 1, $gX, $gY, 115)
- $i += 1
- Else
- ExitLoop
- EndIf
- WEnd
- Next
- EndFunc ;==>pickItems
Advertisement
Add Comment
Please, Sign In to add comment