Skip to content

Commit

Permalink
Merge pull request #12 from Zenairo/stat_tracking_fix
Browse files Browse the repository at this point in the history
Stat tracking fix.
  • Loading branch information
A2TC-YT authored Jul 13, 2024
2 parents e027c7a + 3903b12 commit 2723ea4
Showing 1 changed file with 28 additions and 21 deletions.
49 changes: 28 additions & 21 deletions double_chest_farm.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ OnExit("write_ini")
#Include %A_ScriptDir%/Gdip_all.ahk
pToken := Gdip_Startup()

SetTimer, script_close, 1000

global DEBUG := false

; Data Initialization
Expand Down Expand Up @@ -74,6 +76,21 @@ global DEBUG := false
}
}

; total stats
global TOTAL_FARM_TIME := 0
global TOTAL_RUNS := 0
global TOTAL_CHESTS := 0
global TOTAL_EXOTICS := 0

global CURRENT_FARM_START_TIME := 0
global CURRENT_RUNS := 0
global CURRENT_CHESTS := 0
global CURRENT_EXOTICS := 0

; other global vars
global CHEST_OPENED := false
global EXOTIC_DROP := false

read_ini()
; =================================== ;

Expand Down Expand Up @@ -145,13 +162,6 @@ global DEBUG := false
show_gui()
global GUI_VISIBLE := true

; fun info global vars
; showing stats
global TOTAL_FARM_TIME := 0
global TOTAL_RUNS := 0
global TOTAL_CHESTS := 0
global TOTAL_EXOTICS := 0

; update the total ui stuff with loaded stats
total_time_afk_ui.update_content("Time AFK - " format_timestamp(TOTAL_FARM_TIME, true, true, true, false))
total_runs_ui.update_content("Runs - " TOTAL_RUNS)
Expand All @@ -161,20 +171,6 @@ global DEBUG := false
total_average_loop_time_ui.update_content("Average Loop Time - " format_timestamp((TOTAL_FARM_TIME)/TOTAL_RUNS, false, true, true, true, 2))
total_missed_chests_percent_ui.update_content("Percent Chests Missed - " Round(100 - ((TOTAL_CHESTS)/((TOTAL_RUNS)*2))*100, 2) "%")

global CURRENT_FARM_START_TIME := 0
global CURRENT_RUNS := 0
global CURRENT_CHESTS := 0
global CURRENT_EXOTICS := 0

; hidden stats (im too lazy to actually track these rn, but ideally it could be used to identify if one of the chests is more inconsistent than others)
global TOTAL_GROUP_4_CHESTS := [0, 0, 0, 0, 0, 0] ; 16, 17, 18, 19, 20, no chest
global TOTAL_SUCCESSFUL_GROUP_4_CHESTS := [0, 0, 0, 0, 0]
global MESSED_UP_RUNS := 0

; other global vars
global CHEST_OPENED := false
global EXOTIC_DROP := false

update_chest_ui()
; =================================== ;

Expand Down Expand Up @@ -1508,6 +1504,17 @@ check_tabbed_out:
}
}

script_close:
{
IfWinNotExist, Destiny 2
{
for key, value in key_binds
send, % "{" value " Up}"
ExitApp
}
return
}

; Popup Dialog Functions
; =================================== ;
build_dropdown_string(options, selected) {
Expand Down

0 comments on commit 2723ea4

Please sign in to comment.