Advertisement
Guest User

Betting Script v3

a guest
Jan 19th, 2013
1,051
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $max_rounds = 100
  2. $min_bet = 0.01
  3. $max_bet = 0.32
  4. $address = "1dice7W2AicHosf5EL3GFDUVga7TgtPFn"
  5.  
  6.  
  7.  
  8. Write-Host "Satoshidice Betting Script"
  9.  
  10. $bet = $min_bet
  11. $total_fees = 0
  12. $count = 0
  13. $count_won = 0
  14.  
  15. $starting_balance = ./bitcoind getbalance
  16.  
  17. if ($starting_balance -ge $bet)
  18.     {
  19.         $broke = "false"
  20.     }
  21.  
  22. while ($bet -le $max_bet -AND $count -le $max_rounds -AND $broke -eq "false") {
  23.  
  24.     $count ++
  25.     $balance_a = ./bitcoind getbalance
  26.  
  27.     if ($balance_a -lt $bet)
  28.         {
  29.             $broke = "true"
  30.         }
  31.  
  32.     $tx = ./bitcoind sendtoaddress "$address" $bet
  33.    
  34.     $balance_b = ./bitcoind getbalance
  35.    
  36.     $fee = $balance_a - $balance_b - $bet
  37.     $total_fees += $fee
  38.    
  39.     Write-Host "Game: $count"
  40.     Write-Host "Balance: $balance_a"
  41.     Write-Host "Bet: $bet"
  42.     Write-Host "Fee: $fee"
  43.     Write-Host "Total Fees: $total_fees"
  44.     Write-Host –NoNewLine "Balance: $balance_b Waiting "
  45.    
  46.     $balance_c = 0
  47.     $last_c = 0
  48.    
  49.     while ($balance_b -ge $balance_c)
  50.     {
  51.         $balance_c = ./bitcoind getbalance     
  52.        
  53.         if(  ($balance_c -eq $last_c) -OR ($last_c -eq 0) )
  54.         {
  55.             Write-Host –NoNewLine "."
  56.         }else
  57.         {
  58.             Write-Host "Balance: $balance_c"
  59.         }
  60.        
  61.         $last_c = $balance_c
  62.        
  63.     }
  64.  
  65.     $diff = $balance_c - $balance_b
  66.    
  67.     if ($diff -gt $bet)
  68.     {
  69.         $bet = $min_bet
  70.         $count_won = $count_won + 1
  71.         Write-Host "Win! ($count_won out of $count)"
  72.     }else
  73.     {
  74.         $bet = $bet * 2
  75.         Write-Host "Lose!"
  76.     }
  77.    
  78.     Write-Host ""
  79. }
  80. $ending_balance = ./bitcoind getbalance
  81. if ($bet -gt $max_bet)
  82.     {
  83.         Write-Host ""
  84.         Write-Host -ForegroundColor Black -BackgroundColor White "Script ended due to maximum bet reached."
  85.         Write-Host "Maximum Bet: $max_bet"
  86.         Write-Host ""
  87.     }else
  88.     {
  89.     if ($broke -eq "true")
  90.         {
  91.             Write-Host ""
  92.             Write-Host -ForegroundColor Black -BackgroundColor White "Script ended due to insufficient funds."
  93.             Write-Host "Final Balance: $ending_balance"
  94.             Write-Host ""
  95.         }else
  96.         {
  97.             if ($count -ge $max_count)
  98.             {
  99.                 Write-Host ""
  100.                 Write-Host -ForegroundColor Black -BackgroundColor White "Script ended due to roundlimit."
  101.                 Write-Host "Maximum Rounds:$max_count"
  102.                 Write-Host ""
  103.             }else
  104.             {
  105.                     Write-Host ""
  106.                     Write-Host -ForegroundColor Black -BackgroundColor White "Script ended for an unknown reason."
  107.                     Write-Host ""
  108.             }
  109.         }
  110.     }
  111. Write-Host ""
  112. Write-Host -ForegroundColor Black -BackgroundColor White "Final Stats"
  113. Write-Host "Total Rounds:     $count"
  114. Write-Host "Total Rounds Won: $count_won"
  115. $percent_won = $count_won / $count * 100
  116. Write-Host "Win Percentage:   $percent_won %"
  117. Write-Host "Starting Balance: $starting_balance"
  118. Write-Host "Ending Balance:   $ending_balance"
  119. Write-Host "Total Fees Paid:  $total_fees"
  120. $total_diff = $ending_balance - $starting_balance - $total_fees
  121. if (($total_diff) -gt 0)
  122.     {
  123.         Write-Host "Total Profit:     $total_diff"
  124.     }else
  125.     {
  126.         Write-Host "Total Loss:       $total_diff"
  127.     }
  128. Write-Host ""
  129. Write-Host "Script finished."
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement