View difference between Paste ID: Z4GQ1QGw and 2USBcPs6
SHOW: | | - or go back to the newest paste.
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
19+
		$broke = "false"
20
	}
21
22-
while ($bet -le $max_bet -AND $count_won -le $max_rounds -AND $broke -eq false) { 
22+
while ($bet -le $max_bet -AND $count_won -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
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)
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
				Write-Host ""
98
				Write-Host -ForegroundColor Black -BackgroundColor White "Script ended for an unknown reason."
99
				Write-Host ""
100
		}
101
	}
102
Write-Host ""
103
Write-Host -ForegroundColor Black -BackgroundColor White "Final Stats"
104
Write-Host "Starting Balance: $starting_balance"
105
Write-Host "Ending Balance:   $ending_balance"
106
Write-Host "Total Fees Paid:  $total_fees"
107
$total_diff = $ending_balance - $starting_balance - $total_fees
108
if (($total_diff) -gt 0)
109
	{
110
		Write-Host "Total Profit:     $total_diff"
111
	}else
112
	{
113
		Write-Host "Total Loss:       $total_diff"
114
	}
115
Write-Host ""
116
Write-Host "Script finished."