Skip to content

Commit

Permalink
Update core - add currencies to output
Browse files Browse the repository at this point in the history
Show all selected currencies (config.txt) instead of the first, only.
  • Loading branch information
RainbowMiner committed Aug 13, 2018
1 parent 514cb2f commit a3c9ab1
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions RainbowMiner.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ Import-Module Defender -ErrorAction Ignore
Import-Module "$env:Windir\System32\WindowsPowerShell\v1.0\Modules\NetSecurity\NetSecurity.psd1" -ErrorAction Ignore
Import-Module "$env:Windir\System32\WindowsPowerShell\v1.0\Modules\Defender\Defender.psd1" -ErrorAction Ignore

Test-TimeSync
if ($UseTimeSync) {Test-TimeSync}

$Timer = (Get-Date).ToUniversalTime()
$StatEnd = $Timer
Expand Down Expand Up @@ -1156,7 +1156,6 @@ while ($true) {
}
}


if ($Config.MiningMode -eq "combo") {
if (($AllMiners | Where-Object {$_.HashRates.PSObject.Properties.Value -eq $null -and $_.DeviceModel -notmatch '-'} | Measure-Object).Count -gt 1) {
#Benchmarking is still ongoing - remove device combos from miners
Expand Down Expand Up @@ -1567,15 +1566,21 @@ while ($true) {
Write-Host $Miner_DeviceTitle
Write-Host $("=" * $Miner_DeviceTitle.Length)

$Miners | Where-Object {$_.DeviceModel -eq $Miner_DeviceModel} | Where-Object {$_.Profit -ge 1E-5 -or $_.Profit -eq $null} | Sort-Object DeviceModel, @{Expression = {if ($MinersNeedingBenchmark.Count -gt 0) {$_.HashRates.PSObject.Properties.Name}}}, @{Expression = {if ($MinersNeedingBenchmark.Count -gt 0) {$_.Profit}}; Descending = $true}, @{Expression = {if ($MinersNeedingBenchmark.Count -lt 1) {[double]$_.Profit_Bias}}; Descending = $true} | Select-Object -First $($LimitMiners) | Format-Table (
[System.Collections.ArrayList]$Miner_Table = @(
@{Label = "Miner"; Expression = {$_.Name -split '-' | Select-Object -Index 0}},
@{Label = "Algorithm"; Expression = {$_.HashRates.PSObject.Properties.Name}},
@{Label = "Speed"; Expression = {$_.HashRates.PSObject.Properties.Value | ForEach-Object {if ($_ -ne $null) {"$($_ | ConvertTo-Hash)/s"}else {"Benchmarking"}}}; Align = 'right'},
@{Label = "$($Config.Currency | Select-Object -Index 0)/Day"; Expression = {if ($_.Profit) {ConvertTo-LocalCurrency $($_.Profit) $($Rates.$($Config.Currency | Select-Object -Index 0)) -Offset 2} else {"Unknown"}}; Align = "right"},
@{Label = "Speed"; Expression = {$_.HashRates.PSObject.Properties.Value | ForEach-Object {if ($_ -ne $null) {"$($_ | ConvertTo-Hash)/s"}else {"Benchmarking"}}}; Align = 'right'}
)
foreach($Miner_Currency in $Config.Currency) {
$Miner_Table.Add(@{Label = "$Miner_Currency/Day $($_.Profit)"; Expression = [scriptblock]::Create("if (`$_.Profit) {ConvertTo-LocalCurrency `$(`$_.Profit) $($Rates.$Miner_Currency) -Offset 2} else {`"Unknown`"}"); Align = "right"}) | Out-Null
}
$Miner_Table.AddRange(@(
@{Label = "Accuracy"; Expression = {$_.Pools.PSObject.Properties.Value.MarginOfError | ForEach-Object {(1 - $_).ToString("P0")}}; Align = 'right'},
@{Label = "Fee"; Expression = {$_.DevFee.PSObject.Properties.Value | ForEach-Object {if ($_) {'{0:p2}' -f ($_/100) -replace ",*0+\s%"," %"}else {"-"}}}; Align = 'right'},
@{Label = "Pool"; Expression = {$_.Pools.PSObject.Properties.Value | ForEach-Object {"$($_.Name)$(if ($_.CoinName) {"-$($_.CoinName)"})"}}}
) | Out-Host
)) | Out-Null

$Miners | Where-Object {$_.DeviceModel -eq $Miner_DeviceModel} | Where-Object {$_.Profit -ge 1E-5 -or $_.Profit -eq $null} | Sort-Object DeviceModel, @{Expression = {if ($MinersNeedingBenchmark.Count -gt 0) {$_.HashRates.PSObject.Properties.Name}}}, @{Expression = {if ($MinersNeedingBenchmark.Count -gt 0) {$_.Profit}}; Descending = $true}, @{Expression = {if ($MinersNeedingBenchmark.Count -lt 1) {[double]$_.Profit_Bias}}; Descending = $true} | Select-Object -First $($LimitMiners) | Format-Table $Miner_Table | Out-Host
}

if ($RestartMiners) {
Expand Down

0 comments on commit a3c9ab1

Please sign in to comment.