Advertisement
Guest User

maybe a safer spot

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