Revisions
-
dsetzer revised this gist
Apr 1, 2019 . No changes.There are no files selected for viewing
-
dsetzer revised this gist
Sep 26, 2018 . 1 changed file with 8 additions and 5 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -5,26 +5,29 @@ var betMultiplier = 1.03; // bet multiplied on win log('Script is running..'); var currentBet = baseBet; var betCountdown = 0; engine.on('GAME_STARTING', onGameStarted); engine.on('GAME_ENDED', onGameEnded); function onGameStarted() { if (betCountdown > 0) { betCountdown--; log('Placing bet in', betCountdown+1, 'games..'); }else{ engine.bet(roundBit(currentBet), basePayout); log('Placed bet of', parseFloat(currentBet / 100).toFixed(2), 'bits'); } } function onGameEnded() { var lastGame = engine.history.first(); if (!lastGame.wager) { return; } if (lastGame.cashedAt) { currentBet *= betMultiplier; betCountdown = Math.floor(Math.random() * 5) + 1; // random between 1-5 log('We won, next bet will be', parseFloat(currentBet / 100).toFixed(2), 'bits after', betCountdown+1, 'games..'); } else { stop('We lost, stopping script..'); } -
dsetzer revised this gist
Sep 26, 2018 . 1 changed file with 18 additions and 19 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,36 +1,35 @@ var config = {}; var baseBet = 1 * 100; // base bet in satoshis var basePayout = 1.05; var betMultiplier = 1.03; // bet multiplied on win log('Script is running..'); var currentBet = baseBet; engine.on('GAME_STARTING', onGameStarted); engine.on('GAME_ENDED', onGameEnded); function onGameStarted() { if (Math.floor(Math.random() * 4) == 1) { engine.bet(roundBit(currentBet), basePayout); log('Placed bet of ', parseFloat(currentBet / 100).toFixed(2), 'bits'); } } function onGameEnded() { var lastGame = engine.history.first(); // If we wagered, it means we played if (!lastGame.wager) { return; } // we won.. if (lastGame.cashedAt) { currentBet *= betMultiplier; log('We won, so next bet will be', parseFloat(currentBet / 100).toFixed(2), 'bits'); } else { stop('We lost, stopping script..'); } } function roundBit(bet) { return Math.round(bet / 100) * 100; } -
dsetzer created this gist
Sep 26, 2018 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,36 @@ var config = {}; var baseBet = 1 * 100; // base bet in satoshis var basePayout = 1.05; var betMultiplier = 1.03; // bet multiplied on win log('Script is running..'); var currentBet = baseBet; engine.on('GAME_STARTING', onGameStarted); engine.on('GAME_ENDED', onGameEnded); function onGameStarted() { engine.bet(roundBit(currentBet), basePayout); log('Placed bet of ', parseFloat(currentBet/100).toFixed(2), 'bits'); } function onGameEnded() { var lastGame = engine.history.first(); // If we wagered, it means we played if (!lastGame.wager) { return; } // we won.. if (lastGame.cashedAt) { currentBet *= betMultiplier; log('We won, so next bet will be', parseFloat(currentBet/100).toFixed(2), 'bits'); } else { stop('We lost, stopping script..'); } } function roundBit(bet) { return Math.round(bet / 100) * 100; }