Pages:
Author

Topic: PHP martingale bot for satoshiDICE - page 2. (Read 32838 times)

donator
Activity: 2058
Merit: 1007
Poor impulse control.
February 13, 2013, 06:59:45 PM

Well, if you play long enough, your losses will get arbitrarily close to the house edge.

But if you only play a few times you can end up making a profit.

The guy who only ever makes one bet and doubles his stake has "escaped the house edge", hasn't he?

I assume that the purpose of a bot is to play long enough.

No, anyone using a bot is likely to have played too long. The longer you play, the more likely your luck tends to expected, and the vloser you tend to get to a loss equating to the house edge. That's just rephrasing what dooglus wrote.

It boils down to: the longer you martingale, the more likely your winnngs are to be a range that can be mathematically described as follows:

Code:
lost your shirt <  earnings <  (1 - house edge) * amount you bet
legendary
Activity: 1148
Merit: 1018
February 13, 2013, 06:48:58 PM

Well, if you play long enough, your losses will get arbitrarily close to the house edge.

But if you only play a few times you can end up making a profit.

The guy who only ever makes one bet and doubles his stake has "escaped the house edge", hasn't he?

I assume that the purpose of a bot is to play long enough.
legendary
Activity: 2940
Merit: 1330
February 13, 2013, 05:29:48 PM
Can you  add a feature, to the results of the past N bets, If greater than a certain threshold, and suspended for 10 minutes

Can you be a bit clearer please?  You want it to pause when it's won a certain amount in the last so many bets?  Is that net win?  Like suppose we start at 1 BTC, we lose a bunch, doubling up each time, the last N=3 bets were 64, 128, and 256, and only the 256 won, does that count as a win of 64?  Because it's really only a win of about 1 BTC.  And what's with the weird quoting?  Gyrsur and myself didn't say any of that stuff...

like the example above,can we  query to result directly from the satoshidice website.

That's a good idea.  I'll add both when I need a break from 'real work'.  Smiley
legendary
Activity: 2940
Merit: 1330
February 13, 2013, 05:21:45 PM

Well, if you play long enough, your losses will get arbitrarily close to the house edge.

But if you only play a few times you can end up making a profit.

The guy who only ever makes one bet and doubles his stake has "escaped the house edge", hasn't he?
member
Activity: 117
Merit: 10
Not only FUD :)
February 13, 2013, 01:36:36 PM
Code:
function get_result($mode, $bet_txid, $game_name)
{
unset($r);
$jsonurl = "http://satoshiroulette.com/log.api.php?txid=$bet_txid&mode=$mode";

while(! isset($r->{$game_name}) )
{
$json = file_get_contents($jsonurl);
$r = json_decode($json);
if(isset($r->{$game_name}))
{
$result = $r->{$game_name};
}
print ".";
$s = rand($GLOBALS['sleep'], $GLOBALS['sleep_max']);
sleep($s);
}
return $result;
}

 like the example above,can we  query to result directly from the satoshidice website.

$jsonurl = "http://www.satoshidice.com/lookup.php?tx=$bet_txid&limit=250&min_bet=0&status=ALL&format=json";


legendary
Activity: 1148
Merit: 1018
member
Activity: 117
Merit: 10
Not only FUD :)
February 13, 2013, 06:41:21 AM
  Can you  add a feature, to the results of the past N bets, If greater than a certain threshold, and suspended for 10 minutes



newbie
Activity: 24
Merit: 0
February 08, 2013, 01:20:11 AM
Made 2.46 bitcoin in total. I think I'm done gambling forever!



The last I heard from him:
  "[11:31:16 PM] made a whole bitcoin tonight!!"

hopefully that's not "the last we hear from him" Cheesy

quit while you're ahead KJ!

hero member
Activity: 812
Merit: 1000
February 07, 2013, 09:49:54 PM
The last I heard from him:
  "[11:31:16 PM] made a whole bitcoin tonight!!"

hopefully that's not "the last we hear from him" Cheesy

quit while you're ahead KJ!
legendary
Activity: 2940
Merit: 1330
February 07, 2013, 09:47:06 PM
Using your script, localhost as allowed ip in conf. Running from command line. Still get that http error Sad

I PM'ed him, used TeamViewer to diagnose the problem.  Turned out he had two copies of the script, and was running an old copy while editing the new copy.  Running the new copy showed straight away that his wallet was encrypted and locked.

I modified the script so it prompts for a passphrase, but my Windows skills are weak, and apparently it didn't work.  So I guess he either ended up unlocking his wallet manually or hardcoding the passphrase into the script.

The last I heard from him:
  "[11:31:16 PM] made a whole bitcoin tonight!!"

Smiley

I made a few other changes to the script. like adding the option to set constant starting and stopping bet sizes, rather than using a percentage of your balance, and stopping if a certain file exists.

  http://github.com/dooglus/sdbot
newbie
Activity: 24
Merit: 0
February 06, 2013, 04:01:56 PM
Using your script, localhost as allowed ip in conf. Running from command line. Still get that http error Sad



I don't think that will work as when I just run it for 30 seconds I get a repeat of this once it's done

