Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; Blaksack's mod 1.93hyb
- ; added TP fail detection
- ; made ilvl optional
- ; timing improvements
- ;- optional cellar grid search
- ;- optional hour wait after X runs
- ;-Added latest changes from NotAres 1.93 including all the iLVL60-63 stuff dont forget new images: http://www45.zippyshare.com/v/15622375/file.html
- ;-Fixed the OCR bug where 0 is seen as O
- ;-Added option to use another war shout and call ancients before warping out on failed runs called $ExtraSafeExit
- ;-Added LATMs legendary item count fix
- ;-cleaned up cellar detection code - i hate repeated lines! you can define your own cellar co-ords at line 234ish
- ; enhanced cellar find
- ; item salvaging
- ; stash tab choosing
- ; full logging
- ; gold income OCR
- ; custom keys for skills
- ; for latest version see http://pastebin.com/PtE6XJ4W
- ; you will need tesseract from https://tesseract-ocr.googlecode.com/files/tesseract-ocr-setup-3.01-1.exe
- ; and you will need tesserect library to in your auto it include folder from https://dl.dropbox.com/u/22203901/Tesseract.au3
- ; you will also need image files and search dlls from https://dl.dropbox.com/u/9955791/BotFiles.zip
- ; and http://www45.zippyshare.com/v/15622375/file.html
- ; see for instructions http://www.ownedcore.com/forums/diablo-3/diablo-3-bots-programs/d3-gold-profiles/354464-goldfarming-notares-sarkoth-dh-gold-script-autoit-script-1920x1080.html
- ; use this build http://us.battle.net/d3/en/calculator/barbarian#TUXgkj!ghV!bYcbZa
- ;=========== DO NOT TOUCH ===========;
- #RequireAdmin
- #include <GUIConstantsEx.au3>
- #include <StaticConstants.au3>
- #include <WindowsConstants.au3>
- #include <FastFind.au3>
- #include <Tesseract.au3>
- AutoItSetOption("WinTitleMatchMode", 4)
- Global $FFhWnd = WinGetHandle("Diablo III"), $size = WinGetClientSize("[CLASS:D3 Main Window Class]"), $ver = "BlackSack 1.9.3hyb.f ", $hFont = 0, $title, $Paused, $Go = False, $i = 0, $gX = 0, $gY = 0, $LegendaryCount = 0, $SetCount = 0, $RareCount = 0, $MagicCount = 0, $GemCount = 0, $TomeCount = 0, $deathCount = 0, $cellarCount = 0, $t = TimerInit(), $rt = 0, $run = 0, $yellow = 0xFFF000, $red = 0xD90000, $lblRun, $lblLocation, $lblStatus, $lblLast, $lblRuntime, $lblGear, $lblItems
- Global $str_Stash, $str_StashGems, $str_StashMisc, $str_Vendor, $str_Salvage, $int_TownPosition, $IDitemX, $IDitemY
- Global $numitem, $numgem, $numtomb, $numgold, $numpot, $lblGold, $numsold, $numstashed, $monold = 0, $mon = 0, $monstart = 0, $SprintStart, $lootany, $attackTime, $HeroID, $Hero, $TownTrips = 0, $movementSpeed, $OpenCount = 0, $CloseCount = 0, $FailCount = 0, $UseMultiHeros
- Global $gems[8] = ["Ru1.png", "Ru2.png", "Em1.png", "Em2.png", "To1.png", "To2.png", "Am1.png", "Am2.png"]
- ;====================================;
- $pngLoc = "C:\Program Files (x86)\AutoIt3\pics\" ;Location of the .PNGs (NO SUBFOLDERS - ALL PNGS GO HERE)
- ;FOR A SINGLE HERO ===============================================
- $Hero = "Wizard"
- $movementSpeed = 0
- ;For MULTIPLE HEROS===============================================
- $UseMultiHeros = False ; set to true first
- ; CLASS = Wizard, Monk, Hunter, Barbarian, Witch
- ; ID 1 ID2 "CLASS|POSITION IN HERO LIST|MOVESPEED"
- Global $HeroSelectList[2] = ["Barbarian|2|11", "Wizard|3|12"]
- ;Set the hero in the list above that you want to start with
- $HeroID = 2;
- ;=================================================================
- ; WIZARD ONLY OPTIONS
- $AddDPS = 13700 ; set your wizard base DPS, assumes improved archeon and magic weapon
- ;BARBARIAN ONLY OPTIONS
- $SarkothKillTime = 0 ;additional time delay to wait for sarkoth to die use 2800 for 10K dps 800 for 15kdps etc
- $ExtraSafeExit = False ;use ancients when you port back to prevent death if you have low HP
- ;HUNTER ONLY OPTIONS
- $DHSarkothKillTime = 1000 ;additional time delay to wait for sarkoth to die use 2800 for 10K dps 800 for 15kdps etc
- ;General
- $RunsUntilMenuWait = 0 ;wait for 1 hour at menu after x successful runs, set to 0 to disable
- $TakeMissShots = False ;take screenshots into \shots folder on every cellar miss for finding positions
- $DetectTPFail = True ;set true to immediatly exit game if TP is inturrupted (requires TP.png)
- $TPProtectTime = 2.0 ;number of seconds to check for TP inturrupt if TPfail detection is enabled if your pc is slow reduce this number
- $ReduceLegendSearch = True ; limit legendary searching to lower part of screen to reduce false finds
- $CheckLootWhilePorting = False; continue scanning for loot while you port back incase sakroth dies late
- $CellarEnterHelp = False; Extra click on the cellar if you get stuck ontop of the entrance
- $DetectTownFailRetry = True; set true to retry town visit if somthing goes wrong
- ;AutoStart
- $gameDiabloIIILoc = "C:\Diablo III\" ;Location of Diablo 3 executable
- $gameAutoStart = 0 ; Set this to 1 to start game from desktop or recover from closed game
- $gameStartTime = 9000 ;Change depending on computer/internet speed
- $gamePassword = "" ;Symbols go in brackets "Password1{!}"
- $gameExecutable = "Diablo III.exe"
- GameAutostart()
- DoSetupStuff()
- ;Buttons
- $Skill1 = "1"
- $Skill2 = "2"
- $Skill3 = "3"
- $Skill4 = "4"
- $TownPortalButton = "t"
- $Inventory = "i"
- ;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)
- Global $pick[1] = ["gold.png|50"];Array of items to loot (GEMS AND TOMES ALREADY INCLUDED)
- ;Global $pick[2] = ["mythic.png|50", "gold.png|50"]
- ;Manage Loot
- $Identify = True ;True to enable identifying items before stashing/vendoring
- $mLoot = 9 ;Nuber of successful runs until Stash and Vendor
- $mLootOff = 3 ;Stash and Vendor after mLoot +- X number of runs (Variability)
- ;Variability ==NEW SETTINGS==
- $Timer = False ;True and the bot will add random sleep intervals
- $loadtime = 3400 ;Time (in ms) the script waits for the game to load before it starts pathfinding. Slow this down for slower hard drives
- $tptime = 6000 ;Time (in ms) the script waits for teleport before exiting the game
- ;Stashing/vendoring COMMON
- $StashRare = True ;True if you want to store Rare items in the stash
- $StashMagic = False ;True if you want to store Magic items in the stash
- $VendorRare = False ;True if you want to vendor Rares
- $VendorMagic = True ;True if you want to vendor Magic
- $GemTab = 1 ;Tab to put gems and tombs in
- $ItemTab = 1 ;Tab to put any items in
- $NextItemTab = 2 ;Next Tab to put any items in when first one is full
- $FinalItemTab = 3 ;Next, Next Tab to put any items in when Next one is full
- $UseiLVL = False ;set true or false to enable the iLVL system THIS OVERRIDES ALL "TRADITIONAL" SETTINGS
- ;--------------------------------------------TRADITIONAL----------------------------------------------------
- ;Stashing/vendoring TRADITIONAL METHOD to enable set line 155 to FALSE
- $StashLoot = True ;True if you want to store Items in the stash
- $StashLegendary = True;True if you want to store Legendary items in the stash
- $StashTomes = True ;True if you want to store Tomes items in the stash
- $StashGems = True ;True if you want to store Gems items in the stash
- $StashIdentified = True; Stash all items that have just been identified
- ;SALVAGE - setting this will OVERRIDE traditional vendoring options - it will be skipped
- ; make sure you have a stack of each material in your bottom row( which is not scanned )for it to add To
- ; otherwise it will start tying to salvage your craft items and do nothing!
- $SalvageLoot = False
- ;Vendoring ==NEW SETTINGS==
- $VendorLoot = True ;True if you want to vendor anything
- $vendorAll = False ;True if you want to right click all items when talking to vendor
- $vendorRows = 6 ;# of rows to vendor, starting from the top (default = 5: bottom row is safe)
- $vendorCols = 10 ;# of columns to vendor, starting from left
- ;--------------------------------------------TRADITIONAL----------------------------------------------------
- ; OPTIONS ABOVE AND BELOW ARE MUTUALLY EXCLUSIVE
- ;--------------------------------------------iLVL----------------------------------------------------
- ;====================================;
- ;New Analyze Loot Settings Options are "salvage", "stash", and "vend"
- $i59Rare = "salvage"
- $i60Rare = "salvage"
- $i61Rare = "salvage"
- $i62Rare = "stash"
- $i63Rare = "stash"
- $i59Magic = "salvage"
- $i60Magic = "salvage"
- $i61Magic = "salvage"
- $i62Magic = "salvage"
- $i63Magic = "stash"
- ;====================================;
- ;--------------------------------------------iLVL----------------------------------------------------
- $x_ratio = $size[0] / 1920
- $y_ratio = $size[1] / 1080
- $mLootIn = $mLoot ;DO NOT CHANGE, how many more runs till next manage
- $RunsUntilMenuWaitCnt = $RunsUntilMenuWait
- $totalItems = UBound($pick) ;Number of items in the pick array
- If $totalItems < 1 Then $LootCustom = False
- $AddDPS = $AddDPS * 3.25
- $attackTime = (170000 / $AddDPS) * 1000
- $movementSpeed = 1 + ($movementSpeed / 100)
- If $TakeMissShots Then
- DirCreate("shots")
- EndIf
- If Not FileExists($pngLoc & "MainMenu.png") Then
- $pngLoc = @ScriptDir & "\pics\"
- If Not FileExists($pngLoc & "MainMenu.png") Then
- MsgBox(16, "Fatal Error", "FATAL ERROR: Cannot find: " & $pngLoc & "MainMenu.png" & @CRLF & "Make sure your directory is set properly in the script")
- Exit
- EndIf
- EndIf
- Call("SetupGUI")
- WinActivate("Diablo III")
- Sleep(1000)
- If $gameAutoStart Then Begin()
- While 1
- Call("RestartRun")
- WEnd
- Func RestartRun()
- If ($Go) Then
- $i = 0
- Send("{SPACE}")
- WinSetTitle($title, "", $title & $ver & " - Running")
- MouseMove(Round(Random(1000, 1400) * $x_ratio), Round(Random(400, 680) * $y_ratio), 1) ;Moves mouse out of the way
- ;Checks if the player is Dead/Logout/Window, then if in Main Menu, etc.
- If CheckDead() Then
- Return
- ElseIf CheckFor("ExitGame", "", Round(860 * $x_ratio), Round(400 * $y_ratio), Round(1040 * $x_ratio), Round(450 * $y_ratio), 0.2, 140) Then
- GUICtrlSetData($lblStatus, "Status: Exit window up")
- MouseClick("left", Round(1064 * $x_ratio), Round(632 * $y_ratio))
- Sleep(100)
- Send("{SPACE}")
- Return
- ElseIf CheckFor("MainMenu", "", Round(40 * $x_ratio), Round(300 * $y_ratio), Round(400 * $x_ratio), Round(450 * $y_ratio)) Then
- GUICtrlSetData($lblRun, "Runs till vendor: " & $mLootIn & ", Run Number: " & $run)
- GUICtrlSetData($lblLocation, "Location: Main Menu")
- GUICtrlSetData($lblStatus, "Status: Starting Game")
- If ($run = 0) And $UseMultiHeros Then SelectHero($HeroID)
- RandClick("left", Round(230 * $x_ratio), Round(416 * $y_ratio), 120, 20, 1, 2) ;Random Click on the resume button
- CheckFor("OldRuins", "Area", 0, 0, 0, 0, $loadtime / 1000)
- ;Sleep($loadtime)
- $rt = TimerInit()
- $run += 1
- ElseIf CheckFor("OldRuins", "Area") Or CheckFor("NewTristram", "Area") Or CheckFor("DankCellar", "Area") Then
- Call("TownPortal")
- Call("LeaveGame")
- Return
- ElseIf CheckFor("LimitError", "", Round(700 * $x_ratio), Round(340 * $y_ratio), Round(1200 * $x_ratio), Round(600 * $y_ratio), 1, 140) Then
- MouseClick("left", Round(960 * $y_ratio), Round(635 * $x_ratio))
- $rand = Random(40000, 80000)
- GUICtrlSetData($lblStatus, "Status: Input Limit - Waiting " & Round($rand / 1000) & " seconds.")
- Sleep($rand)
- Send("{SPACE}")
- Return
- ElseIf CheckFor("Disconnect", "", Round(700 * $x_ratio), Round(340 * $y_ratio), Round(1200 * $x_ratio), Round(600 * $y_ratio), 1, 140) Then
- GUICtrlSetData($lblStatus, "Status: Network Disconnect window up")
- MouseClick("left", Round(960 * $x_ratio), Round(632 * $y_ratio))
- Sleep(100)
- Send("{SPACE}")
- Return
- Else
- GUICtrlSetData($lblStatus, "ERROR: Cannot find Resume button")
- Addlog("ERROR: Cannot find Resume button")
- If $gameAutoStart Then GameRestart()
- Return
- EndIf
- $CellarWasFound = 0
- ;Make sure we are in the right area before beginning run
- If CheckFor("OldRuins", "Area") Then
- Sleep(Random(200, 300))
- GUICtrlSetData($lblLocation, "Location: Old Ruins")
- Call("CheckRepair")
- If $run = 1 Then
- GetMoney(True)
- $monstart = Number($mon)
- EndIf
- If $Hero == 'Barbarian' Then;----------------------------------------------------------------------- HERO DEPENDANT ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Send($Skill3)
- Sleep(Random(100, 200))
- RandClick("middle", Round(587 * $x_ratio), Round(350 * $y_ratio), 15, 5) ;starts the main run
- Sleep(Random(700, 710))
- RandMove(Round(16 * $x_ratio), Round(350 * $y_ratio), 20, 6)
- Sleep(Random(5, 10))
- Send($Skill1) ;leap
- $leaptime = TimerInit()
- Sleep(Random(600, 800))
- DoSprint()
- Sleep(Random(50, 80))
- RandClick("middle", Round(2 * $x_ratio), Round(350 * $y_ratio), 10, 10, 1, 2)
- Sleep(Random(700, 900))
- RandClick("middle", Round(2 * $x_ratio), Round(400 * $y_ratio), 15, 15, 1, 2)
- walktime(Round(2 * $x_ratio), Round(400 * $y_ratio))
- ElseIf $Hero == 'Wizard' Then
- Sleep(100)
- MouseClick("middle", Round(300 * $x_ratio), Round(100 * $y_ratio), 1) ;starts the main run
- Sleep(300)
- MouseClick("middle", Round(0 * $x_ratio), Round(300 * $y_ratio), 1) ;starts the main run
- Sleep(50)
- Send("{" & $Skill3 & " down}")
- Sleep(1000)
- MouseMove(Round(0 * $x_ratio), Round(450 * $y_ratio), 1)
- Sleep(900)
- Send("{" & $Skill3 & " up}")
- Sleep(100)
- Send($Skill1)
- ElseIf $Hero == 'Hunter' Then
- Sleep(50)
- RandClick("middle", Round(500 * $x_ratio), Round(250 * $y_ratio), 5 * $x_ratio, 5 * $y_ratio) ;starts the run [waypoint 1]
- Moving(190)
- Send($Skill2)
- Moving(1100)
- RandClick("middle", 1, Round(370 * $y_ratio), 5 * $x_ratio, 5 * $y_ratio) ;waits ~1 second then [waypoint 2]
- Moving(1260)
- Send($Skill2)
- Moving(575)
- RandClick("middle", Round(200 * $x_ratio), Round(400 * $y_ratio), 2, 2) ;middle of courtyard [waypoint 3]
- ;~ RandClick("middle", Round(400*$x_ratio), Round(600*$y_ratio), 5*$x_ratio, 5*$y_ratio) ;middle of courtyard [waypoint 3] OLD
- Moving(50)
- Send($Skill3)
- Moving(25)
- Moving(1200)
- Send($Skill1)
- ElseIf $Hero == 'Monk' Then
- Sleep(200)
- MouseClick("middle", Round(10 * $x_ratio), Round(250 * $y_ratio)) ;starts the main run
- Send("{" & $Skill4 & " down}")
- Sleep(4000)
- Send("{" & $Skill4 & " up}")
- Sleep(100)
- EndIf
- ; cellar check on minimap
- $cellfound = CheckForCellar()
- If CheckDead() Then Return
- ;Checks if Dank Cellar is Open
- If $cellfound Then
- $OpenCount += 1
- GUICtrlSetData($lblStatus, "Status: Cellar Found")
- Call("AddLog", "Cellar Found")
- $cellarCount += 1
- $cellaratx = 1000 * $x_ratio
- $cellaraty = 500 * $y_ratio
- If $Hero == 'Barbarian' Then;----------------------------------------------------------------------- HERO DEPENDANT ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- DoSprint()
- RandClick("middle", Round(400 * $x_ratio), Round(430 * $y_ratio), 10, 10)
- walktime(Round(400 * $x_ratio), Round(430 * $y_ratio), 0)
- ElseIf $Hero == 'Wizard' Then
- RandClick("middle", Round(423 * $x_ratio), Round(421 * $y_ratio), 10, 10)
- walktime(Round(423 * $x_ratio), Round(421 * $y_ratio))
- ElseIf $Hero == 'Monk' Then
- RandClick("middle", Round(407 * $x_ratio), Round(427 * $y_ratio), 10, 10)
- Send("{" & $Skill4 & " down}")
- Moving(600)
- Send("{" & $Skill4 & " up}")
- Sleep(200)
- ElseIf $Hero == 'Hunter' Then
- RandClick("middle", Round(285 * $x_ratio), Round(397 * $y_ratio), 10, 10)
- DoSprint()
- walktime(Round(285 * $x_ratio), Round(397 * $y_ratio), -150)
- EndIf
- Local $cellpos = EnhancedFind(0, 0, 1300, 300, 1090, 280)
- $cellaratx = $cellpos[0]
- $cellaraty = $cellpos[1]
- MouseMove(Round($cellaratx), Round($cellaraty), 1) ;Entrance to cellar
- Sleep(100)
- RandClick("left", Round($cellaratx), Round($cellaraty), 5, 2, 2, 2) ;Entrance to cellar
- walktime(Round($cellaratx), Round($cellaraty))
- ;Call("AddLog",walktime(Round($cellaratx), Round($cellaraty),0,True))
- If $CellarEnterHelp Then RandClick("left", Round(993 * $x_ratio), Round(469 * $y_ratio), 5, 5, 2, 2) ;Entrance to cellar
- CheckFor("DankCellar", "Area", 0, 0, 0, 0, 2)
- $CellarWasFound = 1
- Else ;ABORT RUN
- $CloseCount += 1
- GUICtrlSetData($lblStatus, "Status: Cellar - Not Found" & @CRLF)
- Call("AddLog", 'No Cellar')
- If $TakeMissShots Then CaptureToTIFF("", "", "", "shots\NoCell_" & String($run) & ".tif", 1, 0, 0, 0, 0)
- SafeExit()
- If $CheckLootWhilePorting Then
- Send($TownPortalButton)
- Sleep(200)
- CheckLootWhilePorting()
- Else
- Call("TownPortal")
- EndIf
- Call("LeaveGame")
- Return
- EndIf
- Else ; WE'RE NOT IN OLD RUINS
- Call("TownPortal")
- Call("LeaveGame")
- Return
- EndIf
- ; CELLAR ENTRANCE RECOVERY
- $TryRecover = 0
- If Not CheckFor("DankCellar", "Area", 0, 0, 0, 0, .5) Then
- ; recover from standing on entrance
- RandClick("left", Round(993 * $x_ratio), Round(469 * $y_ratio), 1) ;Entrance to cellar
- $TryRecover = 1
- If Not CheckFor("DankCellar", "Area", 0, 0, 0, 0, 1.5) Then
- ;recover from wall gateway
- $TryRecover = 3
- $cellpos = EnhancedFind(0, 0, 1300, 450, 1000, 350, True)
- RandClick("left", Round($cellpos[0]), Round($cellpos[1]), 1) ;Entrance to cellar
- CheckFor("DankCellar", "Area", 0, 0, 0, 0, 4)
- EndIf
- EndIf
- ;Checks that the player is in the Dank Cellar
- If CheckFor("DankCellar", "Area") Then
- GUICtrlSetData($lblLocation, "Location: Dank Cellar")
- If $TryRecover = 1 Then Call("AddLog", 'OnCellar Recovery Success from ontop')
- If $TryRecover = 2 Then Call("AddLog", 'OnCellar Recovery Success From wall')
- If $TryRecover = 3 Then Call("AddLog", 'OnCellar Recovery Success using enhanced find')
- If $Hero == 'Barbarian' Then;----------------------------------------------------------------------- HERO DEPENDANT ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- RandClick("middle", Round(80 * $x_ratio), Round(830 * $y_ratio), 5, 5) ;moves to doorway leading to rare inside cellar
- walktime(Round(80 * $x_ratio), Round(830 * $y_ratio), -100)
- ;Sleep(Random(2250, 2300))
- GUICtrlSetData($lblStatus, "Status: Attacking Sarkoth")
- RandMove(Round(350 * $x_ratio), Round(60 * $y_ratio), 1) ;hovers over the rare Sarkoth
- If TimerDiff($leaptime) < 10500 Then
- Sleep(10500 - TimerDiff($leaptime))
- EndIf
- Send($Skill1)
- Sleep(200)
- Send("{SHIFTDOWN}")
- RandClick("left", Round(11 * $x_ratio), Round(1037 * $y_ratio), 10, 10) ;earthquake
- Sleep(200)
- RandClick("left", Round(11 * $x_ratio), Round(1037 * $y_ratio), 10, 10) ;earthquake
- Send("{SHIFTUP}")
- Sleep(300)
- Send($Skill2)
- Sleep(300)
- Send($Skill4)
- Sleep(200)
- MouseClick("right", Round(694 * $x_ratio), Round(929 * $y_ratio)) ;cancel aura thanks to LATM
- If CheckDead() Then Return
- Sleep(Random($SarkothKillTime, $SarkothKillTime + 400))
- RandClick("middle", Round(730 * $x_ratio), Round(585 * $y_ratio), 10, 10) ;move to left top corner for gold
- Sleep(Random(850, 1350))
- RandClick("middle", Round(1205 * $x_ratio), Round(380 * $y_ratio), 10, 10) ;move to right top corner for gold
- Sleep(Random(900, 1400))
- RandClick("middle", Round(1121 * $x_ratio), Round(805 * $y_ratio), 10, 10) ;move to middle before looting
- Sleep(Random(900, 1150))
- ElseIf $Hero == 'Wizard' Then
- RandClick("middle", Round(20 * $x_ratio), Round(708 * $y_ratio), 1, 1) ;moves to doorway leading to rare inside cellar
- walktime(Round(20 * $x_ratio), Round(708 * $y_ratio), -100)
- RandMove(Round(440 * $x_ratio), Round(80 * $y_ratio), 1, 1) ;hovers over the rare Sarkoth
- Sleep(150)
- Send("4")
- Sleep(200)
- Send("{SHIFTDOWN}")
- GUICtrlSetData($lblStatus, "Status: Attacking Sarkoth")
- MouseDown("right") ;ATTACK
- Sleep($attackTime)
- MouseUp("right")
- Sleep(150)
- Send("{SHIFTUP}")
- RandClick("middle", Round(558 * $x_ratio), Round(224 * $y_ratio), 1, 1)
- walktime(Round(558 * $x_ratio), Round(224 * $y_ratio), -800)
- MouseClick("right", Round(755 * $x_ratio), Round(936 * $y_ratio), 1) ;cancel archon
- ElseIf $Hero == 'Hunter' Then
- Send($Skill4)
- RandClick("middle", Round(20 * $x_ratio), Round(708 * $y_ratio), 1, 1) ;moves to doorway leading to rare inside cellar
- Moving(2800)
- RandMove(Round(425 * $x_ratio), Round(70 * $y_ratio), 1, 1)
- ;Send($Skill4)
- Send("{SHIFTDOWN}")
- MouseDown("right") ;ATTACK
- Sleep(1200)
- MouseUp("right")
- MouseDown("left")
- Sleep($DHSarkothKillTime)
- MouseUp("left")
- Sleep(Random(50, 150))
- Send("{SHIFTUP}")
- RandClick("middle", Round(470 * $x_ratio), Round(280 * $y_ratio)) ;Left
- Moving(2500)
- ElseIf $Hero == 'Monk' Then
- MouseClick("middle", Round(110 * $x_ratio), Round(1000 * $y_ratio)) ;moves to doorway leading to rare inside cellar
- ;Sleep(Random(2200, 2300))
- Send("{" & $Skill4 & " down}")
- Sleep(1000)
- Send("{" & $Skill4 & " up}")
- Send($Skill3)
- Sleep(30)
- MouseClick("middle", Round(440 * $x_ratio), Round(80 * $y_ratio), 1) ;attacks the rare Sarkoth
- Send("{" & $Skill4 & " down}")
- Sleep(1200)
- Send("{" & $Skill4 & " up}")
- Send("{SHIFTDOWN}")
- Sleep(10)
- GUICtrlSetData($lblStatus, "Status: Attacking Sarkoth")
- MouseClick("left")
- Sleep(10)
- Send($Skill2)
- Sleep(10)
- MouseDown("right") ;attack middle
- Sleep(1500)
- MouseClick("right", Round(960 * $x_ratio), Round(502 * $y_ratio), 2)
- Sleep(100)
- Send("{SHIFTUP}")
- Sleep(10)
- Send($Skill3)
- Sleep(10)
- MouseClick("middle", Round(637 * $x_ratio), Round(540 * $y_ratio)) ;move to left top corner for gold
- Sleep(600)
- MouseClick("middle", Round(1320 * $x_ratio), Round(310 * $y_ratio)) ;move to right top corner for gold
- Sleep(600)
- MouseClick("middle", Round(975 * $x_ratio), Round(827 * $y_ratio)) ;move to middle before looting
- Sleep(600)
- EndIf
- GUICtrlSetData($lblStatus, "Status: Looting")
- $numgem = 0
- $numtomb = 0
- $numgold = 0
- $numpot = 0
- $numitem = 0
- If ($Hero == 'Barbarian') Or ($Hero == 'Hunter') Then
- DoSprint()
- EndIf
- Call("Loot")
- RandSleep(0, 6, 30)
- If $CheckLootWhilePorting Then Send($TownPortalButton)
- Sleep(200)
- $mondelt = GetMoney(True)
- If $Hero == 'Hunter' Then Send($Skill4)
- If $CheckLootWhilePorting Then
- CheckLootWhilePorting()
- Else
- Call("TownPortal")
- EndIf
- GUICtrlSetData($lblGold, "Gold: " & $mon & ", Run: " & $mondelt & ", Gain: " & Number($mon) - $monstart)
- Call("AddLog", 'Gold: ' & $mon & ', Gold Delt: ' & $mondelt & ', Items: ' & $numitem & ', Gems: ' & $numgem & ', Books: ' & $numtomb & ', Potions: ' & $numpot & ', GoldPick: ' & $numgold)
- Else
- If $TryRecover = 1 Then Call("AddLog", 'OnCellar Recovery Failure')
- If $CellarWasFound = 1 Then Call("AddLog", 'Cellar was found but didnt end up there')
- If $TakeMissShots Then CaptureToTIFF("", "", "", "shots\MissCell_" & String($run) & ".tif", 1, 0, 0, 0, 0)
- $FailCount += 1
- SafeExit()
- Call("TownPortal")
- If Not CheckDead() Then Call("LeaveGame")
- Return
- EndIf
- ;After successful run
- If Not CheckDead() Then
- Sleep(600)
- $JustVendored = False
- If $mLootIn = 1 And CheckFor("NewTristram", "Area") Then ;If its time to manage loot and we are in town
- $mLootIn = Round(Random($mLoot - $mLootOff, $mLoot + $mLootOff)) ;Reset Counter
- If $UseiLVL Then
- Call("AnalyseLoots")
- Else
- If $Identify Then Call("Identify")
- If $StashLoot Then Call("StashLoot")
- If $SalvageLoot Then
- Call("SalvageLoot")
- Else
- If $VendorLoot Then Call("VendorLoot")
- EndIf
- EndIf
- If $mLootIn > 1 Then $JustVendored = True
- ElseIf Not CheckFor("NewTristram", "Area") Then
- GUICtrlSetData($lblStatus, "Status: Skipping vendor, not in New Tristram")
- Sleep(3000)
- ElseIf $mLootIn <= 0 Then
- $mLootIn = 1
- Else
- $mLootIn -= 1
- EndIf
- If Not CheckDead() Then
- Call("LeaveGame")
- EndIf
- If $UseMultiHeros Then
- ;Select random hero
- If $JustVendored Then
- $newid = Random(1, UBound($HeroSelectList), 1)
- If UBound($HeroSelectList) = 1 Then $newid = 1
- If $newid <> $HeroID Then
- SelectHero($newid)
- Addlog("Switched to hero: " & $Hero)
- EndIf
- EndIf
- EndIf
- If ($RunsUntilMenuWaitCnt = 1) And ($RunsUntilMenuWait > 0) Then
- $RunsUntilMenuWaitCnt = $RunsUntilMenuWait
- Sleep(Random(3550000, 3650000)) ;wait 1 hour
- Else
- $RunsUntilMenuWaitCnt -= 1
- EndIf
- Return
- Else
- Return
- EndIf
- EndIf
- EndFunc ;==>RestartRun
- Func SafeExit()
- If $Hero == 'Barbarian' Then;----------------------------------------------------------------------- HERO DEPENDANT ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- If $ExtraSafeExit Then
- Send($Skill2) ;grim harvest
- Sleep(Random(200, 300))
- Send($Skill4) ;ancients
- Sleep(Random(500, 600))
- EndIf
- Send("{SHIFTDOWN}")
- RandClick("left", Round(900 * $x_ratio), Round(600 * $y_ratio), 100, 100) ;earthquake
- Send("{SHIFTUP}")
- Sleep(Random(550, 650))
- ElseIf $Hero == 'Wizard' Then
- Send($Skill2)
- Sleep(Random(200, 300))
- Send("{SHIFTDOWN}")
- Sleep(Random(200, 300))
- MouseClick("left")
- Sleep(Random(200, 300))
- Send("{SHIFTUP}")
- Sleep(Random(750, 850))
- ElseIf $Hero == 'Hunter' Then
- Sleep(10)
- RandClick("middle", Round(1100 * $x_ratio), Round(600 * $y_ratio)) ;moves between caltrops for safety before teleporting back to town
- Moving(250)
- Send($Skill1)
- Sleep(620)
- Send($Skill2)
- Sleep(40)
- ElseIf $Hero == 'Monk' Then
- Sleep(10)
- Send($Skill3)
- Moving(250)
- Send($Skill1)
- Sleep(620)
- Send($Skill2)
- Sleep(40)
- EndIf
- EndFunc ;==>SafeExit
- Func VendorLoot()
- GUICtrlSetData($lblStatus, "Status: Vendoring Items")
- If $Hero == 'Barbarian' Or $Hero == 'Hunter' Or $Hero == 'Monk' Then ;----------------------------------------------------------------------- HERO DEPENDANT ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Sleep(Random(200, 300))
- If $Hero == 'Barbarian' Then
- Send($Skill3)
- Sleep(Random(300, 400))
- EndIf
- If $Hero == 'Barbarian' Or $Hero == 'Hunter' Then
- DoSprint()
- EndIf
- If Not $StashLoot Then ;Move from TP towards vendor
- Sleep(Random(100, 300))
- MouseClick("middle", 1565 * $x_ratio, 50 * $y_ratio)
- walktime(1565 * $x_ratio, 50 * $y_ratio, 150)
- Else ;Move from Stash towards vendor
- Sleep(Random(100, 300))
- MouseClick("middle", 1560 * $x_ratio, 120 * $y_ratio)
- walktime(1560 * $x_ratio, 120 * $y_ratio, 150)
- EndIf
- MouseClick("left", 1030 * $x_ratio, 210 * $y_ratio) ;Talk to vendor
- walktime(1030 * $x_ratio, 210 * $y_ratio, 250)
- ElseIf $Hero == 'Wizard' Then
- If Not $StashLoot Then
- MouseMove(1530 * $x_ratio), 0 * $y_ratio), 1) ;begin movement towards merchant
- Send("{3 down}")
- Sleep(1300)
- Send("{3 up}")
- Else ;Move from Stash towards vendor
- Sleep(Random(300, 500))
- MouseMove(1525 * $x_ratio, 70 * $y_ratio)
- Send("{3 down}")
- Sleep(1300)
- Send("{3 up}")
- EndIf
- MouseClick("left", Round(796 * $x_ratio), Round(474 * $y_ratio), 6) ;NPC Merchant to the right of cain's
- EndIf
- Sleep(300)
- $numsold = 0;
- $TownTrips += 1;
- ;All
- If $vendorAll Or (Mod($TownTrips, 4) = 0) Then
- For $c = 1 To $vendorCols
- For $r = 1 To $vendorRows
- RandClick("right", (((($c - 1) * 50) + 32 + 1400) * $x_ratio), (((($r - 1) * 51) + 32 + 580) * $y_ratio), 2, 2, 1, 2.5)
- Next
- Next
- Else
- ;Rares
- If $VendorRare Then
- ClickItems(0x4A3C0B, 2)
- EndIf
- ;Magic
- If $VendorMagic Then
- ClickItems(0x182037, 2)
- EndIf
- EndIf
- $montmp = $mon
- $mondelt = GetMoney()
- If $mon > 0 Or (Not $DetectTownFailRetry) Then
- GUICtrlSetData($lblGold, "Gold: " & $mon & ", Sold value: " & $mondelt)
- Call("AddLog", "Sold Items: " & $numsold & ", Sold value: " & $mondelt)
- Else
- $mLootIn = 1
- $mon = $montmp
- Call("AddLog", "Somthing went wrong in town, retrying next time")
- GUICtrlSetData($lblGold, "Vend fail, retry next run")
- Return
- EndIf
- Sleep(200)
- RandClick("left", Round(521 * $x_ratio), Round(506 * $y_ratio), 1, 1) ;button to open up repair menu
- Sleep(300)
- RandClick("left", Round(260 * $x_ratio), Round(595 * $y_ratio), 1, 1) ;button to pay for repairs
- Sleep(400)
- $mondelt = GetMoney()
- GUICtrlSetData($lblGold, "Gold: " & $mon & ", Repair cost: " & $mondelt)
- Call("AddLog", "Repair Cost: " & - $mondelt)
- GUICtrlSetData($lblStatus, "Status: Done With Vendor")
- Send("{ESCAPE}")
- EndFunc ;==>VendorLoot
- Func StashLoot()
- GUICtrlSetData($lblStatus, "Status: Putting Items in Stash")
- MouseClick("left", 1064 * $x_ratio, 256 * $y_ratio)
- Sleep(Random(800, 1000))
- ClickTab($GemTab)
- ;Tomes
- If $StashTomes Then
- GUICtrlSetData($lblStatus, "Status: Stashing Tomes")
- ClickImage("TomeIcon.png", 140, 1)
- EndIf
- ;Gems (DOESN'T STASH BOTTOM ROW!)
- If $StashGems Then
- GUICtrlSetData($lblStatus, "Status: Stashing Gems")
- For $i = 0 To 7
- ClickImage($gems[$i], 150, 1)
- Next
- EndIf
- $numstashed = 0;
- ClickTab($ItemTab)
- If $Identify And $StashIdentified Then
- If (StringLen($IDitemX) > 1) Then
- $unidx = StringSplit($IDitemX, "|")
- $unidy = StringSplit($IDitemY, "|")
- MouseMove(Round(Random(1000, 1300) * $x_ratio), Round(Random(300, 500) * $y_ratio), 1) ;Moves mouse out of the way
- Sleep(100)
- For $i = 1 To $unidx[0]
- $psum = PixelChecksum($unidx[$i] - 2, $unidy[$i] - 2, $unidx[$i] + 2, $unidy[$i] + 2)
- randclick("right", $unidx[$i], $unidy[$i], 3, 3, 1, 3)
- Sleep(100)
- MouseMove(Round(Random(1000, 1300) * $x_ratio), Round(Random(300, 500) * $y_ratio), 1) ;Moves mouse out of the way
- For $j = 1 To 4
- Sleep(200)
- If PixelChecksum($unidx[$i] - 2, $unidy[$i] - 2, $unidx[$i] + 2, $unidy[$i] + 2) = $psum Then
- If $j = 4 Then
- UseNextTab()
- ClickTab($ItemTab)
- Sleep(200)
- EndIf
- Else
- ExitLoop
- EndIf
- Next
- Next
- EndIf
- Else
- If $StashLegendary Then
- ClickItems(0xFF7F00, 2, True, 5)
- ClickItems(0x8F5C25, 2, True, 5)
- EndIf
- If $StashRare Then
- ClickItems(0x4A3C0B, 1, True, 20)
- EndIf
- EndIf
- If $StashMagic Then
- ClickItems(0x182037, 1, True, 30)
- EndIf
- Call("AddLog", "Stashed Items: " & $numstashed)
- Sleep(Random(300, 400))
- Send("{SPACE}")
- EndFunc ;==>StashLoot
- Func Loot($extra = False)
- MouseMove(Round(Random(0, 400) * $x_ratio), Round(Random(700, 1080) * $y_ratio), 3) ;Moves mouse out of the way
- If Not $extra Then
- If $LootGems Then
- LootImage("square.png", 90, 10)
- EndIf
- If $LootTomes Then
- LootImage("tome.png", 90, 10)
- EndIf
- If $LootMagic Then
- $mac = LootGear(0x6969FF, 0)
- $MagicCount += $mac
- $numitem -= $mac
- EndIf
- EndIf
- If $LootRares Then
- $RareCount += LootGear(0xBBBB00, 1)
- EndIf
- If $LootCustom Then
- Call("LootCustom")
- EndIf
- If $LootLegendaries Then
- If $ReduceLegendSearch Then
- $LegendaryCount += LootGear(0xBF642F, 1, 365, 442, 380)
- $LegendaryCount += LootGear(0xBF642F, 1, 442, 1690, 115)
- Else
- $LegendaryCount += LootGear(0xBF642F, 1)
- EndIf
- EndIf
- If $LootSets Then
- $SetCount += LootGear(0x02CE01, 2)
- EndIf
- Call("ShowLoot")
- EndFunc ;==>Loot
- Func SelectHero($ID)
- $HeroID = $ID
- $array = StringSplit($HeroSelectList[$HeroID - 1], "|")
- $Hero = $array[1]
- $Listnum = $array[2]
- $movementSpeed = $array[3] ;This is the % increase movement speed you have. 25 = 25%, 0 = 0%, 50 = 50%
- $movementSpeed = 1 + ($movementSpeed / 100)
- RandClick("left", Round(955 * $x_ratio), Round(932 * $y_ratio), 20, 6) ;select button
- Sleep(Random(800, 1000))
- RandClick("left", Round(221 * $x_ratio), Round((234 + 87 * ($Listnum - 1)) * $y_ratio), 20, 10) ;hero slot
- Sleep(Random(800, 1000))
- RandClick("left", Round(966 * $x_ratio), Round(961 * $y_ratio), 20, 6) ;select hero
- Sleep(Random(1800, 2200))
- EndFunc ;==>SelectHero
- ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ THINGS ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~###########################################################
- Func CheckLootWhilePorting()
- $lootany = 0
- For $retryloot = 1 To 3
- Sleep(550)
- Loot(True)
- If $lootany > 0 Then
- GUICtrlSetData($lblStatus, "GOLD!" & @CRLF)
- Call("AddLog", 'Got gold on failrun on pass ' & $retryloot)
- Call("TownPortal")
- ExitLoop
- EndIf
- If Not _ImageSearchArea($pngLoc & "TP.png", 1, 600, 200, 1000, 500, $gX, $gY, 50) Then
- GUICtrlSetData($lblStatus, "INTURRUPTED" & @CRLF)
- Return
- EndIf
- Next
- CheckFor("NewTristram", "Area")
- EndFunc ;==>CheckLootWhilePorting
- Func GetMoney($OpenInv = False)
- If $OpenInv Then Send($Inventory)
- Sleep(200)
- $mon = _TesseractScreenCapture(0, "", 1, 2, 1454 * $x_ratio, 508 * $y_ratio, (1920 - 1571) * $x_ratio, (1080 - 525) * $y_ratio, 0)
- $mon = CleanOCR($mon)
- If $OpenInv Then Send($Inventory)
- Sleep(50)
- $mondelt = $mon - $monold
- $monold = $mon
- Return $mondelt
- EndFunc ;==>GetMoney
- Func CheckForCellar()
- ; cellar check on minimap
- $cellfoundat = False
- FFSnapShot(1593 * $x_ratio, 62 * $y_ratio, 1824 * $x_ratio, 350 * $y_ratio, 0)
- Local $bColorArray[3] = [0x692A09, 0x5A2408, 0x6A2A0A]
- FFAddColor($bColorArray)
- ;FFAddExcludedArea(1824 * $x_ratio, 80 * $y_ratio, 1912 * $x_ratio, 353 * $y_ratio)
- ;FFSaveBMP("CellarMinimap_" & @HOUR & @MIN & @SEC, false) ;->uncomment if you wanna see the cellar minimap detection bmp ( gets saved where the script runs )
- Local $aCoords = FFBestSpot(2, 1, 4, 367 * $x_ratio, 135 * $y_ratio, -1, 25, False)
- If Not @error And IsArray($aCoords) Then
- $cellfoundat = True ;found the cellar
- FFResetColors()
- Else
- AddLog("enhanced fail")
- EndIf
- Return $cellfoundat
- EndFunc ;==>CheckForCellar
- Func DoSetupStuff()
- FFSetDebugMode(0)
- Opt('MouseCoordMode', 2)
- Opt('PixelCoordMode', 2)
- For $i = 0 To Random(0, 3, 1)
- $title &= Chr(Random(97, 122, 1))
- Next
- For $i = 0 To Random(2, 5, 1)
- $title &= Chr(Random(65, 90, 1))
- Next
- $title &= " "
- If @OSArch = "X64" Then DllCall("kernel32.dll", "int", "Wow64DisableWow64FsRedirection", "int", 1)
- If @OSArch = "X64" And Not @AutoItX64 Then MsgBox(16, "ERROR", "Why aren't you running the 64-bit AutoIt??? Expect bugs!")
- If $size = 0 Then
- MsgBox(16, "Error", "Diablo III is not running, cannot grab resolution!" & @CRLF & "Exiting...")
- Exit
- EndIf
- $Kill = ProcessList("AutoIt3_x64.exe")
- For $i = 1 To $Kill[0][0]
- $CurrentPID = @AutoItPID
- If $CurrentPID < $Kill[$i][1] Or $CurrentPID > $Kill[$i][1] Then
- ProcessClose($Kill[$i][1])
- EndIf
- Next
- ;============= SETTINGS =============;
- HotKeySet("=", "Begin") ;script toggled on/off by pressing =
- HotKeySet("{PAUSE}", "TogglePause") ;script toggle pause by pressing Pause/Break key
- HotKeySet("x", "Stop") ;script stopped by pressing x
- HotKeySet("0", "GoTown") ;script stopped by pressing x
- EndFunc ;==>DoSetupStuff
- Func GameRestart()
- ProcessClose("Diablo III.exe")
- Sleep(1000)
- GameAutostart()
- EndFunc ;==>GameRestart
- Func Decode($inp)
- $outp = ""
- For $i = 1 To StringLen($inp)
- $outp &= Chr(Asc(StringMid($inp, $i, 1)) - $i)
- Next
- Return $outp
- EndFunc ;==>Decode
- Func GameAutostart()
- If ProcessExists($gameExecutable) = 0 Then
- If FileExists("password.txt") And (StringLen($gamePassword) = 0) Then
- $gamePassword = FileReadLine("password.txt")
- $gamePassword = Decode($gamePassword)
- EndIf
- ;GUICtrlSetData($lblStatus, "Status: Starting Game Client")
- Run($gameDiabloIIILoc & $gameExecutable & " -launch")
- Sleep($gameStartTime)
- WinActivate("Diablo III")
- Sleep(500)
- Send($gamePassword)
- Sleep(500)
- Send("{ENTER}")
- Sleep($gameStartTime)
- $size = WinGetClientSize("[CLASS:D3 Main Window Class]")
- Else
- $size = WinGetClientSize("[CLASS:D3 Main Window Class]")
- EndIf
- EndFunc ;==>GameAutostart
- Func CheckFor($img, $type = "", $startX = 0, $startY = 0, $endX = @DesktopWidth, $endY = @DesktopHeight, $seconds = 6, $tolerance = 140)
- If $type = "Area" Then
- $startX = 1500 * $x_ratio
- $startY = 0 * $y_ratio
- $endX = 1920 * $x_ratio
- $endY = 90 * $y_ratio
- If $seconds = 6 Then $seconds = 2.5
- EndIf
- $c = 0
- $string = $pngLoc & $img & ".png"
- If _ImageSearchArea($string, 1, $startX, $startY, $endX, $endY, $gX, $gY, $tolerance) Then Return True
- Do
- $c += 1
- Sleep(200)
- If $c > ($seconds * 5) Then ;Make sure we never get stuck here for infinity.
- If $type = "Area" Then
- GUICtrlSetData($lblStatus, "Status: Area not found - " & $img)
- EndIf
- Return False
- EndIf
- Until _ImageSearchArea($string, 1, $startX, $startY, $endX, $endY, $gX, $gY, $tolerance)
- GUICtrlSetData($lblStatus, "Status: Area found! " & $img)
- Return True
- EndFunc ;==>CheckFor
- Func DoSprint()
- If $Hero = "Hunter" Then
- Send($Skill2)
- Else
- RandClick("right", Round(15 * $x_ratio), Round(1055 * $y_ratio)) ;sprint
- EndIf
- $SprintStart = TimerInit()
- EndFunc ;==>DoSprint
- Func WalkTime($lootx, $looty, $extra = 0, $returnv = False)
- $PPmSsprint = (960 / 2100) * $movementSpeed
- $PPmSwalk = (960 / 3000) * $movementSpeed
- Dim $BarbFeet[2] = [960 * $x_ratio, 505 * $y_ratio]
- $dist = Sqrt(($BarbFeet[0] - $lootx) ^ 2 + ($BarbFeet[1] - $looty) ^ 2)
- If $Hero == "Hunter" Then
- $sprintremain = 2000 - TimerDiff($SprintStart)
- Else
- $sprintremain = 3000 - TimerDiff($SprintStart)
- EndIf
- ;determine if sprint is still active to choose run speed
- If $sprintremain > 0 Then ;duration of sprint - 100 for safty
- ;calculate milliseconds per pixel for this run, return delay
- ;calculate composite sleep time
- If $dist < $PPmSsprint * $sprintremain Then
- $stime = ($dist / $PPmSsprint + $extra)
- Else
- $stime = (($sprintremain + ($dist - $sprintremain * $PPmSsprint) / $PPmSwalk) + $extra)
- EndIf
- Else
- $stime = ($dist / $PPmSwalk + $extra)
- EndIf
- If $stime < 0 Then $stime = 0
- If Not $returnv Then
- Sleep($stime)
- EndIf
- Return $stime
- EndFunc ;==>WalkTime
- Func LootGear($color, $tolerance = 2, $x1 = 450, $x2 = 1690, $y1 = 20, $y2 = 900)
- $count = 0
- $Loot = PixelSearch(Round($x1 * $x_ratio), Round($y1 * $y_ratio), Round($x2 * $x_ratio), Round($y2 * $y_ratio), $color, $tolerance)
- If Not @error Then
- While Not @error
- $count += 1
- MouseClick('left', $Loot[0], $Loot[1], 1, 1)
- Sleep(20)
- MouseMove(Round(Random(0, 400) * $x_ratio), Round(Random(700, 1080) * $y_ratio), 3) ;Moves mouse out of the way
- WalkTime($Loot[0], $Loot[1])
- ;Sleep(Random(700, 800))
- ;Run at max 10 times per quality
- $lootany += 1
- If $count >= 10 Then
- ExitLoop
- EndIf
- $Loot = PixelSearch(Round($x1 * $x_ratio), Round($y1 * $y_ratio), Round($x2 * $x_ratio), Round($y2 * $y_ratio), $color, $tolerance)
- WEnd
- EndIf
- $numitem += $count;
- Return $count
- EndFunc ;==>LootGear
- Func LootImage($img, $tol, $max = 10, $x1 = 0, $y1 = 0, $x2 = @DesktopWidth, $y2 = @DesktopHeight)
- $count = 0
- $gX = 0
- $gY = 0
- GUICtrlSetData($lblStatus, "Status: Looting - " & $img)
- While _ImageSearchArea($pngLoc & $img, 1, $x1, $y1, $x2, $y2, $gX, $gY, $tol)
- $count += 1
- MouseClick("left", $gX, $gY - 3, 1, 1)
- Sleep(50)
- MouseMove(Round(Random(0, 400) * $x_ratio), Round(Random(700, 1080) * $y_ratio), 3) ;Moves mouse out of the way
- $lootany += 1
- If $img == "square.png" Then
- $GemCount += 1
- $numgem += 1
- ElseIf $img == "tome.png" Then
- $TomeCount += 1
- $numtomb += 1
- ElseIf $img == "gold.png" Then
- $numgold += 1
- ElseIf $img == "mythic.png" Then
- $numpot += 1
- EndIf
- If $img == "gold.png" Then
- WalkTime($gX, $gY, -500)
- Else
- WalkTime($gX, $gY)
- EndIf
- If $count >= $max Then
- ExitLoop
- EndIf
- WEnd
- Return $count
- EndFunc ;==>LootImage
- Func LootCustom()
- For $i = 0 To ($totalItems - 1)
- $array = StringSplit($pick[$i], "|")
- LootImage($array[1], $array[2], 5)
- Next
- EndFunc ;==>LootCustom
- Func Identify()
- Send($Inventory)
- Sleep(1300)
- $count = 0
- $IDitemX = ""
- $IDitemY = ""
- While _ImageSearchArea($pngLoc & "unidentified.png", 1, 1400 * $x_ratio, 580 * $y_ratio, 1914 * $x_ratio, 888 * $y_ratio, $gX, $gY, 120)
- $count += 1
- GUICtrlSetData($lblStatus, "Status: Identifying")
- MouseClick("right", $gX, $gY, 1, 4)
- $IDitemX = $IDitemX & $gX & "|"
- $IDitemY = $IDitemY & $gY & "|"
- MouseMove(Round(Random(0, 400) * $x_ratio), Round(Random(700, 1080) * $y_ratio), 3) ;Moves mouse out of the way
- Sleep(Random(3000, 3500))
- If $count >= 30 Then
- ExitLoop
- EndIf
- WEnd
- Send($Inventory)
- $IDitemX = StringLeft($IDitemX, StringLen($IDitemX) - 1)
- $IDitemY = StringLeft($IDitemY, StringLen($IDitemY) - 1)
- Sleep(200)
- EndFunc ;==>Identify
- Func CleanOCR($text)
- $out = ""
- For $i = 1 To StringLen($text)
- $chr = Asc(StringMid($text, $i, 1))
- If $chr >= 48 And $chr <= 57 Then $out = $out & Chr($chr)
- If $chr = 79 Then $out = $out & '0'
- Next
- Return $out
- EndFunc ;==>CleanOCR
- Func ClickTab($Tabno)
- If $Tabno = 1 Then RandClick("left", Round(517 * $x_ratio), Round(229 * $y_ratio), 3, 4)
- If $Tabno = 2 Then RandClick("left", Round(517 * $x_ratio), Round(361 * $y_ratio), 3, 4)
- If $Tabno = 3 Then RandClick("left", Round(517 * $x_ratio), Round(486 * $y_ratio), 3, 4)
- Sleep(Random(100, 200))
- EndFunc ;==>ClickTab
- Func UseNextTab()
- If $ItemTab = $NextItemTab Then
- Call("AddLog", "Second Stash full Using Last tab")
- $ItemTab = $FinalItemTab
- ElseIf $ItemTab = $FinalItemTab Then
- Call("AddLog", "Stash full, disabling stashing and magic looting")
- $StashLegendary = False
- $StashRare = False
- $StashMagic = False
- $LootMagic = False
- Else
- Call("AddLog", "Stash full Using next tab")
- $ItemTab = $NextItemTab
- EndIf
- EndFunc ;==>UseNextTab
- Func AddLog($logtxt)
- Local $file = FileOpen(@ScriptName & ".txt", 1)
- $msg = @MDAY & '/' & @MON & '/' & @YEAR & ' ' & @HOUR & ':' & @MIN & ':' & @SEC & ': ' & $logtxt & @CRLF
- FileWrite($file, $msg)
- FileClose($file)
- ConsoleWrite($msg)
- EndFunc ;==>AddLog
- ;Helper Functions
- Func EnhancedFind($x1 = 0, $y1 = 0, $x2 = 577, $y2 = 220, $xpos = 367, $ypos = 135, $recov = False)
- For $retry = 1 To 3
- ; take 2 snapshots and black out everything that did not change
- FFSnapShot($x1 * $x_ratio, $y1 * $y_ratio, $x2 * $x_ratio, $y2 * $y_ratio, 2)
- Sleep(50)
- FFSnapShot($x1 * $x_ratio, $y1 * $y_ratio, $x2 * $x_ratio, $y2 * $y_ratio, 3)
- FFKeepChanges(3, 2, 25)
- ;FFSaveBMP("CellarOpen_" & @HOUR & @MIN & @SEC, false) ->uncomment if you wanna see the cellar minimap motion map
- ; do special search for the color in our motionmap
- Local $aColorArray[3] = [0x7897EB, 0x404E9E, 0x536CB6]
- FFAddColor($aColorArray) ; add color to find array
- ;Func FFBestSpot($SizeSearch, $MinNbPixel, $OptNbPixel, $PosX, $PosY, $Color, $ShadeVariation = 0, $ForceNewSnap = True, $Left = 0, $Top = 0, $Right = 0, $Bottom = 0, $NoSnapShot = $FFLastSnap, $WindowHandle = -1)
- Local $cellarCoords = FFBestSpot(10, 1, 4, $xpos * $x_ratio, $ypos * $y_ratio, -1, 25, False) ; search for the opening
- If @error Or Not IsArray($cellarCoords) Then
- Call("AddLog", "The motionmap failed on try " & $retry & " with code " & @error)
- FFResetColors()
- Else
- ExitLoop
- EndIf
- Next
- If (Not @error) And IsArray($cellarCoords) Then
- FFResetColors()
- If Not $recov Then GUICtrlSetData($lblStatus, "Status: Cellar - Found position " & $cellarCoords[0] * $x_ratio & ", " & $cellarCoords[1] * $y_ratio)
- If Not $recov Then Call("AddLog", "Cellar - Found position " & $cellarCoords[0] * $x_ratio & ", " & $cellarCoords[1] * $y_ratio)
- Else
- If $TakeMissShots Then
- CaptureToTIFF("", "", "", "shots\NoCell_" & String($run) & ".tif", 1, 0, 0, 0, 0)
- EndIf
- Dim $cellarCoords[2]
- $cellarCoords[0] = 1000 * $x_ratio
- $cellarCoords[1] = 500 * $y_ratio
- EndIf
- Return $cellarCoords
- EndFunc ;==>EnhancedFind
- Func SetupGUI()
- $frmBot = GUICreate($title & $ver & " - Updating", 290, 140, Round(1580 * $x_ratio), Round(900 * $y_ratio), -1, BitOR($WS_EX_TOPMOST, $WS_EX_TOOLWINDOW), 0)
- GUISetBkColor(0xC0C0C0)
- $lblRun = GUICtrlCreateLabel("Run Number: 0 - Runs till vendor: 0", 4, 0, 280, 24)
- GUICtrlSetFont(-1, 10, 600, 0, "Segoe UI")
- GUICtrlSetColor(-1, 0xFF0000)
- $lblLocation = GUICtrlCreateLabel("Location: Main Menu", 12, 20, 240, 17)
- $lblStatus = GUICtrlCreateLabel("Status: ", 12, 35, 240, 17)
- $lblLast = GUICtrlCreateLabel("Last Runtime: 0 seconds", 12, 50, 240, 17)
- $lblRuntime = GUICtrlCreateLabel("Total Runtime: 0 hours, 0 minutes", 12, 65, 240, 17)
- $lblGear = GUICtrlCreateLabel("Legendary: 0 - Set: 0 - Rare: 0", 12, 80, 240, 17)
- $lblItems = GUICtrlCreateLabel("Magic: 0 - Gems: 0 - Tomes: 0", 12, 95, 240, 17)
- $lblGold = GUICtrlCreateLabel("Gold: 0", 12, 110, 240, 17)
- GUISetState(@SW_SHOW)
- EndFunc ;==>SetupGUI
- Func CheckDead()
- $LogoutTimerCancel = PixelSearch(Round(900 * $x_ratio), Round(240 * $y_ratio), Round(1010 * $x_ratio), Round(290 * $y_ratio), 0x993827) ; checks for cancel button on logout timer
- If Not @error Then
- Call("AddLog", "Logged out")
- GUICtrlSetData($lblStatus, "Status: Logging out")
- CheckFor("MainMenu", "", Round(40 * $x_ratio), Round(300 * $y_ratio), Round(400 * $x_ratio), Round(450 * $y_ratio), $loadtime / 1000)
- Return 1
- EndIf
- $CloseButton = PixelSearch(Round(1570 * $x_ratio), Round(110 * $y_ratio), Round(1590 * $x_ratio), Round(120 * $y_ratio), 0x8C2300) ; checks for the red color of the "X" on an open window
- If Not @error Then
- GUICtrlSetData($lblStatus, "Status: Open Window")
- Call("AddLog", "Open Window")
- Sleep(200)
- Send("{SPACE}") ;close any open windows
- Return 1
- EndIf
- $YouHaveDied = PixelSearch(Round(620 * $x_ratio), Round(325 * $y_ratio), Round(625 * $x_ratio), Round(330 * $y_ratio), 0xFFFFFF) ; checks for white text "YOU HAVE DIED"
- If Not @error Then
- GUICtrlSetData($lblStatus, "Status: Dead")
- Call("AddLog", "You have died")
- $deathCount += 1
- Call("LeaveGame")
- For $c = 1 To 110 + $loadtime / 100
- Sleep(100)
- If CheckFor("MainMenu", "", Round(40 * $x_ratio), Round(300 * $y_ratio), Round(400 * $x_ratio), Round(450 * $y_ratio), 0.1) Then ExitLoop
- Next
- Return 1
- Else
- Return 0
- EndIf
- EndFunc ;==>CheckDead
- Func CheckRepair()
- $RepairArea = PixelSearch(Round(1480 * $x_ratio), 0, Round(1570 * $x_ratio), Round(100 * $y_ratio), $yellow)
- If Not @error Then
- Call("DoRepair")
- EndIf
- $RepairAreaRed = PixelSearch(Round(1480 * $x_ratio), 0, Round(1570 * $x_ratio), Round(100 * $y_ratio), $red)
- If Not @error Then
- Call("DoRepair")
- EndIf
- EndFunc ;==>CheckRepair
- Func DoRepair()
- Sleep(Random(75, 150))
- Call("TownPortal")
- If CheckDead() Then
- Return
- EndIf
- If CheckFor("NewTristram", "Area") Then
- RandClick("left", Round(1480 * $x_ratio), Round(281 * $y_ratio), 1, 1) ;begin movement towards merchant
- WalkTime(Round(1480 * $x_ratio), Round(281 * $y_ratio))
- RandClick("left", Round(1316 * $x_ratio), Round(206 * $y_ratio), 1, 1) ;moves to get merchant in screen
- WalkTime(Round(1316 * $x_ratio), Round(206 * $y_ratio))
- RandClick("left", Round(845 * $x_ratio), Round(225 * $y_ratio), 1, 1) ;NPC Merchant to the right of cain's home
- Sleep(1200)
- RandClick("left", Round(521 * $x_ratio), Round(506 * $y_ratio), 1, 1) ;button to open up repair menu
- Sleep(400)
- RandClick("left", Round(260 * $x_ratio), Round(595 * $y_ratio), 1, 1) ;button to pay for repairs
- Sleep(200)
- Send("{Escape}")
- Call("AddLog", "Repair")
- If Not CheckDead() Then
- Call("LeaveGame")
- EndIf
- EndIf
- EndFunc ;==>DoRepair
- Func CalcTime()
- $srt = TimerDiff($rt)
- GUICtrlSetData($lblLast, "Last Runtime: " & Round($srt / 1000, 2) & "s. Open/Close: " & $OpenCount & "/" & $CloseCount & ": " & Round($OpenCount / ($OpenCount + $CloseCount) * 100) & "%, Fail: " & $FailCount)
- $trt = TimerDiff($t)
- $total = Round((($trt / 1000) / 60) / 60, 4)
- Call("AddLog", "Last Runtime: " & Round($srt / 1000, 2) & " seconds. Open/Close: " & $OpenCount & "/" & $CloseCount & ", Fail: " & $FailCount)
- ;Total runtime calculation.
- $hours = Floor((($trt / 1000) / 60) / 60)
- $minutes = (($trt / 1000) / 60)
- ;trim minutes if runtime is more then 1 hour.
- If $minutes > 60 Then
- While $minutes > 60
- $minutes -= 60
- WEnd
- EndIf
- GUICtrlSetData($lblRuntime, "Runtime: " & $hours & ":" & Ceiling($minutes) & ", GPH: " & Round(Ceiling((Number($mon) - $monstart) / ($trt / 3600000)) / 1000) & "K")
- EndFunc ;==>CalcTime
- Func ClickItems($color, $tolerance, $checkfull = False, $max = 30)
- $c = 0
- While $c < $max
- RandMove(1200 * $x_ratio, 600 * $y_ratio, 5, 5, 2)
- Sleep(Random(60, 120))
- $StashPixel = PixelSearch(1400 * $x_ratio, 580 * $y_ratio, 1914 * $x_ratio, 888 * $y_ratio, $color, $tolerance)
- If Not @error Then
- MouseClick("right", $StashPixel[0], $StashPixel[1], 1, 4)
- $c += 1
- If $checkfull Then
- $numstashed += 1
- Else
- $numsold += 1
- EndIf
- Else
- ExitLoop
- EndIf
- WEnd
- Sleep(Random(60, 120))
- If $checkfull Then
- If $c = $max Then Call("UseNextTab")
- ClickTab($ItemTab)
- EndIf
- EndFunc ;==>ClickItems
- Func ClickImage($image, $tolerance, $max = 20)
- For $c = 1 To $max
- RandMove(1200 * $x_ratio, 600 * $y_ratio, 5, 5, 2)
- Sleep(Random(100, 300))
- If _ImageSearchArea($pngLoc & $image, 1, 1400 * $x_ratio, 580 * $y_ratio, 1914 * $x_ratio, 888 * $y_ratio, $gX, $gY, $tolerance) Then
- MouseClick("right", $gX, $gY, 1, 4)
- Sleep(120)
- Else
- ExitLoop
- EndIf
- Next
- EndFunc ;==>ClickImage
- Func SalvageLoot()
- DoSprint()
- GUICtrlSetData($lblStatus, "Status: Salvaging Items")
- Sleep(Random(300, 500))
- MouseClick("middle", 1786 * $x_ratio, 535 * $y_ratio)
- walktime(1786 * $x_ratio, 535 * $y_ratio, 100)
- ;Sleep(2000)
- MouseClick("left", 1430 * $x_ratio, 390 * $y_ratio) ;Talk to anvil
- ;Sleep(3000)
- walktime(1430 * $x_ratio, 390 * $y_ratio, 100)
- $c = 0
- While $c <= 20
- Sleep(Random(200, 300))
- $MagicPixel = PixelSearch(1400 * $x_ratio, 580 * $y_ratio, 1914 * $x_ratio, 830 * $y_ratio, 0x182037, 1)
- If Not @error Then
- MouseClick("left", 265 * $x_ratio, 291 * $y_ratio, 1, 4)
- Sleep(Random(200, 300))
- MouseClick("left", $MagicPixel[0], $MagicPixel[1], 1, 4)
- Sleep(Random(200, 300))
- MouseClick("left", 1072 * $x_ratio, 375 * $y_ratio, 1, 4)
- RandMove(1200 * $x_ratio, 600 * $y_ratio, 5, 5, 2)
- Sleep(40)
- $c += 1
- Else
- ExitLoop
- EndIf
- WEnd
- Call("AddLog", "Salvaged Items: " & $c)
- Send("{ESCAPE}")
- Sleep(Random(300, 500))
- EndFunc ;==>SalvageLoot
- Func _ImageSearchArea($findImage, $resultPosition, $x1, $y1, $right, $bottom, ByRef $x, ByRef $y, $tolerance)
- If $tolerance > 0 Then $findImage = "*" & $tolerance & " " & $findImage
- $findImage = "*TRANSBLACK " & $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
- EndIf
- ; 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 LeaveGame()
- If CheckFor("MainMenu", "", Round(40 * $x_ratio), Round(300 * $y_ratio), Round(400 * $x_ratio), Round(450 * $y_ratio), .5) Then Return
- Call("RandSleep")
- GUICtrlSetData($lblStatus, "Status: Leaving Game")
- Send("{Escape}")
- Sleep(200)
- RandClick("left", Round(956 * $x_ratio), Round(579 * $y_ratio), 120, 20) ;Random Click on the leave button
- Call("CalcTime")
- CheckFor("MainMenu", "", Round(40 * $x_ratio), Round(300 * $y_ratio), Round(400 * $x_ratio), Round(450 * $y_ratio), $loadtime / 1000)
- EndFunc ;==>LeaveGame
- Func TownPortalShort()
- $gX = 0
- $gY = 0
- $c = 0
- GUICtrlSetData($lblStatus, "Status: Waiting for TP bar")
- Do
- $c += 1
- Sleep(200)
- If $c > 4 Then Return
- Until _ImageSearchArea($pngLoc & "TP.png", 1, 600, 200, 1000, 500, $gX, $gY, 50)
- $seconds = $TPProtectTime
- $c = 0
- Do
- $c += 1
- GUICtrlSetData($lblStatus, "Status: Prepared for inturrupt, " & $seconds * 5 - $c)
- Sleep(200)
- If $c > ($seconds * 5) Then ;Make sure we never get stuck here for infinity.
- GUICtrlSetData($lblStatus, "Status: safe, doing long wait for town")
- Sleep($tptime - $seconds * 1000 - 1200)
- GUICtrlSetData($lblStatus, "Status: detecting town")
- CheckFor("NewTristram", "Area")
- Sleep(300)
- Return
- EndIf
- Until Not _ImageSearchArea($pngLoc & "TP.png", 1, 600, 200, 1000, 500, $gX, $gY, 50)
- EndFunc ;==>TownPortalShort
- Func Moving($time)
- Sleep($time / $movementSpeed)
- EndFunc ;==>Moving
- Func TownPortal()
- GUICtrlSetData($lblStatus, "Status: Returning to Town")
- Send($TownPortalButton)
- If $DetectTPFail Then
- Call("TownPortalShort")
- Else
- CheckFor("NewTristram", "Area", 0, 0, 0, 0, ($tptime + 500) / 1000)
- EndIf
- EndFunc ;==>TownPortal
- #region OtherStuff
- Func RandClick($clickType, $xpos, $ypos, $xOff = 10, $yOff = 10, $clicks = 1, $speed = 4)
- If $xOff < 1 Then $xOff = 1
- If $yOff < 1 Then $yOff = 1
- $randX = Round(Random($xpos - ($xOff * $x_ratio), $xpos + ($xOff * $x_ratio)))
- $randY = Round(Random($ypos - ($yOff * $y_ratio), $ypos + ($yOff * $y_ratio)))
- MouseClick($clickType, $randX, $randY, $clicks, $speed)
- EndFunc ;==>RandClick
- Func RandMove($xpos, $ypos, $xOff = 10, $yOff = 10, $speed = 1)
- $randX = Round(Random($xpos - ($xOff * $x_ratio), $xpos + ($xOff * $x_ratio)))
- $randY = Round(Random($ypos - ($yOff * $y_ratio), $ypos + ($yOff * $y_ratio)))
- MouseMove($randX, $randY, $speed)
- EndFunc ;==>RandMove
- Func RandSleep($min = 5, $max = 45, $chance = 3)
- $randNum = Round(Random(1, 100))
- If $Timer And $randNum <= $chance Then
- $sleepTime = Random($min * 1000, $max * 1000)
- GUICtrlSetData($lblStatus, "Status: Random Sleep - " & Round($sleepTime / 1000) & " secs")
- For $c = 0 To 10
- Sleep($sleepTime / 10)
- Next
- EndIf
- EndFunc ;==>RandSleep
- ;Hotkey Functions
- Func Begin()
- $Go = Not $Go
- If Not $Go Then WinSetTitle($title, "", $title & $ver & " - Halted")
- EndFunc ;==>Begin
- Func TogglePause()
- $Paused = Not $Paused
- While $Paused
- Sleep(100)
- WinSetTitle($title, "", $title & $ver & " - Paused")
- ToolTip('[PAUSED] - Deaths: ' & $deathCount & ' | Cellars: ' & $cellarCount, 0, 0)
- WEnd
- WinSetTitle($title, "", $title & $ver & " - Running")
- ToolTip("")
- EndFunc ;==>TogglePause
- Func ShowLoot()
- GUICtrlSetData($lblGear, "Legendary: " & $LegendaryCount & " - Set: " & $SetCount & " - Rare: " & $RareCount)
- GUICtrlSetData($lblItems, "Magic: " & $MagicCount & " - Gems: " & $GemCount & " - Tomes: " & $TomeCount)
- EndFunc ;==>ShowLoot
- Func Stop() ;to allow the script to stop
- ;Time Function
- $trt = TimerDiff($t)
- $hours = Floor((($trt / 1000) / 60) / 60)
- $minutes = (($trt / 1000) / 60)
- $sec = ($trt / 1000)
- If $minutes > 60 Then
- While $minutes > 60
- $minutes -= 60
- WEnd
- EndIf
- If $sec > 60 Then
- While $sec > 60
- $sec -= 60
- WEnd
- EndIf
- ;Gold Function
- $mondelt = Number($mon) - Number($monold)
- If $monstart = 0 Then $monstart = Number($mon) - $mondelt
- ;Item Function
- $Totalpick = $LegendaryCount + $SetCount + $RareCount + $MagicCount
- ;Log Printer
- Call("AddLog", "=============== iLog Zummarizer Start xD ===============")
- Call("AddLog", 'Total Runtime: ' & $hours & ":" & Ceiling($minutes) & ":" & Ceiling($sec))
- Call("AddLog", '=================================================')
- Call("AddLog", 'Current Gold: ' & $mon & ", Total Gold Gain: " & Number($mon) - $monstart)
- Call("AddLog", 'Gold Per Hour: ' & Ceiling((Number($mon) - $monstart) / ($trt / 3600000)) & ', Gold Per Trip: ' & Ceiling((Number($mon) - $monstart) / $run))
- Call("AddLog", 'Total Items Pick: ' & $Totalpick & ', Per Hour: ' & Ceiling(($Totalpick) / ($trt / 3600000)) & ', Per Trip: ' & $Totalpick / $cellarCount)
- ;enable these 4 lines below if you wants detailed item picks
- ;Call("AddLog", 'Total Items Pick: ' & $LegendaryCount & ', Per Hour: ' & Ceiling(($LegendaryCount) / ($trt / 3600000)) & ', Per Trip: ' & $LegendaryCount / $cellarCount)
- ;Call("AddLog", 'Total Items Pick: ' & $SetCount & ', Per Hour: ' & Ceiling(($SetCount) / ($trt / 3600000)) & ', Per Trip: ' & $SetCount / $cellarCount)
- ;Call("AddLog", 'Total Items Pick: ' & $RareCount & ', Per Hour: ' & Ceiling(($RareCount) / ($trt / 3600000)) & ', Per Trip: ' & $RareCount / $cellarCount)
- ;Call("AddLog", 'Total Items Pick: ' & $MagicCount & ', Per Hour: ' & Ceiling(($MagicCount) / ($trt / 3600000)) & ', Per Trip: ' & $MagicCount / $cellarCount)
- ;more stuff soon
- Call("AddLog", 'Total Gems Pick: ' & $GemCount & ', Per Hour: ' & Ceiling(($GemCount) / ($trt / 3600000)) & ', Per Trip: ' & $GemCount / $cellarCount)
- Call("AddLog", 'Total Tomes Pick: ' & $TomeCount & ', Per Hour: ' & Ceiling(($TomeCount) / ($trt / 3600000)) & ', Per Trip: ' & $TomeCount / $cellarCount)
- Call("AddLog", '=================================================')
- Call("AddLog", 'Cellar freq. (success/total runs): ' & $cellarCount & '/' & $run & ' = ' & ($cellarCount / $run) * 100 & ' %')
- Call("AddLog", 'Trips Per Hour: ' & ((Number($run)) / ($trt / 3600000)) & ', Success runs: ' & $cellarCount & ', Fail runs: ' & Number($run) - $cellarCount)
- Call("AddLog", '=================================================')
- Call("AddLog", 'Deaths total: ' & $deathCount & ', Deaths Per Hour: ' & Number($deathCount) / ($trt / 3600000))
- Call("AddLog", "=============== End of Log Summary ===============")
- Exit
- EndFunc ;==>Stop
- Func GoTown()
- $mLootIn = 1
- EndFunc ;==>GoTown
- Func AnalyseLoots() ; Grid search + ilvl detection, a little bit slower than old method but computes db for fast stashing/vendoring/new salvaging
- ;ConsoleWrite("---- NEW ANALYSIS ----" & @crlf)
- $str_Stash = ""
- $str_StashGems = ""
- $str_StashMisc = ""
- $str_Vendor = ""
- $str_Salvage = ""
- $int_TownPosition = 0
- $int_emptygrid = 0
- $str_Ignore = ""
- $nX = 0
- $nY = 0
- GUICtrlSetData($lblStatus, "Status: Analysing loots")
- Send($Inventory)
- Sleep(500)
- For $y = 0 To 5
- $int_emptygrid = 0
- MouseMove(1435, Round(609 + (45 * $y)), 1)
- Sleep(500)
- For $x = 0 To 9
- If StringInStr($str_Ignore, 1435 + (48 * $x) & "," & 609 + (45 * $y)) Then ContinueLoop
- MouseMove(1435 + (48 * $x), 609 + (45 * $y), 1)
- Sleep(300)
- If _ImageSearchArea($pngLoc & "tt_check.png", 0, Round((1435 + (48 * $x) - 455) * $x_ratio), Round((609 + (45 * $y) - 500) * $y_ratio), Round((1435 + (48 * $x) - 35) * $x_ratio), Round(1080 * $y_ratio), $gX, $gY, 10) Then ; If tooltip exists
- $int_emptygrid = 0
- If _ImageSearchArea($pngLoc & "tt_unidentified.png", 0, $gX, $gY, $gX + 425, $gY + 70, $gX, $gY, 40) And $Identify Then ; Identify items.
- MouseClick("secondary")
- Sleep(Random(3000, 3500, 1))
- EndIf
- If _ImageSearchArea($pngLoc & "tt_square.png", 0, $gX, $gY, $gX + 425, $gY + 70, $gX, $gY, 40) Then ; Gem, automatic stashing.
- $str_StashGems = $str_StashGems & "|" & 1435 + (48 * $x) & "," & 609 + (45 * $y)
- ContinueLoop
- EndIf
- If _ImageSearchArea($pngLoc & "tt_tome.png", 0, $gX, $gY, $gX + 425, $gY + 70, $gX, $gY, 40) Then ; Tome, automatic stashing.
- $str_StashMisc = $str_StashMisc & "|" & 1435 + (48 * $x) & "," & 609 + (45 * $y)
- ContinueLoop
- EndIf
- If _ImageSearchArea($pngLoc & "tt_exquisite.png", 0, $gX, $gY, $gX + 425, $gY + 70, $gX, $gY, 40) Then ; Crafting, automatic stashing.
- $str_StashMisc = $str_StashMisc & "|" & 1435 + (48 * $x) & "," & 609 + (45 * $y)
- ContinueLoop
- EndIf
- If _ImageSearchArea($pngLoc & "tt_iridescent.png", 0, $gX, $gY, $gX + 425, $gY + 70, $gX, $gY, 40) Then ; Crafting, automatic stashing.
- $str_StashMisc = $str_StashMisc & "|" & 1435 + (48 * $x) & "," & 609 + (45 * $y)
- ContinueLoop
- EndIf
- If _ImageSearchArea($pngLoc & "tt_fiery.png", 0, $gX, $gY, $gX + 425, $gY + 70, $gX, $gY, 40) Then ; Crafting, automatic stashing (faster than the pixel detection below).
- $str_StashMisc = $str_StashMisc & "|" & 1435 + (48 * $x) & "," & 609 + (45 * $y)
- ContinueLoop
- EndIf
- If _ImageSearchArea($pngLoc & "tt_plan.png", 0, $gX, $gY, $gX + 425, $gY + 70, $gX, $gY, 60) Then ; Plans, automatic stashing.
- $str_StashMisc = $str_StashMisc & "|" & 1435 + (48 * $x) & "," & 609 + (45 * $y)
- ContinueLoop
- EndIf
- If _ImageSearchArea($pngLoc & "tt_neck.png", 0, $gX + 320, $gY + 60, $gX + 425, $gY + 150, $nX, $nY, 60) == 0 And _ImageSearchArea($pngLoc & "tt_waist.png", 0, $gX + 320, $gY + 60, $gX + 425, $gY + 150, $nX, $nY, 60) == 0 And _ImageSearchArea($pngLoc & "tt_finger.png", 0, $gX + 320, $gY + 60, $gX + 425, $gY + 150, $nX, $nY, 60) == 0 And _ImageSearchArea($pngLoc & "tt_follower.png", 0, $gX + 320, $gY + 60, $gX + 425, $gY + 150, $nX, $nY, 60) == 0 Then
- $str_Ignore = $str_Ignore & "|" & 1435 + (48 * $x) & "," & 609 + (45 * ($y + 1))
- EndIf
- $tt_title = PixelSearch($gX, $gY, $gX + 425, $gY + 70, 0x00FF00, 1) ; Set, no ilvl check since they drop rarely. Goes to stash.
- If Not @error Then
- $str_Stash = $str_Stash & "|" & 1435 + (48 * $x) & "," & 609 + (45 * $y)
- ContinueLoop
- EndIf
- $tt_title = PixelSearch($gX, $gY, $gX + 425, $gY + 70, 0xBF642F, 1) ; Legendary, no ilvl check since they drop rarely. Goes to stash.
- If Not @error Then
- $str_Stash = $str_Stash & "|" & 1435 + (48 * $x) & "," & 609 + (45 * $y)
- ContinueLoop
- EndIf
- $tt_title = PixelSearch($gX, $gY, $gX + 425, $gY + 70, 0xFFFF00, 1) ; Rare
- If Not @error Then
- If _ImageSearchArea($pngLoc & "ilvl59.png", 0, $gX, $gY, $gX + 125, Round(1080 * $y_ratio), $gX, $gY, 20) Then ; Rare ilvl 59
- If (getOption("i59r") == 1) Then
- $str_Salvage = $str_Salvage & "|" & 1435 + (48 * $x) & "," & 609 + (45 * $y) & ",r"
- ElseIf (getOption("i59r") == 2) Then
- $str_Vendor = $str_Vendor & "|" & 1435 + (48 * $x) & "," & 609 + (45 * $y) & ",r"
- Else
- $str_Stash = $str_Stash & "|" & 1435 + (48 * $x) & "," & 609 + (45 * $y) & ",r"
- EndIf
- ContinueLoop
- EndIf
- If _ImageSearchArea($pngLoc & "ilvl60.png", 0, $gX, $gY, $gX + 125, Round(1080 * $y_ratio), $gX, $gY, 20) Then ; Rare ilvl 60, goes to salvage
- If (getOption("i60r") == 1) Then
- $str_Salvage = $str_Salvage & "|" & 1435 + (48 * $x) & "," & 609 + (45 * $y) & ",r"
- ElseIf (getOption("i60r") == 2) Then
- $str_Vendor = $str_Vendor & "|" & 1435 + (48 * $x) & "," & 609 + (45 * $y) & ",r"
- Else
- $str_Stash = $str_Stash & "|" & 1435 + (48 * $x) & "," & 609 + (45 * $y) & ",r"
- EndIf
- ContinueLoop
- EndIf
- If _ImageSearchArea($pngLoc & "ilvl61.png", 0, $gX, $gY, $gX + 125, Round(1080 * $y_ratio), $gX, $gY, 20) Then ; Rare ilvl 61, goes to salvage
- If (getOption("i61r") == 1) Then
- $str_Salvage = $str_Salvage & "|" & 1435 + (48 * $x) & "," & 609 + (45 * $y) & ",r"
- ElseIf (getOption("i61r") == 2) Then
- $str_Vendor = $str_Vendor & "|" & 1435 + (48 * $x) & "," & 609 + (45 * $y) & ",r"
- Else
- $str_Stash = $str_Stash & "|" & 1435 + (48 * $x) & "," & 609 + (45 * $y) & ",r"
- EndIf
- ContinueLoop
- EndIf
- If _ImageSearchArea($pngLoc & "ilvl62.png", 0, $gX, $gY, $gX + 125, Round(1080 * $y_ratio), $gX, $gY, 20) Then ; Rare ilvl 62, goes to salvage
- If (getOption("i62r") == 1) Then
- $str_Salvage = $str_Salvage & "|" & 1435 + (48 * $x) & "," & 609 + (45 * $y) & ",r"
- ElseIf (getOption("i62r") == 2) Then
- $str_Vendor = $str_Vendor & "|" & 1435 + (48 * $x) & "," & 609 + (45 * $y) & ",r"
- Else
- $str_Stash = $str_Stash & "|" & 1435 + (48 * $x) & "," & 609 + (45 * $y) & ",r"
- EndIf
- ContinueLoop
- EndIf
- If _ImageSearchArea($pngLoc & "ilvl63.png", 0, $gX, $gY, $gX + 125, Round(1080 * $y_ratio), $gX, $gY, 20) Then ; Rare ilvl 63, goes to stash
- If (getOption("i63r") == 1) Then
- $str_Salvage = $str_Salvage & "|" & 1435 + (48 * $x) & "," & 609 + (45 * $y)
- ElseIf (getOption("i63r") == 2) Then
- $str_Vendor = $str_Vendor & "|" & 1435 + (48 * $x) & "," & 609 + (45 * $y)
- Else
- $str_Stash = $str_Stash & "|" & 1435 + (48 * $x) & "," & 609 + (45 * $y)
- EndIf
- ContinueLoop
- EndIf
- ; Below ilvl 59
- If $StashRare Then
- $str_Stash = $str_Stash & "|" & 1435 + (48 * $x) & "," & 609 + (45 * $y)
- ElseIf $VendorRare Then
- $str_Vendor = $str_Vendor & "|" & 1435 + (48 * $x) & "," & 609 + (45 * $y)
- Else
- $str_Stash = $str_Stash & "|" & 1435 + (48 * $x) & "," & 609 + (45 * $y)
- EndIf
- ContinueLoop
- EndIf
- $tt_title = PixelSearch($gX, $gY, $gX + 425, $gY + 40, 0xFF0000, 1) ; unusable rares, legendaries & sets. Goes to stash.
- If Not @error Then
- $str_Stash = $str_Stash & "|" & 1435 + (48 * $x) & "," & 609 + (45 * $y)
- ContinueLoop
- EndIf
- $tt_title = PixelSearch($gX, $gY, $gX + 425, $gY + 70, 0x6969FF, 1) ; Magic
- If Not @error Then
- If _ImageSearchArea($pngLoc & "ilvl59.png", 0, $gX, $gY, $gX + 125, Round(1080 * $y_ratio), $gX, $gY, 20) Then ; Magic ilvl 59
- If (getOption("i59m") == 1) Then
- $str_Salvage = $str_Salvage & "|" & 1435 + (48 * $x) & "," & 609 + (45 * $y)
- ElseIf (getOption("i59m") == 2) Then
- $str_Vendor = $str_Vendor & "|" & 1435 + (48 * $x) & "," & 609 + (45 * $y)
- Else
- $str_Stash = $str_Stash & "|" & 1435 + (48 * $x) & "," & 609 + (45 * $y)
- EndIf
- ContinueLoop
- EndIf
- If _ImageSearchArea($pngLoc & "ilvl60.png", 0, $gX, $gY, $gX + 125, Round(1080 * $y_ratio), $gX, $gY, 20) Then ; Magic ilvl 60, goes to salvage
- If (getOption("i60m") == 1) Then
- $str_Salvage = $str_Salvage & "|" & 1435 + (48 * $x) & "," & 609 + (45 * $y)
- ElseIf (getOption("i60m") == 2) Then
- $str_Vendor = $str_Vendor & "|" & 1435 + (48 * $x) & "," & 609 + (45 * $y)
- Else
- $str_Stash = $str_Stash & "|" & 1435 + (48 * $x) & "," & 609 + (45 * $y)
- EndIf
- ContinueLoop
- EndIf
- If _ImageSearchArea($pngLoc & "ilvl61.png", 0, $gX, $gY, $gX + 125, Round(1080 * $y_ratio), $gX, $gY, 20) Then ; Magic ilvl 61, goes to salvage
- If (getOption("i61m") == 1) Then
- $str_Salvage = $str_Salvage & "|" & 1435 + (48 * $x) & "," & 609 + (45 * $y)
- ElseIf (getOption("i61m") == 2) Then
- $str_Vendor = $str_Vendor & "|" & 1435 + (48 * $x) & "," & 609 + (45 * $y)
- Else
- $str_Stash = $str_Stash & "|" & 1435 + (48 * $x) & "," & 609 + (45 * $y)
- EndIf
- ContinueLoop
- EndIf
- If _ImageSearchArea($pngLoc & "ilvl62.png", 0, $gX, $gY, $gX + 125, Round(1080 * $y_ratio), $gX, $gY, 20) Then ; Magic ilvl 62, goes to salvage
- If (getOption("i62m") == 1) Then
- $str_Salvage = $str_Salvage & "|" & 1435 + (48 * $x) & "," & 609 + (45 * $y)
- ElseIf (getOption("i62m") == 2) Then
- $str_Vendor = $str_Vendor & "|" & 1435 + (48 * $x) & "," & 609 + (45 * $y)
- Else
- $str_Stash = $str_Stash & "|" & 1435 + (48 * $x) & "," & 609 + (45 * $y)
- EndIf
- ContinueLoop
- EndIf
- If _ImageSearchArea($pngLoc & "ilvl63.png", 0, $gX, $gY, $gX + 125, Round(1080 * $y_ratio), $gX, $gY, 20) Then ; Magic ilvl 63, goes to stash
- If (getOption("i63m") == 1) Then
- $str_Salvage = $str_Salvage & "|" & 1435 + (48 * $x) & "," & 609 + (45 * $y)
- ElseIf (getOption("i63m") == 2) Then
- $str_Vendor = $str_Vendor & "|" & 1435 + (48 * $x) & "," & 609 + (45 * $y)
- Else
- $str_Stash = $str_Stash & "|" & 1435 + (48 * $x) & "," & 609 + (45 * $y)
- EndIf
- ContinueLoop
- EndIf
- ; Below ilvl 59
- If $StashMagic Then
- $str_Stash = $str_Stash & "|" & 1435 + (48 * $x) & "," & 609 + (45 * $y)
- ElseIf $VendorMagic Then
- $str_Vendor = $str_Vendor & "|" & 1435 + (48 * $x) & "," & 609 + (45 * $y)
- Else
- $str_Ignore = $str_Ignore & "|" & 1435 + (48 * $x) & "," & 609 + (45 * $y)
- EndIf
- ContinueLoop
- EndIf
- ; Probably white/gray trash bugged pick, add to vendor string
- $str_Vendor = $str_Vendor & "|" & 1435 + (48 * $x) & "," & 609 + (45 * $y)
- Else
- $int_emptygrid += 1
- If $int_emptygrid == 2 Then ; If there's nothing 2 times in a row in a row (see wut i did thar?), it probably ends here, skip to the next row.
- $int_emptygrid = 0
- ExitLoop
- Else
- ContinueLoop
- EndIf
- EndIf
- Next
- Next
- Send($Inventory)
- Sleep(500)
- ;Call("AddLog", "Stash gear : " & $str_Stash )
- ;Call("AddLog", "Stash misc : " & $str_StashMisc )
- ;Call("AddLog", "Stash gems : " & $str_StashGems )
- ;Call("AddLog", "Salvage : " & $str_Salvage )
- ;Call("AddLog", "Vendor : " & $str_Vendor )
- ;Call("AddLog", "Ignored Square : " & $str_Ignore )
- Call("AddLog", "Stashed Items: " & UBound(StringSplit($str_Stash, "|")))
- If $str_Stash <> "" Or $str_StashGems <> "" Or $str_StashMisc <> "" Then Call("StashLoot_new")
- If $str_Salvage <> "" Then Call("SalvageLoot_new")
- If $str_Vendor <> "" Then Call("VendorLoot_new")
- EndFunc ;==>AnalyseLoots
- Func StashLoot_new()
- $arr_split = ""
- $pos_split = ""
- GUICtrlSetData($lblStatus, "Status: Putting Items in Stash")
- MouseClick("left", 1064 * $x_ratio, 256 * $y_ratio)
- walktime(1064 * $x_ratio, 256 * $y_ratio, 500)
- $int_TownPosition = 1
- ;Gems Page 1
- If $str_StashGems <> "" Then
- ClickTab($GemTab)
- $str_StashGems = StringMid($str_StashGems, 2)
- $arr_split = StringSplit($str_StashGems, "|")
- For $i = 1 To $arr_split[0]
- Sleep(Random(300, 350))
- $pos_split = StringSplit($arr_split[$i], ",", 2)
- MouseClick("right", $pos_split[0], $pos_split[1], 1, 3)
- Next
- EndIf
- ;Tomes/Crafting Materials/Plans/Etc Page 2
- If $str_StashMisc <> "" Then
- ClickTab($GemTab)
- $str_StashMisc = StringMid($str_StashMisc, 2)
- $arr_split = StringSplit($str_StashMisc, "|")
- For $i = 1 To $arr_split[0]
- Sleep(Random(300, 350))
- $pos_split = StringSplit($arr_split[$i], ",", 2)
- MouseClick("right", $pos_split[0], $pos_split[1], 1, 3)
- Next
- EndIf
- ;Gears Page 2
- If $str_Stash <> "" Then
- $str_Stash = StringMid($str_Stash, 2)
- $arr_split = StringSplit($str_Stash, "|")
- For $i = 1 To $arr_split[0]
- Sleep(Random(80, 100))
- If Random() < 0.5 Then
- ClickTab($ItemTab)
- Else
- ClickTab($NextItemTab)
- EndIf
- Sleep(Random(300, 350))
- $pos_split = StringSplit($arr_split[$i], ",", 2)
- MouseClick("right", $pos_split[0], $pos_split[1], 1, 3)
- Next
- EndIf
- Sleep(Random(100, 150))
- Send("{SPACE}")
- EndFunc ;==>StashLoot_new
- Func SalvageLoot_new()
- $arr_split = ""
- $pos_split = ""
- GUICtrlSetData($lblStatus, "Status: Salvaging loots")
- If $int_TownPosition = 0 Then ; Starting from TP
- MouseClick("middle", 1582 * $x_ratio, 527 * $y_ratio)
- walktime(1582 * $x_ratio, 527 * $y_ratio, 500)
- MouseClick("left", 1661 * $x_ratio, 409 * $y_ratio)
- walktime(1661 * $x_ratio, 409 * $y_ratio, 500)
- Else ; Starting from Stash
- MouseClick("middle", 1484 * $x_ratio, 583 * $y_ratio)
- walktime(1484 * $x_ratio, 583 * $y_ratio, 500)
- MouseClick("left", 1773 * $x_ratio, 484 * $y_ratio)
- walktime(1773 * $x_ratio, 484 * $y_ratio, 500)
- EndIf
- $int_TownPosition = 2
- MouseClick("left", 263 * $x_ratio, 287 * $y_ratio)
- $str_Salvage = StringMid($str_Salvage, 2)
- $arr_split = StringSplit($str_Salvage, "|")
- For $i = 1 To $arr_split[0]
- Sleep(Random(300, 400))
- $pos_split = StringSplit($arr_split[$i], ",")
- MouseClick("left", $pos_split[1], $pos_split[2], 1, 3)
- If $pos_split[0] == 3 Then
- Send("{ENTER}")
- Sleep(1000)
- EndIf
- Next
- Sleep(Random(300, 400))
- Send("{SPACE}")
- EndFunc ;==>SalvageLoot_new
- Func VendorLoot_new()
- $arr_split = ""
- $pos_split = ""
- GUICtrlSetData($lblStatus, "Status: Vendoring Items")
- If $int_TownPosition = 0 Then ; Starting from TP
- MouseClick("middle", 1565 * $x_ratio, 50 * $y_ratio)
- WalkTime(1565 * $x_ratio, 50 * $y_ratio, 500)
- ElseIf $int_TownPosition = 1 Then ; Starting from Stash
- MouseClick("middle", 1560 * $x_ratio, 120 * $y_ratio)
- WalkTime(1560 * $x_ratio, 120 * $y_ratio, 500)
- Else ; Starting from Blacksmith
- MouseClick("middle", 738 * $x_ratio, 64 * $y_ratio)
- WalkTime(738 * $x_ratio, 64 * $y_ratio, 500)
- EndIf
- MouseClick("left", 1030 * $x_ratio, 210 * $y_ratio) ;Talk to vendor
- WalkTime(1030 * $x_ratio, 210 * $y_ratio, 500)
- $str_Vendor = StringMid($str_Vendor, 2)
- $arr_split = StringSplit($str_Vendor, "|")
- For $i = 1 To $arr_split[0]
- Sleep(Random(100, 300))
- $pos_split = StringSplit($arr_split[$i], ",", 2)
- MouseClick("right", $pos_split[0], $pos_split[1], 1, 3)
- If PixelGetColor(819 * $x_ratio, 375 * $y_ratio) == 0x370C00 Then Send("{ENTER}")
- Next
- Sleep(Random(100, 200))
- $mon = _TesseractScreenCapture(0, "", 1, 2, 1454 * $x_ratio, 508 * $y_ratio, (1920 - 1571) * $x_ratio, (1080 - 525) * $y_ratio, 0)
- $mon = CleanOCR($mon)
- $mondelt = Number($mon) - Number($monold)
- GUICtrlSetData($lblGold, "Gold: " & $mon & ", Sold value: " & $mondelt)
- $monold = $mon
- Call("AddLog", "Sold Items: " & $arr_split[0] & ", Sold value: " & $mondelt)
- Sleep(Random(200, 300))
- RandClick("left", Round(521 * $x_ratio), Round(506 * $y_ratio), 1, 1) ;button to open up repair menu
- Sleep(200)
- RandClick("left", Round(260 * $x_ratio), Round(595 * $y_ratio), 1, 1) ;button to pay for repairs
- Sleep(400)
- $mon = _TesseractScreenCapture(0, "", 1, 2, 1454 * $x_ratio, 508 * $y_ratio, (1920 - 1571) * $x_ratio, (1080 - 525) * $y_ratio, 0)
- $mon = CleanOCR($mon)
- $mondelt = Number($mon) - Number($monold)
- GUICtrlSetData($lblGold, "Gold: " & $mon & ", Repair cost: " & $mondelt)
- $monold = $mon
- Call("AddLog", "Repair Cost: " & - $mondelt)
- GUICtrlSetData($lblStatus, "Status: Done With Vendor")
- Send("{SPACE}")
- EndFunc ;==>VendorLoot_new
- Func getOption($option) ;Gets the correct INI settings corrisponding to the vend/stash/salvage of items.
- If ($option == "i59r") Then
- If ($i59Rare = "salvage") Then
- Return 1
- ElseIf ($i59Rare = "vend") Then
- Return 2
- Else
- Return 0
- EndIf
- ElseIf ($option == "i60r") Then
- If ($i60Rare = "salvage") Then
- Return 1
- ElseIf ($i60Rare = "vend") Then
- Return 2
- Else
- Return 0
- EndIf
- ElseIf ($option == "i61r") Then
- If ($i61Rare = "salvage") Then
- Return 1
- ElseIf ($i61Rare = "vend") Then
- Return 2
- Else
- Return 0
- EndIf
- ElseIf ($option == "i62r") Then
- If ($i62Rare = "salvage") Then
- Return 1
- ElseIf ($i62Rare = "vend") Then
- Return 2
- Else
- Return 0
- EndIf
- ElseIf ($option == "i63r") Then
- If ($i63Rare = "salvage") Then
- Return 1
- ElseIf ($i63Rare = "vend") Then
- Return 2
- Else
- Return 0
- EndIf
- ElseIf ($option == "i59m") Then
- If ($i59Magic = "salvage") Then
- Return 1
- ElseIf ($i59Magic = "vend") Then
- Return 2
- Else
- Return 0
- EndIf
- ElseIf ($option == "i60m") Then
- If ($i60Magic = "salvage") Then
- Return 1
- ElseIf ($i60Magic = "vend") Then
- Return 2
- Else
- Return 0
- EndIf
- ElseIf ($option == "i61m") Then
- If ($i61Magic = "salvage") Then
- Return 1
- ElseIf ($i61Magic = "vend") Then
- Return 2
- Else
- Return 0
- EndIf
- ElseIf ($option == "i62m") Then
- If ($i62Magic = "salvage") Then
- Return 1
- ElseIf ($i62Magic = "vend") Then
- Return 2
- Else
- Return 0
- EndIf
- ElseIf ($option == "i63m") Then
- If ($i63Magic = "salvage") Then
- Return 1
- ElseIf ($i63Magic = "vend") Then
- Return 2
- Else
- Return 0
- EndIf
- Else
- Return 0
- EndIf
- EndFunc ;==>getOption
- #endregion OtherStuff
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement