Last active
September 4, 2017 18:59
-
-
Save cklosowski/c98506b2abb3d19490aba9fa52fc5c10 to your computer and use it in GitHub Desktop.
earn.gg rollbot: http://earn.gg?ref=ember81
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* This is a rollbot for earn.gg written in PHP | |
* | |
* It will use the parameters below to run bets. If a bet wins it resets to the $starting value. | |
* If a bet loses, it doubles your bet amount and continues to do so until you win, or hit the $max_bet. | |
* | |
* Once you win, it kicks back down to the $starting bet. | |
* | |
* This code comes As-Is. The author not responsible for your gambling habits on earn.gg. Losses are your responsibility. | |
* | |
* Donations Welcome: | |
* https://earn.gg/donate/112485290338746605618?ref=ember81 | |
*/ | |
$key = '<your api key>'; | |
$secret = '<your api secret>'; | |
$api = 'http://earn.gg/'; | |
$min_bal = 1000; // If your balance ever gets at or below this, betting will not start, or stop the current bet run | |
$starting = 25; // The amount to start betting at | |
$bet_amount = $starting; // The initial bet amount (this will change as the loop persists | |
$multiplyer = 2; // The multiplyer you want to bet against (2=49%, 3=32%, 4=24%, 5=19%, 6=15%, 7=13%, 8=11%, 9=10%) | |
$max_bets = 25; // Number of bets to make in this loop | |
// Get current balance | |
$response = json_decode( file_get_contents( $api . 'account/get?key=' . $key . '&secret=' . $secret ) ); | |
$current_balance = $response->result->balance; | |
$total_balance = $current_balance; | |
$starting_balance = $current_balance; | |
$i = 1; | |
$wins = 0; | |
$losses = 0; | |
echo '--- Stating bets with ' . (string) $starting_balance . '---' . "\n"; | |
while ( $i <= $max_bets ) { | |
if ( $current_balance <= $min_bal ) { | |
echo '--- Balance threshold crossed ---' . "\n"; | |
exit; | |
} | |
$bet_response = json_decode( file_get_contents( $api . 'gamble/roll?amount=' . $bet_amount . '&payout=' . $multiplyer . '&key=' . $key . '&secret=' . $secret ) ); | |
if ( $bet_response->won ) { | |
$wins++; | |
$won = $bet_amount * ( $multiplyer - 1 ); | |
$bet_amount = $starting; | |
$current_balance = $current_balance + ( $won ) + $bet_amount; | |
echo $i . ' - Won: ' . $won . "\n"; | |
} else { | |
$losses++; | |
$lost = $bet_amount; | |
$bet_amount = $bet_amount * 2; | |
// Never end on a loss, helps total RIP | |
if ( $i === $max_bets ) { | |
$max_bets++; | |
} | |
$current_balance = $current_balance - $lost; | |
echo $i . ' - Lost: ' . $lost . "\n"; | |
} | |
sleep(1); | |
$i++; | |
} | |
echo 'Starting Balance: ' . $starting_balance . "\n"; | |
$response = json_decode( file_get_contents( $api . 'account/get?key=' . $key . '&secret=' . $secret ) ); | |
echo 'Ending Balance: ' . $response->result->balance . "\n"; | |
echo 'Bet Performance: ' . (string) ( $response->result->balance - $starting_balance ) . "\n"; | |
echo $wins . ' Wins & ' . $losses . ' Losses' . "\n"; | |
echo 'Win Pct: ' . round( ( $wins/$i ) * 100 ) . '%' . "\n"; | |
echo '--- Betting Closed ---' . "\n"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Latest updates, removes the max bet (it can cause issues with doubling and making up for losses) and also makes it so this never ends on a loss. If your last bet is a loss, it simply adds one more to the max bet, so that it can try and make up for the loss.