Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;Darkling Lord's CustomLooting v1.0.1 - 6/14/2012
- ;Installation Instructions: http://www.ownedcore.com/forums/diablo-3/diablo-3-bots-programs/356234-gold-item-farming-shimizokis-sarkoth-dh-script-autoit.html
- ;;;;;
- #include <ImageSearch.au3>
- ;================SETTINGS================;
- ;Looting
- $LootSets = True ;True if you want to pick up Sets
- $LootLegendaries = True ;True if you want to pick up Legendaries
- $LootRares = True ;True if you want to pick up Rares
- $LootMagic = True ;True if you want to pick up Magic
- $LootGems = True ;True if you want to pick up Gems
- $LootTomes = True ;True if you want to pick up Tome of Secrets
- $LootCustom = True ;True if you want to pick up Custom Items (The items in the pick array above)
- ;Custom Loot
- $pngLoc = "D:\Users\Shimizoki\Desktop\D3 Stuff\AutoIt\Images\" ;Location of the .PNGs
- $totalItems = 1 ;Number of items in the pick array
- Global $pick[$totalItems] ;DONT CHANGE THIS
- ;Array of items to loot
- $pick[0] = "mythic.png|40" ;png|Tolerance
- ;$pick[1] = "item2.png"
- ;$pick[2] = "item3.png"i
- ;===DO NOT CHANGE ANYTHING BELOW HERE===;
- HotKeySet("x", "Stop") ;script stopped by pressing x
- $walktime = 3000 ; 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 = 3200 ; 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
- $yellow = 0xFFF000 ; yellow color code (repair icon)
- $red = 0xD90000 ; red color code (repair icon)
- ;Counts
- $LegendaryCount = 0
- $SetCount = 0
- $RareCount = 0
- $MagicCount = 0
- $GemCount = 0
- $TomeCount = 0
- $go = True
- $Leave = False
- $Dead = False
- $Logout = False
- $Window = False
- $default_resolutionX = 1920
- $default_resolutionY = 1080
- $x_ratio = @Desktopwidth / $default_resolutionX
- $y_ratio = @Desktopheight / $default_resolutionY
- $i = 0
- Call("Loot")
- Call("ShowLoot")
- Func Loot()
- Sleep(Random(500,2000))
- ConsoleWrite("Looting" & @CRLF)
- MouseMove(Round(Random(1400,1920)*$x_ratio),Round(Random(700,1080)*$y_ratio),3) ;Moves mouse out of the way
- If $LootSets == True Then
- $SetCount += LootGear(0x02CE01, 2)
- EndIf
- If $LootLegendaries == True Then
- $LegendaryCount += LootGear(0xBF642F, 0)
- EndIf
- If $LootRares == True Then
- $RareCount += LootGear(0xBBBB00, 2)
- EndIf
- If $LootTomes == True Then
- Call("LootTomes")
- EndIf
- If $LootMagic == True Then
- $MagicCount += LootGear(0x6969FF, 2)
- EndIf
- If $LootGems == True Then
- Call("LootGems")
- EndIf
- If $LootCustom == True Then
- Call("LootCustom")
- EndIf
- EndFunc
- Func LootCustom()
- $currentArrayItem = 0
- $gX = 0
- $gY = 0
- for $i = 0 to ($totalItems - 1)
- $array = StringSplit($pick[$i],"|")
- $file = $array[1]
- $accuracy = $array[2]
- $urlString = $pngLoc & $file
- ;ConsoleWrite("Looting " & $file & @CRLF)
- While _ImageSearchArea($pngLoc & $file,1,0,0,@DesktopWidth,@DesktopHeight,$gX,$gY,$accuracy)
- MouseMove($gX, $gY, 3)
- sleep(Random(75, 150))
- MouseClick("left",$gX,$gY,1,1)
- sleep(Random(800, 1200))
- MouseMove(Round(Random(1400,1920)*$x_ratio),Round(Random(700,1080)*$y_ratio),3) ;Moves mouse out of the way
- WEnd
- next
- EndFunc
- Func LootGear($color, $tolerance = 2)
- $count = 0
- $Loot = PixelSearch(Round(400*$x_ratio), 0, Round(1690*$x_ratio), Round(900*$y_ratio), $color, $tolerance) ; Magic loot (darker for compatibility)
- If Not @error Then
- While Not @error
- $count += 1
- MouseClick ('left', $Loot[0], $Loot[1])
- Sleep(Random(700,900))
- MouseMove(Round(Random(1400,1920)*$x_ratio),Round(Random(700,1080)*$y_ratio),3) ;Moves mouse out of the way
- ;Run at max 10 times per quality
- If $count >= 10 Then
- ExitLoop
- EndIf
- $Loot = PixelSearch(Round(400*$x_ratio), 0, Round(1690*$x_ratio), Round(900*$y_ratio), $color, $tolerance) ; Magic loot (darker for compatibility)
- WEnd
- EndIf
- Return $count
- EndFunc
- Func LootGems()
- $gX = 0
- $gY = 0
- While _ImageSearchArea($pngLoc & "square.png",1,0,0,@DesktopWidth,@DesktopHeight,$gX,$gY,115)
- ;MouseMove($gX,$gY,3)
- sleep(Random(75, 150))
- MouseClick("left",$gX,$gY)
- $GemCount += 1
- sleep(Random(800, 1200))
- MouseMove(Round(Random(1400,1920)*$x_ratio),Round(Random(700,1080)*$y_ratio),3) ;Moves mouse out of the way
- WEnd
- EndFunc
- Func LootTomes()
- $gX = 0
- $gY = 0
- $Start = 0
- ;variables are all set, now onto the scan.
- While _ImageSearchArea($pngLoc & "tome.png",1,0,0,@DesktopWidth,@DesktopHeight,$gX,$gY,90)
- ;MouseMove($gX,$gY,3)
- sleep(Random(75, 150))
- MouseClick("left",$gX,$gY)
- $TomeCount += 1
- sleep(Random(800, 1200))
- MouseMove(Round(Random(1400,1920)*$x_ratio),Round(Random(700,1080)*$y_ratio),3) ;Moves mouse out of the way
- WEnd
- EndFunc
- Func ShowLoot()
- ConsoleWrite(@CRLF & "Legendary:" & $LegendaryCount & " Set:" & $SetCount & " Rare:" & $RareCount & " Magic:" & $MagicCount & " Gem:" & $GemCount & " Tome:" & $TomeCount & @CRLF)
- EndFunc
- Func Stop() ;to allow the script to stop
- ShowLoot()
- Exit
- EndFunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement