Skip to content

Commit

Permalink
Update Core.ps1
Browse files Browse the repository at this point in the history
  • Loading branch information
UselessGuru committed Feb 2, 2025
1 parent 500bb79 commit 48a9190
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Includes/Core.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,9 @@ Try {

If ($Config.Donation -gt 0) {
If (-not $Variables.DonationStart) {
# Re-Randomize donation start and data once per day, do not donate if remaing time for today is less than donation duration
If (($Variables.DonationLog.Start | Select-Object -Last 1) -ne [DateTime]::Today) {
# Re-Randomize donation start and data once per day
If ((Get-Item -Path "$PWD\Logs\DonationLog.csv" -ErrorAction Ignore).LastWriteTime -lt [DateTime]::Today) {
# Do not donate if remaing time for today is less than donation duration
If ($Config.Donation -lt (1440 - [Math]::Floor([DateTime]::Now.TimeOfDay.TotalMinutes))) {
$Variables.DonationStart = [DateTime]::Now.AddMinutes((Get-Random -Minimum 0 -Maximum (1440 - [Math]::Floor([DateTime]::Now.TimeOfDay.TotalMinutes) - $Config.Donation)))
}
Expand Down

0 comments on commit 48a9190

Please sign in to comment.