Advertisement
Guest User

Chancity's Dank Cellar

a guest
Jun 20th, 2012
1,690
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 33.00 KB | None | 0 0
  1. ;notAres' Wizard Gold Script 1.9.3 Modified by Chancity - 6/18/2012 - New INI option: Identify. Added VendItems() and StashItems() to simplify code and added 2 colors of legendaries to stash (highlighted/not highlighted). Trimmed down all "Area" CheckFor() calls. Fixed CheckFor("ExitGame"). Moves mouse out of the way while looting. Added deaths/cellars to PAUSED tooltip.
  2. ;YOU MUST START THE BOT AT THE RESUME GAME SCREEN!
  3. ;Thread: http://www.ownedcore.com/forums/diablo-3/diablo-3-bots-programs/d3-gold-profiles/355759-goldfarming-dank-celler-gold-loot-autoit-script-wizard-1920x1080.html
  4. ;;;;;
  5. ;WONT WORK UNLESS MOVE IS BOUND TO MIDDLE MOUSE (Mouse 3) -- NOT MOVE/INTERACT
  6. ;Suggested build: http://www.ownedcore.com/forums/diablo-3/diablo-3-bots-programs/d3-gold-profiles/355759-goldfarming-dank-celler-gold-loot-autoit-script-wizard-1920x1080.html
  7. ;Required display mode for cellar detection: "FULLSCREEN WINDOWED"
  8. ;Official supported resolution: 1920x1080
  9. ;;;;;
  10. ;Original by mackus101 @ ownedcore
  11. ;ImageSearch contributions by rvbfreak, goofinator, and asuRob
  12. ;Refactoring and additional functions by Shimizoki
  13.  
  14. ;=========== DO NOT TOUCH ===========;
  15. #RequireAdmin
  16. #include <GUIConstantsEx.au3>
  17. #include <StaticConstants.au3>
  18. #include <WindowsConstants.au3>
  19. #include <tesserect.au3>
  20. Opt('MouseCoordMode', 2)
  21. Opt('PixelCoordMode', 2)
  22. Global $size = WinGetClientSize("[CLASS:D3 Main Window Class]"), $ver = "1.9.5", $ini = "WZD.ini", $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,$lblGold, $StartingGold = 0,$AccumulatedGold = 0,$GPH = 0
  23. For $i = 0 To Random(0, 7, 1)
  24.     $title &= Chr(Random(97, 122, 1))
  25. Next
  26. For $i = 0 To Random(5, 10, 1)
  27.     $title &= Chr(Random(65, 90, 1))
  28. Next
  29. $title &= " "
  30. Global $gems[8] = ["Ru1.png", "Ru2.png", "Em1.png", "Em2.png", "To1.png", "To2.png", "Am1.png", "Am2.png"]
  31. If @OSArch = "X64" Then DllCall("kernel32.dll", "int", "Wow64DisableWow64FsRedirection", "int", 1)
  32. If @OSArch = "X64" And Not @AutoItX64 Then MsgBox(16, "ERROR", "Why aren't you running the 64-bit AutoIt??? Expect bugs!")
  33. If $size = 0 Then
  34.     MsgBox(16, "Error", "Diablo III is not running, cannot grab resolution!" & @CRLF & "Exiting...")
  35.     Exit
  36. EndIf
  37. ;====================================;
  38.  
  39. ;============= SETTINGS: DONT CHANGE HERE, CHANGE WZD.INI =============;
  40. HotKeySet("=", "Begin") ;script toggled on/off by pressing =
  41. HotKeySet("{PAUSE}", "TogglePause") ;script toggle pause by pressing Pause/Break key
  42. HotKeySet("x", "Stop") ;script stopped by pressing x
  43. HotKeySet("g", "GoldPerHour")
  44.  
  45. ;Change to match your abilities (1-4 by default)z
  46. $DiamondSkin = "1"
  47. $MirrorImage = "2"
  48. $Teleport = "3"
  49. $Hydra = "4"
  50.  
  51. $movementSpeed = 0 ;This is the % increase movement speed you have. 25 = 25%, 0 = 0% (25% is the movement cap but SS + Displacement avg = 32%)
  52.  
  53. ;Custom Loot
  54. $pngLoc = "@ScriptDir" ;Location of the .PNGs (NO SUBFOLDERS - ALL PNGS GO HERE)
  55. $totalItems = 1 ;Number of items in the pick array
  56. Global $pick[$totalItems] ;DONT CHANGE THIS
  57.  
  58. ;Array of items to loot (GEMS AND TOMES ALREADY INCLUDED)
  59. $pick[0] = "mythic.png|40" ;png|Tolerance
  60. ;$pick[1] = "item2.png|0"
  61. ;$pick[2] = "item3.png|0"
  62.  
  63. ;Looting
  64. $LootSets = "True" ;True if you want to pick up Sets
  65. $LootLegendaries = "True";True if you want to pick up Legendaries
  66. $LootRares = "True" ;True if you want to pick up Rares
  67. $LootMagic = "True" ;True if you want to pick up Magic
  68. $LootGems = "True" ;True if you want to pick up Gems
  69. $LootTomes = "True" ;True if you want to pick up Tome of Secrets
  70. $LootCustom = "False" ;True if you want to pick up Custom Items (The items in the $pick array above)
  71.  
  72. ;Manage Loot
  73. $Identify = "True" ;True to enable identifying items before stashing/vendoring
  74. $mLoot = 5 ;Nuber of successful runs until Stash and Vendor
  75. $mLootOff = 2 ;Stash and Vendor after mLoot +- X number of runs (Variability)
  76.  
  77. ;Stashing
  78. $StashLoot = "True" ;True if you want to store Items in the stash
  79. ;---
  80. $StashLegendary = "True";True if you want to store Legendary items in the stash
  81. $StashRare = "True" ;True if you want to store Rare items in the stash
  82. $StashMagic = "False" ;True if you want to store Magic items in the stash
  83. $StashTomes = "True" ;True if you want to store Tomes items in the stash
  84. $StashGems = "True" ;True if you want to store Gems items in the stash
  85.  
  86. ;Vendoring ==NEW SETTINGS==
  87. $VendorLoot = "True" ;True if you want to vendor anything
  88. ;---
  89. $VendorRare = "True" ;True if you want to vendor Rares
  90. $VendorMagic = "True" ;True if you want to vendor Magic
  91. $vendorAll = "False" ;True if you want to right click all items when talking to vendor
  92. $vendorRows = 4 ;# of rows to vendor, starting from the top (default = 5: bottom row is safe)
  93. $vendorCols = 10 ;# of columns to vendor, starting from left
  94.  
  95. ;Variability ==NEW SETTINGS==
  96. $Timer = "False" ;True and the bot will add random sleep intervals
  97. ;---
  98. $attackTime = 3400 ;Time (in ms) the script will shoot sarkoth with the right button
  99. $walktime = 3600 ;Time (in ms) the script waits for you to enter and load the cellar. Slow this down for slower move speeds and loading times
  100. $loadtime = 4500 ;Time (in ms) the script waits for the game to load before it starts pathfinding. Slow this down for slower hard drives
  101. $tptime = 6900 ;Time (in ms) the script waits for teleport before exiting the game
  102. ;====================================;
  103.  
  104. $x_ratio = $size[0] / 1920
  105. $y_ratio = $size[1] / 1080
  106. If FileExists($ini) Then
  107.     Call("ReadINI")
  108.     Call("CreateINI")
  109. Else
  110.     Call("CreateINI")
  111. EndIf
  112.  
  113. If $pngLoc == "@ScriptDir" Then $pngLoc = @ScriptDir & "\pics\"
  114. If $totalItems < 1 Then $LootCustom = "False"
  115. $mLootIn = $mLoot
  116. $movementSpeed = 1 + ($movementSpeed / 100)
  117. $VersionsInfo = "http://dl.dropbox.com/s/5scw181ipfdy8l3/version.ini"
  118. $oldVersion = IniRead("updater.ini", "Version", "Version", $ver)
  119. $newVersion = "0.0"
  120.  
  121. If Not FileExists($pngLoc & "MainMenu.png") Then
  122.     MsgBox(16, "Fatal Error", "FATAL ERROR: Cannot find: " & $pngLoc & "MainMenu.png" & @CRLF & "Make sure your directory is set properly in the script")
  123.     Exit
  124. EndIf
  125.  
  126. Call("SetupGUI")
  127. Call("DoUpdate")
  128.  
  129. While 1
  130.     Call("RestartRun")
  131. WEnd
  132.  
  133. Func RestartRun()
  134.     If ($Go) Then
  135.         $i = 0
  136.         WinSetTitle($title, "", $title & $ver & " - Running")
  137.         MouseMove(Round(Random(0, 400) * $x_ratio), Round(Random(700, 1080) * $y_ratio), 3) ;Moves mouse out of the way
  138.         ;Checks if the player is Dead/Logout/Window, then if in Main Menu, etc.
  139.         If CheckDead() Then
  140.             Return
  141.         ElseIf CheckFor("ExitGame", "", Round(860 * $x_ratio), Round(400 * $y_ratio), Round(1040 * $x_ratio), Round(450 * $y_ratio), 0.5, 140) Then
  142.             GUICtrlSetData($lblStatus, "Status: Exit window up")
  143.             MouseClick("left", Round(1064 * $x_ratio), Round(632 * $y_ratio))
  144.             Sleep(100)
  145.             Send("{SPACE}")
  146.             Return
  147.         ElseIf CheckFor("MainMenu", "", Round(40 * $x_ratio), Round(300 * $y_ratio), Round(400 * $x_ratio), Round(450 * $y_ratio)) Then
  148.             GUICtrlSetData($lblRun, "Run Number: " & $run & " - Runs till vendor: " & $mLootIn)
  149.             GUICtrlSetData($lblLocation, "Location: Main Menu")
  150.             GUICtrlSetData($lblStatus, "Status: Starting Game")
  151.             RandClick("left", Round(230 * $x_ratio), Round(416 * $y_ratio), 120, 20, 1, 6) ;Random Click on the resume button
  152.             Sleep($loadtime)
  153.             $rt = TimerInit()
  154.             $run += 1
  155.         ElseIf CheckFor("OldRuins", "Area") Or CheckFor("NewTristram", "Area") Or CheckFor("DankCellar", "Area") Then
  156.             Call("TownPortal")
  157.             Call("LeaveGame")
  158.             Return
  159.         ElseIf CheckFor("LimitError", "", Round(700 * $x_ratio), Round(340 * $y_ratio), Round(1200 * $x_ratio), Round(600 * $y_ratio), 1, 140) Then
  160.             MouseClick("left", Round(960 * $y_ratio), Round(635 * $x_ratio))
  161.             $rand = Random(40000, 80000)
  162.             GUICtrlSetData($lblStatus, "Status: Input Limit - Waiting " & Round($rand / 1000) & " seconds.")
  163.             Sleep($rand)
  164.             Send("{SPACE}")
  165.             Return
  166.         ElseIf CheckFor("Disconnect", "", Round(700 * $x_ratio), Round(340 * $y_ratio), Round(1200 * $x_ratio), Round(600 * $y_ratio), 1, 140) Then
  167.             GUICtrlSetData($lblStatus, "Status: Network Disconnect window up")
  168.             MouseClick("left", Round(960 * $x_ratio), Round(632 * $y_ratio))
  169.             Sleep(100)
  170.             Send("{SPACE}")
  171.             Return
  172.         Else
  173.             GUICtrlSetData($lblStatus, "ERROR: Cannot find Resume button")
  174.             Return
  175.         EndIf
  176.         ;Make sure we are in the right area before beginning run
  177.         If CheckFor("OldRuins", "Area") Then
  178.             Sleep(200)
  179.             GUICtrlSetData($lblLocation, "Location: Old Ruins")
  180.             Call("CheckRepair")
  181.             If $StartingGold = 0 Then Call("GoldPerHour")
  182.             ;Start Run
  183.             MouseClick("middle", Round(0 * $x_ratio),Round(250 * $y_ratio)) ;starts the main run
  184.             Send("{3 down}")
  185.             Sleep(1900)
  186.             Send("{3 up}")
  187.             send($DiamondSkin)
  188.             Moving(100)
  189.             RandMove(Round(255*$x_ratio),Round(290 * $y_ratio), 1, 1) ;moves cursor over to the cellar so the proper blue pixel becomes highlighted
  190.             Sleep(350)
  191.             If CheckDead() Then
  192.                 Return
  193.             EndIf
  194.  
  195.             ;Checks if Dank Cellar is Open
  196.             $Pixel2 = PixelSearch(0, 0, Round(600*$x_ratio), Round(400 * $y_ratio), 0x334FB7, 3)
  197.             If Not @error Then
  198.                 GUICtrlSetData($lblStatus, "Status: Cellar - Found")
  199.                 $cellarCount += 1
  200.                 MouseClick("left", Round(255*$x_ratio),Round(290 * $y_ratio), 1) ;Entrance to cellar
  201.                 Sleep(800 * $movementSpeed)
  202.                 Moving($walktime)
  203.             Else ;ABORT RUN
  204.                 GUICtrlSetData($lblStatus, "Status: Cellar - Not Found" & @CRLF)
  205.                 Sleep(10)
  206.                 mousemove(962,518,1) ;Keep me safE!
  207.                 Send($Hydra)
  208.                 Sleep(620)
  209.                 Send($MirrorImage)
  210.                 Sleep(400)
  211.                 send("{SHIFTDOWN}")
  212.                 sleep(200)
  213.                 Mouseclick("left")
  214.                 sleep(300)
  215.                 send("{SHIFTUP}")
  216.                 sleep(400)
  217.                 Call("TownPortal")
  218.                 If Not CheckDead() Then
  219.                     Call("LeaveGame")
  220.                 EndIf
  221.                 Return
  222.             EndIf
  223.         Else
  224.             Call("TownPortal")
  225.             If Not CheckDead() Then
  226.                 Call("LeaveGame")
  227.             EndIf
  228.             Return
  229.         EndIf
  230.  
  231.         ;Checks that the player is in the Dank Cellar
  232.         If CheckFor("DankCellar", "Area") Then
  233.             GUICtrlSetData($lblLocation, "Location: Dank Cellar")
  234.             RandClick("middle", Round(20 * $x_ratio),Round(708 * $y_ratio), 1, 1) ;moves to doorway leading to rare inside cellar
  235.             Sleep(Random(2200, 2800))
  236.             RandMove(Round(440 * $x_ratio),Round(80 * $y_ratio), 1, 1) ;hovers over the rare Sarkoth
  237.             sleep(400)
  238.             Send($Hydra)
  239.             Sleep(100)
  240.             Send("{SHIFTDOWN}")
  241.             GUICtrlSetData($lblStatus, "Status: Attacking Sarkoth")
  242.             MouseDown("right") ;ATTACK
  243.             Sleep($attackTime)
  244.             MouseUp("right")
  245.             Sleep(200)
  246.             Send("{SHIFTUP}")
  247.             sleep(800)
  248.             MouseClick("right",694,929) ;cancel archon
  249.             sleep(300)
  250.             Moving(200)
  251.             RandClick("middle", Round(564*$x_ratio),Round(222 * $y_ratio)) ;location of sarkoth after death
  252.             Moving(1600)
  253.             GUICtrlSetData($lblStatus, "Status: Looting")
  254.             Call("Loot")
  255.             RandSleep(0, 6, 30)
  256.             Call("TownPortal")
  257.         Else
  258.             mousemove(962,518,1) ;Keep me safE!
  259.             Send($Hydra)
  260.             Sleep(620)
  261.             Send($MirrorImage)
  262.             Sleep(400)
  263.             send("{SHIFTDOWN}")
  264.             sleep(200)
  265.             Mouseclick("left")
  266.             sleep(300)
  267.             send("{SHIFTUP}")
  268.             sleep(400)
  269.             Call("TownPortal")
  270.             If Not CheckDead() Then
  271.                 Call("LeaveGame")
  272.             EndIf
  273.             Return
  274.         EndIf
  275.         ;After successful run
  276.         If Not CheckDead() Then
  277.             Sleep(600)
  278.             If $mLootIn = 1 And CheckFor("NewTristram", "Area") Then ;If its time to manage loot and we are in town
  279.                 If $Identify == True Then Call("Identify")
  280.                 If $StashLoot == True Then
  281.                     Call("StashLoot")
  282.                 EndIf
  283.                 If $VendorLoot == True Then
  284.                     Call("VendorLoot")
  285.                 EndIf
  286.                 $mLootIn = Round(Random($mLoot - $mLootOff, $mLoot + $mLootOff)) ;Reset Counter
  287.             ElseIf Not CheckFor("NewTristram", "Area") Then
  288.                 GUICtrlSetData($lblStatus, "Status: Skipping vendor, not in New Tristram")
  289.                 Sleep(3000)
  290.             ElseIf $mLootIn <= 0 Then
  291.                 $mLootIn = 1
  292.             Else
  293.                 $mLootIn -= 1
  294.             EndIf
  295.             If Not CheckDead() Then
  296.                 Call("LeaveGame")
  297.             EndIf
  298.             Return
  299.         Else
  300.             Return
  301.         EndIf
  302.     EndIf
  303. EndFunc   ;==>RestartRun
  304.  
  305. ;Helper Functions
  306.  
  307. Func SetupGUI()
  308.     $frmBot = GUICreate($title & $ver & " - Updating", 300, 125, Round(1540 * $x_ratio), Round(920 * $y_ratio), -1, BitOR($WS_EX_TOPMOST, $WS_EX_TOOLWINDOW), 0)
  309.     GUISetBkColor(0xC0C0C0)
  310.     $lblRun = GUICtrlCreateLabel("Run Number: 0 - Runs till vendor: 0", 4, 0, 280, 24)
  311.     GUICtrlSetFont(-1, 10, 600, 0, "Segoe UI")
  312.     GUICtrlSetColor(-1, 0xFF0000)
  313.     $lblLocation = GUICtrlCreateLabel("Location: Main Menu", 12, 20, 240, 17)
  314.     $lblStatus = GUICtrlCreateLabel("Status: ", 12, 35, 240, 17)
  315.     $lblLast = GUICtrlCreateLabel("Last Runtime: 0 seconds", 12, 50, 240, 17)
  316.     $lblRuntime = GUICtrlCreateLabel("Total Runtime: 0 hours, 0 minutes", 12, 65, 240, 17)
  317.     $lblGear = GUICtrlCreateLabel("Legendary: 0 - Set: 0 - Rare: 0", 12, 80, 240, 17)
  318.     $lblItems = GUICtrlCreateLabel("Magic: 0 - Gems: 0 - Tomes: 0", 12, 95, 240, 17)
  319.     $lblGold = GUICtrlCreateLabel("0 Gold Per Hour - Accumulated Gold: 0", 12, 110, 240, 17)
  320.  
  321.     GUISetState(@SW_SHOW)
  322. EndFunc   ;==>SetupGUI
  323.  
  324. Func CheckDead()
  325.     $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
  326.     If Not @error Then
  327.         GUICtrlSetData($lblStatus, "Status: Logging out")
  328.         Sleep(11000)
  329.         Sleep($loadtime)
  330.         Return 1
  331.     EndIf
  332.  
  333.     $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
  334.     If Not @error Then
  335.         GUICtrlSetData($lblStatus, "Status: Open Window")
  336.         Sleep(200)
  337.         Send("{SPACE}") ;close any open windows
  338.         Return 1
  339.     EndIf
  340.  
  341.     $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"
  342.     If Not @error Then
  343.         GUICtrlSetData($lblStatus, "Status: Dead")
  344.         $deathCount += 1
  345.         Call("LeaveGame")
  346.         Sleep(11000)
  347.         Sleep($loadtime)
  348.         Return 1
  349.     Else
  350.         Return 0
  351.     EndIf
  352. EndFunc   ;==>CheckDead
  353.  
  354. Func CheckRepair()
  355.     $RepairArea = PixelSearch(Round(1480 * $x_ratio), 0, Round(1570 * $x_ratio), Round(100 * $y_ratio), $yellow)
  356.     If Not @error Then
  357.         Call("DoRepair")
  358.     EndIf
  359.     $RepairAreaRed = PixelSearch(Round(1480 * $x_ratio), 0, Round(1570 * $x_ratio), Round(100 * $y_ratio), $red)
  360.     If Not @error Then
  361.         Call("DoRepair")
  362.     EndIf
  363. EndFunc   ;==>CheckRepair
  364.  
  365. Func DoRepair()
  366.     Sleep(Random(75, 150))
  367.     Call("TownPortal")
  368.     If CheckDead() Then
  369.         Return
  370.     EndIf
  371.     If CheckFor("NewTristram", "Area") Then
  372.         RandClick("left", Round(1480 * $x_ratio), Round(281 * $y_ratio), 1, 1) ;begin movement towards merchant
  373.         Moving(1875)
  374.         RandClick("left", Round(1316 * $x_ratio), Round(206 * $y_ratio), 1, 1) ;moves to get merchant in screen
  375.         Moving(1875)
  376.         RandClick("left", Round(845 * $x_ratio), Round(225 * $y_ratio), 1, 1) ;NPC Merchant to the right of cain's home
  377.         Sleep(1200)
  378.         RandClick("left", Round(521 * $x_ratio), Round(506 * $y_ratio), 1, 1) ;button to open up repair menu
  379.         Sleep(400)
  380.         RandClick("left", Round(260 * $x_ratio), Round(595 * $y_ratio), 1, 1) ;button to pay for repairs
  381.         Sleep(200)
  382.         Send("{Escape}")
  383.         If Not CheckDead() Then
  384.             Call("LeaveGame")
  385.         EndIf
  386.     EndIf
  387. EndFunc   ;==>DoRepair
  388.  
  389. Func CalcTime()
  390.     $srt = TimerDiff($rt)
  391.     GUICtrlSetData($lblLast, "Last Runtime: " & Round($srt / 1000, 2) & " seconds.")
  392.     $trt = TimerDiff($t)
  393.     $total = Round((($trt / 1000) / 60) / 60, 4)
  394.     ;Total runtime calculation.
  395.     $hours = Floor((($trt / 1000) / 60) / 60)
  396.     $minutes = (($trt / 1000) / 60)
  397.     ;trim minutes if runtime is more then 1 hour.
  398.     If $minutes > 60 Then
  399.         While $minutes > 60
  400.             $minutes -= 60
  401.         WEnd
  402.     EndIf
  403.     GUICtrlSetData($lblRuntime, "Total Runtime: " & $hours & " hours, " & Ceiling($minutes) & " minutes")
  404. EndFunc   ;==>CalcTime
  405.  
  406. Func CheckFor($img, $type = "", $startX = 0, $startY = 0, $endX = @DesktopWidth, $endY = @DesktopHeight, $seconds = 6, $tolerance = 140)
  407.     If $type = "Area" Then
  408.         $startX = 1500 * $x_ratio
  409.         $startY = 0 * $y_ratio
  410.         $endX = 1920 * $x_ratio
  411.         $endY = 90 * $y_ratio
  412.         $seconds = 2.5
  413.     EndIf
  414.     $c = 0
  415.     $string = $pngLoc & $img & ".png"
  416.     Do
  417.         $c += 1
  418.         Sleep(100)
  419.         If $c > ($seconds * 10) Then ;Make sure we never get stuck here for infinity.
  420.             If $type = "Area" Then
  421.                 GUICtrlSetData($lblStatus, "Status: Area not found - " & $img)
  422.             EndIf
  423.             Return False
  424.         EndIf
  425.     Until _ImageSearchArea($string, 1, $startX, $startY, $endX, $endY, $gX, $gY, $tolerance)
  426.     Return True
  427. EndFunc   ;==>CheckFor
  428.  
  429. Func Loot()
  430.     Sleep(Random(500, 1200))
  431.     MouseMove(Round(Random(0, 400) * $x_ratio), Round(Random(700, 1080) * $y_ratio), 3) ;Moves mouse out of the way
  432.     If $LootSets == True Then
  433.         $SetCount += LootGear(0x02CE01)
  434.     EndIf
  435.     If $LootLegendaries == True Then
  436.         $LegendaryCount += LootGear(0xBF642F, 0)
  437.     EndIf
  438.     If $LootRares == True Then
  439.         $RareCount += LootGear(0xBBBB00)
  440.     EndIf
  441.     If $LootGems == True Then
  442.         Call("LootGems")
  443.     EndIf
  444.     If $LootTomes == True Then
  445.         Call("LootTomes")
  446.     EndIf
  447.     If $LootCustom == True Then
  448.         Call("LootCustom")
  449.     EndIf
  450.     If $LootMagic == True Then
  451.         $MagicCount += LootGear(0x6969FF)
  452.     EndIf
  453.     Call("ShowLoot")
  454. EndFunc   ;==>Loot
  455.  
  456. Func LootGear($color, $tolerance = 2)
  457.     $count = 0
  458.     $Loot = PixelSearch(Round(400 * $x_ratio), 0, Round(1690 * $x_ratio), Round(900 * $y_ratio), $color, $tolerance)
  459.     If Not @error Then
  460.         While Not @error
  461.             $count += 1
  462.             MouseClick('left', $Loot[0], $Loot[1], 1, 3)
  463.             Sleep(50)
  464.             MouseMove(Round(Random(0, 400) * $x_ratio), Round(Random(700, 1080) * $y_ratio), 3) ;Moves mouse out of the way
  465.             Sleep(1000)
  466.             ;Run at max 10 times per quality
  467.             If $count >= 10 Then
  468.                 ExitLoop
  469.             EndIf
  470.             $Loot = PixelSearch(Round(400 * $x_ratio), 0, Round(1690 * $x_ratio), Round(900 * $y_ratio), $color, $tolerance)
  471.         WEnd
  472.     EndIf
  473.     Return $count
  474. EndFunc   ;==>LootGear
  475.  
  476. Func LootCustom()
  477.     $count = 0
  478.     $gX = 0
  479.     $gY = 0
  480.     For $i = 0 To ($totalItems - 1)
  481.         $array = StringSplit($pick[$i], "|")
  482.         $file = $array[1]
  483.         $accuracy = $array[2]
  484.         $urlString = $pngLoc & $file
  485.         While _ImageSearchArea($pngLoc & $file, 1, 0, 0, @DesktopWidth, @DesktopHeight, $gX, $gY, $accuracy)
  486.             $count += 1
  487.             MouseClick("left", $gX, $gY, 1, 3)
  488.             Sleep(50)
  489.             MouseMove(Round(Random(0, 400) * $x_ratio), Round(Random(700, 1080) * $y_ratio), 3) ;Moves mouse out of the way
  490.             Sleep(1000)
  491.             If $count >= 10 Then
  492.                 ExitLoop
  493.             EndIf
  494.         WEnd
  495.     Next
  496. EndFunc   ;==>LootCustom
  497.  
  498. Func LootGems()
  499.     $count = 0
  500.     $gX = 0
  501.     $gY = 0
  502.     While _ImageSearchArea($pngLoc & "square.png", 1, 0, 0, @DesktopWidth, @DesktopHeight, $gX, $gY, 90)
  503.         $count += 1
  504.         MouseClick("left", $gX, $gY - 3, 1, 3)
  505.         Sleep(50)
  506.         MouseMove(Round(Random(0, 400) * $x_ratio), Round(Random(700, 1080) * $y_ratio), 3) ;Moves mouse out of the way
  507.         $GemCount += 1
  508.         Sleep(1000)
  509.         If $count >= 10 Then
  510.             ExitLoop
  511.         EndIf
  512.     WEnd
  513. EndFunc   ;==>LootGems
  514.  
  515. Func LootTomes()
  516.     $count = 0
  517.     $gX = 0
  518.     $gY = 0
  519.     While _ImageSearchArea($pngLoc & "tome.png", 1, 0, 0, @DesktopWidth, @DesktopHeight, $gX, $gY, 90)
  520.         $count += 1
  521.         MouseClick("left", $gX, $gY - 3, 1, 3)
  522.         Sleep(50)
  523.         MouseMove(Round(Random(0, 400) * $x_ratio), Round(Random(700, 1080) * $y_ratio), 3) ;Moves mouse out of the way
  524.         $TomeCount += 1
  525.         Sleep(1000)
  526.         If $count >= 10 Then
  527.             ExitLoop
  528.         EndIf
  529.     WEnd
  530. EndFunc   ;==>LootTomes
  531.  
  532. Func Identify()
  533.     Send("c")
  534.     Sleep(1300)
  535.     While _ImageSearchArea($pngLoc & "unidentified.png", 1, 1400 * $x_ratio, 580 * $y_ratio, 1914 * $x_ratio, 888 * $y_ratio, $gX, $gY, 120)
  536.         GUICtrlSetData($lblStatus, "Status: Identifying")
  537.         MouseClick("right", $gX, $gY, 1, 4)
  538.         MouseMove(Round(Random(0, 400) * $x_ratio), Round(Random(700, 1080) * $y_ratio), 3) ;Moves mouse out of the way
  539.         Sleep(Random(3000, 3500))
  540.     WEnd
  541.     Send("c")
  542.     Sleep(200)
  543. EndFunc   ;==>Identify
  544.  
  545. Func StashLoot()
  546.     GUICtrlSetData($lblStatus, "Status: Putting Items in Stash")
  547.     MouseClick("left", 1064 * $x_ratio, 256 * $y_ratio)
  548.     Moving(1600)
  549.  
  550.     ;Tomes
  551.     While $StashTomes == True
  552.         Sleep(Random(100, 300))
  553.         If _ImageSearchArea($pngLoc & "TomeIcon.png", 1, 1400 * $x_ratio, 580 * $y_ratio, 1914 * $x_ratio, 888 * $y_ratio, $gX, $gY, 140) Then
  554.             GUICtrlSetData($lblStatus, "Status: Stashing Tomes")
  555.             MouseClick("left", 500 * $x_ratio, 360 * $y_ratio, 1, 4)
  556.             MouseClick("right", $gX, $gY, 1, 4)
  557.             Sleep(80)
  558.             MouseClick("left", 500 * $x_ratio, 200 * $y_ratio, 1, 4)
  559.         Else
  560.             ExitLoop
  561.         EndIf
  562.     WEnd
  563.  
  564.     If $StashLegendary == True Then
  565.         StashItems(0xFF7F00, 0)
  566.         StashItems(0x8F5C25, 1)
  567.     EndIf
  568.  
  569.     If $StashRare == True Then
  570.         StashItems(0x4A3C0B, 1)
  571.     EndIf
  572.  
  573.     If $StashMagic == True Then
  574.         StashItems(0x182037, 1)
  575.     EndIf
  576.  
  577.  
  578.     ;Gems (DOESN'T STASH BOTTOM ROW!)
  579.     If $StashGems == True Then
  580.         GUICtrlSetData($lblStatus, "Status: Stashing Gems")
  581.         MouseClick("left", 500 * $x_ratio, 200 * $y_ratio, 1, 4)
  582.         Sleep(Random(20, 100))
  583.         For $i = 0 To 7
  584.             If _ImageSearchArea($pngLoc & $gems[$i], 1, 1400 * $x_ratio, 580 * $y_ratio, 1914 * $x_ratio, 820 * $y_ratio, $gX, $gY, 140) Then
  585.                 MouseClick("right", $gX, $gY, 1, 3)
  586.             EndIf
  587.         Next
  588.     EndIf
  589.     Sleep(Random(1000, 1500))
  590.     Send("{SPACE}")
  591. EndFunc   ;==>StashLoot
  592.  
  593. Func VendorLoot()
  594.     GUICtrlSetData($lblStatus, "Status: Vendoring Items")
  595.     If Not $StashLoot == True Then ;Move from TP towards vendor
  596.         Sleep(Random(300, 500))
  597.         MouseClick("middle", 1565 * $x_ratio, 50 * $y_ratio)
  598.     Else ;Move from Stash towards vendor
  599.         Sleep(Random(300, 500))
  600.         MouseClick("middle", 1560 * $x_ratio, 120 * $y_ratio)
  601.     EndIf
  602.     Moving(2600)
  603.     MouseClick("left", 1030 * $x_ratio, 210 * $y_ratio) ;Talk to vendor
  604.     Moving(2600)
  605.  
  606.     ;All
  607.     If $vendorAll == True Then
  608.         For $c = 1 To $vendorCols
  609.             For $r = 1 To $vendorRows
  610.                 RandClick("right", (((($c - 1) * 50) + 32 + 1400) * $x_ratio), (((($r - 1) * 51) + 32 + 580) * $y_ratio), 2, 2, 1, 2.5)
  611.             Next
  612.         Next
  613.     EndIf
  614.  
  615.     ;Rares
  616.     If $VendorRare == True Then
  617.         VendItems(0x4A3C0B, 1)
  618.     EndIf
  619.  
  620.     ;Magic
  621.     If $VendorMagic == True Then
  622.         VendItems(0x182037, 1)
  623.     EndIf
  624.  
  625.     Sleep(200)
  626.     RandClick("left", Round(521 * $x_ratio), Round(506 * $y_ratio), 1, 1) ;button to open up repair menu
  627.     Sleep(300)
  628.     RandClick("left", Round(260 * $x_ratio), Round(595 * $y_ratio), 1, 1) ;button to pay for repairs
  629.     Sleep(200)
  630.     GUICtrlSetData($lblStatus, "Status: Done With Vendor")
  631.     Send("{ESCAPE}")
  632. EndFunc   ;==>VendorLoot
  633.  
  634. Func StashItems($color, $tolerance)
  635.     $c = 0
  636.     While $c <= 20
  637.         Sleep(Random(20, 100))
  638.         $StashPixel = PixelSearch(1400 * $x_ratio, 580 * $y_ratio, 1914 * $x_ratio, 888 * $y_ratio, $color, $tolerance)
  639.         If Not @error Then
  640.             MouseClick("right", $StashPixel[0] + 4, $StashPixel[1], 1, 4)
  641.             $c += 1
  642.         Else
  643.             ExitLoop
  644.         EndIf
  645.     WEnd
  646. EndFunc   ;==>StashItems
  647.  
  648. Func VendItems($color, $tolerance)
  649.     $c = 0
  650.     While $c <= 20
  651.         Sleep(Random(20, 100))
  652.         $VendPixel = PixelSearch(1400 * $x_ratio, 580 * $y_ratio, 1914 * $x_ratio, 888 * $y_ratio, $color, $tolerance)
  653.         If Not @error Then
  654.             MouseClick("right", $VendPixel[0], $VendPixel[1], 1, 4)
  655.             $c += 1
  656.         Else
  657.             ExitLoop
  658.         EndIf
  659.     WEnd
  660. EndFunc   ;==>VendItems
  661.  
  662. Func DoUpdate()
  663.     $ini = InetGet($VersionsInfo, @ScriptDir & "\version.ini") ;download version.ini
  664.     If $ini = 0 Then ;was the download of version.ini successful?
  665.         MsgBox(16, "Fatal Error", "The server seems to be offline. No update will be done.")
  666.     Else
  667.         $newVersion = IniRead(@ScriptDir & "\version.ini", "Version", "Version", "") ;reads the new version out of version.ini
  668.         If $newVersion = $oldVersion Then ;compare old and new
  669.             ;MsgBox (0,"No update","There is no update available!")
  670.             FileDelete(@ScriptDir & "\version.ini")
  671.         Else
  672.             $msg = MsgBox(68, "Update", "A new version is available: " & $newVersion & "! Current version: " & $oldVersion & @CRLF & "Do you want to download the new version?")
  673.             If $msg = 7 Then ;No was pressed
  674.                 FileDelete(@ScriptDir & "\version.ini")
  675.             ElseIf $msg = 6 Then ;OK was pressed
  676.                 $downloadLink = IniRead(@ScriptDir & "\version.ini", "Version", "download", "NotFound")
  677.                 $dlhandle = InetGet($downloadLink, @ScriptDir & "\Update_" & $newVersion & ".zip", 1, 1)
  678.                 ProgressOn("Update", "Downloading Updates", "", -1, -1, 16) ;creates a progressbar
  679.  
  680.                 $size = InetGetSize($downloadLink, 1) ;get the size of the update
  681.                 While Not InetGetInfo($dlhandle, 2)
  682.                     $Percent = Round((InetGetInfo($dlhandle, 0) / $size) * 100)
  683.                     ProgressSet($Percent, $Percent & "%") ;update progressbar
  684.                     Sleep(1)
  685.                 WEnd
  686.                 ProgressSet(100, "Done", "Complete") ;show complete progressbar
  687.                 Sleep(500)
  688.                 ProgressOff() ;close progress window
  689.                 IniWrite("updater.ini", "version", "version", $newVersion)
  690.                 InetClose($dlhandle)
  691.                 $iniMsg = IniRead(@ScriptDir & "\version.ini", "Version", "message", "Exiting...")
  692.                 MsgBox(64, "Success", "Download Complete!" & @CRLF & "Please restart the bot by extracting the Au3 from Update_" & $newVersion & ".zip" & @CRLF & $iniMsg)
  693.                 FileDelete(@ScriptDir & "\version.ini")
  694.                 Exit
  695.             EndIf
  696.         EndIf
  697.     EndIf
  698.     WinSetTitle($title, "", $title & $ver & " - Waiting")
  699. EndFunc   ;==>DoUpdate
  700. Func ReadINI()
  701.     $pngLoc = IniRead($ini, "Custom Loot", "PNG Location", $pngLoc)
  702.     $totalItems = IniRead($ini, "Custom Loot", "Total Items", $totalItems)
  703.     $DiamondSkin = IniRead($ini, "Skills", "DiamondSkin", $DiamondSkin)
  704.     $MirrorImage = IniRead($ini, "Skills", "MirrorImage", $MirrorImage)
  705.     $Teleport = IniRead($ini, "Skills", "Teleport", $Teleport)
  706.     $Hydra = IniRead($ini, "Skills", "Hydra", $Hydra)
  707.     $movementSpeed = IniRead($ini, "Additional", "Movement Speed", $movementSpeed)
  708.     $walktime = IniRead($ini, "Additional", "Walk Time", $walktime)
  709.     $loadtime = IniRead($ini, "Additional", "Load Time", $loadtime)
  710.     $tptime = IniRead($ini, "Additional", "Teleport Time", $tptime)
  711.     $LootSets = IniRead($ini, "Looting", "Sets", $LootSets)
  712.     $LootLegendaries = IniRead($ini, "Looting", "Legendaries", $LootLegendaries)
  713.     $LootRares = IniRead($ini, "Looting", "Rares", $LootRares)
  714.     $LootMagic = IniRead($ini, "Looting", "Magic", $LootMagic)
  715.     $LootGems = IniRead($ini, "Looting", "Gems", $LootGems)
  716.     $LootTomes = IniRead($ini, "Looting", "Tomes", $LootTomes)
  717.     $LootCustom = IniRead($ini, "Looting", "Custom", $LootCustom)
  718.     $mLoot = IniRead($ini, "ManageLoot", "Every", $mLoot)
  719.     $Identify = IniRead($ini, "ManageLoot", "Identify", $Identify)
  720.     $StashLoot = IniRead($ini, "Stashing", "Loot", $StashLoot)
  721.     $StashLegendary = IniRead($ini, "Stashing", "Legendaries", $StashLegendary)
  722.     $StashRare = IniRead($ini, "Stashing", "Rares", $StashRare)
  723.     $StashMagic = IniRead($ini, "Stashing", "Magic", $StashMagic)
  724.     $StashTomes = IniRead($ini, "Stashing", "Tomes", $StashTomes)
  725.     $StashGems = IniRead($ini, "Stashing", "Gems", $StashGems)
  726.     $VendorLoot = IniRead($ini, "Vendoring", "Loot", $VendorLoot)
  727.     $VendorRare = IniRead($ini, "Vendoring", "Rares", $VendorRare)
  728.     $VendorMagic = IniRead($ini, "Vendoring", "Magic", $VendorMagic)
  729.     $vendorAll = IniRead($ini, "Vendoring", "All", $vendorAll)
  730.     $vendorRows = IniRead($ini, "Vendoring", "All-Rows", $vendorRows)
  731.     $vendorCols = IniRead($ini, "Vendoring", "All-Cols", $vendorCols)
  732.     $Timer = IniRead($ini, "Variability", "Timer", $Timer)
  733.     $mLootOff = IniRead($ini, "Variability", "Manage Off By", $mLootOff)
  734.     $attackTime = IniRead($ini, "Variability", "Attack Time", $attackTime)
  735. EndFunc   ;==>ReadINI
  736. Func CreateINI()
  737.     IniWrite($ini, "Custom Loot", "PNG Location", $pngLoc)
  738.     IniWrite($ini, "Custom Loot", "Total Items", $totalItems)
  739.     IniWrite($ini, "Skills", "DiamondSkin", $DiamondSkin)
  740.     IniWrite($ini, "Skills", "MirrorImage", $MirrorImage)
  741.     IniWrite($ini, "Skills", "Teleport", $Teleport)
  742.     IniWrite($ini, "Skills", "Hydra", $Hydra)
  743.     IniWrite($ini, "Additional", "Movement Speed", $movementSpeed)
  744.     IniWrite($ini, "Additional", "Walk Time", $walktime)
  745.     IniWrite($ini, "Additional", "Load Time", $loadtime)
  746.     IniWrite($ini, "Additional", "Teleport Time", $tptime)
  747.     IniWrite($ini, "Looting", "Sets", $LootSets)
  748.     IniWrite($ini, "Looting", "Legendaries", $LootLegendaries)
  749.     IniWrite($ini, "Looting", "Rares", $LootRares)
  750.     IniWrite($ini, "Looting", "Magic", $LootMagic)
  751.     IniWrite($ini, "Looting", "Gems", $LootGems)
  752.     IniWrite($ini, "Looting", "Tomes", $LootTomes)
  753.     IniWrite($ini, "Looting", "Custom", $LootCustom)
  754.     IniWrite($ini, "ManageLoot", "Every", $mLoot)
  755.     IniWrite($ini, "ManageLoot", "Identify", $Identify)
  756.     IniWrite($ini, "Stashing", "Loot", $StashLoot)
  757.     IniWrite($ini, "Stashing", "Legendaries", $StashLegendary)
  758.     IniWrite($ini, "Stashing", "Rares", $StashRare)
  759.     IniWrite($ini, "Stashing", "Magic", $StashMagic)
  760.     IniWrite($ini, "Stashing", "Tomes", $StashTomes)
  761.     IniWrite($ini, "Stashing", "Gems", $StashGems)
  762.     IniWrite($ini, "Vendoring", "Loot", $VendorLoot)
  763.     IniWrite($ini, "Vendoring", "Rares", $VendorRare)
  764.     IniWrite($ini, "Vendoring", "Magic", $VendorMagic)
  765.     IniWrite($ini, "Vendoring", "All", $vendorAll)
  766.     IniWrite($ini, "Vendoring", "All-Rows", $vendorRows)
  767.     IniWrite($ini, "Vendoring", "All-Cols", $vendorCols)
  768.     IniWrite($ini, "Variability", "Timer", $Timer)
  769.     IniWrite($ini, "Variability", "Manage Off By", $mLootOff)
  770.     IniWrite($ini, "Variability", "Attack Time", $attackTime)
  771. EndFunc   ;==>CreateINI
  772.  
  773. Func _ImageSearchArea($findImage, $resultPosition, $x1, $y1, $right, $bottom, ByRef $x, ByRef $y, $tolerance)
  774.     If $tolerance > 0 Then $findImage = "*" & $tolerance & " " & $findImage
  775.     $findImage = "*TRANSBLACK " & $findImage
  776.     If @AutoItX64 Then
  777.         $result = DllCall("ImageSearchDLL_x64.dll", "str", "ImageSearch", "int", $x1, "int", $y1, "int", $right, "int", $bottom, "str", $findImage)
  778.     Else
  779.         $result = DllCall("ImageSearchDLL.dll", "str", "ImageSearch", "int", $x1, "int", $y1, "int", $right, "int", $bottom, "str", $findImage)
  780.     EndIf
  781.     If $result = "0" Then
  782.         Return 0
  783.     EndIf
  784.  
  785.     ; Otherwise get the x,y location of the match and the size of the image to
  786.     ; compute the centre of search
  787.     $array = StringSplit($result[0], "|")
  788.     If (UBound($array) >= 4) Then
  789.         $x = Int(Number($array[2]))
  790.         $y = Int(Number($array[3]))
  791.         If $resultPosition = 1 Then
  792.             $x = $x + Int(Number($array[4]) / 2)
  793.             $y = $y + Int(Number($array[5]) / 2)
  794.         EndIf
  795.         Return 1
  796.     EndIf
  797. EndFunc   ;==>_ImageSearchArea
  798.  
  799. ;Gold Calculations
  800. Func GoldPerHour()
  801. Send("i")
  802. Sleep(800)
  803. $CurrentGoldCaptured = _TesseractScreenCapture(0, "", 1,  2,1454,508,1920-1571,1080-525, 0)
  804. Send("i")
  805.  
  806. $CurrentGoldInteger = ""
  807. For $i = 1 to stringlen($CurrentGoldCaptured)
  808. $chr = asc(StringMid($CurrentGoldCaptured, $i, 1))
  809. if $chr >= 48 And $chr <= 57 Then $CurrentGoldInteger = $CurrentGoldInteger & chr($chr)
  810. Next
  811.  
  812. $trt = TimerDiff($t)
  813. $SecondsRan = $trt / 1000
  814.  
  815. If $StartingGold <= 0 Then $StartingGold = $CurrentGoldInteger
  816. If $StartingGold > 0 Then $AccumulatedGold = $CurrentGoldInteger - $StartingGold
  817. $GPH = $AccumulatedGold / $SecondsRan * 60 * 60
  818.  
  819. GUICtrlSetData($lblGold, Round($GPH,0) & " Gold Per Hour - Accumulated Gold: " & $AccumulatedGold)
  820.  
  821. EndFunc ;==>GoldPerHour
  822.  
  823. Func LeaveGame()
  824.     Call("RandSleep")
  825.     Call("GoldPerHour")
  826.     GUICtrlSetData($lblStatus, "Status: Leaving Game")
  827.     Send("{Escape}")
  828.     Sleep(200)
  829.     RandClick("left", Round(956 * $x_ratio), Round(579 * $y_ratio), 120, 20) ;Random Click on the leave button
  830.     Call("CalcTime")
  831.     Sleep($loadtime)
  832. EndFunc   ;==>LeaveGame
  833.  
  834. Func TownPortal()
  835.     GUICtrlSetData($lblStatus, "Status: Returning to Town")
  836.     Send("t")
  837.     Sleep(Random($tptime, $tptime + 500))
  838. EndFunc   ;==>TownPortal
  839.  
  840. Func Moving($time)
  841.     Sleep($time / $movementSpeed)
  842. EndFunc   ;==>Moving
  843.  
  844. Func RandClick($clickType, $xPos, $yPos, $xOff = 10, $yOff = 10, $clicks = 1, $speed = 4)
  845.     If $xOff < 1 Then $xOff = 1
  846.     If $yOff < 1 Then $yOff = 1
  847.     $randX = Round(Random($xPos - ($xOff * $x_ratio), $xPos + ($xOff * $x_ratio)))
  848.     $randY = Round(Random($yPos - ($yOff * $y_ratio), $yPos + ($yOff * $y_ratio)))
  849.     MouseClick($clickType, $randX, $randY, $clicks, $speed)
  850. EndFunc   ;==>RandClick
  851.  
  852. Func RandMove($xPos, $yPos, $xOff = 10, $yOff = 10, $speed = 1)
  853.     $randX = Round(Random($xPos - ($xOff * $x_ratio), $xPos + ($xOff * $x_ratio)))
  854.     $randY = Round(Random($yPos - ($yOff * $y_ratio), $yPos + ($yOff * $y_ratio)))
  855.     MouseMove($randX, $randY, $speed)
  856. EndFunc   ;==>RandMove
  857.  
  858. Func RandSleep($min = 5, $max = 45, $chance = 3)
  859.     $randNum = Round(Random(1, 100))
  860.     If $Timer == True And $randNum <= $chance Then
  861.         $sleepTime = Random($min * 1000, $max * 1000)
  862.         GUICtrlSetData($lblStatus, "Status: Random Sleep - " & Round($sleepTime / 1000) & " secs")
  863.  
  864.         For $c = 0 To 10
  865.             Sleep($sleepTime / 10)
  866.         Next
  867.     EndIf
  868. EndFunc   ;==>RandSleep
  869.  
  870. ;Hotkey Functions
  871.  
  872. Func Begin()
  873.     $Go = Not $Go
  874.     If Not $Go Then WinSetTitle($title, "", $title & $ver & " - Halted")
  875. EndFunc   ;==>Begin
  876.  
  877. Func TogglePause()
  878.     $Paused = Not $Paused
  879.     While $Paused
  880.         Sleep(100)
  881.         WinSetTitle($title, "", $title & $ver & " - Paused")
  882.         ToolTip('[PAUSED] - Deaths: ' & $deathCount & ' | Cellars: ' & $cellarCount, 0, 0)
  883.     WEnd
  884.     WinSetTitle($title, "", $title & $ver & " - Running")
  885.     ToolTip("")
  886. EndFunc   ;==>TogglePause
  887.  
  888. Func ShowLoot()
  889.     GUICtrlSetData($lblGear, "Legendary: " & $LegendaryCount & " - Set: " & $SetCount & " - Rare: " & $RareCount)
  890.     GUICtrlSetData($lblItems, "Magic: " & $MagicCount & " - Gems: " & $GemCount & " - Tomes: " & $TomeCount)
  891. EndFunc   ;==>ShowLoot
  892.  
  893.  
  894. Func Stop() ;to allow the script to stop
  895.     Exit
  896. EndFunc   ;==>Stop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement