Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var config = {
- payout: {value: 3.5, type: 'multiplier'},
- stop: {value: 20000000, type: 'balance', label: 'stop if bet >'},
- };
- let logsVar = {
- playedGamesStats: {
- games: 0,
- netProfit: 0,
- lastTimeLost: 0
- },
- userStats: {
- balance: userInfo.balance,
- profit: userInfo.profit
- },
- fibonacci: {
- lastVal: 0
- }
- };
- log('Script is running..');
- log(`at start: userBalance: ${logsVar.userStats.balance / 100} | userProfit: ${logsVar.userStats.profit / 100}`);
- let currentBet = 100;
- // Always try to bet when script is started + start listeners
- engine.bet(roundBit(currentBet), config.payout.value);
- engine.on('GAME_STARTING', onGameStarted);
- engine.on('GAME_ENDED', onGameEnded);
- const onWin = () => {
- logsVar.playedGamesStats.netProfit += (config.payout.value * currentBet) - currentBet;
- logsVar.fibonacci.lastVal = 0;
- currentBet = 100;
- log('We won, so next bet will be', currentBet / 100, 'bits')
- };
- const onLose = () => {
- const nextVal = currentBet + logsVar.fibonacci.lastVal;
- logsVar.playedGamesStats.netProfit -= currentBet;
- logsVar.fibonacci.lastVal = currentBet;
- currentBet = nextVal;
- log('We lost, so next bet will be', currentBet / 100, 'bits');
- };
- const onStop = () => {
- log(`Was about to bet ${currentBet / 100}, which triggers the stop, start back with base bet value.`);
- log(`From the last crash, ${logsVar.playedGamesStats.lastTimeLost} games ago, we earned: ${logsVar.playedGamesStats.netProfit / 100} bits.`);
- log(`actual user account informations: userBalance: ${logsVar.userStats.balance / 100} | userProfit: ${logsVar.userStats.profit / 100}`);
- logsVar.playedGamesStats.lastTimeLost = 0;
- logsVar.fibonacci.lastVal = 0;
- currentBet = 100;
- };
- function onGameStarted() {
- engine.bet(roundBit(currentBet), config.payout.value);
- }
- function onGameEnded() {
- var lastGame = engine.history.first();
- // If we wagered, it means we played
- if (lastGame.wager) {
- logsVar.playedGamesStats.games++;
- logsVar.playedGamesStats.lastTimeLost++;
- lastGame.cashedAt
- ? onWin()
- : onLose();
- }
- if (currentBet > config.stop.value)
- onStop();
- log(`Actual profit: ${logsVar.playedGamesStats.netProfit / 100} in ${logsVar.playedGamesStats.games} games played.`);
- }
- function roundBit(bet) {
- return Math.round(bet / 100) * 100;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement