Skip to content

Commit

Permalink
Update D2Loader.ps1
Browse files Browse the repository at this point in the history
1.8.3
  • Loading branch information
shupershuff authored Aug 9, 2023
1 parent 66180b5 commit 5fafbc2
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions D2Loader.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,8 @@ Servers:
EU - eu.actual.battle.net
Asia - kr.actual.battle.net
Changes since 1.8.1 (next version edits):
Fixed an oversight from the previous release where a missing value in stats.csv causes errors to occur for new users who have downloaded the script fresh.
Minor Formatting changes
Added a couple of comments.
Changes since 1.8.2 (next version edits):
Fix issue where updater doesn't work on first of the month. My bad. Some folks will have to manually update from 1.8.2 from whatever new version there is.
1.8.3-1.9.0 to do list
Find more accurate dclone tracker - Replacement Source likely to be https://diablo2.io/dclone_api.php. maybe add config option for $D2CloneTracker to choose between diablo2.io & D2runewizard.com.
Expand All @@ -33,7 +31,7 @@ Fix whatever I broke or poorly implemented in 1.8.1 :)
#>

param($AccountUsername,$PW,$Region,$All,$Batch,$ManualSettingSwitcher) #used to capture parameters sent to the script, if anyone even wants to do that.
$CurrentVersion = "1.8.2"
$CurrentVersion = "1.8.3"

###########################################################################################################################################
# Script itself
Expand Down Expand Up @@ -193,6 +191,10 @@ elseif ($CurrentStats.LastUpdateCheck -eq "") {# If script has just been freshly
$CurrentStats | Export-Csv "$Script:WorkingDirectory\Stats.csv" -NoTypeInformation
}

if ($CurrentStats.LastUpdateCheck.IndexOf("/") -eq 1){# If date (day) is only a single digit.
$CurrentStats.LastUpdateCheck = "0" + $CurrentStats.LastUpdateCheck
}

#Only Check for updates if updates haven't been checked in last 8 hours. Reduces API requests.
if ([DateTime]::ParseExact($CurrentStats.LastUpdateCheck, "dd/MM/yyyy h:mm:ss tt", $null) -lt (Get-Date).addhours(-8).datetime){# Compare current date and time to LastUpdateCheck date & time.
try {
Expand Down

0 comments on commit 5fafbc2

Please sign in to comment.