Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var config = {};
- var initialized = false;
- function patchFunctions(debugging = false) {
- if (!initialized) {
- engine.placeBet = function (bet, multiplier, callback) {
- engine.bet(bet, parseFloat(multiplier / 100));
- }
- engine.getMaxBet = function () {
- return userInfo.balance;
- }
- engine.getCurrentPayout = function () {
- return (engine.gameState != 'IN_PROGRESS' ? null : (engine.bust * 100));
- }
- engine.getBalance = function () {
- return userInfo.balance;
- }
- engine.getUsername = function () {
- return userInfo.uname;
- }
- engine.getEngine = function () {
- return engine;
- }
- engine.lastGamePlayed = function () {
- return (engine.lastGamePlay() != 'NOT_PLAYED' ? true : false);
- }
- engine.lastGamePlay = function () {
- let lastGame = engine.history.first();
- if (lastGame.wager) {
- if (lastGame.cashedAt) {
- return 'WON';
- }
- return 'LOST';
- }
- return 'NOT_PLAYED';
- }
- engine.stop = function (reason) {
- stop(reason);
- }
- engine.on('GAME_STARTING', function () {
- if (this._events['game_starting']) {
- if (debugging) { console.log(`[debug] Remit 'GAME_STARTING'->'game_starting' {game_id: ${engine.gameId}, time_till_start: 5000}`); }
- engine.emit('game_starting', { game_id: engine.gameId, time_till_start: 5000 });
- }
- });
- engine.on('GAME_STARTED', function () {
- if (this._events['game_started']) {
- if (debugging) { console.log(`[debug] Remit 'GAME_STARTED'->'game_started' {${engine.playing}}`); }
- engine.emit('game_started', engine.playing);
- }
- });
- engine.on('GAME_ENDED', function () {
- if (this._events['game_crash']) {
- let lastGame = engine.history.first();
- let elapsed = parseInt(lastGame.lastGameTick - lastGame.startTime);
- if (debugging) { console.log(`[debug] Remit 'GAME_ENDED'->'game_crash' {elapsed: ${elapsed}, game_crash: ${lastGame.bust}, bonuses: 0, hash: ${lastGame.hash}}`); }
- engine.emit('game_crash', { elapsed: elapsed, game_crash: (lastGame.bust * 100), bonuses: 0, hash: lastGame.hash });
- }
- });
- engine.on('CASHED_OUT', function (bet) {
- if (this._events['cashed_out']) {
- if (debugging) { console.log(`[debug] Remit 'CASHED_OUT'->'cashed_out' {username: ${bet.uname}, amount: ${bet.wager}, stopped_at: ${bet.cashedAt}}`); }
- engine.emit('cashed_out', { username: bet.uname, amount: bet.wager, stopped_at: (bet.cashedAt * 100) });
- }
- });
- engine.on('BET_PLACED', function (bet) {
- if (this._events['player_bet']) {
- if (debugging) { console.log(`[debug] Remit 'BET_PLACED'->'player_bet' {username: ${bet.uname}, bet: ${bet.wager}`); }
- engine.emit('player_bet', { username: bet.uname, bet: bet.wager });
- }
- });
- initialized = true;
- }
- }
- patchFunctions();
- var baseBet = 1; // bet size awal (bits)
- var baseMultiplier = 2; // base cashout
- var stopAtProfit = 50;
- var maxbalance = 5000;
- // ===================== MARTINGALE SYSTEM ========================
- var inc_on_lost = 30; // increase bet (%) tiap kalah
- var inc_on_win = -70; // increase bet (%) tiap menang
- var inc_every_lost = 1; // increase bet tiap kalah x strake
- var inc_every_win = 2; // increase bet tiap kalah x strake
- // ===================== END LINE MARTINGALE SYSTEM ========================
- var currentGameID = -1;
- var firstgame = true;
- var cashout_multipler = baseMultiplier;
- var baseSatoshi = baseBet * 100;
- var currentBet = baseSatoshi;
- var currentMultiplier = baseMultiplier;
- var realCurrentBet = baseSatoshi;
- var lastBet = 0;
- var stopAtProfit = 50;
- var winStrake = 5;
- var loseStrake = 0;
- engine.on('game_starting', function(info) {
- currentGameID = info.game_id;
- cashout_multipler = baseMultiplier;
- if(!firstgame){
- console.log("=============== New Game #"+currentGameID+" ===============");
- }
- if (engine.lastGamePlay() == 'LOST' && !firstgame) { // If last game loss:
- winStrake = 0;
- loseStrake++;
- if(inc_on_lost == 0){
- currentBet = baseSatoshi;
- currentMultiplier = baseMultiplier;
- realCurrentBet = baseSatoshi;
- }else if(loseStrake > 0 && loseStrake % inc_every_lost == 0){
- realCurrentBet = (realCurrentBet * (inc_on_lost/100))+realCurrentBet;
- currentBet = (Math.floor((realCurrentBet) / 100)) * 100;
- if(currentBet < baseSatoshi){
- currentBet = baseSatoshi;
- }
- currentMultiplier = baseMultiplier;
- }
- }else if(!firstgame){
- loseStrake = 0;
- winStrake++;
- if(winStrake > 0 && winStrake % inc_every_win == 0){
- realCurrentBet = (realCurrentBet * (inc_on_win/100))+realCurrentBet;
- currentBet = (Math.floor((realCurrentBet) / 100)) * 100;
- if(currentBet < baseSatoshi){
- currentBet = baseSatoshi;
- realCurrentBet = currentBet;
- }
- currentMultiplier = baseMultiplier;
- }
- }
- console.log(winStrake,loseStrake,currentBet, realCurrentBet);
- if(currentBet > (engine.getBalance() / 2)){
- console.log("[Stop] Strategy stop out of balance");
- engine.stop();
- return;
- }
- engine.placeBet(currentBet, Math.round(currentMultiplier * 100), function(){
- console.log("[Bot] Betting "+(currentBet/100)+" bits on x"+currentMultiplier);
- lastBet = currentBet;
- });
- });
- engine.on('game_started', function(data) {
- });
- var already_cashed_out = false;
- engine.on('cashed_out', function(data) {
- if(data.username==engine.getUsername()){
- cashout_multipler = data.stopped_at/100;
- already_cashed_out = true;
- }
- });
- engine.on('game_crash', function(data) {
- already_cashed_out = false;
- if(firstgame) firstgame = false;
- });
Advertisement
Add Comment
Please, Sign In to add comment