try 25.6 next time.
Good catch
It was the Bitcointalk forum that inspired us to create Bitcointalksearch.org - Bitcointalk is an excellent site that should be the default page for anybody dealing in cryptocurrency, since it is a virtual gold-mine of data. However, our experience and user feedback led us create our site; Bitcointalk's search is slow, and difficult to get the results you need, because you need to log in first to find anything useful - furthermore, there are rate limiters for their search functionality.
The aim of our project is to create a faster website that yields more results and faster without having to create an account and eliminate the need to log in - your personal data, therefore, will never be in jeopardy since we are not asking for any of your data and you don't need to provide them to use our site with all of its capabilities.
We created this website with the sole purpose of users being able to search quickly and efficiently in the field of cryptocurrency so they will have access to the latest and most accurate information and thereby assisting the crypto-community at large.
require_once('jsonRPCClient.php');
/** BITCOIN **/
$btcu = array("user" => "BitcoinRPC", // RPC Username
"pass" => "password", // RPC Password
"host" => "127.0.0.1", // RPC Hostname/IP
"port" => 9332); // RPC Port
$b = new jsonRPCClient("http://{$btcu['user']}:{$btcu['pass']}@{$btcu['host']}:{$btcu['port']}");
define('MIN_BET', 0.05);
define('MAX_BET', 2.519995);
define('ADDRESS', '1dice6YgEVBf88erBFra9BHf6ZMoyvG88');
$bet_8x=array(0.010562,0.012070,0.013795,0.015765,0.018018,0.020592,0.023533,0.026895,0.030737,0.035128,0.040147,0.045882,0.052436,0.059927,0.068488,0.078272,0.089454,0.102233,0.116838,0.133529,0.152605,0.174406,0.199321,0.227795,0.260337,0.297528,0.340033,0.388609,0.444124,0.507570,0.580081,0.662949,0.757656,0.865893,0.989592,1.130962,1.292528,1.477175,1.688200,1.929371,2.204996,2.519995,2.879994,3.291422);
$total_fees = 0;
$count = 0;
$count_won = 0;
$current_bet_index=0;
$bet = $bet_8x[0];
$total_lost=0;
while (($bet <= MAX_BET) && ($count_won < 200))
{
$balance_a = $b->getbalance('*', 0);
if (!isset($starting_balance)) $starting_balance = $balance_a;
if($b->getbalance('*', 1) < $bet) { // If we don't have enough confirmed bitcoins to send to satoshi dice...
echo "Waiting for confirmed balance";
while($b->getbalance('*', 1) < $bet)
{
echo ".";
sleep(60); // Wait a full minute before checking the balance again.
}
echo "\n";
}
try // Wrapped in a try catch block just incase we run out of cash.
{
$b->sendtoaddress(ADDRESS, (float) $bet);
}
catch(Exception $e)
{
echo "Have: " . $b->getbalance('*', 1) . " Needed: " . $bet . "\n";
die("Ran out of money?\n");
}
$balance_b = $b->getbalance('*', 0);
$count++;
$fee = $balance_a - $balance_b - $bet;
$total_fees += $fee;
$total_fees = number_format($total_fees,8,'.','')+0;
echo 'Game #'.$count."---------------------------------------------\n";
echo "\n".'Balance: ' . $balance_a."";
echo "\n".'Bet Amount Sent: -'. $bet."";
echo "\n".'Fee: -'. (number_format($fee, 8, '.', '') +0) . "";
echo "\n".'Total Fees: -'. $total_fees. "";
echo "\n".'Balance after bet sent: ' . $balance_b . " ".'Waiting';
$balance_c = 0;
while ($balance_b >= $balance_c)
{
sleep(4);
$balance_c = $b -> getbalance('*', 0);
echo '.';
}
echo "\nNew Balance: $balance_c";
$diff = $balance_c - $balance_b;
if ($diff > $bet)
{
$bet = $bet_8x[0];
$current_bet_index=0;
$count_won++;
echo "\n*****Win!***** (Won $count_won out of $count games)";
echo "\nTotal lost: ".$total_lost."";
echo "\nProfit made: ".$diff."";
$net_profit=$diff-$total_lost;
echo "\n"."Net profit: ".$net_profit."\n";
$total_lost=0;
}
else
{
echo "\n".'_____Lose!_____'."";
$total_lost += $balance_a-$balance_c;
echo "\nTotal lost: ".$total_lost."\n";
$bet = $bet_8x[$current_bet_index++];
}
echo "\n";
}
echo 'Starting Balance: '.$starting_balance."\n";
echo 'Ending Balance: '. $balance_c."\n";
echo 'Total Fees: '. $total_fees."\n";
$amt_won = $balance_c - $starting_balance;
echo 'Net Profit: '. (number_format($amt_won,8,'.','') + 0). "\n\n";
?>