Pages:
Author

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

newbie
Activity: 24
Merit: 0
February 02, 2013, 10:58:21 PM
#94
So I've got a good understanding of PHP but never heard of JSON. I've got everything you said. How do I make it work?  Roll Eyes



http://bitcoin.org -> install bitcoin
http://www.apachefriends.org/en/xampp.html -> install xampp (which includes php)

have a read of https://en.bitcoin.it/wiki/PHP_developer_intro

http://jsonrpcphp.org -> get jsonRPCClient.php


the OP was aimed at coders who already have the basic dev environment set up.
newbie
Activity: 9
Merit: 0
February 01, 2013, 09:13:16 PM
#93
require_once('jsonRPCClient.php');
/** BITCOIN **/
$btcu = array("user" => "xxx",             // RPC Username
            "pass" =>   "xxx",               // RPC Password
            "host" =>   "localhost",      // RPC Hostname/IP
            "port" =>   8332);            // RPC Port
$b = new jsonRPCClient("http://{$btcu['user']}:{$btcu['pass']}@{$btcu['host']}:{$btcu['port']}");

define('MIN_BET', 0.0633399);
define('MAX_BET', 2);
define('ADDRESS', '1dicec9k7KpmQaA8Uc8aCCxfWnwEWzpXE');

$bet = MIN_BET;
$total_fees = 0;
$count = 0;
$count_won = 0;
while (($bet <= MAX_BET) && ($count_won < 300))
{
        $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


the errors came with 3 different attempts at modifieng the bet amount for it to be a fraction of the balance,
hero member
Activity: 812
Merit: 1000
February 01, 2013, 08:49:57 PM
#92
I am no coder, but would like some advice in modding the phpbot to allow for a fraction of balance as MIN_BET and for it to recalculate after any win, same for MAX bet, also  if MAX_BET reached start over

i did try to modify the script by myself to allow this but received

Object of class jsonRPCClient could not be converted to int in XXXXX/bot2.php on line 14

Or

PHP Notice:  Object of class jsonRPCClient could not be converted to int in XXXXX/bot2.php on line 10

Or

PHP Fatal error:  Can't use method return value in write context in XXXXX/bot2.php on line 10

Any Advice would be appreciated

maybe show us lines 10 & 14 in bot2.php, or paste the whole thing
newbie
Activity: 9
Merit: 0
February 01, 2013, 08:24:48 PM
#91
I am no coder, but would like some advice in modding the phpbot to allow for a fraction of balance as MIN_BET and for it to recalculate after any win, same for MAX bet, also  if MAX_BET reached start over

i did try to modify the script by myself to allow this but received

Object of class jsonRPCClient could not be converted to int in XXXXX/bot2.php on line 14

Or

PHP Notice:  Object of class jsonRPCClient could not be converted to int in XXXXX/bot2.php on line 10

Or

PHP Fatal error:  Can't use method return value in write context in XXXXX/bot2.php on line 10

Any Advice would be appreciated
hero member
Activity: 812
Merit: 1000
January 28, 2013, 04:49:09 PM
#90

http://bitcoin.org -> install bitcoin
http://www.apachefriends.org/en/xampp.html -> install xampp (which includes php)

have a read of https://en.bitcoin.it/wiki/PHP_developer_intro

http://jsonrpcphp.org -> get jsonRPCClient.php


the OP was aimed at coders who already have the basic dev environment set up.
member
Activity: 86
Merit: 10
January 28, 2013, 04:24:20 PM
#89
How would I set this up?

I guess that'd depend on your OS
Windows 7
zvs
legendary
Activity: 1680
Merit: 1000
https://web.archive.org/web/*/nogleg.com
January 27, 2013, 07:45:31 PM
#88
How would I set this up?

I guess that'd depend on your OS
legendary
Activity: 2072
Merit: 1001
January 26, 2013, 03:56:16 PM
#87
How would I set this up?

Download the script then burn your usd or send bitcoins to a bad address to be lost forever.
That is the end result if you play long enough with this system. Mathematically proven to lose over time due to a run of bad luck.
member
Activity: 86
Merit: 10
January 26, 2013, 03:12:06 PM
#86
How would I set this up?
newbie
Activity: 56
Merit: 0
January 26, 2013, 08:55:29 AM
#85
This is the best way to go bankrupt!

;(
newbie
Activity: 28
Merit: 0
January 25, 2013, 07:48:30 PM
#84
Awesome!
newbie
Activity: 48
Merit: 0
January 19, 2013, 03:05:10 PM
#83
A PowerShell Version:

Code:
--snipped--

If someone thinks this is worth a donation... 1J66vZHf1oFPHFhjFBtbEqxkJahdF3vetu

Thanks payb.tc for your nice PHP Script :0) Donation on the way
I've made a few changes to the PowerShell script just to make it a bit nicer on the end-user, all the configurable variables are in the first chunk of code. I also bet on a different payout rate, but that's configurable too.
http://pastebin.com/dS1FqjpA

1LFuotBujG44YeLskhivdy9MbpMyuCnCoA
and
1J66vZHf1oFPHFhjFBtbEqxkJahdF3vetu
if this helped you make some decent coin. Smiley
legendary
Activity: 2940
Merit: 1333
October 10, 2012, 11:12:12 PM
#82
I posted that and I KNEW someone would quote just that part

I tried not to, but something compelled me to do it.
full member
Activity: 147
Merit: 100
October 10, 2012, 08:29:23 AM
#81
I posted that and I KNEW someone would quote just that part
legendary
Activity: 2940
Merit: 1333
October 09, 2012, 11:52:55 PM
#80
full member
Activity: 147
Merit: 100
October 09, 2012, 08:16:38 AM
#79
the second one, I was using the strategy in the thread about 'how to last longer' and it works really well, until your luck runs out Cheesy

but that was without the script and I noticed every once in awhile the transaction fee would go up if I didn't have enough confirmed coins obviously, so I would go do something else for awhile and come back, does this script check for that?

EDIT: i went back and re-read the code samples here and it looks like they take into consideration unconfirmed coins which would make the fee go up I think (?)

I was also wondering about the blockchain idea so I can screw around with it from work, I may do that in my spare time.  It seems like they have an api that works with bitcoind so you would just point your script to blockchain.info with your identifier (not the shortlink) and the password along with port 443 instead of localhost and it might work the same.

I have yet to actually try it because all my wallet stuff is at home and I don't have any coins in my blockchain account so don't quote me Cheesy
legendary
Activity: 2940
Merit: 1333
October 08, 2012, 07:57:40 PM
#78
i like the idea of this, but feel a bit iffy actually putting it to use

Iffy like it's cheating to use a bot to play?  It's not - the site won't mind at all.

Or iffy like it's going to lose all the bitcoins you let it play it?  It will, eventually.
full member
Activity: 147
Merit: 100
October 08, 2012, 03:05:38 PM
#77
i like the idea of this, but feel a bit iffy actually putting it to use
legendary
Activity: 2940
Merit: 1333
October 05, 2012, 08:30:06 PM
#76
Is it possible to convert these bots for blockchain.info wallet?

Yes.

The blockchain.info wallet provides an API, so it would be relatively easy to modify them (or pay someone else to modify them) to interact with that API rather than using the satoshi client.
SNS
sr. member
Activity: 516
Merit: 252
October 05, 2012, 05:56:10 PM
#75
Is it possible to convert these bots for blockchain.info wallet?
Pages:
Jump to: