Bitcoin Forum
December 03, 2016, 11:40:39 AM *
News: Latest stable version of Bitcoin Core: 0.13.1  [Torrent].
 
   Home   Help Search Donate Login Register  
Pages: « 1 [2] 3 4 5 6 7 8 »  All
  Print  
Author Topic: PHP martingale bot for satoshiDICE  (Read 30823 times)
camem
Jr. Member
*
Offline Offline

Activity: 45


View Profile
May 09, 2012, 06:31:55 PM
 #21

what's all this then

1480765239
Hero Member
*
Offline Offline

Posts: 1480765239

View Profile Personal Message (Offline)

Ignore
1480765239
Reply with quote  #2

1480765239
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
byronbb
Legendary
*
Offline Offline

Activity: 1400


HODL OR DIE


View Profile
May 10, 2012, 04:44:49 PM
 #22


 

warning: the martingale method of betting isn't foolproof. this script may cause you to lose your entire balance.
warning 2: even if the martingale method of betting were foolproof, my php code may not be... use at your own risk.

if you like this and want to send me a few bits for the effort, 1CxzfAQo2UK9rppeQNvNmAFhApPqmdVR8y Cheesy


I would demand a donation from SatoshiDice actually....  Grin

To ad to the warnings of this "system".

camem
Jr. Member
*
Offline Offline

Activity: 45


View Profile
May 10, 2012, 10:20:01 PM
 #23


as stated on their website rules, you can send to more than one of their games at once via a single 'sendmany' transaction.


Good answer, thank you

To make amends I'll make my next question luckier, by only asking it if the hash of it (mod 65535) comes in below a satoshi throw.
julz
Legendary
*
Offline Offline

Activity: 1092



View Profile
May 11, 2012, 04:03:12 AM
 #24

The Jinx is a magical being (often hangs around 2-up games) who grows a little stronger every time someone bets based on 'patterns' occurring in independent events.
The Jinx sometimes gets upset when someone tries to credit its hard work to 'gamblers fallacy' - and may give a run of good luck to the pattern-better just to piss off that interfering logic-nerd!


@electricwings   BM-GtyD5exuDJ2kvEbr41XchkC8x9hPxdFd
Kris
Donator
Hero Member
*
Offline Offline

Activity: 645


View Profile
May 14, 2012, 07:57:24 AM
 #25

So yeah I made 3 btc, and today I lost it all, pretty neat script though, worked perfect Smiley
someguy123
Sr. Member
****
Offline Offline

Activity: 335


PHP Coder, Bitcoin enthusiast, Litecointalk admin


View Profile WWW
June 01, 2012, 03:58:26 PM
 #26

Here's my modified version with a few more sanity checks, it even waits for your balance to be confirmed.
I was testing it out and it worked great, but one issue was, I had it running so quickly, that I ran out of confirmed balance, and had nearly 2BTC unconfirmed, so I added a function to check whether you actually have enough balance confirmed to even send it, if not, it waits 1 minute, and repeats until you have enough balance.

Code:
<?php
require_once('jsonRPCClient.php');
/** BITCOIN **/
$btcu = array("user" => "",             // RPC Username
            
"pass" =>   "",               // RPC Password
            
"host" =>   "localhost",      // 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'6);
define('ADDRESS''1dice97ECuByXAvqXpaYzSaQuPVvrtmz6');

$bet MIN_BET;
$total_fees 0;
$count 0;
$count_won 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 
'Balance: ' $balance_a."       ";
        echo 
'Bet: '$bet."       ";
        echo 
'Fee: '. (number_format($fee8'.''') +0) . "       ";
        echo 
'Total Fees: '$total_fees"\n";
        echo 
'Balance: ' $balance_b "       ".'Waiting';

        
$balance_c 0;

        while (
$balance_b >= $balance_c)
        {
        sleep(4);
$balance_c $b -> getbalance('*'0);
echo '.';
        }

        echo 
"\nBalance: $balance_c       ";

        
$diff $balance_c $balance_b;

        if (
$diff $bet)
        {
                
$bet MIN_BET;
                
$count_won++;
                echo 
"Win! ($count_won out of $count)\n";
        }
        else
        {
                
$bet *= 2;
                echo 
'Lose!'."\n";
        }

        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";

?>


1SoMGuYknDgyYypJPVVKE2teHBN4HDAh3
Administrator/owner of LTC Forum | LTC Block Explorer | Someguy123 Web Development
paraipan
Legendary
*
Offline Offline

Activity: 924


Firstbits: 1pirata


View Profile WWW
June 01, 2012, 04:46:36 PM
 #27

interesting...

BTCitcoin: An Idea Worth Saving - Q&A with bitcoins on rugatu.com - Check my rep
JoelKatz
Legendary
*
Offline Offline

Activity: 1386


Democracy is vulnerable to a 51% attack.


View Profile WWW
June 01, 2012, 09:16:43 PM
 #28

Be careful.

As other users have pointed out, no matter what strategy you use (including martingale progression), you can never overcome the casino's mathematical advantage (Law of Large Numbers). Over the long term the house always wins.
And, equally importantly, the longer you postpone the house's win, the more the house wins. (Because with every wager you place, the house's expected profit goes up.)

I am an employee of Ripple.
1Joe1Katzci1rFcsr9HH7SLuHVnDy2aihZ BM-NBM3FRExVJSJJamV9ccgyWvQfratUHgN
Sukrim
Legendary
*
Offline Offline

Activity: 1848


View Profile
June 01, 2012, 09:29:23 PM
 #29

In other words:
If you play more often, you give the house more chances to win.

https://bitfinex.com <-- leveraged trading of BTCUSD, LTCUSD and LTCBTC (long and short) - 10% discount on fees for the first 30 days with this refcode: x5K9YtL3Zb
Mail me at Bitmessage: BM-BbiHiVv5qh858ULsyRDtpRrG9WjXN3xf
geebus
Sr. Member
****
Offline Offline

Activity: 258



View Profile WWW
June 01, 2012, 11:22:09 PM
 #30

Python Version:

Win32 Binary, Source & Dependencies included.

http://www.mediafire.com/?sdlkfpgyxhcz7st

Feel like donating to me? BTC Address: 14eUVSgBSzLpHXGAfbN9BojXTWvTb91SHJ
shockD
Member
**
Offline Offline

Activity: 93


View Profile
June 02, 2012, 06:17:38 AM
 #31

Be careful.

As other users have pointed out, no matter what strategy you use (including martingale progression), you can never overcome the casino's mathematical advantage (Law of Large Numbers). Over the long term the house always wins.
And, equally importantly, the longer you postpone the house's win, the more the house wins. (Because with every wager you place, the house's expected profit goes up.)

Indeed, careful folks Wink I was screwing around with a slightly modified version of this, bet small amounts over the course of a week and got up about 35 BTC. Then the smackdown came and lost 20 BTC in relatively quick succession. I decided to call it good and stop as I was still ahead. This is precisely what you would expect to happen. Over the long term, your expected return is ~98% or whatever, depending on the game, meaning if you play long enough, you will consistently lose 2%.

Have fun, be safe Smiley

someguy123
Sr. Member
****
Offline Offline

Activity: 335


PHP Coder, Bitcoin enthusiast, Litecointalk admin


View Profile WWW
June 04, 2012, 09:32:59 PM
 #32

Be careful.

As other users have pointed out, no matter what strategy you use (including martingale progression), you can never overcome the casino's mathematical advantage (Law of Large Numbers). Over the long term the house always wins.
And, equally importantly, the longer you postpone the house's win, the more the house wins. (Because with every wager you place, the house's expected profit goes up.)

Indeed, careful folks Wink I was screwing around with a slightly modified version of this, bet small amounts over the course of a week and got up about 35 BTC. Then the smackdown came and lost 20 BTC in relatively quick succession. I decided to call it good and stop as I was still ahead. This is precisely what you would expect to happen. Over the long term, your expected return is ~98% or whatever, depending on the game, meaning if you play long enough, you will consistently lose 2%.

Have fun, be safe Smiley



this is almost my exact experience... very slow climb to +50, sudden smack down back to +30, and then quit about a week ago Cheesy

don't want to be one of those people who end up putting their car / their house on the line!

yeah, I went full retard, I got to 50BTC, went to 17BTC due to them doublespending me or some other bug, then I slowly climbed back to 50BTC... then BAM, huge loss streak on the 50% dice, which brought me to 0.
I'm now broke.
T_T
Note: if you wanna see these results: http://www.satoshidice.com/lookup.php?tx=1LnSD2xBieJQaKXS3EtjTdWUEhkct68jAU
Feel free to facepalm at my long loss streaks =_=

1SoMGuYknDgyYypJPVVKE2teHBN4HDAh3
Administrator/owner of LTC Forum | LTC Block Explorer | Someguy123 Web Development
evoorhees
Legendary
*
Offline Offline

Activity: 994


Democracy is the original 51% attack


View Profile
June 04, 2012, 11:55:21 PM
 #33

And, equally importantly, the longer you postpone the house's win, the more the house wins. (Because with every wager you place, the house's expected profit goes up.)

I'm not sure I agree with this statement. I'm no statistical expert, but I believe what is being referred to here are called "independent events" in statistics, wherein each bet occurs independently of other bets. If you thus bet 9 times and win all 9 times, the 10th bet does not have any worse odds than the first, even though the house's odds have gotten out of whack.

In other words, if you "postpone" the house's win, there's no additional reason to not place the next bet. There is no "karma" in gambling. Every marginal bet has the same chance of you winning. Thus with every wager you place, the house's expected profit does NOT go up, but is the same each time no matter what.

Am I wrong or misunderstanding you Joel?
JoelKatz
Legendary
*
Offline Offline

Activity: 1386


Democracy is vulnerable to a 51% attack.


View Profile WWW
June 05, 2012, 03:38:47 AM
 #34

And, equally importantly, the longer you postpone the house's win, the more the house wins. (Because with every wager you place, the house's expected profit goes up.)

I'm not sure I agree with this statement. I'm no statistical expert, but I believe what is being referred to here are called "independent events" in statistics, wherein each bet occurs independently of other bets. If you thus bet 9 times and win all 9 times, the 10th bet does not have any worse odds than the first, even though the house's odds have gotten out of whack.

In other words, if you "postpone" the house's win, there's no additional reason to not place the next bet. There is no "karma" in gambling. Every marginal bet has the same chance of you winning. Thus with every wager you place, the house's expected profit does NOT go up, but is the same each time no matter what.

Am I wrong or misunderstanding you Joel?
No, you're not wrong. It's just another way to view the same thing. Remember, your expected loses are proportional to your total bets. Thus the more you bet in total, the more you can expect to lose.

To put it another way, the more money you are trying to win or willing to lose when you do a Martingale, the more you can expect to lose.

I am an employee of Ripple.
1Joe1Katzci1rFcsr9HH7SLuHVnDy2aihZ BM-NBM3FRExVJSJJamV9ccgyWvQfratUHgN
ErebusBat
Hero Member
*****
Offline Offline

Activity: 560

I am the one who knocks


View Profile
June 05, 2012, 08:56:39 PM
 #35

Joel.... you picture freaks me out.

░▒▓█ Coinroll.it - 1% House Edge Dice Game █▓▒░ • Coinroll Thread • *FREE* 100 BTC Raffle

Signup for CEX.io BitFury exchange and get GHS Instantly!  Don't wait for shipping, mine NOW!
bearbones
Sr. Member
****
Offline Offline

Activity: 317



View Profile WWW
June 06, 2012, 02:48:06 AM
 #36

However, you have learned a valuable lesson: there is no such a thing called "the strategy to defeat the casino". Don't waste your money (and time) in gambling, instead, help the community to bring Bitcoin to the next level.

I'm pretty sure that gambling is a big part of bringing Bitcoin to the next level. SatoshiDice is unique, and couldn't be done without Bitcoin. The people gambling on it are proving just how useful Bitcoin is. Maybe a major casino will take notice, and make my friend Erik a buyout offer he can't refuse.

Feed Ze Birds Pay and get paid for tweets
Coinapult Send Bitcoins easily over email or text message
ErebusBat
Hero Member
*****
Offline Offline

Activity: 560

I am the one who knocks


View Profile
June 06, 2012, 03:24:47 AM
 #37

I'm pretty sure that gambling is a big part of bringing Bitcoin to the next level. SatoshiDice is unique, and couldn't be done without Bitcoin. The people gambling on it are proving just how useful Bitcoin is. Maybe a major casino will take notice, and make my friend Erik a buyout offer he can't refuse.

I highly doubt this due to reglatory bodies, in the USA anyway.

In fact that is one of the only major stumbling blocks I have from proceeding with a gambling idea of my own... uncle sammy kocking at my door.

░▒▓█ Coinroll.it - 1% House Edge Dice Game █▓▒░ • Coinroll Thread • *FREE* 100 BTC Raffle

Signup for CEX.io BitFury exchange and get GHS Instantly!  Don't wait for shipping, mine NOW!
JoelKatz
Legendary
*
Offline Offline

Activity: 1386


Democracy is vulnerable to a 51% attack.


View Profile WWW
June 06, 2012, 07:21:22 AM
 #38

Joel.... you picture freaks me out.
I'll ask if I can use the picture of me from Bitcoin magazine. It's equally horrible, but the "cartoonizing" makes me less painful to look at.

I am an employee of Ripple.
1Joe1Katzci1rFcsr9HH7SLuHVnDy2aihZ BM-NBM3FRExVJSJJamV9ccgyWvQfratUHgN
JoelKatz
Legendary
*
Offline Offline

Activity: 1386


Democracy is vulnerable to a 51% attack.


View Profile WWW
June 06, 2012, 07:24:16 AM
 #39

I respectfully disagree. Positive balances are the consequence of having "enough luck", not because of a "winner strategy". For each person (doing a martingale) showing a positive balance, there is another (also doing a martingale) with a negative one, and the aggregate balance is negative. Even though you use a martingale approach (or whatever strategy), the expected value of your winnings/losses doesn't change at all.
With a Martingale, the majority of people can have a positive balance. The problem is that the few people who have a negative balance have lost every single cent they were willing to risk. For example, with a typical Martingale system, for every 20 people who have won 100 bitcoins, there's a guy who lost 2700 bitcoins. Your odds of being that guy aren't that high, but if you are, ...

It's like a lottery where you get paid $1 for buying a ticket. But if your ticket gets drawn, they shoot you. Martingale = Hunger Games.

I am an employee of Ripple.
1Joe1Katzci1rFcsr9HH7SLuHVnDy2aihZ BM-NBM3FRExVJSJJamV9ccgyWvQfratUHgN
Bitcoin Oz
Hero Member
*****
Offline Offline

Activity: 700


Wat


View Profile WWW
June 06, 2012, 07:30:20 AM
 #40

Indeed, careful folks Wink I was screwing around with a slightly modified version of this, bet small amounts over the course of a week and got up about 35 BTC. Then the smackdown came and lost 20 BTC in relatively quick succession. I decided to call it good and stop as I was still ahead. This is precisely what you would expect to happen. Over the long term, your expected return is ~98% or whatever, depending on the game, meaning if you play long enough, you will consistently lose 2%.

Have fun, be safe Smiley

this is almost my exact experience... very slow climb to +50, sudden smack down back to +30, and then quit about a week ago Cheesy

don't want to be one of those people who end up putting their car / their house on the line!

I respectfully disagree. Positive balances are the consequence of having "enough luck", not because of a "winner strategy". For each person (doing a martingale) showing a positive balance, there is another (also doing a martingale) with a negative one, and the aggregate balance is negative. Even though you use a martingale approach (or whatever strategy), the expected value of your winnings/losses doesn't change at all.

I'm now broke.

However, you have learned a valuable lesson: there is no such a thing called "the strategy to defeat the casino". Don't waste your money (and time) in gambling, instead, help the community to bring Bitcoin to the next level.





What is onecoin ?  Cheesy

Pages: « 1 [2] 3 4 5 6 7 8 »  All
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!