Warning: fopen(http://[email protected]:8332/): failed to open stream: HTTP request failed! HTTP/1.1 500 Internal Server Error in C:\xampp\htdocs\jsonRPCClient.php on line 132

Run the script on the command line:

  php bot.php

not from a web server.

Try using my script and the json-rpc PHP file that's with it.  It has better error handling.

  https://github.com/dooglus/sdbot
legendary
Activity: 2940
Merit: 1330
February 06, 2013, 03:57:46 PM
So, what next? Buy bitcoins to feed the SD monster with 20.48 --> 40.96 --> 81.92?? NO WAY!! DON'T FEED THE SD MONSTER. IT IS WASTE OF TIME.

I think we all realise that there's no way to guarantee a win at satoshidice, and that the longer you play, the more likely you are to make a loss.  It can be fun/exciting/scary to use Martingale betting, but of course you should never risk more than you can afford to lose, because you might end up losing everything you bet.
legendary
Activity: 2856
Merit: 1518
Bitcoin Legal Tender Countries: 2 of 206
February 06, 2013, 08:16:09 AM
you cannot successfully play SD with logic or a script. forget to play with this!

to beat SD you have to play with illogicalness. this is where the fear of SD comes from!

http://blockchain.info/tx/9784cb364ffbaa000bbb5574ec6a50c9f500c9df830cf89d3cd90318bd7225dc --> WIN

EDIT: http://blockchain.info/tx/9b446789a58501a84767f0ad87013982aec870048b40cc895fc3fde0c56af37a --> WIN

EDIT2: http://blockchain.info/tx/812bdb3cc7e620e38e1fdee74361d58c1c860e3d2b2b7a7ee3c37047e2157a8c --> LOSE

So, what next? Buy bitcoins to feed the SD monster with 20.48 --> 40.96 --> 81.92?? NO WAY!! DON'T FEED THE SD MONSTER. IT IS WASTE OF TIME.

^^update
legendary
Activity: 2940
Merit: 1330
February 06, 2013, 07:20:16 AM
nope that's old-fashioned and against modern recommendations

pretty much any php parser will work just fine without a closing ?> at the end of the file, and leaving it off the end of the file makes it less likely you'll accidentally introduce unwanted whitespace in the output.

I didn't know that.  Thanks!
hero member
Activity: 812
Merit: 1000
February 06, 2013, 07:00:31 AM
or first try the bare minimum:

Code:
require_once('jsonRPCClient.php');
$b = new jsonRPCClient('http://KJTetc:MyRpcpass@localhost:8332/');
print_r($b->getinfo());

You'll need a ?> at the end too.

nope that's old-fashioned and against modern recommendations

pretty much any php parser will work just fine without a closing ?> at the end of the file, and leaving it off the end of the file makes it less likely you'll accidentally introduce unwanted whitespace in the output.
legendary
Activity: 2940
Merit: 1330
February 06, 2013, 06:56:02 AM
or first try the bare minimum:

Code:
require_once('jsonRPCClient.php');
$b = new jsonRPCClient('http://KJTetc:MyRpcpass@localhost:8332/');
print_r($b->getinfo());

You'll need a ?> at the end too.
hero member
Activity: 812
Merit: 1000
February 06, 2013, 06:26:42 AM
I don't think that will work as when I just run it for 30 seconds I get a repeat of this once it's done

Warning: fopen(http://[email protected]:8332/): failed to open stream: HTTP request failed! HTTP/1.1 500 Internal Server Error in C:\xampp\htdocs\jsonRPCClient.php on line 132

Run the script on the command line:

  php bot.php

not from a web server.

Try using my script and the json-rpc PHP file that's with it.  It has better error handling.

  https://github.com/dooglus/sdbot

or first try the bare minimum:

Code:
require_once('jsonRPCClient.php');
$b = new jsonRPCClient('http://KJTetc:MyRpcpass@localhost:8332/');
print_r($b->getinfo());
legendary
Activity: 2940
Merit: 1330
February 06, 2013, 04:59:45 AM
I don't think that will work as when I just run it for 30 seconds I get a repeat of this once it's done

Warning: fopen(http://[email protected]:8332/): failed to open stream: HTTP request failed! HTTP/1.1 500 Internal Server Error in C:\xampp\htdocs\jsonRPCClient.php on line 132

Run the script on the command line:

  php bot.php

not from a web server.

Try using my script and the json-rpc PHP file that's with it.  It has better error handling.

  https://github.com/dooglus/sdbot
newbie
Activity: 24
Merit: 0
February 06, 2013, 03:55:33 AM
I don't think that will work as when I just run it for 30 seconds I get a repeat of this once it's done

Warning: fopen(http://[email protected]:8332/): failed to open stream: HTTP request failed! HTTP/1.1 500 Internal Server Error in C:\xampp\htdocs\jsonRPCClient.php on line 132

Just ran the loop thing for about 5 minutes and no trades made. Sad

I'm gonna try your script as it looks 1000x better.

Here is an error I get:

Fatal error: Maximum execution time of 30 seconds exceeded in C:\xampp\htdocs\bot2.php on line 132



BTC2 received, thanks.  Good luck! (you'll need it if you plan to use martingale betting for very long...)
When you run PHP on a web server there is typically a 30s time limit.
You can increase that in the PHP code with:
 set_time_limit(3600);
Which will mean an hour from the time that was executed.
Though if you put that in the correct loop (probably the innermost loop?) it will stop it from ever timing out.
legendary
Activity: 4466
Merit: 1798
Linux since 1997 RedHat 4
February 06, 2013, 02:22:56 AM
I'm gonna try your script as it looks 1000x better.

Here is an error I get:

Fatal error: Maximum execution time of 30 seconds exceeded in C:\xampp\htdocs\bot2.php on line 132



BTC2 received, thanks.  Good luck! (you'll need it if you plan to use martingale betting for very long...)
When you run PHP on a web server there is typically a 30s time limit.
You can increase that in the PHP code with:
 set_time_limit(3600);
Which will mean an hour from the time that was executed.
Though if you put that in the correct loop (probably the innermost loop?) it will stop it from ever timing out.
Pages:
Jump to: