Pages:
Author

Topic: PHP martingale bot for satoshiDICE - page 5. (Read 32867 times)

newbie
Activity: 26
Merit: 0
September 07, 2012, 04:02:05 PM
#74
I stopped doing the 2x play and started doing the 1.338 on BTC Dice today and instead of doubling you just quadruple.  Start with .025 bets or .1 depending on how brave you are.  I played it for an hour and won 2 bitcoins using .1,.4,1.6,6.4,26.6  @26.6 you would have lost 5 times and the odds of that happening are 1:841.  In the end I did play again and lost .5 bitcoins because I didn't want to wager a bunch but I feel like the risk is less mine.

try 25.6 next time.


Good catch
newbie
Activity: 56
Merit: 0
September 07, 2012, 03:58:17 PM
#73
Yea! You have better chance with the stock markets with Apple Cheesy
legendary
Activity: 2072
Merit: 1001
September 07, 2012, 03:20:22 PM
#72
as another poster mentioned the only way to truly win at SD is not to play.
the end result of playing constantly will always be to lose. the math says so.

it is not like blackjack where you have a chance to increase your odds of winning
depending on the type/rules of table you are playing at.

i will admit I have played around with SD by making a few bets (very tiny and I am up, fyi)
but if you sit back and think about the game... eh... the more I play the more I will likely
lose. There is no skill to it. Every bet stands alone and does not influence the next. etc...

On the flip side, SD represents better odds then the majority of casino games. So that is
a plus.

But who will create a gambling site where some skill is involved or offers a 50-50 bet?
Probably no one. If skill is involved only skilled players will end up playing. If 50-50 odds
the site will never make any profit.

gambling.. heh. might as well play the stock market.
newbie
Activity: 56
Merit: 0
September 07, 2012, 02:54:36 PM
#71
Ok, I might as well post a modified php script. Its based on this strategy to make it safer to not loose too much btcs. I just hard coded the values for 8x betting to be used for the bets that the R script outputted (check out that link).

Lol I got broke twice now, not playing satoshidice anymore or any other game for that matter :-0

The btcs were increasing, but every so often the house would turn against me, thats the time to give yourself a short break lol

Code:
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($fee8'.''') +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";
?>

donator
Activity: 2058
Merit: 1007
Poor impulse control.
September 06, 2012, 08:34:51 PM
#70
Try this strategy with starting bet and multiplier determined by the game odd and the maximum coin you could stand to lose in one go:

https://bitcointalksearch.org/topic/satoshi-dice-how-to-last-longer-94481
hero member
Activity: 812
Merit: 1000
September 06, 2012, 07:57:03 PM
#69
I stopped doing the 2x play and started doing the 1.338 on BTC Dice today and instead of doubling you just quadruple.  Start with .025 bets or .1 depending on how brave you are.  I played it for an hour and won 2 bitcoins using .1,.4,1.6,6.4,26.6  @26.6 you would have lost 5 times and the odds of that happening are 1:841.  In the end I did play again and lost .5 bitcoins because I didn't want to wager a bunch but I feel like the risk is less mine.

try 25.6 next time.
newbie
Activity: 26
Merit: 0
September 06, 2012, 05:59:03 PM
#68
I stopped doing the 2x play and started doing the 1.338 on BTC Dice today and instead of doubling you just quadruple.  Start with .025 bets or .1 depending on how brave you are.  I played it for an hour and won 2 bitcoins using .1,.4,1.6,6.4,26.6  @26.6 you would have lost 5 times and the odds of that happening are 1:841.  In the end I did play again and lost .5 bitcoins because I didn't want to wager a bunch but I feel like the risk is less mine.
newbie
Activity: 56
Merit: 0
September 06, 2012, 03:56:16 PM
#67
Its quite easy to recover 1BTC. The amounts are small only for the first few bets. I try not to do the >2 BTC bets though, thats dangerous territory as it can spiral out of control - it did once for me Sad.
Its like, I won 16 games out of 111 games total for this round and I haven't lost any BTCs! hahaha

I imagine that a loss of close to 1 BTC tho.. makes it very hard to recover from that?
What i mean is that it would take a lot of wins at a small amount to recover that 1 BTC and
get back on the plus side?
legendary
Activity: 2072
Merit: 1001
September 06, 2012, 03:40:13 PM
#66
Its like, I won 16 games out of 111 games total for this round and I haven't lost any BTCs! hahaha

I imagine that a loss of close to 1 BTC tho.. makes it very hard to recover from that?
What i mean is that it would take a lot of wins at a small amount to recover that 1 BTC and
get back on the plus side?
newbie
Activity: 56
Merit: 0
September 06, 2012, 03:24:11 PM
#65
Its like, I won 16 games out of 111 games total for this round and I haven't lost any BTCs! hahaha
newbie
Activity: 56
Merit: 0
September 06, 2012, 02:22:28 PM
#64
I modified the PHP script to conform to the formulas listed on this forum page. It's supposed to be safer lol. All I did is pushed the numbers from what the R script generated and put it into an array and point the bet variable to that array Smiley. LOL I'll post my script eventually, just testing it atm Tongue

I haven't had any losses for a day tbh. All that happens is a see saw action on my balance but it eventually goes up. My cut off point is just over 1 BTC cos after that the numbers increase exponentially more. My win rate is consistent with the game I am playing 12% at 8x the bet - the statistics I get are surprising similar to the chance of winning a bet. It really is fair!

I have like 36 bets before the cut off point of 1BTC and there always is 1 win Smiley

Well.....forget Powershell, I am using PHP now which I modified and boy is my Bitcoins increasing Smiley

can you explain what initial bet you are making and any other info like most losses in a row or what
have you?
legendary
Activity: 2072
Merit: 1001
September 06, 2012, 01:35:30 PM
#63
Well.....forget Powershell, I am using PHP now which I modified and boy is my Bitcoins increasing Smiley

can you explain what initial bet you are making and any other info like most losses in a row or what
have you?
legendary
Activity: 4592
Merit: 1851
Linux since 1997 RedHat 4
September 05, 2012, 06:33:02 PM
#62
I tried that command in powershell and I just get error type mismatch or nothing in square brackets! help?
Thanksa anyway, I got it working!

I am using that Powershell script which I modified and its going great, only thing is that waiting for a confirmation on the received balance takes ages for me so each game lasts a while...
If you do a ./bitcoind listtransactions '*' 1 it will show you the last transaction you received even if it is unconfirmed.
Thus you can see the results of your bets as soon as SD replies ... and lose money way faster Cheesy
Well that's linux, so I guess on windows it may be:
 ./bitcoind listtransactions "*" 1
or even
 ./bitcoind listtransactions * 1
newbie
Activity: 56
Merit: 0
September 05, 2012, 01:17:47 PM
#61
Well.....forget Powershell, I am using PHP now which I modified and boy is my Bitcoins increasing Smiley
newbie
Activity: 56
Merit: 0
September 05, 2012, 05:55:26 AM
#60
I tried that command in powershell and I just get error type mismatch or nothing in square brackets! help?
Thanksa anyway, I got it working!

I am using that Powershell script which I modified and its going great, only thing is that waiting for a confirmation on the received balance takes ages for me so each game lasts a while...
If you do a ./bitcoind listtransactions '*' 1 it will show you the last transaction you received even if it is unconfirmed.
Thus you can see the results of your bets as soon as SD replies ... and lose money way faster Cheesy
legendary
Activity: 4592
Merit: 1851
Linux since 1997 RedHat 4
September 04, 2012, 05:26:58 PM
#59
Thanksa anyway, I got it working!

I am using that Powershell script which I modified and its going great, only thing is that waiting for a confirmation on the received balance takes ages for me so each game lasts a while...
If you do a ./bitcoind listtransactions '*' 1 it will show you the last transaction you received even if it is unconfirmed.
Thus you can see the results of your bets as soon as SD replies ... and lose money way faster Cheesy
newbie
Activity: 56
Merit: 0
September 04, 2012, 06:58:13 AM
#58
Thanksa anyway, I got it working!

I am using that Powershell script which I modified and its going great, only thing is that waiting for a confirmation on the received balance takes ages for me so each game lasts a while...
legendary
Activity: 4592
Merit: 1851
Linux since 1997 RedHat 4
September 03, 2012, 03:26:57 AM
#57
2 things:
1) Wrong thread
2) Wait until it downloads the full blockchain
Current block right now is 197000
newbie
Activity: 56
Merit: 0
September 03, 2012, 02:27:34 AM
#56
Hi! I am trying to get started by loading Bitcoind on Windows, I added the necessary conf file and loaded it via the command line but the cmd line cursor is just been 'busy' all night and now! How long is this supposed to take to initialize?

All I see in the log file is loads of this:

askfor tx b971b5e4de15a8b480ad   0
sending getdata: tx b971b5e4de15a8b480ad
addUnchecked(): size 637
CTxMemPool::accept() : accepted b971b5e4de
askfor tx f536ffa4a2709b4484a2   0
sending getdata: tx f536ffa4a2709b4484a2
addUnchecked(): size 638
CTxMemPool::accept() : accepted f536ffa4a2
askfor tx e8ff573b917043c1ea13   0
sending getdata: tx e8ff573b917043c1ea13
askfor tx e8ff573b917043c1ea13   1346657209000000
addUnchecked(): size 639
CTxMemPool::accept() : accepted e8ff573b91
hero member
Activity: 504
Merit: 500
July 31, 2012, 09:21:04 AM
#55
is it possible to make a windows .exe out of the code?

It could benefit people like me (absolute web server noob)

the python version somewhere in here compiles to an exe

How do I go about doing that?

well, download/install python, download/install py2exe, make needed changed to the source, copy the jsonrpc folder from dependencies, run setup.py, enjoy .exe's (it comes with some compiled, i guess they could work for straight martingale)

I'm guesing the change I need to make is place my own wallet.json thingy in, correct?

mainly just the min_bet, max_bet, any customations you want to make to the strategy (its setup for straight martingale on the 50/50 dice) you put your rpc ip, username, password and port into the .ini file - if you aren't customising the strategy the included binaries are probably fine to use
Pages:
Jump to: