Advertisement
Guest User

Untitled

a guest
Jul 15th, 2012
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 65.49 KB | None | 0 0
  1. ;=========== DO NOT TOUCH ===========;
  2. #RequireAdmin
  3. #include <GUIConstantsEx.au3>
  4. #include <StaticConstants.au3>
  5. #include <WindowsConstants.au3>
  6. #include <ScreenCapture.au3>
  7. #include <GoldRead.au3>
  8. Opt('MouseCoordMode', 2)
  9. Opt('PixelCoordMode', 2)
  10.  
  11.  
  12. ;GUI Predeclare to prevent firing the Case statements
  13. Global $lbllink,$mFile,$mOptions,$lblRun,$lblLocation,$lblStatus,$lblLast,$lblRuntime,$lblGold,$lblCellars,$lblStats,$mAutoUpdate,$SettingsGUI,$Settings,$tsSettings,$grpgameAutoStart,$lblgameDiabloIIILoc,$txtgameDiabloIIILoc,$lblgamePassword,$txtgamePassword,$cbgameAutoStart,$btngameDiabloIIILoc,$tsLooting,$grpLoot,$etlootCustom,$cblootSet,$cblootLegendary,$cblootRare,$cblootMagic,$cblootCustom,$tsStash,$grpStashing,$cbstashSet,$cbStashLegendary,$cbstashRare,$cbstashMagic,$cbStashTomes,$cbStashGems, $tsVendoring,$grpVendoring,$cbvendorRare,$cbvendorMagic,$cbvendorLegendary,$cbvendorSet,$cmbvendorRows,$lblVendorRow,$cbvendorAll, $lblVendorCol,$cmbVendorColumns,$tsSkills,$grpSkills,$txtSkill1,$txtSkill2,$txtSkill3,$txtSkill4,$lblskill1,$lblSkill2,$lblSkill3, $lblSkill4,$cbCellarDetectScreenShots, $btnSave,$grpAdd,$txtAddMove, $txtAddDPS, $lblAddDPS,$cbAddGoldOnly, $lbltimingGameLoad, $lbltimingCellarClick, $lbltimingWormHole, $lbltimingMiddleDoor, $lbltimingAbort, $lbltimingTP, $lbltimingLoot, $lbltimingLootRun, $txttimingGameLoad, $txttimingWormHole, $txttimingTP, $txttimingCellarClick, $txttimingMiddleDoor, $txttimingLootRun, $txttimingLoot, $txttimingAbort,$txtRareStashilvl, $txtRareSalvageilvl, $txtRareVendorilvl, $txtMagicStashilvl, $txtMagicSalvageilvl, $txtMagicVendorilvl,$lblitems,$lblgear,$lblStartingG,$CurrentItems
  14.  
  15. Global $size = WinGetClientSize("[CLASS:D3 Main Window Class]"), $Kill = ProcessList("AutoIt3_x64.exe"),$mLootIn = 0, $x_ratio, $y_ratio, $AddDPS = 0,$attackTime = 0, $hFont = 0, $title, $Paused, $Go = 0, $i = 0, $gX = 0, $gY = 0, $GemCount = 0, $LegendaryCount = 0, $SetCount = 0, $RareCount = 0, $deathCount = 0, $MagicCount = 0, $repairCount = 0, $closedcellarCount = 0, $cellarCount = 0, $countMissedCellar = 0, $MissedCellarCountPercent = 0, $t = TimerInit(), $rt = 0, $run = 0, $yellow = 0xFFF000, $red = 0xD90000, $StartingGold = 0,$AccumulatedGold = 0,$GPH = 0, $OpenCellarAvg = 0, $OpenCellarSec = 0,$ClosedCellarAvg, $ClosedCellarSec = 0,$CellCoord = 0, $c = 0, $RunsPerHour = 0,$closedCellarCountPercent = 0, $repairCountPercent = 0, $deathsCountPercent = 0, $cellarCountPercent = 0, $settingsINI = "Settings.ini", $StashSelectedTab = 0,$Items = 0
  16. Global $gems[4] = ["Em1.png", "Ru1.png", "To1.png", "Am1.png"]
  17. Global $AnalyzedLoot[10][6]
  18. Global $StashTabs[3][2] = [[281,127], [281,199], [285,271]]
  19.  
  20.  
  21. For $i = 1 To $Kill[0][0]
  22. $CurrentPID = @AutoItPID
  23. If $CurrentPID < $Kill[$i][1] or $CurrentPID > $Kill[$i][1] Then
  24. ProcessClose($Kill[$i][1])
  25. EndIf
  26. Next
  27.  
  28. DirCreate("shots")
  29. DirCreate("shots\Start")
  30. DirCreate("shots\Cellar")
  31.  
  32. $pngLoc = @ScriptDir & "\pics\" & @DesktopWidth & "x" & @DesktopHeight& "\"
  33.  
  34. If Not FileExists($pngLoc & "MainMenu.png") Then
  35. MsgBox(16, "Fatal Error", "FATAL ERROR: Cannot find: " & $pngLoc & "MainMenu.png" & @CRLF & "Make sure your desktop resolution is 800x600")
  36. Exit
  37. EndIf
  38.  
  39. If @OSArch = "X64" Then DllCall("kernel32.dll", "int", "Wow64DisableWow64FsRedirection", "int", 1)
  40. If @OSArch = "X64" And Not @AutoItX64 Then MsgBox(16, "ERROR", "Why aren't you running the 64-bit AutoIt??? Expect bugs!")
  41.  
  42. ;GUI Title Bar
  43. For $i = 0 To Random(0, 7, 1)
  44. $title &= Chr(Random(97, 122, 1))
  45. Next
  46. For $i = 0 To Random(5, 10, 1)
  47. $title &= Chr(Random(65, 90, 1))
  48. Next
  49. $title &= "Nikolaos"
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72. ;==================================================
  73.  
  74. $totalItems = 1 ;Number of items in the pick array
  75. ;$currentArrayItem = 0x
  76. Global $pick[$totalItems] ;DONT CHANGE THIS
  77.  
  78. ;Cellar Detection
  79. Global $cellarCoordx[6] = [166,137,240,245,121,174]
  80. Global $cellarCoordy[6]= [146,145,156,144,135,129]
  81. $cellarCheckSleep = 300
  82. $Screenshot = 1
  83.  
  84. ;AutoStart
  85. $gameDiabloIIILoc = "C:\" ;Location of Diablo 3 executable
  86. $gameAutoStart = 0 ; Set this to 1 to start game from desktop or reco from closed game
  87. $gameStartTime = 9000 ;Change depending on computer/internet speed
  88. $gamePassword = "Your Password" ;Symbols go in brackets "Password1{!}"
  89. $gameExecutable = "Diablo III.exe"
  90.  
  91. ;Change to match your abilities (1-4 by default)z
  92. $Skill1 = "1"
  93. $Skill2 = "2"
  94. $Skill3 = "3"
  95. $Skill4 = "4"
  96. ;==================================================
  97.  
  98. ;Looting
  99. $LootSet = 1 ;1 if you want to pick up Set
  100. $LootLegendary = 1;1 if you want to pick up Legendaries
  101. $LootRare = 1 ;1 if you want to pick up Rares
  102. $LootMagic = 1 ;1 if you want to pick up Magic
  103. $LootCustom = 0 ;1 if you want to pick up Custom Items
  104. $LootGoldOnly = 0 ; 1 if you want to not loot anything but gold
  105. ;==================================================
  106.  
  107. ;Stashing
  108. $StashLegendary = 1 ;1 if you want to store Legendary items in the stash
  109. $StashSet = 1 ;1 if you want to store Set items in the stash
  110. $StashRare = 1 ;1 if you want to store Rare items in the stash
  111. $StashMagic = 0 ;1 if you want to store Magic items in the stash
  112. $StashTomes = 1 ;1 if you want to store Tomes items in the stash
  113. $StashGems = 1 ;1 if you want to store Gems items in the stash
  114. $StashLoot = $StashMagic + $StashRare + $StashLegendary + $Stashset + $StashGems + $StashTomes
  115. ;==================================================
  116.  
  117. ;Vendoring
  118. $VendorSet = 0
  119. $VendorLegendary = 0
  120. $VendorRare = 0 ;1 if you want to vendor Rares
  121. $VendorMagic = 1 ;1 if you want to vendor Magic
  122. $vendorRows = 6 ;# of rows to vendor, starting from the top (default = 5: bottom row is safe)
  123. $vendorColumns = 10 ;# of columns to vendor, starting from left
  124. $VendorAll = 1 ;Vendors everything but identified items
  125. $VendorLoot = $VendorMagic + $VendorRare + $VendorLegendary + $VendorSet + $VendorAll
  126. ;==================================================
  127.  
  128. ;Additional
  129. $AddDPS = 0 ;Time (in s) the script will shoot sarkoth with the right button
  130.  
  131. ;==================================================
  132.  
  133. ;Timing
  134.  
  135.  
  136.  
  137. $timingCellarClick = 750 ;time (in ms) it takes to run into the cellar
  138.  
  139.  
  140.  
  141.  
  142. $timingAbort = 300 ;time (in ms) to wait to cast abort skills, decrease if you have high attack speed
  143. $timingGameLoad = 5000 ;Time (in ms) the script waits for the game to load before it starts pathfinding. Slow this down for slower hard drives
  144. $timingTP = 6000;Time (in ms) the script waits for teleport before exiting the game
  145. $timingLoot = 800;Time (in ms) the script waits before each loot attempt
  146. $timingLootRun = 600;Time (in ms) the script runs towards sarkoth dead body
  147. ;==================================================
  148.  
  149.  
  150. ;Anal Loot!!
  151. $AnalLoot = 1
  152. $RareSalvageiLvl = 61 ;and below to Salvage #
  153. $MagicSalvageiLvl = 62 ;and below to Salvage #
  154. $RareStashiLvl = 62 ;and above to Stash #
  155. $MagicStashiLvl = 63 ;and above to Stash #
  156. $RareVendoriLvl = 60 ;and below to Vendor #
  157. $MagicVendoriLvl = 60 ;and below to Vendor #
  158. $AnalSpeed = 50
  159. ;==================================================
  160. ;New Loot Coords
  161. $slot1x = 530 ; first slot x coordinate
  162. $slot1y = 338 ;first slot y coordinate
  163.  
  164.  
  165. $offset = 27 ; offset for each slot
  166.  
  167.  
  168. $slotLineX = 520 ;First slot line x coordinate
  169. $slotLineY = 324 ;First slot line y coordinate
  170. $slotLineOffSet = 26.75 ;offset for each line
  171.  
  172. $CellMiddleTopX = 530
  173. $CellMiddleTopY = 339
  174. $CellMiddleBotX = 531
  175. $CellMiddleBotY =341
  176. $CellMiddleO = 26.75
  177. ;==================================================
  178.  
  179. ;====DONT CHANGE=====;
  180. $AnalSalvage = 0 ;determines whether not theres items to salvage
  181. $AnalRareIdentify = 0 ;determines whether not theres a rare to identify, don't change
  182. $AnalVendor = 0
  183. $slotError = 0;Used if line doesn't exisit
  184. ;==================================================
  185.  
  186.  
  187. HotKeySet("=", "Begin") ;script toggled on/off by pressing =
  188. HotKeySet("{-}", "TogglePause") ;script toggle pause by pressing Pause/Break key
  189. HotKeySet("x", "Stop") ;script stopped by pressing x
  190.  
  191. Call("ReadINI")
  192.  
  193. If $AddDPS = 0 then
  194. MsgBox(16, "First Run", "Edit your settings.")
  195. EndIf
  196.  
  197.  
  198.  
  199.  
  200. If $gameAutoStart = 1 Then
  201. Call("GameAutostart")
  202. Else
  203. $size = WinGetClientSize("[CLASS:D3 Main Window Class]")
  204. If $size = 0 Then
  205. MsgBox(16, "Error", "Diablo III is not running, cannot grab resolution!" & @CRLF & "Exiting...")
  206. Exit
  207. EndIf
  208. $x_ratio = $size[0] / 800
  209. $y_ratio = $size[1] / 600
  210. EndIf
  211.  
  212. MainGUI()
  213. Func MainGUI()
  214.  
  215. $frmBot = GUICreate($title & " -waiting to start", 280, 157, Round(10 * $x_ratio), Round(375 * $y_ratio), -1, BitOR($WS_EX_TOPMOST, $WS_EX_TOOLWINDOW), 0)
  216. GUISetBkColor(0xC0C0C0)
  217. $mFile = GUICtrlCreateMenu("File")
  218. $mStart = GUICtrlCreateMenuItem("Start", $mFile)
  219. $mOptions = GUICtrlCreateMenu("Options")
  220. $mSettings = GUICtrlCreateMenuItem("Settings", $mOptions)
  221.  
  222.  
  223.  
  224.  
  225.  
  226.  
  227.  
  228.  
  229. $lblRun = GUICtrlCreateLabel("Run Number: 0 - Runs Per Hour: 0", 2, 0, 260, 24)
  230. GUICtrlSetFont(-1, 10, 600, 0, "Segoe UI")
  231. GUICtrlSetColor(-1, 0xFF0000)
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241. $lblStatus = GUICtrlCreateLabel("Status: ", 2, 20, 260, 17)
  242. $lblRuntime = GUICtrlCreateLabel("Total Runtime: 0 hours, 0 minutes", 2, 35, 260, 17)
  243. $lblLast = GUICtrlCreateLabel("Open Cellar Avg: 0s - Closed Cellar Avg: 0s", 2, 50, 260, 17)
  244. $lblCellars = GUICtrlCreateLabel("Cellars Open: 0 (0%) - Cellars Closed: 0 (0%)", 2, 65, 260, 17)
  245. $lblGold = GUICtrlCreateLabel("0 Per Hour - Accumulated Gold: 0", 2, 80, 260, 17)
  246. $lblStartingG=GUICtrlCreateLabel("Staring Gold: 0", 2, 95, 260, 17)
  247. $lblGear= GUICtrlCreateLabel("Legendary: 0 Set: 0 Rare: 0 Magics: 0",2, 110,260,17)
  248.  
  249. GUISetState()
  250.  
  251. While 1
  252.  
  253. $aMsg = GUIGetMsg(1) ; Use advanced parameter to get array
  254. Switch $aMsg[1] ; check which GUI sent the message
  255. Case $frmBot
  256. Switch $aMsg[0]
  257. Case $mStart
  258. Call("Begin")
  259. Case $mSettings
  260. GUICtrlSetState($mSettings, $GUI_DISABLE)
  261. SettingsGUI()
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270.  
  271.  
  272.  
  273.  
  274.  
  275.  
  276.  
  277.  
  278. EndSwitch
  279. Case $SettingsGUI
  280. Switch $aMsg[0] ; Now check for the messages for $hGUI2
  281. Case $cbStashSet
  282. If IsChecked($cbStashSet) Then GUICtrlSetState($cbvendorSet,$GUI_UNCHECKED)
  283. Case $cbStashLegendary
  284. If IsChecked($cbStashLegendary) Then GUICtrlSetState($cbvendorLegendary,$GUI_UNCHECKED)
  285. Case $cbStashRare
  286. If IsChecked($cbStashRare) Then GUICtrlSetState($cbvendorRare,$GUI_UNCHECKED)
  287. Case $cbStashMagic
  288. If IsChecked($cbStashMagic) Then GUICtrlSetState($cbvendorMagic,$GUI_UNCHECKED)
  289. Case $cbvendorSet
  290. If IsChecked($cbvendorSet) Then GUICtrlSetState($cbStashSet,$GUI_UNCHECKED)
  291. Case $cbvendorLegendary
  292. If IsChecked($cbvendorLegendary) Then GUICtrlSetState($cbStashLegendary,$GUI_UNCHECKED)
  293. Case $cbVendorRare
  294. If IsChecked($cbvendorRare) Then GUICtrlSetState($cbStashRare,$GUI_UNCHECKED)
  295. Case $cbVendorMagic
  296. If IsChecked($cbvendorMagic) Then GUICtrlSetState($cbStashMagic,$GUI_UNCHECKED)
  297. Case $cbgameAutoStart
  298. If IsChecked($cbgameAutoStart) And FileExists(GUICtrlRead($txtgameDiabloIIILoc) & "Diablo III.exe") = 0 Then
  299. GUICtrlSetState($cbgameAutoStart,$GUI_UNCHECKED)
  300. EndIF
  301. Case $txtSkill1
  302. SkillAlphaNum($txtSkill1,$Skill1,0)
  303. Case $txtSkill2
  304. SkillAlphaNum($txtSkill2,$Skill2,0)
  305. Case $txtSkill3
  306. SkillAlphaNum($txtSkill3,$Skill3,0)
  307. Case $txtSkill4
  308. SkillAlphaNum($txtSkill4,$Skill4,0)
  309.  
  310.  
  311. Case $btngameDiabloIIILoc
  312. $GUIfileSelect = FileSelectFolder ("Diablo III Executable Location","")
  313. If Not @Error And FileExists($GUIfileSelect & "\Diablo III.exe") = 0 Then
  314. $GUIwrongLocation = MsgBox ( "6", "Wrong Location", "Select the folder with the Diablo III.exe!")
  315. If $GUIwrongLocation = 2 Or 11 Then
  316. GUISetCheck(0,$cbgameAutoStart)
  317. GUIUpdate($txtgameDiabloIIILoc,$GUIfileSelect)
  318. EndIf
  319. ElseIf FileExists($GUIfileSelect & "\Diablo III.exe") = 1 Then
  320. GUIUpdate($txtgameDiabloIIILoc,$GUIfileSelect & "\")
  321. GUISetCheck(1,$cbgameAutoStart)
  322. Endif
  323.  
  324.  
  325.  
  326.  
  327.  
  328.  
  329.  
  330. Case $btnSave
  331. Call("SaveINI")
  332. GUIDelete($SettingsGUI)
  333. GUICtrlSetState($mSettings, $GUI_ENABLE)
  334. EndSwitch
  335. EndSwitch
  336. Call("RestartRun")
  337. WEnd
  338.  
  339. EndFunc ;==>MainGUI
  340.  
  341. Func SettingsGUI()
  342.  
  343. $SettingsGUI = GUICreate($title , 443, 195, Round(10 * $x_ratio), Round(375 * $y_ratio), -1,$WS_EX_TOPMOST, 0)
  344. GUISetIcon(@ScriptDir & "\Setting-icon.ico")
  345. $Settings = GUICtrlCreateTab(0, 8, 441, 185)
  346. GUICtrlSetResizing($Settings, $GUI_DOCKWIDTH+$GUI_DOCKHEIGHT)
  347. $tsSettings = GUICtrlCreateTabItem("Auto Start")
  348. $grpgameAutoStart = GUICtrlCreateGroup("", 4, 33, 273, 121)
  349. $lblgameDiabloIIILoc = GUICtrlCreateLabel("Diablo III Location:", 12, 83, 93, 17)
  350. $txtgameDiabloIIILoc = GUICtrlCreateInput($gameDiabloIIILoc, 116, 81, 105, 21)
  351. $lblgamePassword = GUICtrlCreateLabel("Password:", 12, 116, 53, 17)
  352. $txtgamePassword = GUICtrlCreateInput($gamePassword, 116, 113, 105, 21)
  353. $cbgameAutoStart = GUICtrlCreateCheckbox("Auto Start", 12, 49, 73, 17)
  354. $btngameDiabloIIILoc = GUICtrlCreateButton("Browse", 224, 79, 49, 23, 0)
  355. GUICtrlSetState($txtgameDiabloIIILoc, $GUI_DISABLE)
  356.  
  357. GUICtrlCreateGroup("", -99, -99, 1, 1)
  358. $tsLooting = GUICtrlCreateTabItem("Looting")
  359. $grpLoot = GUICtrlCreateGroup("", 4, 33, 273, 121)
  360. $etlootCustom = GUICtrlCreateEdit("",148, 73, 121, 65)
  361. $cblootSet = GUICtrlCreateCheckbox("Set Items", 12, 49, 81, 17)
  362. $cblootLegendary = GUICtrlCreateCheckbox("Legendary Items", 12, 73, 113, 17)
  363. $cblootRare = GUICtrlCreateCheckbox("Rare Items", 12, 97, 81, 17)
  364. $cblootMagic = GUICtrlCreateCheckbox("Magic Items", 12, 121, 81, 17)
  365. $cblootCustom = GUICtrlCreateCheckbox("Custom Loot", 149, 49, 81, 17)
  366.  
  367. GUICtrlCreateGroup("", -99, -99, 1, 1)
  368. $tsstash = GUICtrlCreateTabItem("Stashing")
  369. $grpStashing = GUICtrlCreateGroup("", 4, 33, 273, 121)
  370. ;~ $cbstashSet = GUICtrlCreateCheckbox("Set Items", 12, 49, 97, 17)
  371. ;~ $cbstashLegendary = GUICtrlCreateCheckbox("Legendary Items", 12, 73, 97, 17)
  372. ;~ $cbstashRare = GUICtrlCreateCheckbox("Rare Items", 12, 97, 97, 17)
  373. ;~ $cbstashMagic = GUICtrlCreateCheckbox("Magic Items", 12, 121, 96, 17)
  374. $cbStashGems = GUICtrlCreateCheckbox("Gems", 12, 49, 97, 17)
  375. $cbStashTomes = GUICtrlCreateCheckbox("Tomes", 12, 73, 97, 17)
  376.  
  377.  
  378. GUICtrlCreateGroup("", -99, -99, 1, 1)
  379. $tsAnalLoot = GUICtrlCreateTabItem("Anal Loot")
  380. $grpAnalLoot = GUICtrlCreateGroup("", 4, 33, 273, 121)
  381. $lblRareStashiLvl = GUICtrlCreateLabel("Rare Stash:", 12, 52, 60, 17)
  382. $lblRareSalvageiLvl = GUICtrlCreateLabel("Rare Salvage:", 12, 76, 72, 17)
  383. $lblRareVendoriLvl = GUICtrlCreateLabel("Rare Vendor:", 12, 100, 67, 17)
  384. $lblMagicStashiLvl = GUICtrlCreateLabel("Magic Stash:", 136, 52, 66, 17)
  385. $lblMagicSalvageiLvl = GUICtrlCreateLabel("Magic Salvage:", 136, 76, 78, 17)
  386. $lblMagicVendoriLvl = GUICtrlCreateLabel("Magic Vendor:", 136, 100, 73, 17)
  387. $txtRareStashiLvl = GUICtrlCreateInput($RareStashiLvl, 88, 49, 33, 21)
  388. $txtRareVendoriLvl = GUICtrlCreateInput($RareVendoriLvl, 88, 97, 33, 21)
  389. $txtRareSalvageiLvl = GUICtrlCreateInput($RareSalvageiLvl, 88, 73, 33, 21)
  390. $txtMagicStashiLvl = GUICtrlCreateInput($MagicStashiLvl, 216, 49, 33, 21)
  391. $txtMagicSalvageiLvl = GUICtrlCreateInput($MagicSalvageiLvl, 216, 73, 33, 21)
  392. $txtMagicVendoriLvl = GUICtrlCreateInput($MagicVendoriLvl, 216, 97, 33, 21)
  393.  
  394. GUICtrlCreateGroup("", -99, -99, 1, 1)
  395. $tsSkills = GUICtrlCreateTabItem("Skills")
  396. $grpSkills = GUICtrlCreateGroup("", 4, 33, 273, 121)
  397. $txtSkill1 = GUICtrlCreateInput($Skill1, 184, 49, 41, 21)
  398. $txtSkill2 = GUICtrlCreateInput($Skill2, 184, 73, 41, 21)
  399. $txtSkill3 = GUICtrlCreateInput($Skill3, 184, 97, 41, 21)
  400. $txtSkill4 = GUICtrlCreateInput($Skill4, 184, 121, 41, 21)
  401. $lblskill1 = GUICtrlCreateLabel("Vault(Rattling Roll):", 12, 52, 139, 17)
  402. $lblSkill2 = GUICtrlCreateLabel("Preperation(Battlescars):", 12, 76, 124, 17)
  403. $lblSkill3 = GUICtrlCreateLabel("Companion(Ferret):", 12, 100, 103, 17)
  404. $lblSkill4 = GUICtrlCreateLabel("Spike Trap(Scatter):", 12, 124, 160, 17)
  405.  
  406.  
  407. GUICtrlCreateGroup("", -99, -99, 1, 1)
  408. $tsTiming = GUICtrlCreateTabItem("Timing")
  409. $grpTiming = GUICtrlCreateGroup("", 4, 33, 273, 121)
  410. $lbltimingGameLoad = GUICtrlCreateLabel("Game Load:", 12, 52, 62, 17)
  411. $lbltimingTP = GUICtrlCreateLabel("Town Portal:", 12, 76, 64, 17)
  412.  
  413.  
  414.  
  415. $lbltimingCellarClick = GUICtrlCreateLabel("Cellar Click:", 12, 124, 59, 17)
  416. $lbltimingAbort = GUICtrlCreateLabel("Abort:", 139, 52, 32, 17)
  417. $lbltimingMiddleDoor = GUICtrlCreateLabel("Middle Door:", 139, 76, 64, 17)
  418. $lbltimingLootRun = GUICtrlCreateLabel("Loot Run:", 139, 100, 51, 17)
  419. $lbltimingLoot = GUICtrlCreateLabel("Loot:", 139, 124, 28, 17)
  420. $txttimingGameLoad = GUICtrlCreateInput("2000", 80, 49, 41, 21)
  421. $txttimingTP = GUICtrlCreateInput("5000", 80, 73, 41, 21)
  422.  
  423.  
  424.  
  425. $txttimingCellarClick = GUICtrlCreateInput("750", 80, 121, 41, 21)
  426. $txttimingAbort = GUICtrlCreateInput("255", 206, 49, 41, 21)
  427.  
  428.  
  429.  
  430.  
  431. $txttimingLootRun = GUICtrlCreateInput("300", 206, 97, 41, 21)
  432. $txttimingLoot = GUICtrlCreateInput("800", 206, 121, 41, 21)
  433.  
  434.  
  435. GUICtrlCreateGroup("", -99, -99, 1, 1)
  436. $tsCellarDetect = GUICtrlCreateTabItem("Cellar Detect")
  437. $grpCellarDetect = GUICtrlCreateGroup("", 4, 33, 273, 121)
  438. $lblCellarDetectX = GUICtrlCreateLabel("X Coordinates:", 12, 52, 73, 17)
  439. $lblCellarDetectY = GUICtrlCreateLabel("Y Coordinates:", 12, 76, 73, 17)
  440. $lblCellarDetectTime = GUICtrlCreateLabel("Check Time:", 12, 100, 64, 17)
  441. $cbCellarDetectScreenShots = GUICtrlCreateCheckbox("Screen Shots", 12, 124, 97, 17)
  442. $txtCellarDetectXCoords = GUICtrlCreateInput("166,137,240,245,121", 96, 49, 169, 21)
  443. GUICtrlSetState($txtCellarDetectXCoords, $GUI_DISABLE)
  444. $txtCellarDetectYCoords = GUICtrlCreateInput("146,145,156,144,135", 96, 73, 169, 21)
  445. GUICtrlSetState($txtCellarDetectYCoords, $GUI_DISABLE)
  446. $txtCellarDetectTime = GUICtrlCreateInput("155", 96, 97, 41, 21)
  447. GUICtrlCreateGroup("", -99, -99, 1, 1)
  448.  
  449.  
  450.  
  451. GUICtrlCreateTabItem("")
  452. $btnSave = GUICtrlCreateButton("Save", 352, 160, 75, 25, 0)
  453. $grpAdd = GUICtrlCreateGroup("Additional", 280, 33, 153, 121)
  454. $cbAddGoldOnly = GUICtrlCreateCheckbox("Gold Only", 288, 97, 97, 17)
  455. $txtAddDPS = GUICtrlCreateInput($AddDPS, 376, 49, 49, 21)
  456. $lblAddDPS = GUICtrlCreateLabel("DPS:", 288, 52, 29, 17)
  457.  
  458.  
  459.  
  460.  
  461.  
  462. GUICtrlCreateGroup("", -99, -99, 1, 1)
  463. GUISetState()
  464.  
  465.  
  466.  
  467.  
  468.  
  469.  
  470.  
  471.  
  472.  
  473.  
  474.  
  475. getCustomKeys()
  476. UpdateGUI()
  477. EndFunc ;===SettingsGUI
  478.  
  479. Func ReadINI()
  480. getCustomkeys()
  481. $gameAutoStart = IniRead($settingsINI, "Auto Start", "Auto Start", $gameAutoStart)
  482. $gameDiabloIIILoc = IniRead($settingsINI, "Auto Start", "Game Location", $gameDiabloIIILoc)
  483. $gamePassword = IniRead($settingsINI, "Auto Start", "Password", $gamePassword)
  484. $Skill1 = IniRead($settingsINI, "Skills", "Skill1", $Skill1)
  485. $Skill2 = IniRead($settingsINI, "Skills", "Skill2", $Skill2)
  486. $Skill3 = IniRead($settingsINI, "Skills", "Skill3", $Skill3)
  487. $Skill4 = IniRead($settingsINI, "Skills", "Skill4", $Skill4)
  488.  
  489.  
  490.  
  491. $AddDPS = IniRead($settingsINI, "Additional", "DPS", $AddDPS )
  492. $LootSet = IniRead($settingsINI, "Looting", "Set", $LootSet)
  493. $LootLegendary = IniRead($settingsINI, "Looting", "Legendary", $LootLegendary)
  494. $LootRare = IniRead($settingsINI, "Looting", "Rare", $LootRare)
  495. $LootMagic = IniRead($settingsINI, "Looting", "Magic", $LootMagic)
  496. $LootCustom = IniRead($settingsINI, "Looting", "Custom", $LootCustom)
  497. $LootGoldOnly = IniRead($settingsINI, "Looting", "Gold Only", $LootGoldOnly)
  498. $StashSet = IniRead($settingsINI, "Stashing", "Set", $StashSet)
  499. $StashLegendary = IniRead($settingsINI, "Stashing", "Legendary", $StashLegendary)
  500. $StashRare = IniRead($settingsINI, "Stashing", "Rare", $StashRare)
  501. $StashMagic = IniRead($settingsINI, "Stashing", "Magic", $StashMagic)
  502. $StashGems = IniRead($settingsINI, "Stashing", "Gems", $StashGems)
  503. $StashTomes = IniRead($settingsINI, "Stashing", "Tomes", $StashTomes)
  504. $VendorSet = IniRead($settingsINI, "Vendoring", "Set", $VendorSet)
  505. $VendorLegendary = IniRead($settingsINI, "Vendoring", "Legendary", $VendorLegendary)
  506. $VendorRare = IniRead($settingsINI, "Vendoring", "Rare", $VendorRare)
  507. $VendorMagic = IniRead($settingsINI, "Vendoring", "Magic", $VendorMagic)
  508. $VendorAll = IniRead($settingsINI, "Vendoring", "All Items", $VendorAll)
  509. $vendorRows = IniRead($settingsINI, "Vendoring", "All-Rows", $vendorRows)
  510. $vendorColumns = IniRead($settingsINI, "Vendoring", "All-Columns", $vendorColumns)
  511.  
  512. $timingGameLoad = IniRead($SettingsINI, "Timing", "Game Load", $timingGameLoad)
  513.  
  514.  
  515. $timingTP = Iniread($SettingsINI, "Timing", "Town Portal", $timingTP)
  516.  
  517.  
  518. $timingCellarClick = Iniread($SettingsINI, "Timing", "Cellar Click", $timingCellarClick)
  519.  
  520.  
  521.  
  522. $timingLootRun = Iniread($SettingsINI, "Timing", "Loot Run", $timingLootRun)
  523. $timingLoot = Iniread($SettingsINI, "Timing", "Loot", $timingLoot)
  524. $timingAbort = Iniread($SettingsINI, "Timing", "Abort", $timingAbort)
  525. $ScreenShot = InIread($SettingsINI, "Cellar Detect", "Screen Shot", $ScreenShot)
  526. $RareStashilvl=IniRead($settingsINI, "Anal Loot", "Stash Rare", $RareStashiLvl)
  527. $RareSalvageilvl=IniRead($settingsINI, "Anal Loot", "Salvage Rare", $RareSalvageilvl)
  528. $RareVendoriLvl=IniRead($settingsINI, "Anal Loot", "Vendor Rare", $RareVendoriLvl)
  529. $MagicStashilvl=IniRead($settingsINI, "Anal Loot", "Stash Magic", $MagicStashilvl)
  530. $MagicSalvageilvl=IniRead($settingsINI, "Anal Loot", "Salvage Magic", $MagicSalvageilvl)
  531. $MagicVendorilvl=IniRead($settingsINI, "Anal Loot", "Vendor Magic", $MagicVendorilvl)
  532. EndFunc ;==>ReadINI
  533.  
  534. Func UpdateGUI()
  535. ;GUI Update
  536.  
  537. ;Loot
  538. GUISetCheck($gameAutoStart,$cbgameAutoStart)
  539. GUISetCheck($LootSet,$cbLootSet)
  540. GUISetCheck($LootLegendary,$cbLootLegendary)
  541. GUISetCheck($LootRare,$cbLootRare)
  542. GUISetCheck($LootMagic,$cbLootMagic)
  543. GUISetCheck($LootCustom,$cbLootCustom)
  544. GUISetCheck($LootGoldOnly,$cbAddGoldOnly)
  545. ;=============================================
  546.  
  547. ;Stash
  548. GUISetCheck($StashSet,$cbStashSet)
  549. GUISetCheck($StashLegendary,$cbStashLegendary)
  550. GUISetCheck($StashRare,$cbStashRare)
  551. GUISetCheck($StashMagic,$cbStashMagic)
  552. GUISetCheck($StashGems,$cbStashGems)
  553. GUISetCheck($StashTomes,$cbStashTomes)
  554. ;=============================================
  555.  
  556. ;Vendor
  557. If Not IsChecked($cbStashSet) Then GUISetCheck($VendorSet,$cbvendorSet)
  558. If Not IsChecked($cbStashLegendary) Then GUISetCheck($VendorLegendary,$cbvendorLegendary)
  559. If Not IsChecked($cbStashRare) Then GUISetCheck($VendorRare,$cbVendorRare)
  560. If Not IsChecked($cbStashMagic) Then GUISetCheck($VendorMagic,$cbVendorMagic)
  561. GUISetCheck($VendorAll,$cbVendorAll)
  562. ;=============================================
  563.  
  564. ;Cellar Detect
  565. GUISetCheck($ScreenShot,$cbCellarDetectScreenShots)
  566. ;=============================================
  567.  
  568.  
  569. ;Misc
  570. ;Skills
  571. SkillAlphaNum($txtSkill1,$Skill1,1)
  572. SkillAlphaNum($txtSkill2,$Skill2,1)
  573. SkillAlphaNum($txtSkill3,$Skill3,1)
  574. SkillAlphaNum($txtSkill4,$Skill4,1)
  575.  
  576. ;AutoStart
  577. GUIUpdate($txtgamePassword,$gamePassword)
  578. GUIUpdate($txtgameDiabloIIILoc,$gameDiabloIIILoc)
  579.  
  580. ;Vendoring
  581. GUIUpdate($cmbVendorColumns,$vendorColumns)
  582. GUIUpdate($cmbvendorRows,$vendorRows)
  583.  
  584. ;Timing
  585. GUIUpdate($txttimingGameLoad, $timingGameLoad)
  586.  
  587.  
  588.  
  589. GUIUpdate($txttimingTP, $timingTP)
  590. GUIUpdate($txttimingCellarClick, $timingCellarClick)
  591.  
  592.  
  593.  
  594.  
  595. GUIUpdate($txttimingLootRun, $timingLootRun)
  596. GUIUpdate($txttimingLoot, $timingLoot)
  597. GUIUpdate($txttimingAbort, $timingAbort)
  598.  
  599. ;anal loot
  600. GUIUpdate($txtRareStashiLvl,$RareStashiLvl)
  601. GUIUpdate($txtRareSalvageiLvl,$RareSalvageiLvl)
  602. GUIUpdate($txtRareVendoriLvl,$RareVendoriLvl)
  603. GUIUpdate($txtMagicStashiLvl,$MagicStashiLvl)
  604. GUIUpdate($txtMagicSalvageiLvl,$MagicSalvageiLvl)
  605. GUIUpdate($txtMagicVendoriLvl,$MagicVendoriLvl)
  606. ;=============================================
  607.  
  608. ;Additional
  609. GUIUpdate($txtAddDPS, $AddDPS)
  610. ;=============================================
  611. EndFunc
  612.  
  613. Func SaveINI()
  614. FileDelete($settingsINI)
  615. IniWrite($settingsINI, "Auto Start", "Auto Start", ConvertFlag($cbgameAutoStart))
  616. IniWrite($settingsINI, "Auto Start", "Game Location", GUICtrlRead($txtgameDiabloIIILoc))
  617. IniWrite($settingsINI, "Auto Start", "Password", GUICtrlRead($txtgamePassword))
  618. IniWrite($settingsINI, "Auto Start", "Task Manager Executable Name", $gameExecutable)
  619. IniWrite($settingsINI, "Skills", "Skill1", GUICtrlRead($txtSkill1))
  620. IniWrite($settingsINI, "Skills", "Skill2", GUICtrlRead($txtSkill2))
  621. IniWrite($settingsINI, "Skills", "Skill3", GUICtrlRead($txtSkill3))
  622. IniWrite($settingsINI, "Skills", "Skill4", GUICtrlRead($txtSkill4))
  623. IniWrite($settingsINI, "Additional", "DPS", GUICtrlRead($txtAddDPS))
  624.  
  625.  
  626.  
  627. IniWrite($settingsINI, "Looting", "Set", ConvertFlag($cbLootSet))
  628. IniWrite($settingsINI, "Looting", "Legendary", ConvertFlag($cbLootLegendary))
  629. IniWrite($settingsINI, "Looting", "Rare", ConvertFlag($cbLootRare))
  630. IniWrite($settingsINI, "Looting", "Magic", ConvertFlag($cbLootMagic))
  631. IniWrite($settingsINI, "Looting", "Custom", ConvertFlag($cbLootCustom))
  632. IniWrite($settingsINI, "Looting", "Gold Only", ConvertFlag($cbAddGoldOnly))
  633. IniWrite($settingsINI, "Stashing", "Set", ConvertFlag($cbStashSet))
  634. IniWrite($settingsINI, "Stashing", "Legendary", ConvertFlag($cbStashLegendary))
  635. IniWrite($settingsINI, "Stashing", "Rare", ConvertFlag($cbStashRare))
  636. IniWrite($settingsINI, "Stashing", "Magic", ConvertFlag($cbStashMagic))
  637. IniWrite($settingsINI, "Stashing", "Gems", ConvertFlag($cbStashGems))
  638. IniWrite($settingsINI, "Stashing", "Tomes", ConvertFlag($cbStashTomes))
  639. IniWrite($settingsINI, "Vendoring", "Set", ConvertFlag($cbVendorSet))
  640. IniWrite($settingsINI, "Vendoring", "Legendary", ConvertFlag($cbVendorLegendary))
  641. IniWrite($settingsINI, "Vendoring", "Rare", ConvertFlag($cbVendorRare))
  642. IniWrite($settingsINI, "Vendoring", "Magic", ConvertFlag($cbVendorMagic))
  643. IniWrite($settingsINI, "Vendoring", "All Items", ConvertFlag($cbVendorAll))
  644. IniWrite($settingsINI, "Vendoring", "All-Rows", GUICtrlRead($cmbvendorRows))
  645. IniWrite($settingsINI, "Vendoring", "All-Columns", GUICtrlRead($cmbVendorColumns))
  646.  
  647. IniWrite($settingsINI, "Timing", "Game Load", GUICtrlRead($txttimingGameLoad))
  648.  
  649.  
  650.  
  651. IniWrite($settingsINI, "Timing", "Town Portal", GUICtrlRead($txttimingTP))
  652. IniWrite($settingsINI, "Timing", "Cellar Click", GUICtrlRead($txttimingCellarClick))
  653.  
  654.  
  655. IniWrite($settingsINI, "Timing", "Loot Run", GUICtrlRead($txttimingLootRun))
  656. IniWrite($settingsINI, "Timing", "Loot", GUICtrlRead($txttimingLoot))
  657. IniWrite($settingsINI, "Timing", "Abort", GUICtrlRead($txttimingAbort))
  658. IniWrite($SettingsINI, "Cellar Detect", "Screen Shot", ConvertFlag($cbCellarDetectScreenShots))
  659. IniWrite($settingsINI, "Anal Loot", "Stash Rare", GUICtrlRead($txtRareStashilvl))
  660. IniWrite($settingsINI, "Anal Loot", "Salvage Rare", GUICtrlRead($txtRareSalvageilvl))
  661. IniWrite($settingsINI, "Anal Loot", "Vendor Rare", GUICtrlRead($txtRareVendoriLvl))
  662. IniWrite($settingsINI, "Anal Loot", "Stash Magic", GUICtrlRead($txtMagicStashilvl))
  663. IniWrite($settingsINI, "Anal Loot", "Salvage Magic", GUICtrlRead($txtMagicSalvageilvl))
  664. IniWrite($settingsINI, "Anal Loot", "Vendor Magic", GUICtrlRead($txtMagicVendorilvl))
  665. saveCustomKeys()
  666. Call("ReadINI")
  667. $StashLoot = $StashMagic + $StashRare + $StashLegendary + $Stashset + $StashGems + $StashTomes
  668. $VendorLoot = $VendorMagic + $VendorRare + $VendorLegendary + $VendorSet + $VendorAll
  669. EndFunc ;==>SaveINI
  670.  
  671.  
  672.  
  673. Func GUISetCheck($Flag,$CheckBox)
  674. If $Flag = 0 Then
  675. GUICtrlSetState($CheckBox, $GUI_UNCHECKED)
  676. ElseIf $Flag = 1 Then
  677. GUICtrlSetState($CheckBox, $GUI_CHECKED)
  678. EndIf
  679. EndFunc
  680.  
  681. Func ConvertFlag($CheckBox)
  682. If GUICtrlRead($Checkbox) = 4 Or GUICtrlRead($Checkbox) = 68 Then
  683. Return 0
  684. Else
  685. Return 1
  686. EndIf
  687. EndFunc
  688.  
  689. Func GUIUpdate($CheckBox,$Value)
  690. GUICtrlSetData($CheckBox, $Value)
  691. EndFunc
  692.  
  693. Func saveCustomKeys()
  694. $string = GUICtrlRead($etlootCustom)
  695. If Not $string = "" Then
  696. $temp = StringReplace($string, @CRLF, " ")
  697. $temp = StringStripWS($temp, 7)
  698. $arr = StringSplit($temp, " ")
  699.  
  700. For $a = 1 To $arr[0]
  701. $tempLoc = StringSplit($arr[$a],"|")
  702. If FileExists($pngLoc & $tempLoc[1] & ".png") Then
  703. IniWrite($settingsINI, "Custom Items", "Key" & $a , $arr[$a])
  704. EndIf
  705. Next
  706. Return 1
  707. Else
  708. If $totalItems < 1 Then
  709. $LootCustom = "0"
  710. GUICtrlSetState($cblootCustom, $GUI_UNCHECKED)
  711. EndIf
  712. Return @error
  713. EndIf
  714. EndFunc
  715.  
  716. Func getCustomKeys()
  717. $string = ""
  718. $var = IniReadSection($settingsINI, "Custom Items")
  719. If Not @error Then
  720. $totalItems = $var[0][0]
  721. If $totalItems > 0 Then
  722. ReDim $pick[$totalItems]
  723. EndIf
  724. For $a = 1 To $totalItems
  725. $pick[$a-1] = $var[$a][1]
  726. $string &= $pick[$a-1] & @CRLF
  727. Next
  728. Else
  729. $totalItems = 0
  730. EndIf
  731. If $totalItems < 1 Then
  732. $LootCustom = "0"
  733. GUICtrlSetState($cblootCustom, $GUI_UNCHECKED)
  734. EndIf
  735. GUICtrlSetData($etlootCustom, $string)
  736. EndFunc
  737.  
  738. Func IsChecked($control)
  739. Return BitAnd(GUICtrlRead($control),$GUI_CHECKED) = $GUI_CHECKED
  740. EndFunc
  741.  
  742. Func SkillAlphaNum($txtSkill,$Skill,$UpdateFlag)
  743. If $UpdateFlag = 0 Then $temp = GUICtrlRead($txtSkill)
  744. If $UpdateFlag = 1 Then $temp = $Skill
  745. $temp = StringStripWS($temp, 8)
  746. If StringLen($temp) = 1 Then
  747. If StringRegExp($temp,"[a-zA-Z0-9]") Then
  748. GUICtrlSetData($txtSkill, $temp)
  749. Else
  750. GUICtrlSetData($txtSkill,"1")
  751. EndIf
  752. Else
  753. $temp = StringTrimRight($temp, StringLen($temp)-1)
  754. GUICtrlSetData($txtSkill, $temp)
  755. SkillAlphaNum($txtSkill,$Skill,$UpdateFlag)
  756. EndIf
  757. EndFunc
  758.  
  759.  
  760.  
  761.  
  762.  
  763.  
  764.  
  765.  
  766.  
  767.  
  768.  
  769.  
  770.  
  771.  
  772.  
  773.  
  774.  
  775.  
  776.  
  777.  
  778.  
  779.  
  780.  
  781.  
  782.  
  783.  
  784.  
  785.  
  786.  
  787.  
  788.  
  789.  
  790.  
  791.  
  792.  
  793.  
  794.  
  795.  
  796.  
  797.  
  798.  
  799.  
  800.  
  801.  
  802.  
  803.  
  804.  
  805.  
  806.  
  807.  
  808.  
  809.  
  810.  
  811.  
  812.  
  813.  
  814.  
  815.  
  816.  
  817.  
  818.  
  819.  
  820.  
  821.  
  822.  
  823.  
  824.  
  825.  
  826.  
  827.  
  828.  
  829.  
  830.  
  831.  
  832.  
  833.  
  834.  
  835. Func RestartRun()
  836. If ($Go) Then
  837. $i = 0
  838. WinSetTitle($title, "", $title & " - Running")
  839.  
  840. MouseMove(Round(Random(0, 400) * $x_ratio), Round(Random(300, 600) * $y_ratio), 1) ;Moves mouse out of the way
  841. ;Checks if the player is Dead/Logout/Window, then if in Main Menu, etc.
  842. If CheckDead() Then
  843. Return
  844. ElseIf CheckFor("ExitGame", "", Round(370 * $x_ratio), Round(232 * $y_ratio), Round(431 * $x_ratio), Round(243 * $y_ratio), 0.5, 140) Then
  845. GUICtrlSetData($lblStatus, "Status: Exit window up")
  846. MouseClick("left", Round(461 * $x_ratio), Round(351 * $y_ratio))
  847. Sleep(Random(100, 105))
  848. Send("{SPACE}")
  849. Return
  850. ElseIf CheckFor("MainMenu", "", Round(86 * $x_ratio),Round(225 * $y_ratio) ,Round(174 * $x_ratio),Round(240 * $y_ratio)) Then
  851. GUICtrlSetData($lblRun, "Run Number: " & $run & " - Runs Per Hour: " & Round($RunsPerHour))
  852. GUICtrlSetData($lblLocation, "Location: Main Menu")
  853. GUICtrlSetData($lblStatus, "Status: Starting Game")
  854. WinActivate("Diablo III")
  855. RandClick("left", Round(128* $x_ratio), Round(232 * $y_ratio), 10, 20, 1, 1) ;Random Click on the resume button
  856. Sleep($timingGameLoad)
  857. ElseIf CheckFor("Road", "Area") Then
  858. Call("TownPortal")
  859. Call("LeaveGame")
  860. Return
  861. ElseIf CheckFor("OldRuins", "Area") Or CheckFor("NewTristram", "Area") Or CheckFor("DankCellar", "Area") Then
  862. Call("TownPortal")
  863. Call("LeaveGame")
  864. Return
  865. ElseIf CheckFor("Disconnect", "", Round(338 * $x_ratio), Round(230* $y_ratio), Round(461 * $x_ratio), Round(242 * $y_ratio), 1, 140) Then
  866. GUICtrlSetData($lblStatus, "Status: Network Disconnect window up")
  867. MouseClick("left", Round(401 * $x_ratio), Round(351 * $y_ratio),1)
  868. Sleep(Random(100, 105))
  869.  
  870. Send("{SPACE}")
  871.  
  872. Return
  873. ElseIf CheckFor("LimitError", "", Round(700 * $x_ratio), Round(340 * $y_ratio), Round(1200 * $x_ratio), Round(600 * $y_ratio), 1, 140) Then
  874. MouseClick("left", Round(960 * $y_ratio), Round(635 * $x_ratio),1)
  875. $rand = Random(40000, 80000)
  876. GUICtrlSetData($lblStatus, "Status: Input Limit - Waiting " & Round($rand / 1000) & " seconds.")
  877. Sleep($rand)
  878. Send("{SPACE}")
  879. Return
  880.  
  881. ElseIf CheckFor("connection", "", Round(338 * $x_ratio), Round(230* $y_ratio), Round(461 * $x_ratio), Round(242 * $y_ratio), 1, 140) Then
  882. GUICtrlSetData($lblStatus, "Status: Lost Connection window up")
  883. MouseClick("left", Round(401 * $x_ratio), Round(351 * $y_ratio),1)
  884. Sleep(Random(100, 105))
  885. Send("{SPACE}")
  886.  
  887. Return
  888.  
  889. else
  890. GUICtrlSetData($lblStatus, "ERROR: Cannot find Resume button")
  891.  
  892. Return
  893. EndIf
  894.  
  895. ;Make sure we are in the right area before beginning run
  896. If CheckFor("OldRuins", "Area") Then
  897. $rt = TimerInit()
  898. $run += 1
  899. ;Call("StartScreenShot")
  900. GUICtrlSetData($lblLocation, "Location: Old Ruins")
  901. If $StartingGold = 0 Then Call("GoldPerHour")
  902. ;Start Run
  903. MouseMove(Round(262* $x_ratio ), Round(220* $y_ratio )) ;vault to stairs
  904. Send($skill1)
  905. sleep(random(200,220))
  906. MouseMove(Round(0* $x_ratio ), Round(224* $y_ratio )) ;vault1
  907. Send($Skill1)
  908. sleep(random(330,360))
  909. MouseMove( Round(0 * $x_ratio), Round(224* $y_ratio )) ;vault2
  910. Send($Skill1)
  911. sleep(random(330,360))
  912. MouseMove( Round(0 * $x_ratio), Round(224* $y_ratio )) ;vault3
  913. Send($Skill1)
  914. sleep(random(50,75))
  915. MouseMove( Round(55 * $x_ratio), Round(224* $y_ratio )) ;vault4
  916. Send($Skill4) ;scatter to vaulting area
  917. sleep(random(500,520))
  918. ;Send($skill2) ;preperation to heal/regen disc
  919. ;sleep(random(250,270))
  920. Send($skill1) ;vault5
  921. sleep(random(500,520))
  922.  
  923.  
  924.  
  925.  
  926.  
  927.  
  928.  
  929. If FindCellar() = 1 Then
  930. If CheckDead() Then
  931. Return
  932. EndIf
  933.  
  934. GUICtrlSetData($lblStatus, "Status: Cellar - Found")
  935. MouseClick("left",Round($cellarCoordx[$CellCoord] * $x_ratio),Round($cellarCoordy[$CellCoord] * $y_ratio),1)
  936. sleep($timingCellarClick)
  937. Else ;ABORT RUN
  938. ;FileMove(@ScriptDir & "\shots\Start\OpenStartShot"& $run & ".bmp", @ScriptDir & "\shots\Start\ClosedStartShot"& $run & ".bmp")
  939. GUICtrlSetData($lblStatus, "Status: Cellar - Not Found" & @CRLF)
  940. Sleep(Random(300, 320))
  941. MouseMove(Round(396 * $x_ratio),Round(526 * $y_ratio))
  942. Send("{SHIFTDOWN}")
  943. MouseDown("right") ;ATTACK
  944. Sleep(Random(100, 120))
  945. MouseUp("right")
  946. Send("{SHIFTUP}")
  947. Sleep(Random(50, 78))
  948. send($Skill1)
  949. Sleep(Random(300, 312))
  950. send($Skill4)
  951. Sleep(Random(200, 215))
  952. Send($skill2) ; caltrop
  953. Sleep(Random(200, 215))
  954. randMove(Round(396 * $x_ratio),Round(526 * $y_ratio))
  955. Sleep(Random(50, 61))
  956. send($Skill4)
  957. Sleep(Random(100, 115))
  958. ;Send($skill2) ; caltrop
  959. randclick("middle", Round(437* $x_ratio),Round(349 * $y_ratio) , 1, 1)
  960. Sleep(Random(200, 215))
  961. Send($skill2) ; caltrop
  962. randMove(Round(362 * $x_ratio),Round(196 * $y_ratio))
  963. ;send($Skill4)
  964. ;Sleep(Random(300, 350))
  965.  
  966.  
  967.  
  968.  
  969.  
  970.  
  971.  
  972. ;Sleep(Random(200, 205))
  973. ;Send($Skill3)
  974. Call("TownPortal")
  975. If Not CheckDead() Then
  976. Call("ClosedCellar")
  977. Call("LeaveGame")
  978. EndIf
  979. Return
  980. EndIf
  981. Else
  982. Call("TownPortal")
  983. If Not CheckDead() Then
  984. Call("ClosedCellar")
  985. Call("LeaveGame")
  986. EndIf
  987. Return
  988. EndIf
  989.  
  990. ;Checks that the player is in the Dank Cellar
  991. If CheckFor("DankCellar", "Area") Then
  992. GUICtrlSetData($lblLocation, "Location: Dank Cellar")
  993. ;Sleep(Random(500, 550))
  994. MouseMove(round(0 * $x_ratio),Round(500 * $y_ratio)) ;moves cursor to doorway leading to rare inside cellar
  995. Sleep(Random(50, 60))
  996. send($skill1);vaults to doorway leading to rare inside cellar
  997. sleep(random(500,520))
  998.  
  999. randclick("middle", Round(200 * $x_ratio),Round(228 * $y_ratio) , 1, 1) ;moves to doorway inside doorway
  1000. Sleep(Random(375, 383))
  1001. MouseMove(Round(213* $x_ratio),Round(147 * $y_ratio)) ;hovers over the rare Sarkoth
  1002. Send($Skill4); bombs
  1003. Sleep(Random(150, 200))
  1004. Send($Skill3) ;cast ferret for looting
  1005. Sleep(Random(100, 110))
  1006. Send("{SHIFTDOWN}")
  1007. MouseDown("right") ;cast cluster arrow 1x
  1008. Sleep(Random(600, 650));cast cluster arrow
  1009. MouseUp("right");end cluster arrow should shoot 2x
  1010. MouseDown("left") ;cast hungering arrow till mobs are dead
  1011. sleep($attackTime/2)
  1012. mousemove(Round(109* $x_ratio),Round(157 * $y_ratio))
  1013. sleep($attackTime/2)
  1014. mousemove(Round(109* $x_ratio),Round(157 * $y_ratio))
  1015.  
  1016. sleep(100)
  1017. MouseUp("left") ;stop cast hungering arrow
  1018.  
  1019. Sleep(Random(150, 156))
  1020. Send("{SHIFTUP}")
  1021. Sleep(Random(100, 110))
  1022. send($Skill1) ;vault to loot
  1023. Sleep(Random(400, 510))
  1024.  
  1025. sleep($timingLootRun)
  1026.  
  1027. If $LootGoldOnly = 0 then
  1028. GUICtrlSetData($lblStatus, "Status: Looting")
  1029. Call("Loot")
  1030. EndIf
  1031. ;Sleep(Random(355, 380))
  1032.  
  1033.  
  1034. Call("TownPortal")
  1035. Else
  1036. $countMissedCellar += 1
  1037. Call("CellarScreenShot")
  1038. MouseMove(Round(396 * $x_ratio),Round(526 * $y_ratio))
  1039.  
  1040.  
  1041. Send("{SHIFTDOWN}")
  1042. MouseDown("right") ;ATTACK
  1043. Sleep(Random(100, 120))
  1044. MouseUp("right")
  1045. Send("{SHIFTUP}")
  1046. Sleep(Random(50, 78))
  1047. send($Skill1)
  1048. Sleep(Random(300, 312))
  1049. send($Skill4)
  1050. Sleep(Random(200, 215))
  1051. randMove(Round(396 * $x_ratio),Round(526 * $y_ratio))
  1052. Sleep(Random(50, 61))
  1053. send($Skill4)
  1054. Sleep(Random(100, 115))
  1055.  
  1056.  
  1057.  
  1058.  
  1059.  
  1060. Call("TownPortal")
  1061. If Not CheckDead() Then
  1062. Call("ClosedCellar")
  1063. Call("LeaveGame")
  1064. EndIf
  1065. Return
  1066. EndIf
  1067. ;After successful run
  1068. If Not CheckDead() Then
  1069. Sleep(Random(300, 305))
  1070. If $mLootIn = 1 And CheckFor("NewTristram", "Area") Then ;If its time to manage loot and we are in town
  1071. If $LootGoldOnly = 0 Then
  1072. If $StashLoot >= 1 Then
  1073. Call("StashLoot")
  1074. EndIF
  1075. EndIF
  1076.  
  1077.  
  1078. ElseIf Not CheckFor("NewTristram", "Area") Then
  1079. GUICtrlSetData($lblStatus, "Status: Skipping vendor, not in New Tristram")
  1080. Sleep(Random(3000, 3005))
  1081. ElseIf $mLootIn = 1 Then
  1082. $mLootIn = 0
  1083. EndIf
  1084.  
  1085.  
  1086. If Not CheckDead() Then
  1087. Call("OpenCellar")
  1088. Call("LeaveGame")
  1089. EndIf
  1090. Return
  1091. Else
  1092. Return
  1093. EndIf
  1094. Else
  1095. Return 0
  1096. EndIf
  1097. EndFunc ;==>RestartRun
  1098.  
  1099. Func CheckDead()
  1100. $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
  1101. If Not @error Then
  1102. GUICtrlSetData($lblStatus, "Status: Logging out")
  1103. Sleep(11000)
  1104. Sleep($timingGameLoad)
  1105. Return 1
  1106. EndIf
  1107.  
  1108. $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
  1109. If Not @error Then
  1110. GUICtrlSetData($lblStatus, "Status: Open Window")
  1111. Sleep(200)
  1112. Send("{SPACE}") ;close any open windows
  1113. Return 1
  1114. EndIf
  1115.  
  1116.  
  1117.  
  1118. $YouHaveDied = PixelSearch(Round(285* $x_ratio), Round(491* $y_ratio), Round(308* $x_ratio), Round(508* $y_ratio), 0x2C0100,2) ; checks for white text "YOU HAVE DIED"
  1119. If Not @error Then
  1120. GUICtrlSetData($lblStatus, "Status: Dead")
  1121. $deathCount += 1
  1122. Call("LeaveGame")
  1123. Sleep(Random(11000, 11005)
  1124.  
  1125. Sleep($timingGameLoad)
  1126. Return 1
  1127. Else
  1128. Return 0
  1129. EndIf
  1130. EndFunc ;==>CheckDead
  1131.  
  1132.  
  1133. Func CheckRepair()
  1134. $RepairArea = PixelSearch(Round(552 * $x_ratio),Round(6* $y_ratio),Round(589 * $x_ratio),Round(51 * $y_ratio), $yellow)
  1135. If Not @error Then
  1136. Call("DoRepair")
  1137. EndIf
  1138. $RepairAreaRed = PixelSearch(Round(552 * $x_ratio),Round(6 * $y_ratio),Round(589 * $x_ratio),Round(51 * $y_ratio), $red)
  1139. If Not @error Then
  1140. Call("DoRepair")
  1141. EndIf
  1142. EndFunc ;==>CheckRepair
  1143.  
  1144. Func DoRepair()
  1145. Sleep(Random(2500, 2550))
  1146.  
  1147. $repairCount += 1
  1148. If CheckDead() Then
  1149. Return
  1150. EndIf
  1151. If CheckFor("NewTristram", "Area") Then
  1152. RandClick1("middle", Round(755 * $x_ratio),Round(29 * $y_ratio), 1, 1) ;step1
  1153. Sleep(Random(3500, 3550))
  1154.  
  1155.  
  1156.  
  1157. RandClick1("left", Round(399 * $x_ratio),Round(123 * $y_ratio), 1, 1) ;vendor
  1158. Sleep(Random(2100,2110))
  1159.  
  1160. RandClick("left", Round(282 * $x_ratio),Round(267 * $y_ratio), 1, 1) ;button to open up repair menu
  1161. Sleep(Random(400, 412))
  1162. RandClick("left", Round(142 * $x_ratio),Round(295 * $y_ratio), 1, 1) ;button to pay for repairs
  1163. Sleep(Random(200, 212))
  1164. Send("{Escape}")
  1165. EndIf
  1166. EndFunc ;==>DoRepair
  1167.  
  1168.  
  1169. Func ClosedCellar()
  1170. $closedcellarCount += 1
  1171. $srt = TimerDiff($rt)
  1172. $ClosedCellarSec = $ClosedCellarSec + Round($srt / 1000, 2)
  1173. $ClosedCellarAvg = $ClosedCellarSec / $closedcellarCount
  1174. EndFunc
  1175.  
  1176. Func OpenCellar()
  1177. $cellarCount += 1
  1178. $srt = TimerDiff($rt)
  1179. $OpenCellarSec = $OpenCellarSec + Round($srt / 1000, 2)
  1180. $OpenCellarAvg = $OpenCellarSec / $cellarCount
  1181. EndFunc
  1182.  
  1183. Func CalcTime()
  1184. $trt = TimerDiff($t)
  1185. $total = Round((($trt / 1000) / 60) / 60, 4)
  1186. ;Total runtime calculation.
  1187. $hours = Floor((($trt / 1000) / 60) / 60)
  1188. $minutes = (($trt / 1000) / 60)
  1189. ;trim minutes if runtime is more then 1 hour.
  1190. If $minutes > 60 Then
  1191. While $minutes > 60
  1192. $minutes -= 60
  1193. WEnd
  1194. EndIf
  1195. $RunsPerHour = $Run / ($trt / 1000) * 3600
  1196. $repairCountPercent = $repairCount / $run
  1197. $deathsCountPercent = $deathCount / $run
  1198. $cellarCountPercent = $cellarCount / $run
  1199. $closedCellarCountPercent = ($run - $cellarCount) / $run
  1200. $MissedCellarCountPercent = $countMissedCellar / $run
  1201. GUICtrlSetData($lblRuntime, "Total Runtime: " & $hours & " hours, " & Ceiling($minutes) & " minutes")
  1202. GUICtrlSetData($lblLast, "Open Cellar Avg: " & Round($OpenCellarAvg,1) & "s - Closed Cellar Avg: " & Round($ClosedCellarAvg,1) & "s")
  1203. GUICtrlSetData($lblCellars, "Cellars Open: " & $cellarCount & " (" & Round($cellarCountPercent * 100) & "%)" & " - Cellars Closed: " & $run - $cellarCount & " (" & Round($closedCellarCountPercent * 100,.00) & "%)")
  1204. GUICtrlSetData($lblStats, "Deaths: " & $deathCount & " (" & Round($deathsCountPercent * 100) & "%" & ")" & " - Missed Cellars: " & $countMissedCellar & " (" & Round($MissedCellarCountPercent * 100) & "%)")
  1205. EndFunc ;==>CalcTime
  1206.  
  1207. Func CheckFor($img, $type = "", $startX = 0, $startY = 0, $endX = @DesktopWidth, $endY = @DesktopHeight, $seconds = 6, $tolerance = 140)
  1208. If $type = "Area" Then
  1209. $startX = 650 * $x_ratio
  1210. $startY = 0 * $y_ratio
  1211. $endX = 800 * $x_ratio
  1212. $endY = 50 * $y_ratio
  1213. $seconds = 2.5
  1214. EndIf
  1215. $c = 0
  1216. $string = $pngLoc & $img & ".png"
  1217. Do
  1218. $c += 1
  1219. Sleep(Random(100, 105))
  1220.  
  1221. If $c > ($seconds * 10) Then ;Make sure we never get stuck here for infinity.
  1222. If $type = "Area" Then
  1223. GUICtrlSetData($lblStatus, "Status: Area not found - " & $img)
  1224. EndIf
  1225. Return 0
  1226. EndIf
  1227. Until _ImageSearchArea($string, 1, $startX, $startY, $endX, $endY, $gX, $gY, $tolerance)
  1228. Return 1
  1229. EndFunc ;==>CheckFor
  1230.  
  1231.  
  1232. Func Loot()
  1233. Sleep($timingLoot)
  1234. MouseMove(Round(Random(0, 400) * $x_ratio), Round(Random(300, 600) * $y_ratio), 3) ;Moves mouse out of the way
  1235. If $LootSet == 1 Then
  1236. $SetCount += LootGear(0x02CE01)
  1237. EndIf
  1238.  
  1239. If $LootLegendary == 1 Then
  1240. $LegendaryCount += LootGear(0xBF642F, 0)
  1241. EndIf
  1242.  
  1243. If $LootRare == 1 Then
  1244. $RareCount += LootGear(0xBBBB00)
  1245. EndIf
  1246.  
  1247. If $LootCustom == 1 Then
  1248. Call("LootCustom")
  1249. EndIf
  1250.  
  1251. If $LootMagic == 1 Then
  1252. $MagicCount += LootGear(0x6969FF)
  1253. EndIf
  1254. call("Showloot")
  1255. EndFunc ;==>Loot
  1256.  
  1257. Func LootCustom()
  1258. $count = 0
  1259. $gX = 0
  1260. $gY = 0
  1261. For $i = 0 To ($totalItems - 1)
  1262. $array = StringSplit($pick[$i], "|")
  1263. $file = $array[1]
  1264. $accuracy = $array[2]
  1265. $urlString = $pngLoc & $file & ".png"
  1266. While _ImageSearchArea($urlString, 1, 0, 0, @DesktopWidth, @DesktopHeight, $gX, $gY, $accuracy)
  1267. $count += 1
  1268. MouseClick("left", $gX, $gY, 1, 3)
  1269. Sleep(Random(50, 55))
  1270.  
  1271. MouseMove(Round(Random(0, 400) * $x_ratio), Round(Random(300, 600) * $y_ratio), 3) ;Moves mouse out of the way
  1272. Sleep($timingLoot)
  1273. If $count >= 15 Then
  1274. ExitLoop
  1275. EndIf
  1276. WEnd
  1277. Next
  1278. EndFunc ;==>LootCustom
  1279.  
  1280. Func LootGear($color, $tolerance = 3)
  1281. $count = 0
  1282. $Loot = PixelSearch(Round(0 * $x_ratio), Round(75*$y_ratio), Round(800 * $x_ratio), Round(400 * $y_ratio), $color, $tolerance)
  1283. If Not @error Then
  1284. While Not @error
  1285. $count += 1
  1286. MouseClick('left', $Loot[0], $Loot[1], 1, 3)
  1287. Sleep(Random(50, 55))
  1288.  
  1289. MouseMove(Round(Random(0, 400) * $x_ratio), Round(Random(300, 600) * $y_ratio), 1) ;Moves mouse out of the way
  1290. sleep($timingLoot)
  1291. If $count >= 15 Then
  1292. ExitLoop
  1293. EndIf
  1294. $Loot = PixelSearch(Round(0 * $x_ratio), Round(75*$y_ratio), Round(800 * $x_ratio), Round(400 * $y_ratio), $color, $tolerance)
  1295. WEnd
  1296. EndIf
  1297. Return $count
  1298.  
  1299. EndFunc ;==>LootGear
  1300.  
  1301. Func CheckFullInventory()
  1302.  
  1303. If Not _ImageSearchArea($pngLoc & "FullInventory.png", 1, Round(679 * $x_ratio),Round(431 * $y_ratio), Round(788 * $y_ratio),Round(484 * $x_ratio), $gX, $gY, 140) Then
  1304. $mLootIn = 1
  1305. If $StashLoot = 0 And $VendorLoot = 0 Then
  1306. $LootGoldOnly = 1
  1307. EndIf
  1308. Return 0
  1309.  
  1310. Else
  1311. $mLootIn = 0
  1312. Return 1
  1313. EndIf
  1314. Return
  1315. EndFunc
  1316.  
  1317.  
  1318. Func StashLoot()
  1319. MouseClick("left", 442* $x_ratio,121* $y_ratio)
  1320. Sleep(Random(1600, 1620))
  1321.  
  1322. GUICtrlSetData($lblStatus, "Status: Putting Items in Stash")
  1323. If $StashSelectedTab > 0 Then MouseClick("left", Round($StashTabs[$StashSelectedTab][0] * $x_ratio) ,Round($StashTabs[$StashSelectedTab][1] * $x_ratio), 1, 4)
  1324.  
  1325. If $AnalLoot = 1 And $StashLoot > 0 Then
  1326. MouseMove(Round($StashTabs[$StashSelectedTab][0] * $x_ratio) ,Round($StashTabs[$StashSelectedTab][1] * $x_ratio), 2)
  1327. AnalLoot()
  1328. Send("{SPACE}")
  1329. If $AnalSalvage = 1 Then
  1330. If $AnalRareIdentify = 1 Then
  1331. DoIdentify()
  1332. EndIf
  1333. DoSalvage()
  1334. EndIf
  1335. If $AnalVendor = 1 Then
  1336. If $AnalRareIdentify = 1 Then
  1337. DoIdentify()
  1338. EndIf
  1339. VendorLoot()
  1340. EndIf
  1341. EndIF
  1342. $AnalSalvage = 0
  1343. $AnalRareIdentify = 0
  1344. $AnalVendor = 0
  1345. EndFunc ;==>StashLoot
  1346.  
  1347.  
  1348. Func CheckFullStash()
  1349. If _ImageSearchArea($pngLoc & "FullStash.png", 1, Round(320 * $x_ratio),Round(72 * $y_ratio), Round(376 * $y_ratio),Round(88 * $x_ratio), $gX, $gY, 140) Then
  1350. If $StashSelectedTab < 2 Then
  1351. $StashSelectedTab += 1
  1352. ElseIf $StashSelectedTab = 2 Then
  1353. $StashLoot = 0
  1354. Return 0
  1355. EndIf
  1356. Do
  1357. Sleep(Random(100, 105))
  1358. Until Not _ImageSearchArea($pngLoc & "FullStash.png", 1, Round(320 * $x_ratio),Round(72 * $y_ratio), Round(376 * $y_ratio),Round(88 * $x_ratio), $gX, $gY, 140)
  1359.  
  1360. MouseClick("left", Round($StashTabs[$StashSelectedTab][0] * $x_ratio) ,Round($StashTabs[$StashSelectedTab][1] * $x_ratio), 1, 4)
  1361. EndIf
  1362. Return 1
  1363. EndFunc
  1364.  
  1365. Func AnalScan()
  1366. GUICtrlSetData($lblStatus, "Status: Unhighlighting new items")
  1367. For $i = 0 To 9
  1368. For $j = 0 To 5
  1369. MouseMove(Round(($slot1x + ($i * $offset)*$x_ratio)),Round(($slot1y + ($j * $offset)) * $y_ratio), 1)
  1370. Next
  1371. Next
  1372. EndFunc
  1373.  
  1374. Func AnalLoot()
  1375. DebugLog(@CRLF & "iLvl Analyzing " & @CRLF & _
  1376. "****************************************************")
  1377. GUICtrlSetData($lblStatus, "Status: Stashing And Analyzing Loot")
  1378. AnalScan()
  1379. ArrayClear($AnalyzedLoot)
  1380. $rt = TimerInit()
  1381.  
  1382. For $i = 0 To 9
  1383. For $j = 0 To 5
  1384. $SlotPixelLine = PixelSearch(Round($slotLineX + $i * $slotLineOffSet * $x_ratio), Round($slotLineY + $j * $slotLineOffSet * $y_ratio), Round($slotLineX + $i * $slotLineOffSet * $x_ratio), Round($slotLineY + $j * $slotLineOffSet + 27 * $y_ratio), 0x37241A,5)
  1385. $MiddleOfCell = PixelSearch(Round($CellMiddleTopX + $i * $CellMiddleO * $x_ratio), Round($CellMiddleTopY + $j * $CellMiddleO * $y_ratio), Round($CellMiddleBotX+ $i * $CellMiddleO * $x_ratio), Round($CellMiddleBotY + $j * $CellMiddleO * $y_ratio), 0x130C08,2)
  1386. If Not IsArray($MiddleOfCell) Then
  1387. If IsArray($SlotPixelLine) Or $slotError >= 1 Or $j = 0 Then
  1388. $slotError = 0
  1389. MouseMove(Round($slot1x + $i * $offset * $x_ratio), Round($slot1y + $j * $offset * $y_ratio),1)
  1390. Sleep($AnalSpeed)
  1391. $ItemInfo = StringSplit(GetItemInfo(), ",")
  1392.  
  1393. If StringRegExp($ItemInfo[1],"Magic") Then
  1394. DebugLog("Magic Item Found iLvl=" &$ItemInfo[2]&" @ Cell " & $i & "," & $j)
  1395.  
  1396. If $ItemInfo[2] < 0 Then
  1397. $AnalyzedLoot[$i][$j] = Round($slot1x + $i * $offset * $x_ratio) & "," & Round($slot1y + $j * $offset * $y_ratio) & ",Vendor,Magic," & $ItemInfo[2]
  1398. $AnalVendor = 1
  1399. Else
  1400. If $ItemInfo[2] >= $MagicStashiLvl Then
  1401. GUICtrlSetData($lblStatus, "Status: " & $ItemInfo[2] & " Stashing Magic @ " & $i & "," & $j)
  1402. $AnalyzedLoot[$i][$j] = Round($slot1x + $i * $offset * $x_ratio) & "," & Round($slot1y + $j * $offset * $y_ratio) & ",Stashed,Magic," & $ItemInfo[2]
  1403. MouseClick("Right", Round($slot1x + $i * $offset * $x_ratio), Round($slot1y + $j * $offset * $y_ratio), 1)
  1404.  
  1405.  
  1406. Elseif $ItemInfo[2] <= $MagicSalvageiLvl And $ItemInfo[2] > $MagicVendoriLvl Then
  1407. GUICtrlSetData($lblStatus, "Status: " & $ItemInfo[2] & " Salvaging Magic @ " & $i & "," & $j)
  1408. $AnalyzedLoot[$i][$j] = Round($slot1x + $i * $offset * $x_ratio) & "," & Round($slot1y + $j * $offset * $y_ratio) & ",Salvage,Magic," & $ItemInfo[2]
  1409. $AnalSalvage = 1
  1410.  
  1411. Elseif $ItemInfo[2] <= $MagicVendoriLvl Then
  1412. GUICtrlSetData($lblStatus, "Status: " & $ItemInfo[2] & " Vendoring Magic @ " & $i & "," & $j)
  1413. $AnalyzedLoot[$i][$j] = Round($slot1x + $i * $offset * $x_ratio) & "," & Round($slot1y + $j * $offset * $y_ratio) & ",Vendor,Magic," & $ItemInfo[2]
  1414. $AnalVendor = 1
  1415.  
  1416. EndIf
  1417. EndIf
  1418. ElseIf StringRegExp($ItemInfo[1],"Rare") Then
  1419.  
  1420. DebugLog("Rare Item Found iLvl=" &$ItemInfo[2]&" @ Cell " & $i & "," & $j)
  1421.  
  1422. If $ItemInfo[2] < 0 Then
  1423. $AnalyzedLoot[$i][$j] = Round($slot1x + $i * $offset * $x_ratio) & "," & Round($slot1y + $j * $offset * $y_ratio) & ",Vendor,Rare," & $ItemInfo[2]
  1424. $AnalRareIdentify = 1
  1425. $AnalVendor = 1
  1426.  
  1427. Else
  1428. If $ItemInfo[2] >= $RareStashiLvl Then
  1429. GUICtrlSetData($lblStatus, "Status: " & $ItemInfo[2] & " Stashing Rare @ " & $i & "," & $j)
  1430. $AnalyzedLoot[$i][$j] = Round($slot1x + $i * $offset * $x_ratio) & "," & Round($slot1y + $j * $offset * $y_ratio) & ",Stashed,Rare," & $ItemInfo[2]
  1431. MouseClick("Right", Round($slot1x + $i * $offset * $x_ratio), Round($slot1y + $j * $offset * $y_ratio), 1)
  1432.  
  1433.  
  1434.  
  1435. Elseif $ItemInfo[2] <= $RareSalvageiLvl And $ItemInfo[2] > $RareVendoriLvl Then
  1436. GUICtrlSetData($lblStatus, "Status: " & $ItemInfo[2] & " Salvaging Rare @ " & $i & "," & $j)
  1437. $AnalyzedLoot[$i][$j] = Round($slot1x + $i * $offset * $x_ratio) & "," & Round($slot1y + $j * $offset * $y_ratio) & ",Salvage,Rare," & $ItemInfo[2]
  1438. $AnalRareIdentify = 1
  1439. $AnalSalvage = 1
  1440.  
  1441. ElseIf $ItemInfo[2] <= $RareVendoriLvl Then
  1442. GUICtrlSetData($lblStatus, "Status: " & $ItemInfo[2] & " Vendoring Rare @ " & $i & "," & $j)
  1443. $AnalyzedLoot[$i][$j] = Round($slot1x + $i * $offset * $x_ratio) & "," & Round($slot1y + $j * $offset * $y_ratio) & ",Vendor,Rare," & $ItemInfo[2]
  1444. $AnalRareIdentify = 1
  1445. $AnalVendor = 1
  1446.  
  1447. EndIf
  1448. EndIf
  1449. ElseIf StringRegExp($ItemInfo[1],"Set") Or StringRegExp($ItemInfo[1],"Legendary") Then
  1450.  
  1451. DebugLog($ItemInfo[1] & " Item Found iLvl=" &$ItemInfo[2]&" @ Cell " & $i & "," & $j)
  1452. GUICtrlSetData($lblStatus, "Status: " & $ItemInfo[2] & " Stashing " & $ItemInfo[1] & " @ " & $i & "," & $j)
  1453. $AnalyzedLoot[$i][$j] = Round($slot1x + $i * $offset * $x_ratio) & "," & Round($slot1y + $j * $offset * $y_ratio) & ",Stashed,Set/Legendary," & $ItemInfo[2]
  1454. MouseClick("Right", Round($slot1x + $i * $offset * $x_ratio), Round($slot1y + $j * $offset * $y_ratio), 1)
  1455.  
  1456.  
  1457. ElseIf StringRegExp($ItemInfo[1],"Crafting") Or StringRegExp($ItemInfo[1],"Tomes") Or StringRegExp($ItemInfo[1],"Gem") Or StringRegExp($ItemInfo[1],"Tome") _
  1458. Or StringRegExp($ItemInfo[1],"RareRing") Or StringRegExp($ItemInfo[1], "RareAmmy") Or StringRegExp($ItemInfo[1], "BlackSmithPlan") Then
  1459.  
  1460. DebugLog($ItemInfo[1] & " @ Cell " & $i & "," & $j)
  1461. GUICtrlSetData($lblStatus, "Status: Stashing " & $ItemInfo[1] & " @ " & $i & "," & $j)
  1462. $AnalyzedLoot[$i][$j] = Round($slot1x + $i * $offset * $x_ratio) & "," & Round($slot1y + $j * $offset * $y_ratio) & ",Stashed," &$ItemInfo[1]& ",0"
  1463. MouseClick("Right", Round($slot1x + $i * $offset * $x_ratio), Round($slot1y + $j * $offset * $y_ratio), 1)
  1464.  
  1465. ElseIf $ItemInfo[1] = 0 Then
  1466.  
  1467. DebugLog("Unknown Item Found iLvl=0 @ Cell " & $i & "," & $j)
  1468. GUICtrlSetData($lblStatus, "Status: Vendoring Unknown @ " & $i & "," & $j)
  1469. $AnalyzedLoot[$i][$j] = Round($slot1x + $i * $offset * $x_ratio) & "," & Round($slot1y + $j * $offset * $y_ratio) & ",Vendor,Unknown,0"
  1470. $AnalVendor = 1
  1471.  
  1472. Else
  1473. $slotError += 1
  1474. EndIF
  1475. EndIf
  1476. EndIf
  1477. If CheckFullStash() = 0 Then ExitLoop
  1478. Next
  1479. Next
  1480. $srt = TimerDiff($rt)
  1481. $AnalTime = Round($srt / 1000, 2)
  1482. DebugLog(@CRLF & "iLvl Analyzing took " & $AnalTime & " Seconds" & @CRLF & _
  1483. "****************************************************")
  1484. ToolTip("")
  1485. EndFunc ;==>AnalLoot
  1486.  
  1487. Func DoIdentify()
  1488. DebugLog("Identifying Rare Items" & @CRLF & _
  1489. "****************************************************")
  1490. Send("c")
  1491. $arr = 0
  1492. For $i = 0 To 9
  1493. For $j = 0 To 5
  1494. If StringRegExp($AnalyzedLoot[$i][$j],"Rare") Then
  1495. $arr = StringSplit($AnalyzedLoot[$i][$j], ",")
  1496. DebugLog("Rare to Identify " & $i & "," & $j)
  1497. GUICtrlSetData($lblStatus, "Status: " & $arr[5] & " Identify " & $arr[4] & " @ Cell " & $i & "," & $j)
  1498. MouseClick("Right",$arr[1],$arr[2],2)
  1499. Sleep(Random(2900, 3000))
  1500. ToolTip("")
  1501. EndIF
  1502. Next
  1503. Next
  1504. Send("c")
  1505. $AnalRareIdentify = 0
  1506. EndFunc
  1507.  
  1508. Func DoSalvage()
  1509. DebugLog("Salvaging Items")
  1510. MouseClick("Left",Round(799 * $x_ratio),Round(290 * $y_ratio),1)
  1511.  
  1512. Sleep(Random(1600, 1620))
  1513. MouseClick("Left",Round(562 * $x_ratio),Round(211 * $y_ratio),1)
  1514. Sleep(Random(1000, 1010))
  1515.  
  1516. MouseClick("Left",Round(286 * $x_ratio),Round(268 * $y_ratio),1)
  1517. Sleep(Random(300, 305))
  1518.  
  1519. MouseClick("Left",Round(151 * $x_ratio),Round(159 * $y_ratio),1)
  1520. If Not _ImageSearchArea("CurrentInventory.png", 1, Round(625 * $x_ratio), Round(93 * $y_ratio), Round(772 * $x_ratio), Round(300 * $y_ratio), $gX, $gY, 9) Then
  1521. TogglePause()
  1522. GUICtrlSetData($lblStatus, "Status: Frozen to prevent vendor of worn item, sorry....")
  1523. EndIf
  1524. $arr = 0
  1525. For $i = 0 To 9
  1526. For $j = 0 To 5
  1527. If StringRegExp($AnalyzedLoot[$i][$j],"Salvage") Then
  1528. $arr = StringSplit($AnalyzedLoot[$i][$j], ",")
  1529. DebugLog("Item to Salvage " & $arr[4] & " " & $i & "," & $j)
  1530. GUICtrlSetData($lblStatus, "Status: " & $arr[5] & " Salvaging " & $arr[4] & " @ Cell " & $i & "," & $j)
  1531. MouseClick("Left",$arr[1],$arr[2],1)
  1532. If $arr[4] == "Rare" Then
  1533. Send("{Enter}")
  1534. EndIf
  1535. sleep(150)
  1536. EndIF
  1537. Next
  1538. Next
  1539. ToolTip("")
  1540. Send("{Space}")
  1541. EndFunc
  1542.  
  1543.  
  1544. Func VendorLoot()
  1545. If $AnalSalvage = 1 Then
  1546. MouseClick("left",Round(517 * $x_ratio), Round(15 * $y_ratio), 6) ;NPC Merchant to the right of cain's home
  1547. Sleep(Random(2200, 2210))
  1548.  
  1549.  
  1550. MouseClick("left",Round(279 * $x_ratio), Round(218 * $y_ratio), 6) ;NPC Merchant to the right of cain's home
  1551. Sleep(Random(500, 550))
  1552.  
  1553.  
  1554. Else
  1555. Sleep(Random(500, 550))
  1556. RandClick1("middle", Round(755 * $x_ratio),Round(29 * $y_ratio), 1, 1) ;step1
  1557.  
  1558. Sleep(Random(3500, 3550))
  1559.  
  1560.  
  1561.  
  1562.  
  1563. RandClick1("left", Round(399 * $x_ratio),Round(123 * $y_ratio), 1, 1) ;vendor
  1564. Sleep(Random(2800, 2850))
  1565. EndIf
  1566.  
  1567. Sleep(Random(300, 310))
  1568.  
  1569. $arr = 0
  1570. If Not _ImageSearchArea("CurrentInventory.png", 1, Round(625 * $x_ratio), Round(93 * $y_ratio), Round(772 * $x_ratio), Round(300 * $y_ratio), $gX, $gY, 9) Then
  1571. TogglePause()
  1572. GUICtrlSetData($lblStatus, "Status: Frozen to prevent salvage of worn item, sorry....")
  1573. EndIf
  1574.  
  1575.  
  1576. For $i = 0 To 9
  1577. For $j = 0 To 5
  1578. If StringRegExp($AnalyzedLoot[$i][$j],"Vendor") Then
  1579. $arr = StringSplit($AnalyzedLoot[$i][$j], ",")
  1580. DebugLog("Item To Vendor " & $arr[4] & " " & $i & "," & $j)
  1581. GUICtrlSetData($lblStatus, "Status: " & $arr[5] & " Vendoring " & $arr[4] & " @ Cell " & $i & "," & $j)
  1582.  
  1583. MouseClick("Right",$arr[1],$arr[2],1)
  1584. EndIF
  1585. Next
  1586. Next
  1587. ToolTip("")
  1588. Sleep(Random(200, 205))
  1589. RandClick("left", Round(282 * $x_ratio),Round(267 * $y_ratio), 1) ;button to open up repair menu
  1590. Sleep(Random(400, 405))
  1591.  
  1592. RandClick("left", Round(142 * $x_ratio),Round(295 * $y_ratio), 1) ;button to pay for repairs
  1593. Sleep(Random(200, 205))
  1594.  
  1595. Send("{ESCAPE}")
  1596. EndFunc ;==>VendorLoot
  1597.  
  1598.  
  1599.  
  1600. Func GetItemInfo()
  1601. $gX = 0
  1602. $gY = 0
  1603. $Type = 0
  1604. $CheckRing = 0
  1605. $mousePos = MouseGetPos()
  1606.  
  1607. Local $MiscItems[6] = ["Crafting","Tomes","Gem","RareRing","RareAmmy","BlackSmithPlan"]
  1608. Local $ItemQuality[8] = ["Magic","MagicRed","Rare","RareRed","Legendary","LegendaryRed","Set","SetRed"]
  1609.  
  1610.  
  1611.  
  1612. For $i = 0 to Ubound($ItemQuality) -1
  1613. If _ImageSearchArea($pngLoc & $ItemQuality[$i] & ".png",1, Round($mousePos[0] - 300 * $x_ratio), 0, Round($mousePos[0] + 70 * $x_ratio),900,$gX,$gY, 90) Then
  1614. $Type = $ItemQuality[$i]
  1615. If StringRegExp($Type,"Rare") Or StringRegExp($Type,"Legendary") Or StringRegExp($Type,"Set") Then
  1616. $CheckRing = 1
  1617. EndIf
  1618. ExitLoop
  1619. Else
  1620. $Type = 0
  1621. EndIf
  1622. Next
  1623.  
  1624. If $CheckRing = 1 Or $Type = 0 Then
  1625.  
  1626. For $i = 0 to Ubound($MiscItems) -1
  1627. If _ImageSearchArea($pngLoc & $MiscItems[$i] & ".png",1, Round($mousePos[0] - 300 * $x_ratio), 0, Round($mousePos[0] + 70 * $x_ratio), $size[1],$gX,$gY, 90) And $CheckRing = 1 Then
  1628. Return $MiscItems[$i] & "," & $RareStashiLvl
  1629.  
  1630. Exitloop
  1631.  
  1632. EndIf
  1633.  
  1634.  
  1635. Next
  1636. EndIf
  1637.  
  1638.  
  1639.  
  1640.  
  1641. If _ImageSearchArea($pngLoc & "ItemLevel800x600.png",1, Round($mousePos[0] - 300 * $x_ratio), 0, Round($mousePos[0] + 70 * $x_ratio), $size[1],$gX,$gY, 90) Then
  1642. $capture = _TesseractScreenCapture(0, "", 1, 11, Round($gX - 5 * $x_ratio), Round($gY - 10 * $y_ratio), Round($gX + 40 * $x_ratio), Round($gY + 10 * $y_ratio), 0)
  1643. $Fixed = StringRegExpReplace($capture,"Q","9")
  1644. $iLvl = StringRegExpReplace($Fixed,"[a-zA-Z|:;~.,»<?_=+|-]","")
  1645. $StringLength = StringLen($iLvl)
  1646. If $StringLength > 2 Then
  1647. $StringLength -= 3
  1648. $iLvl = StringMid($iLvl, $StringLength, 2)
  1649. EndIF
  1650. Return $Type & "," & $iLvl
  1651. Else
  1652. Return 0
  1653. EndIf
  1654. EndFunc
  1655.  
  1656.  
  1657. Func _ImageSearchArea($findImage, $resultPosition, $x1, $y1, $right, $bottom, ByRef $x, ByRef $y, $tolerance)
  1658. If $tolerance > 0 Then $findImage = "*" & $tolerance & " " & $findImage
  1659. $findImage = "*TRANSBLACK " & $findImage
  1660. If @AutoItX64 Then
  1661. $result = DllCall("ImageSearchDLL_x64.dll", "str", "ImageSearch", "int", $x1, "int", $y1, "int", $right, "int", $bottom, "str", $findImage)
  1662. Else
  1663. $result = DllCall("ImageSearchDLL.dll", "str", "ImageSearch", "int", $x1, "int", $y1, "int", $right, "int", $bottom, "str", $findImage)
  1664. EndIf
  1665. If $result = "0" Then
  1666. Return 0
  1667. EndIf
  1668.  
  1669. ; Otherwise get the x,y location of the match and the size of the image to
  1670. ; compute the centre of search
  1671. $array = StringSplit($result[0], "|")
  1672. If (UBound($array) >= 4) Then
  1673. $x = Int(Number($array[2]))
  1674. $y = Int(Number($array[3]))
  1675. If $resultPosition = 1 Then
  1676. $x = $x + Int(Number($array[4]) / 2)
  1677. $y = $y + Int(Number($array[5]) / 2)
  1678. EndIf
  1679. Return 1
  1680. EndIf
  1681. EndFunc ;==>_ImageSearchArea
  1682.  
  1683. Func FindCellar()
  1684. $CellCoord = 0
  1685. $gY = 0
  1686. $gX = 0
  1687.  
  1688. ;A precheck to the cellar search
  1689. _ImageSearchArea($pngLoc & "Cellar.png", 1,Round(630 * $x_ratio),Round(60 * $y_ratio) ,Round(691 * $x_ratio),Round(110 * $y_ratio), $gX, $gY, 160)
  1690. sleep($cellarCheckSleep)
  1691. If $gX > 0 Or $gY > 0 then
  1692. Do
  1693. MouseMove(Round($cellarCoordx[$CellCoord] * $x_ratio), Round($cellarCoordy[$CellCoord] * $y_ratio),1) ;moves cursor over to the cellar
  1694. sleep($cellarCheckSleep)
  1695.  
  1696. $Pixel2 = PixelSearch(Round($cellarCoordx[$CellCoord] * $x_ratio - 65),Round($cellarCoordy[$CellCoord] * $y_ratio - 50),Round($cellarCoordx[$CellCoord] * $x_ratio + 50),Round($cellarCoordy[$CellCoord] * $x_ratio + 65), 0x375BC6, 3) ;checks for open cellar (in a 600x400 box from the top left - where it should always be)
  1697.  
  1698.  
  1699.  
  1700. If Not @Error Then
  1701. ;Msgbox("4096","found it","Found it")
  1702. Return 1
  1703. EndIf
  1704. $CellCoord += 1
  1705. Until $CellCoord >= Ubound($cellarCoordx)
  1706. Else
  1707. Return 0
  1708. EndIf
  1709. $countMissedCellar += 1
  1710. Call("CellarScreenShot")
  1711. Return 0
  1712. EndFunc
  1713.  
  1714. Func CellarScreenShot()
  1715. If $ScreenShot = 1 Then
  1716. _ScreenCapture_SetBMPFormat(0)
  1717. _ScreenCapture_Capture(@ScriptDir & "\shots\Cellar\CellarShot"& $run & "c" & $CellCoord & ".bmp")
  1718. EndIf
  1719. EndFunc
  1720.  
  1721. Func GoldPerHour()
  1722. Send("i")
  1723. Sleep(Random(750, 800))
  1724. If $CurrentItems = 0 Then
  1725. Call("ScreenShotInventory")
  1726. EndIf
  1727. CheckFullInventory()
  1728. $CurrentGoldCaptured = _TesseractGoldCapture(0, "", 1, 6,544*$x_ratio, 281*$y_ratio, 607*$x_ratio, 292*$y_ratio, 0)
  1729. Sleep(Random(190, 200))
  1730. Send("i")
  1731.  
  1732. $CurrentGoldInteger = ""
  1733.  
  1734.  
  1735. For $i = 1 to stringlen($CurrentGoldCaptured)
  1736. $chr = asc(StringMid($CurrentGoldCaptured, $i, 1))
  1737. if $chr >= 48 And $chr <= 57 Then $CurrentGoldInteger = $CurrentGoldInteger & chr($chr)
  1738. Next
  1739.  
  1740.  
  1741. $trt = TimerDiff($t)
  1742. $SecondsRan = $trt / 1000
  1743.  
  1744. If $StartingGold <= 0 Then $StartingGold = $CurrentGoldInteger
  1745. If $StartingGold > 0 Then $AccumulatedGold = $CurrentGoldInteger - $StartingGold
  1746. $GPH = $AccumulatedGold / $SecondsRan * 60 * 60
  1747.  
  1748. $GPH=(Round($GPH,0))
  1749.  
  1750. If $GPH >= 0 and $AccumulatedGold >=0 then
  1751. GUICtrlSetData($lblStartingG,"Staring Gold: " & $StartingGold)
  1752. GUICtrlSetData($lblGold,$GPH & " Per Hour - Accumulated Gold: " & $AccumulatedGold)
  1753.  
  1754. EndIf
  1755.  
  1756. EndFunc ;==>GoldPerHour
  1757.  
  1758. Func LeaveGame()
  1759. GUICtrlSetData($lblStatus, "Status: Leaving Game")
  1760. Send("{SPACE}")
  1761. sleep(200)
  1762. Send("{Escape}")
  1763. RandClick("left", Round(398 * $x_ratio),Round(322 * $y_ratio), 10, 2) ;Random Click on the leave button
  1764. Call("CalcTime")
  1765. Sleep($timingGameLoad)
  1766. EndFunc ;==>LeaveGame
  1767.  
  1768.  
  1769. Func TownPortal()
  1770. GUICtrlSetData($lblStatus, "Status: Returning to Town")
  1771.  
  1772. Sleep(Random(50, 65))
  1773. Send("t")
  1774. Call("GoldPerHour")
  1775. Sleep($timingTP)
  1776. Call("CheckRepair")
  1777. EndFunc ;==>TownPortal
  1778.  
  1779. Func RandClick($clickType, $xPos, $yPos, $xOff = 5, $yOff = 5, $clicks = 1, $speed = 1)
  1780. If $xOff < 1 Then $xOff = 1
  1781. If $yOff < 1 Then $yOff = 1
  1782. $randX = Round(Random($xPos - ($xOff * $x_ratio), $xPos + ($xOff * $x_ratio)))
  1783. $randY = Round(Random($yPos - ($yOff * $y_ratio), $yPos + ($yOff * $y_ratio)))
  1784. MouseClick($clickType, $randX, $randY, $clicks, $speed)
  1785. EndFunc ;==>RandClick
  1786.  
  1787. Func RandClick1($clickType, $xPos, $yPos, $xOff = 3, $yOff = 2, $clicks = 1, $speed = 1)
  1788. If $xOff < 1 Then $xOff = 1
  1789. If $yOff < 1 Then $yOff = 1
  1790. $randX = Round(Random($xPos - ($xOff * $x_ratio), $xPos + ($xOff * $x_ratio)))
  1791. $randY = Round(Random($yPos - ($yOff * $y_ratio), $yPos + ($yOff * $y_ratio)))
  1792. MouseClick($clickType, $randX, $randY, $clicks, $speed)
  1793. EndFunc ;==>RandClick
  1794.  
  1795. Func RandMove($xPos, $yPos, $xOff = 10, $yOff = 10, $speed = 1)
  1796. $randX = Round(Random($xPos - ($xOff * $x_ratio), $xPos + ($xOff * $x_ratio)))
  1797. $randY = Round(Random($yPos - ($yOff * $y_ratio), $yPos + ($yOff * $y_ratio)))
  1798. MouseMove($randX, $randY, $speed)
  1799. EndFunc ;==>RandMove
  1800.  
  1801. Func StopLog()
  1802. If $run > 0 Then
  1803. $repairCountPercent = $repairCount / $run
  1804. $deathsCountPercent = $deathCount / $run
  1805. $cellarCountPercent = $cellarCount / $run
  1806. $closedCellarCountPercent = ($run - $cellarCount) / $run
  1807. $trt = TimerDiff($t)
  1808. ;Total runtime calculation.
  1809. $hours = Floor((($trt / 1000) / 60) / 60)
  1810. $minutes = (($trt / 1000) / 60)
  1811. If $minutes > 60 Then
  1812. While $minutes > 60
  1813. $minutes -= 60
  1814. WEnd
  1815. EndIf
  1816.  
  1817. _FileWriteLog("Dank Cellar Log.txt", @CRLF & "************************************************" & @CRLF & _
  1818. "Dank Celler" & @CRLF & @CRLF & "Stats:" & @CRLF & _
  1819. "Total Runtime: " & $hours & " hours, " & Ceiling($minutes) & " minutes" & @CRLF & _
  1820. GUICtrlRead($lblLast) & @CRLF & _
  1821. "Total Cellars Found: " & $cellarCount & " (" & Round($cellarCountPercent * 100,.00) & "%" & ")" & @CRLF & _
  1822. "Total Cellars Not Found: " & $run - $cellarCount & " (" & Round($closedCellarCountPercent * 100,.00) & "%" & ")" & @CRLF & _
  1823. "Total Deaths: " & $deathCount & " (" & Round($deathsCountPercent * 100,.00) & "%" & ")" & @CRLF & _
  1824. "Total Repairs: " & $repairCount & " (" & Round($repairCountPercent * 100,.00) & "%" & ")" & @CRLF & @CRLF & "Loot:" & @CRLF & _
  1825. "Magics: " & $MagicCount & " Rares: " & $RareCount & " Legendary's: " & $LegendaryCount & " Set Items: " & $setCount & @CRLF & _
  1826. "Gems: " & $GemCount & @CRLF & _
  1827. GUICtrlRead($lblGold) & $StartingGold & @CRLF & _
  1828. "************************************************")
  1829. EndIf
  1830. EndFunc
  1831.  
  1832. Func Begin()
  1833. If $AddDPS = 0 then
  1834. MsgBox(16, "First Run", "Edit your settings.")
  1835. Else
  1836. $AddDPS = $AddDPS * 3.25
  1837. $attackTime = (170000 / $AddDPS) * 1000
  1838. WinActivate("Diablo III")
  1839. $Go = Not $Go
  1840. GUICtrlSetState($mFile, $GUI_DISABLE)
  1841. GUICtrlSetState($mOptions, $GUI_DISABLE)
  1842. EndIf
  1843. If Not $Go Then WinSetTitle($title, "", $title & " - Halted")
  1844. EndFunc ;==>Begin
  1845.  
  1846. Func TogglePause()
  1847. $Paused = Not $Paused
  1848. While $Paused
  1849. Sleep(100)
  1850. WinSetTitle($title, "", $title & " - Paused")
  1851. ToolTip('[PAUSED] - Deaths: ' & $deathCount & ' | Cellars: ' & $cellarCount, 0, 0)
  1852. WEnd
  1853. WinSetTitle($title, "", $title & " - Running")
  1854. ToolTip("")
  1855. EndFunc ;==>TogglePause
  1856.  
  1857. Func GameAutostart()
  1858. If ProcessExists($gameExecutable) = 0 Then
  1859. GUICtrlSetData($lblStatus, "Status: Starting Game Client")
  1860. Run($gameDiabloIIILoc & $gameExecutable & " -launch")
  1861. sleep($gameStartTime)
  1862. WinActivate("Diablo III")
  1863. Sleep(Random(500, 505))
  1864.  
  1865. Send($gamePassword)
  1866. Sleep(Random(500, 505))
  1867.  
  1868. Send("{ENTER}")
  1869. Sleep($gameStartTime)
  1870. $size = WinGetClientSize("[CLASS:D3 Main Window Class]")
  1871. $x_ratio = $size[0] / 800
  1872. $y_ratio = $size[1] / 600
  1873. Call("Begin")
  1874. Else
  1875. $size = WinGetClientSize("[CLASS:D3 Main Window Class]")
  1876. $x_ratio = $size[0] / 800
  1877. $y_ratio = $size[1] / 600
  1878.  
  1879. Call("Begin")
  1880. EndIf
  1881. EndFunc
  1882.  
  1883. Func ArrayClear(ByRef $aArray)
  1884. Local $iCols = UBound($aArray, 2)
  1885. Local $iDim = UBound($aArray, 0)
  1886. Local $iRows = UBound($aArray, 1)
  1887.  
  1888. If $iDim > 1 Then
  1889. Local $ClearArray2D[$iRows][$iCols]
  1890. $AnalyzedLoot = $ClearArray2D
  1891. EndIf
  1892. EndFunc ;==>_ArrayClear
  1893.  
  1894.  
  1895. Func DebugLog($DebugLine)
  1896. _FileWriteLog( "Debug.txt", $DebugLine )
  1897. EndFunc
  1898.  
  1899.  
  1900. Func ScreenShotInventory()
  1901.  
  1902.  
  1903. _ScreenCapture_Capture("CurrentInventory.png",625 * $x_ratio,93 * $y_ratio,772 * $x_ratio,300 * $y_ratio)
  1904. $CurrentItems = 1
  1905. EndFunc
  1906.  
  1907. Func Stop() ;to allow the script to stop
  1908. Call("StopLog")
  1909. Exit
  1910. EndFunc ;==>Stop
  1911.  
  1912. func ShowLoot()
  1913. GUICtrlSetData($lblGear, "Legendary: " & $LegendaryCount & " - Set: " & $SetCount & " - Rare: " & $RareCount& " - Magic: " & $MagicCount )
  1914. EndFunc ;==>ShowLoot
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement