Advertisement
Guest User

Untitled

a guest
Mar 21st, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.72 KB | None | 0 0
  1. . .\Include.ps1
  2.  
  3. $Name = Get-Item $MyInvocation.MyCommand.Path | Select-Object -ExpandProperty BaseName
  4.  
  5.  
  6. $blockmasters_Request = [PSCustomObject]@{}
  7.  
  8.  
  9. try {
  10. $blockmasters_Request = Invoke-RestMethod "http://blockmasters.co/api/status" -UseBasicParsing -TimeoutSec 10 -ErrorAction Stop
  11.  
  12. }
  13. catch {
  14. Write-Warning "Sniffdog howled at ($Name) for a failed API check. "
  15. return
  16. }
  17.  
  18. if (($blockmasters_Request | Get-Member -MemberType NoteProperty -ErrorAction Ignore | Measure-Object Name).Count -le 1) {
  19. Write-Warning "SniffDog sniffed near ($Name) but ($Name) Pool API had no scent. "
  20. return
  21. }
  22.  
  23. $Location = 'US'
  24. $blockmasters_Request | Get-Member -MemberType NoteProperty -ErrorAction Ignore | Select -ExpandProperty Name | foreach {
  25. #$blockmasters_Request | Get-Member -MemberType NoteProperty -ErrorAction Ignore | Select-Object -ExpandProperty Name | Where-Object {$blockmasters_Request.$_.hashrate -gt 0} | foreach {
  26. $blockmasters_Host = "blockmasters.co"
  27. $blockmasters_Port = $blockmasters_Request.$_.port
  28. $blockmasters_Algorithm = Get-Algorithm $blockmasters_Request.$_.name
  29. $blockmasters_Coin = $blockmasters_Request.$_.coins
  30. $blockmasters_Fees = $blockmasters_Request.$_.fees
  31. $blockmasters_Workers = $blockmasters_Request.$_.workers
  32.  
  33. $Divisor = 1000000
  34.  
  35. switch($blockmasters_Algorithm)
  36. {
  37.  
  38.  
  39.  
  40. "neoscrypt"{$Divisor *= 1000}
  41. "xevan"{$Divisor *= 1000}
  42. "c11"{$Divisor *= 1000}
  43. "phi"{$Divisor *= 1000}
  44. "tribus"{$Divisor *= 1000}
  45. "skunk"{$Divisor *= 1000}
  46. "lyra2v2"{$Divisor *= 1000}
  47. "skein"{$Divisor *= 1000}
  48.  
  49.  
  50.  
  51. }
  52.  
  53.  
  54. if((Get-Stat -Name "$($Name)_$($blockmasters_Algorithm)_Profit") -eq $null){$Stat = Set-Stat -Name "$($Name)_$($blockmasters_Algorithm)_Profit" -Value ([Double]$blockmasters_Request.$_.estimate_last24h/$Divisor*(1-($blockmasters_request.$_.fees/100)))}
  55. else{$Stat = Set-Stat -Name "$($Name)_$($blockmasters_Algorithm)_Profit" -Value ([Double]$blockmasters_Request.$_.estimate_current/$Divisor *(1-($blockmasters_request.$_.fees/100)))}
  56.  
  57. if($Wallet)
  58. {
  59. [PSCustomObject]@{
  60. Algorithm = $blockmasters_Algorithm
  61. Info = "$blockmasters_Coin - Coin(s)"
  62. Price = $Stat.Live
  63. Fees = $blockmasters_Fees
  64. StablePrice = $Stat.Week
  65. Workers = $blockmasters_Workers
  66. MarginOfError = $Stat.Fluctuation
  67. Protocol = "stratum+tcp"
  68. Host = $blockmasters_Host
  69. Port = $blockmasters_Port
  70. User = $Wallet
  71. Pass = "ID=$RigName,c=$Passwordcurrency"
  72. Location = $Location
  73. SSL = $false
  74. }
  75. }
  76. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement