Bitcoin Forum
November 15, 2024, 10:38:52 PM *
News: Check out the artwork 1Dq created to commemorate this forum's 15th anniversary
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: BitPonzi Betbot Feedback Thread  (Read 878 times)
ineededausername (OP)
Hero Member
*****
Offline Offline

Activity: 784
Merit: 1000


bitcoin hundred-aire


View Profile
September 19, 2011, 10:19:23 PM
 #1

Here's a new thread for all things related to betbots.
I managed to get one working, with a few trivial tweaks:
Code:
<?php   

if (!defined('kBitcoinToInt')) define('kBitcoinToInt'100000000); 
require_once(
'bitcoinURL.php'); 
require_once(
'jsonRPCClient.php');

define('kJackpotRatio'5); 
define('kMinSecs'120); 
define('kMaxSecs'600); 
define('kSecsFixed'120);

header('Refresh: 240');

echo 
"Jackpot ratio threshold: " kJackpotRatio "<br />"
echo 
"Min secs remaining: " kMinSecs "<br />"
echo 
"Max secs remaining: " kMaxSecs "<br />"

try  

    
$bitcoin = new jsonRPCClient(kBitcoinURL); 

    
$betPlaced false

    
$soapClient null
    try  
    {   
        
$soapClient = @new SoapClient("http://bitponzi.net/API/API.asmx?WSDL",array("exceptions" => 1));   
    } 
    catch (
SoapFault $E
    {   
        echo 
$E->faultstring;  
        exit(); 
    }   
    
    
$rounds $soapClient->getRounds()->getRoundsResult->_Round

    
$payoutAddress $bitcoin->getnewaddress("bet bot ineededausername"); 
echo "New address created: " $payoutAddress "<br />";

    foreach (
$rounds as $r
    {

        
$deposits $soapClient->getDeposits(array("round" => $r->Name))->getDepositsResult->_Deposit

        
$jackpotRatio $r->JP $r->MinDeposit
        
$secsRemaining $r->Remaining 60;     
        echo 
"<hr />Round ID: " $r->Name "<br />Jackpot ratio: $jackpotRatio<br />" "Secs remaining: $secsRemaining<br/ >";
if ($r->FixedDuration) echo "Fixed duration round.<br />";

        
// make sure that bet bot wasn't the last to deposit. 
        
$lastConfirmedDeposit end($deposits); 
if ($lastConfirmedDeposit) {
$lastConfirmedPayoutAddr $lastConfirmedDeposit->PaymentAddress

echo "Last payment address: " $lastConfirmedPayoutAddr "<br />";
echo "Address id: "$bitcoin->getaccount($lastConfirmedPayoutAddr) . "<br />";
if ('bet bot ineededausername' == $bitcoin->getaccount($lastConfirmedPayoutAddr)) { 
echo 'Bet bot is the last depositor<br />'
continue; 

} else {
echo "Only 1 deposit. <br />";
}
         
        if (
$jackpotRatio >= kJackpotRatio && ($secsRemaining mt_rand(kMinSecs,kMaxSecs))
|| ($secsRemaining kSecsFixed && $r->FixedDuration)) { 

echo "Sniping...<br />";

            
// Let's not let it expire! 
            
$depositAddress $soapClient->newDeposit(array( "round" => $r->Name"bitcoinAddress" => $payoutAddress ))->newDepositResult

            if (
$depositAddress[0] != "1") { 
                echo 
$depositAddress
                exit(); 
            } 
             
            
$bitcoin->sendtoaddress($depositAddressfloatval($r->MinDeposit kBitcoinToInt)); 
            
$betPlaced true
            echo 
"Bet for " $r->MinDeposit " placed for round " $r->Name 
                
", jackpot ratio: $jackpotRatio, secs remaining: $secsRemaining<br />";         

        } 
        if (!
$betPlaced) echo "<hr />No bets were placed."

    } 


catch (
Exception $e)  

//    require_once('MessageLog.inc'); 
//    $msgLog = new MessageLog('errors'); 
//    $msgLog->write('Exception: '.$e->getMessage()); 
    
echo $e->getMessage();             


Make sure to replace my username with your username, or our bots will identify as the same...


Known API bugs and other issues:
Please note that not all of these are bugs, but they are things to be aware of.
  • getDeposits returns empty array when there is only 1 deposit PHP does not interpret response as array
  • Only 128 queries/hr (not a bug, but not documented)

EDIT: Please note that this bot has not made a real deposit from my computer yet.

(BFL)^2 < 0
mb300sd
Legendary
*
Offline Offline

Activity: 1260
Merit: 1000

Drunk Posts


View Profile WWW
September 19, 2011, 10:22:56 PM
 #2

Not an API bug. You can test any API call and see the return XML here.

http://bitponzi.net/API/API.asmx

http://bitponzi.net/API/API.asmx?op=getDeposits

I think something funny is happening in PHP since it lacks variable types, and its not converting it to an array when theres only 1 element.

1D7FJWRzeKa4SLmTznd3JpeNU13L1ErEco
ineededausername (OP)
Hero Member
*****
Offline Offline

Activity: 784
Merit: 1000


bitcoin hundred-aire


View Profile
September 19, 2011, 10:25:27 PM
 #3

I think something funny is happening in PHP since it lacks variable types, and its not converting it to an array when theres only 1 element.
Oh damn, should've tested before saying it was a bug.  I'll modify the code in a little while.

(BFL)^2 < 0
Pages: [1]
  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!