Bitcoin Forum
November 09, 2024, 09:25:18 PM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Warning: One or more bitcointalk.org users have reported that they strongly believe that the creator of this topic is a scammer. (Login to see the detailed trust ratings.) While the bitcointalk.org administration does not verify such claims, you should proceed with extreme caution.
Pages: « 1 2 3 4 5 [6] 7 8 »  All
  Print  
Author Topic: PHP martingale bot for satoshiDICE  (Read 32867 times)
dooglus
Legendary
*
Offline Offline

Activity: 2940
Merit: 1333



View Profile
February 04, 2013, 04:01:46 AM
 #101

How do I start it in server mode? I think I saw a script a while ago on it but I can't remember...

Go to the folder with your wallet.dat and blockchain files in it.
Edit or create bitcoin.conf
Put these 3 lines in it:

rpcuser=yourusername
rpcpassword=yourpassword
server=1

Then change the script so the user and password at the top match your bitcoin.conf:

$btcu = array("user" => "yourusername",             // RPC Username
            "pass" =>   "yourpassword",               // RPC Password
            "host" =>   "localhost",      // RPC Hostname/IP
            "port" =>   8332);            // RPC Port

Then restart bitcoin-qt.

Pick something other than 'yourpassword' of course - so long as it's the same in the bitcoin.conf as in the script, it's ok.

Just-Dice                 ██             
          ██████████         
      ██████████████████     
  ██████████████████████████ 
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
    ██████████████████████   
        ██████████████       
            ██████           
   Play or Invest                 ██             
          ██████████         
      ██████████████████     
  ██████████████████████████ 
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
    ██████████████████████   
        ██████████████       
            ██████           
   1% House Edge
kano
Legendary
*
Offline Offline

Activity: 4620
Merit: 1851


Linux since 1997 RedHat 4


View Profile
February 04, 2013, 06:04:00 AM
 #102

How do I start it in server mode? I think I saw a script a while ago on it but I can't remember...

Go to the folder with your wallet.dat and blockchain files in it.
Edit or create bitcoin.conf
Put these 3 lines in it:

rpcuser=yourusername
rpcpassword=yourpassword
server=1
...
and also
rpcallowip=127.0.0.1
rpcallowip=192.168.x.y

Put as many of those as IP addresses you want to have RPC access to bitcoiond

Pool: https://kano.is - low 0.5% fee PPLNS 3 Days - Most reliable Solo with ONLY 0.5% fee   Bitcointalk thread: Forum
Discord support invite at https://kano.is/ Majority developer of the ckpool code - k for kano
The ONLY active original developer of cgminer. Original master git: https://github.com/kanoi/cgminer
dooglus
Legendary
*
Offline Offline

Activity: 2940
Merit: 1333



View Profile
February 04, 2013, 06:40:23 AM
 #103

and also
rpcallowip=127.0.0.1
rpcallowip=192.168.x.y

Put as many of those as IP addresses you want to have RPC access to bitcoiond

I've never needed any rpcallowip settings.  I'm guessing that localhost is allowed by default.

Just-Dice                 ██             
          ██████████         
      ██████████████████     
  ██████████████████████████ 
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
    ██████████████████████   
        ██████████████       
            ██████           
   Play or Invest                 ██             
          ██████████         
      ██████████████████     
  ██████████████████████████ 
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
    ██████████████████████   
        ██████████████       
            ██████           
   1% House Edge
dooglus
Legendary
*
Offline Offline

Activity: 2940
Merit: 1333



View Profile
February 04, 2013, 06:43:05 AM
Last edit: February 04, 2013, 07:15:13 AM by dooglus
 #104

I'm playing with these PHP martingale scripts.

I see one that's doing a "bitcoind getbalance '*' 1" to work out the confirmed balance.

When I run that, it's including change from old bets that didn't confirm yet.  If the change isn't confirmed, why's it being counted as confirmed balance?

And - is there any (hopefully simple) way of finding out your real confirmed balance, not including unconfirmed change?

Edit: note that the bitcoin-qt client's 'overview' tab shows "balance" and "unconfirmed", but the "unconfirmed" value doesn't include change from unconfirmed transactions you've made.  So the PHP SD bot checks if it has sufficient confirmed funds, thinks that it does, when it really doesn't, and ends up making a bet using unconfirmed change coins.

Edit2: looks like the culprit is IsConfirmed() in wallet.h, which says:

        // If no confirmations but it's from us, we can still
        // consider it confirmed if all dependencies are confirmed

