Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Variable Cashout point with percent of balance BASEBET.
- //Engine events:
- engine.on('game_starting', function(info) {
- console.log('Game Starting in ' + info.time_till_start);
- });
- engine.on('game_started', function(data) {
- console.log('Game Started', data);
- });
- engine.on('game_crash', function(data) {
- console.log('Game crashed at ', data.game_crash);
- });
- engine.on('player_bet', function(data) {
- console.log('The player ', data.username,
- ' placed a bet. This player could be me :o.');
- });
- engine.on('cashed_out', function(resp) {
- console.log('The player ', resp.username,
- ' cashed out. This could be me.');
- });
- engine.on('msg', function(data) {
- console.log('Chat message!...');
- });
- engine.on('connect', function() {
- console.log(
- 'Client connected, this wont happen when you run the script'
- );
- });
- engine.on('disconnect', function() {
- console.log('Client disconnected');
- });
- //Getters:
- console.log('Balance: ' + engine.getBalance());
- console.log('The current payout is: ' + engine.getCurrentPayout());
- console.log('My username is: ', engine.getUsername());
- console.log('The max current bet is: ', engine.getMaxBet() / 100, ' Bits');
- console.log('The current maxWin is: ', engine.getMaxWin() / 100, ' Bits');
- // engine.getEngine() for raw engine
- //Helpers:
- console.log('Was the last game played? ', engine.lastGamePlayed() ? 'Yes' :
- 'No');
- console.log('Last game status: ', engine.lastGamePlay());
- //Actions:
- //Do this between the 'game_starting' and 'game_started' events
- //engine.placeBet(betInSatoshis, autoCashOutinPercent, autoPlay);
- //engine.cashOut(); //Do this when playing
- //engine.stop(); //Stops the strategy
- //engine.chat('Hello Spam');
- var percentageWanted = 0.05; // 0.1% or less recommended <0.001% to survive zombie appocolypses :D
- var currentBet = (percentageWanted * 0.0001 * engine.getBalance()) * 100;
- var loss = 0;
- var lossTolerance = 27; // how many loses before restarting?
- var lastGameLost = false;
- var cashOut = 160;
- engine.on('game_starting', function() {
- if (engine.lastGamePlay() == 'LOST') {
- loss += 1;
- if (loss < lossTolerance + 1) { //not inclusive of int-lossTolerance originally
- if (cashOut < 400) { // increase these if needed
- currentBet *= 1.49;
- cashOut *= 1.26;
- } else {
- currentBet *= 1.32; // increase these if needed
- cashOut = 400;
- cashOut *= 1.04;
- }
- } else { // restart the bot after X loss streaks
- currentBet = (percentageWanted * 0.0001 * engine.getBalance()) *
- 100;
- cashOut = 160;
- loss = 0;
- }
- } else if (engine.lastGamePlay() == 'WON') {
- currentBet = (percentageWanted * 0.0001 * engine.getBalance()) *
- 100;
- cashOut = 160;
- loss = 0;
- }
- if (currentBet <= engine.getBalance() && currentBet <= engine.getMaxBet()) {
- engine.placeBet(Math.round(currentBet / 100) * 100, Math.round(
- cashOut / 1) * 1, false);
- } else {
- engine.stop();
- console.log(
- 'You ran out of bits or exceeded the max bet :(');
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment