here is my gold count portion its kinda complicated to implement so if you are not sure what you are doing I wouldnt try.
Before doing this i would recommend making a copy of your current script incase something doesnt work properly. I will do my best to answer any questions you may have but I am out of town for the 4th of july so it may be a bit before I respond. I have only tried it on 1920x1080 but should support other similiar ratio resolutions. If not you will need to edit to your coords for the tiny gold square $CurrentGoldCaptured = _TesseractScreenCapture(0, "", 1, 2,
1454,508,1920-1571,1080-525, 0)
add this to the includes at the top
#include <tesserect.au3>
#include <currency.au3>
Edit the global list Delete from $hFont=0 in the main script and paste this
$hFont = 0, $title, $Paused, $Go = False, $i = 0, $gX = 0, $gY = 0, $LegendaryCount = 0,$RepairCount=0, $SetCount = 0, $RareCount = 0, $MagicCount = 0,$deathLabel, $GemCount = 0, $TomeCount = 0, $deathCount = 0, $cellarCount = 0, $t = TimerInit(), $rt = 0, $run = 0, $yellow = 0xFFF000, $red = 0xD90000, $lblRun, $lblLocation, $lblStatus, $lblLast, $lblRuntime, $lblGear, $lblItems,$lblGold, $lblFailed, $StartingGold = 0,$AccumulatedGold = 0,$GPH = 0, $StartingG, $AccumulatedG, $TotalGold, $CurrentGoldCaptured , $CurrentGoldInteger
next find the checkfor old ruins function
Code:
If CheckFor("OldRuins", "Area") Then
Sleep(200)
GUICtrlSetData($lblLocation, "Location: Old Ruins")
Call("CheckRepair")
If $StartingGold = 0 Then Call("GoldPerHour")
;Start Run
Now find the function setup gui and replace the entire function
Code:
Func SetupGUI()
$frmBot = GUICreate($title & $ver & " - Updating", 340, 120, Round(1532* $x_ratio), Round(927 * $y_ratio), -1, BitOR($WS_EX_TOPMOST, $WS_EX_TOOLWINDOW), 0)
GUISetBkColor(0xC0C0C0)
$lblRun = GUICtrlCreateLabel("Run Number: 0 - Runs till vendor: 0", 4, 0, 280, 24)
GUICtrlSetFont(-1, 10, 600, 0, "Segoe UI")
GUICtrlSetColor(-1, 0xFF0000)
$lblLocation = GUICtrlCreateLabel("Location: Main Menu", 12, 20, 240, 17)
$deathLabel = GUICtrlCreateLabel("Deaths: 0", 190, 20, 240, 17)
$lblStatus = GUICtrlCreateLabel("Status: ", 12, 35, 240, 17)
$lblLast = GUICtrlCreateLabel("Last Runtime: 0 seconds", 12, 50, 240, 17)
$lblRuntime = GUICtrlCreateLabel("Total Runtime: 0 hours, 0 minutes", 12, 65, 240, 17)
$lblGear = GUICtrlCreateLabel("Legendary: 0 - Set: 0 - Rare: 0", 12, 80, 240, 17)
$lblItems = GUICtrlCreateLabel("Magic: 0 - Gems: 0 - Tomes: 0", 12, 95, 240, 17)
$StartingG = GUICtrlCreateLabel("Starting Gold: 0 ", 190, 50, 240, 17)
$AccumulatedG=GUICtrlCreateLabel("Accumulated Gold: 0 ", 190, 65, 240, 17)
$lblGold=GUICtrlCreateLabel("Gold Per Hour: 0 ", 190, 80, 240, 17)
$TotalGold=GUICtrlCreateLabel("Total Gold: 0 ", 190, 95, 240, 17)
GUISetState(@SW_SHOW)
EndFunc ;==>SetupGUI
now add this after the vendloot function find
EndFunc ;==>VendItems and paste it below that
Code:
Func StopLog()
$repairCountPercent = $repairCount / $run
$deathsCountPercent = $deathCount / $run
$cellarCountPercent = $cellarCount / $run
$closedCellarCountPercent = ($run - $cellarCount) / $run
$trt = TimerDiff($t)
;Total runtime calculation.
$hours = Floor((($trt / 1000) / 60) / 60)
$minutes = (($trt / 1000) / 60)
If $minutes > 60 Then
While $minutes > 60
$minutes -= 60
WEnd
EndIf
_FileWriteLog("Dank Cellar Log.txt", @CRLF & "************************************************" & @CRLF & _
"Dank Celler" & @CRLF & @CRLF & "Stats:" & @CRLF & _
"Total Runtime: " & $hours & " hours, " & Ceiling($minutes) & " minutes" & @CRLF & _
"Total Cellars Found: " & $cellarCount & " (" & Round($cellarCountPercent * 100,.00) & "%" & ")" & @CRLF & _
"Total Cellars Not Found: " & $run - $cellarCount & " (" & Round($closedCellarCountPercent * 100,.00) & "%" & ")" & @CRLF & _
"Total Deaths: " & $deathCount & " (" & Round($deathsCountPercent * 100,.00) & "%" & ")" & @CRLF & _
"Total Repairs: " & $repairCount & " (" & Round($repairCountPercent * 100,.00) & "%" & ")" & @CRLF & @CRLF & "Loot:" & @CRLF & _
"Magic: " & $MagicCount & " - Gems: " & $GemCount & " - Tomes: " & $TomeCount & @CRLF & _
"Legendary: " & $LegendaryCount & " - Set: " & $SetCount & " - Rare: " & $RareCount & @CRLF & _
"Starting Gold: " & $StartingGold & " Gold Per Hour: " & (Round($GPH)) & " Gold Earned: " & $AccumulatedGold & @CRLF & _
"Total Gold: " & $CurrentGoldInteger & @CRLF & _
"************************************************")
EndFunc
Func GoldPerHour()
Send("i")
Sleep(800)
$CurrentGoldCaptured = _TesseractScreenCapture(0, "", 1, 2,1454,508,1920-1571,1080-525, 0)
Send("i")
$CurrentGoldInteger = ""
For $i = 1 to stringlen($CurrentGoldCaptured)
$chr = asc(StringMid($CurrentGoldCaptured, $i, 1))
if $chr >= 48 And $chr <= 57 Then $CurrentGoldInteger = $CurrentGoldInteger & chr($chr)
Next
$trt = TimerDiff($t)
$SecondsRan = $trt / 1000
If $StartingGold <= 0 Then $StartingGold = $CurrentGoldInteger
If $StartingGold > 0 Then $AccumulatedGold = $CurrentGoldInteger - $StartingGold
$GPH = $AccumulatedGold / $SecondsRan * 60 * 60
$GPH=(Round($GPH,0))
If $GPH >= 0 and $AccumulatedGold >=0 then
GUICtrlSetData($StartingG, "Starting Gold: " & _StringAddThousandsSep($StartingGold))
GUICtrlSetData($AccumulatedG, "Gold Earned: "& _StringAddThousandsSep($AccumulatedGold))
GUICtrlSetData($lblGold, "Gold Per Hour: " & _StringAddThousandsSep($GPH))
GUICtrlSetData($TotalGold, "Total Gold: " & _StringAddThousandsSep($CurrentGoldInteger))
EndIf
EndFunc ;==>GoldPerHour
finally you need to edit the leave game function
Code:
Func LeaveGame()
Call("GoldPerHour")
Call("RandSleep")
GUICtrlSetData($lblStatus, "Status: Leaving Game")
Send("{Escape}")
Sleep(200)
RandClick("left", Round(956 * $x_ratio), Round(579 * $y_ratio), 120, 20) ;Random Click on the leave button
Call("CalcTime")
Sleep($loadtime)
EndFunc ;==>LeaveGame
you also need to install tesseract ocr and put these 2 files in the autoit include folder or the folder with the script itself
I uploaded a zip with both the include files and the tesseract ocr program.
UploadMB.com
You may have to edit the tesseract script file to point to the correct location of your tesseract install. it will be this line
Global $tesseract_Program_file = "C:\Program Files (x86)\Tesseract-OCR\tesseract.exe"