Just-Dice                 ██             
          ██████████         
      ██████████████████     
  ██████████████████████████ 
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
    ██████████████████████   
        ██████████████       
            ██████           
   Play or Invest                 ██             
          ██████████         
      ██████████████████     
  ██████████████████████████ 
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
    ██████████████████████   
        ██████████████       
            ██████           
   1% House Edge
dooglus
Legendary
*
Offline Offline

Activity: 2940
Merit: 1333



View Profile
February 04, 2013, 06:25:03 PM
 #105

    BTC2 Bounty for Modding the php bot to:

    • Make the MIN_BET and MAX_BET a percentage/fraction of the current balance

    • If LOSE! use this same amount multiplied until WIN! OR MAX_BET reached

    • If WIN! send a fraction of win amount to "1XYZ1" address

    • If MAX_BET Reached, start over

    • Stop after X amount sent to "1XYZ1" address

      • OR count_won grater than XYZ2
        • OR after a WIN! and the ratio of win loses is grater than XYZ3 and a minimum of XYZ bets have been played

      Always wait for confirmed balance to avoid the larger fees.(no rush to lose everything)


    Here you go:

    https://github.com/dooglus/sdbot

    I lost about BTC1 testing it, but it seems to work pretty well.

    In the process I discovered that bitcoin's "getbalance '*' 1" lies about how much is confirmed, because it considers your change to always be confirmed, even when it isn't.  The script includes a patch to bitcoin that fixes the problem.  And if you don't want to bother rebuilding bitcoin, there's also a setting to get the script to wait for all your transactions to be confirmed each time before betting.

    My address: 135XYa4hDX8vof62UBE2zJVDwcidz52pPw[/list]

    Just-Dice                 ██             
              ██████████         
          ██████████████████     
      ██████████████████████████ 
    ██████████████████████████████
    ██████████████████████████████
    ██████████████████████████████
    ██████████████████████████████
    ██████████████████████████████
    ██████████████████████████████
    ██████████████████████████████
    ██████████████████████████████
    ██████████████████████████████
        ██████████████████████   
            ██████████████       
                ██████           
       Play or Invest                 ██             
              ██████████         
          ██████████████████     
      ██████████████████████████ 
    ██████████████████████████████
    ██████████████████████████████
    ██████████████████████████████
    ██████████████████████████████
    ██████████████████████████████
    ██████████████████████████████
    ██████████████████████████████
    ██████████████████████████████
    ██████████████████████████████
        ██████████████████████   
            ██████████████       
                ██████           
       1% House Edge
    dooglus
    Legendary
    *
    Offline Offline

    Activity: 2940
    Merit: 1333



    View Profile
    February 04, 2013, 07:23:21 PM
     #106

    I found a way of getting the true unconfirmed balance:

    Code:
    function get_confirmed_balance() {
        global $bitcoin;
        $unspent = 0;
        foreach ($bitcoin->listunspent(1) as $tx)
            $unspent += $tx['amount'];
        return $unspent;
    }

    I updated my script to use that instead, as well as fixing a couple of other bugs.

    Just-Dice                 ██             
              ██████████         
          ██████████████████     
      ██████████████████████████ 
    ██████████████████████████████
    ██████████████████████████████
    ██████████████████████████████
    ██████████████████████████████
    ██████████████████████████████
    ██████████████████████████████
    ██████████████████████████████
    ██████████████████████████████
    ██████████████████████████████
        ██████████████████████   
            ██████████████       
                ██████           
       Play or Invest                 ██             
              ██████████         
          ██████████████████     
      ██████████████████████████ 
    ██████████████████████████████
    ██████████████████████████████
    ██████████████████████████████
    ██████████████████████████████
    ██████████████████████████████
    ██████████████████████████████
    ██████████████████████████████
    ██████████████████████████████
    ██████████████████████████████
        ██████████████████████   
            ██████████████       
                ██████           
       1% House Edge
    dooglus
    Legendary
    *
    Offline Offline

    Activity: 2940
    Merit: 1333



    View Profile
    February 04, 2013, 09:45:38 PM
     #107

    It seems to work pretty well now.  The min_bet goes up each time I win, and 90% of the net winnings get stashed away in a safe place:

    Quote
    $ php sdbot.php

    starting new round; balance   1.231179 BTC; min:   0.011081 BTC; max:   1.231179 BTC
          [ wait for confirms; bet =   0.011081 BTC; confirmed =   0.002181 BTC; unconfirmed =   1.228998 BTC .................................................................... ]
      1 : Won  0; Lost  0; W:L ratio  (inf)    bet   0.011081 BTC . payout   0.021704 BTC : WIN
          [ net win:   0.010123 BTC; stashing 90% =   0.009111 BTC; total stashed =   0.009111 BTC ]

    starting new round; balance   1.232192 BTC; min:   0.011090 BTC; max:   1.232192 BTC
      2 : Won  1; Lost  0; W:L ratio  (inf)    bet   0.011090 BTC . payout   0.021722 BTC : WIN
          [ net win:   0.010132 BTC; stashing 90% =   0.009119 BTC; total stashed =   0.018230 BTC ]

    starting new round; balance   1.233205 BTC; min:   0.011099 BTC; max:   1.233205 BTC
      3 : Won  2; Lost  0; W:L ratio  (inf)    bet   0.011099 BTC . payout   0.000000 BTC : LOSE
      4 : Won  2; Lost  1; W:L ratio 2.00000   bet   0.022198 BTC .... payout   0.043981 BTC : WIN
          [ net win:   0.009684 BTC; stashing 90% =   0.008716 BTC; total stashed =   0.026946 BTC ]

    starting new round; balance   1.233673 BTC; min:   0.011103 BTC; max:   1.233673 BTC
      5 : Won  3; Lost  1; W:L ratio 3.00000   bet   0.011103 BTC . payout   0.000000 BTC : LOSE
      6 : Won  3; Lost  2; W:L ratio 1.50000   bet   0.022206 BTC . payout   0.000000 BTC : LOSE
          [ wait for confirms; bet =   0.044412 BTC; confirmed =   0.002181 BTC; unconfirmed =   1.197183 BTC ...... ]
      7 : Won  3; Lost  3; W:L ratio 1.00000   bet   0.044412 BTC . payout   0.000000 BTC : LOSE
      8 : Won  3; Lost  4; W:L ratio 0.75000   bet   0.088824 BTC . payout   0.000000 BTC : LOSE
      9 : Won  3; Lost  5; W:L ratio 0.60000   bet   0.177649 BTC .... payout   0.355482 BTC : WIN
          [ net win:   0.008787 BTC; stashing 90% =   0.007908 BTC; total stashed =   0.034854 BTC ]

    starting new round; balance   1.234552 BTC; min:   0.011111 BTC; max:   1.234552 BTC
     10 : Won  4; Lost  5; W:L ratio 0.80000   bet   0.011111 BTC . payout   0.021765 BTC : WIN
          [ net win:   0.010154 BTC; stashing 90% =   0.009138 BTC; total stashed =   0.043992 BTC ]

    starting new round; balance   1.235567 BTC; min:   0.011120 BTC; max:   1.235567 BTC
     11 : Won  5; Lost  5; W:L ratio 1.00000   bet   0.011120 BTC . payout   0.000000 BTC : LOSE
     12 : Won  5; Lost  6; W:L ratio 0.83333   bet   0.022240 BTC . payout   0.000000 BTC : LOSE
     13 : Won  5; Lost  7; W:L ratio 0.71429   bet   0.044480 BTC . payout   0.088632 BTC : WIN
          [ net win:   0.009291 BTC; stashing 90% =   0.008362 BTC; total stashed =   0.052354 BTC ]

    starting new round; balance   1.235996 BTC; min:   0.011124 BTC; max:   1.235996 BTC
          [ wait for confirms; bet =   0.011124 BTC; confirmed =   0.004471 BTC; unconfirmed =   1.231525 BTC .............. ]
     14 : Won  6; Lost  7; W:L ratio 0.85714   bet   0.011124 BTC .... payout   0.021791 BTC : WIN
          [ net win:   0.010167 BTC; stashing 90% =   0.009150 BTC; total stashed =   0.061505 BTC ]

    starting new round; balance   1.237013 BTC; min:   0.011133 BTC; max:   1.237013 BTC
     15 : Won  7; Lost  7; W:L ratio 1.00000   bet   0.011133 BTC . payout   0.021809 BTC : WIN
          [ net win:   0.010176 BTC; stashing 90% =   0.009158 BTC; total stashed =   0.070663 BTC ]

    starting new round; balance   1.238031 BTC; min:   0.011142 BTC; max:   1.238031 BTC
     16 : Won  8; Lost  7; W:L ratio 1.14286   bet   0.011142 BTC . payout   0.021827 BTC : WIN
          [ net win:   0.010185 BTC; stashing 90% =   0.009167 BTC; total stashed =   0.079830 BTC ]

    starting new round; balance   1.238549 BTC; min:   0.011147 BTC; max:   1.238549 BTC
     17 : Won  9; Lost  7; W:L ratio 1.28571   bet   0.011147 BTC . payout   0.021837 BTC : WIN
          [ net win:   0.010190 BTC; stashing 90% =   0.009171 BTC; total stashed =   0.089000 BTC ]

    starting new round; balance   1.239568 BTC; min:   0.011156 BTC; max:   1.239568 BTC
     18 : Won 10; Lost  7; W:L ratio 1.42857   bet   0.011156 BTC . payout   0.000000 BTC : LOSE
     19 : Won 10; Lost  8; W:L ratio 1.25000   bet   0.022312 BTC . payout   0.000000 BTC : LOSE
     20 : Won 10; Lost  9; W:L ratio 1.11111   bet   0.044624 BTC . payout   0.088921 BTC : WIN
          [ net win:   0.009328 BTC; stashing 90% =   0.008395 BTC; total stashed =   0.097395 BTC ]

    starting new round; balance   1.240501 BTC; min:   0.011165 BTC; max:   1.240501 BTC
     21 : Won 11; Lost  9; W:L ratio 1.22222   bet   0.011165 BTC . payout   0.000000 BTC : LOSE
     22 : Won 11; Lost 10; W:L ratio 1.10000   bet   0.022329 BTC ... payout   0.000000 BTC : LOSE
     23 : Won 11; Lost 11; W:L ratio 1.00000   bet   0.044658 BTC . payout   0.000000 BTC : LOSE
     24 : Won 11; Lost 12; W:L ratio 0.91667   bet   0.089316 BTC . payout   0.000000 BTC : LOSE
          [ wait for confirms; bet =   0.178632 BTC; confirmed =   0.137693 BTC; unconfirmed =   0.950906 BTC .....

    It should have stopped once I'd stashed 0.05 BTC of winnings, but there was a bug which meant that didn't happen.  It's fixed now.

    Just-Dice                 ██             
              ██████████         
          ██████████████████     
      ██████████████████████████ 
    ██████████████████████████████
    ██████████████████████████████
    ██████████████████████████████
    ██████████████████████████████
    ██████████████████████████████
    ██████████████████████████████
    ██████████████████████████████
    ██████████████████████████████
    ██████████████████████████████
        ██████████████████████   
            ██████████████       
                ██████           
       Play or Invest                 ██             
              ██████████         
          ██████████████████     
      ██████████████████████████ 
    ██████████████████████████████
    ██████████████████████████████
    ██████████████████████████████
    ██████████████████████████████
    ██████████████████████████████
    ██████████████████████████████
    ██████████████████████████████
    ██████████████████████████████
    ██████████████████████████████
        ██████████████████████   
            ██████████████       
                ██████           
       1% House Edge
    K1773R
    Legendary
    *
    Offline Offline

    Activity: 1792
    Merit: 1008


    /dev/null


    View Profile
    February 04, 2013, 09:51:54 PM
     #108

    What do I have near the top as the ip address? I get this error right now :

    Warning: fopen(http://...@127.0.0.1:8332/): failed to open stream: No connection could be made because the target machine actively refused it. in C:\xampp\htdocs\jsonRPCClient.php on line 86


    Your bitcoin client prob need to be in server mode and listening on 127.0.0.1 which is local loopback ip addy.

    How do I start it in server mode? I think I saw a script a while ago on it but I can't remember...
    i saw something named README / wiki

    [GPG Public Key]
    BTC/DVC/TRC/FRC: 1K1773RbXRZVRQSSXe9N6N2MUFERvrdu6y ANC/XPM AK1773RTmRKtvbKBCrUu95UQg5iegrqyeA NMC: NK1773Rzv8b4ugmCgX789PbjewA9fL9Dy1 LTC: LKi773RBuPepQH8E6Zb1ponoCvgbU7hHmd EMC: EK1773RxUes1HX1YAGMZ1xVYBBRUCqfDoF BQC: bK1773R1APJz4yTgRkmdKQhjhiMyQpJgfN
    dooglus
    Legendary
    *
    Offline Offline

    Activity: 2940
    Merit: 1333



    View Profile
    February 04, 2013, 10:41:16 PM
     #109

    Here you go:

    https://github.com/dooglus/sdbot

    I lost about BTC1 testing it, but it seems to work pretty well.

    Don't forget to edit this line:

    Code:
    define('STASH_ADDRESS', '1Doog7asLrYah3yeUppBVj8nUYnFkmXm2N');                             

    or your winnings will be sent somewhere *really* safe...  Wink

    Just-Dice                 ██             
              ██████████         
          ██████████████████     
      ██████████████████████████ 
    ██████████████████████████████
    ██████████████████████████████
    ██████████████████████████████
    ██████████████████████████████
    ██████████████████████████████
    ██████████████████████████████
    ██████████████████████████████
    ██████████████████████████████
    ██████████████████████████████
        ██████████████████████   
            ██████████████       
                ██████           
       Play or Invest                 ██             
              ██████████         
          ██████████████████     
      ██████████████████████████ 
    ██████████████████████████████
    ██████████████████████████████
    ██████████████████████████████
    ██████████████████████████████
    ██████████████████████████████
    ██████████████████████████████
    ██████████████████████████████
    ██████████████████████████████
    ██████████████████████████████
        ██████████████████████   
            ██████████████       
                ██████           
       1% House Edge
    dooglus
    Legendary
    *
    Offline Offline

    Activity: 2940
    Merit: 1333



    View Profile
    February 05, 2013, 01:27:03 AM
     #110


    BTC2 received, thanks.  Good luck! (you'll need it if you plan to use martingale betting for very long...)

    Just-Dice                 ██             
              ██████████         
          ██████████████████     
      ██████████████████████████ 
    ██████████████████████████████
    ██████████████████████████████
    ██████████████████████████████
    ██████████████████████████████
    ██████████████████████████████
    ██████████████████████████████
    ██████████████████████████████
    ██████████████████████████████
    ██████████████████████████████
        ██████████████████████   
            ██████████████       
                ██████           
       Play or Invest                 ██             
              ██████████         
          ██████████████████     
      ██████████████████████████ 
    ██████████████████████████████
    ██████████████████████████████
    ██████████████████████████████
    ██████████████████████████████
    ██████████████████████████████
    ██████████████████████████████
    ██████████████████████████████
    ██████████████████████████████
    ██████████████████████████████
        ██████████████████████   
            ██████████████       
                ██████           
       1% House Edge
    Gyrsur
    Legendary
    *
    Offline Offline

    Activity: 2856
    Merit: 1520


    Bitcoin Legal Tender Countries: 2 of 206


    View Profile WWW
    February 05, 2013, 02:31:42 PM
    Last edit: February 06, 2013, 12:11:30 PM by Gyrsur
     #111

    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.

    KJTetc
    Newbie
    *
    Offline Offline

    Activity: 24
    Merit: 0


    View Profile
    February 06, 2013, 01:58:27 AM
     #112

    Okay so I'm still confused.

    This is what I currently have in my bitcoin.conf:
    rpcuser=KJTetc
    rpcpassword=(my pass lol)
    rpcallowip=*
    server=1

    And this is my bot which is in htdocs which also has JSONrpcClient in it.

     
    Code:
    <?php
    require_once('jsonRPCClient.php');
    $b = new jsonRPCClient('http://KJTetc:MyRpcpass@localhost:8332/');

    define('MIN_BET'0.01);
    define('MAX_BET'6);
    define('ADDRESS''1dice8EMZmqKvrGE4Qc9bUFf9PX3xaYDp');

    $bet MIN_BET;
    $total_fees 0;
    $count 0;
    $count_won 0;

    while ((
    $bet <= MAX_BET) && ($count_won 100))
    {
            
    $count++;

            
    $balance_a $b->getbalance('*'0);
            if (!isset(
    $starting_balance)) $starting_balance $balance_a;
            
    $b->sendtoaddress(ADDRESS, (float) $bet);
            
    $balance_b $b->getbalance('*'0);

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

    I get this error:


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

    Fatal error: Uncaught exception 'Exception' with message 'Unable to connect to http://KJTetc:*****@localhost:8332/' in C:\xampp\htdocs\jsonRPCClient.php:140 Stack trace: #0 C:\xampp\htdocs\bot2.php(20): jsonRPCClient->__call('sendtoaddress', Array) #1 C:\xampp\htdocs\bot2.php(20): jsonRPCClient->sendtoaddress('1dice8EMZmqKvrG...', 0.01) #2 {main} thrown in C:\xampp\htdocs\jsonRPCClient.php on line 140





    BTC2 received, thanks.  Good luck! (you'll need it if you plan to use martingale betting for very long...)
    fcmatt
    Legendary
    *
    Offline Offline

    Activity: 2072
    Merit: 1001


    View Profile
    February 06, 2013, 02:08:12 AM
     #113

    maybe * does not work as you expect. put 127.0.0.1

    maybe server=1 does not work.
    start bitcoin from dos prompt. change directory to where bitcoin executable is and start like this "bitcoin -server" or
    whatever the exe is called. bitcoind or bitcoin...
    KJTetc
    Newbie
    *
    Offline Offline

    Activity: 24
    Merit: 0


    View Profile
    February 06, 2013, 05:14:45 AM
     #114

    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...)
    kano
    Legendary
    *
    Offline Offline

    Activity: 4620
    Merit: 1851


    Linux since 1997 RedHat 4


    View Profile
    February 06, 2013, 06:22:56 AM
     #115

    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.

    Pool: https://kano.is - low 0.5% fee PPLNS 3 Days - Most reliable Solo with ONLY 0.5% fee   Bitcointalk thread: Forum
    Discord support invite at https://kano.is/ Majority developer of the ckpool code - k for kano
    The ONLY active original developer of cgminer. Original master git: https://github.com/kanoi/cgminer
    KJTetc
    Newbie
    *
    Offline Offline

    Activity: 24
    Merit: 0


    View Profile
    February 06, 2013, 07:55:33 AM
     #116

    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://...@127.0.0.1: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.
    dooglus
    Legendary
    *
    Offline Offline

    Activity: 2940
    Merit: 1333



    View Profile
    February 06, 2013, 08:59:45 AM
     #117

    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://...@127.0.0.1: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

    Just-Dice                 ██             
              ██████████         
          ██████████████████     
      ██████████████████████████ 
    ██████████████████████████████
    ██████████████████████████████
    ██████████████████████████████
    ██████████████████████████████
    ██████████████████████████████
    ██████████████████████████████
    ██████████████████████████████
    ██████████████████████████████
    ██████████████████████████████
        ██████████████████████   
            ██████████████       
                ██████           
       Play or Invest                 ██             
              ██████████         
          ██████████████████     
      ██████████████████████████ 
    ██████████████████████████████
    ██████████████████████████████
    ██████████████████████████████
    ██████████████████████████████
    ██████████████████████████████
    ██████████████████████████████
    ██████████████████████████████
    ██████████████████████████████
    ██████████████████████████████
        ██████████████████████   
            ██████████████       
                ██████           
       1% House Edge
    payb.tc (OP)
    Hero Member
    *****
    Offline Offline

    Activity: 812
    Merit: 1000



    View Profile
    February 06, 2013, 10:26:42 AM
     #118

    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://...@127.0.0.1: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:
    <?php
    require_once('jsonRPCClient.php');
    $b = new jsonRPCClient('http://KJTetc:MyRpcpass@localhost:8332/');
    print_r($b->getinfo());
    dooglus
    Legendary
    *
    Offline Offline

    Activity: 2940
    Merit: 1333



    View Profile
    February 06, 2013, 10:56:02 AM
     #119

    or first try the bare minimum:

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

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

    Just-Dice                 ██             
              ██████████         
          ██████████████████     
      ██████████████████████████ 
    ██████████████████████████████
    ██████████████████████████████
    ██████████████████████████████
    ██████████████████████████████
    ██████████████████████████████
    ██████████████████████████████
    ██████████████████████████████
    ██████████████████████████████
    ██████████████████████████████
        ██████████████████████   
            ██████████████       
                ██████           
       Play or Invest                 ██             
              ██████████         
          ██████████████████     
      ██████████████████████████ 
    ██████████████████████████████
    ██████████████████████████████
    ██████████████████████████████
    ██████████████████████████████
    ██████████████████████████████
    ██████████████████████████████
    ██████████████████████████████
    ██████████████████████████████
    ██████████████████████████████
        ██████████████████████   
            ██████████████       
                ██████           
       1% House Edge
    payb.tc (OP)
    Hero Member
    *****
    Offline Offline

    Activity: 812
    Merit: 1000



    View Profile
    February 06, 2013, 11:00:31 AM
     #120

    or first try the bare minimum:

    Code:
    <?php
    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.
    Pages: « 1 2 3 4 5 [6] 7 8 »  All
      Print  
     
    Jump to:  

    Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!