View difference between Paste ID: Nt4hGQuC and Z4GQ1QGw
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"
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 -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
		if ($count -ge $max_count)
97
		{
98
			Write-Host ""
99
			Write-Host -ForegroundColor Black -BackgroundColor White "Script ended due to roundlimit."
100
			Write-Host "Maximum Rounds:$max_count"
101
			Write-Host ""
102
		}else
103
		{
104
				Write-Host ""
105
				Write-Host -ForegroundColor Black -BackgroundColor White "Script ended for an unknown reason."
106
				Write-Host ""
107
		}
108
	}
109
Write-Host ""
110
Write-Host -ForegroundColor Black -BackgroundColor White "Final Stats"
111
Write-Host "Total Rounds:     $count"
112
Write-Host "Total Rounds Won: $count_won"
113
$percent_won = $count_won / $count * 100
114
Write-Host "Win Percentage:   $percent_won %"
115
Write-Host "Starting Balance: $starting_balance"
116
Write-Host "Ending Balance:   $ending_balance"
117
Write-Host "Total Fees Paid:  $total_fees"
118
$total_diff = $ending_balance - $starting_balance - $total_fees
119
if (($total_diff) -gt 0)
120
	{
121
		Write-Host "Total Profit:     $total_diff"
122
	}else
123
	{
124
		Write-Host "Total Loss:       $total_diff"
125
	}
126
Write-Host ""
127
Write-Host "Script finished."