Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //
- //
- //
- //
- var bet = 1000*100;
- var autoTimeOut = 1000*100;
- var imPlaying = false;
- var imCachedOut = false;
- var cashedOut = 0;
- var following = 'mojojojo';
- engine.on('game_starting', function(info) {
- console.log('Game Starting in ' + info.time_till_start);
- cashedOut = 0;
- imCachedOut = false;
- imPlaying = true;
- engine.placeBet(bet, autoTimeOut);
- });
- engine.on('game_started', function(data) {
- console.log('Game Started', data);
- if(imPlaying && !data.hasOwnProperty(following)) {
- console.log("Where is " + following + "?");
- engine.cashOut();
- }
- });
- engine.on('game_crash', function(data) {
- console.log('Game crashed at ', data.game_crash);
- });
- engine.on('player_bet', function(data) {
- //
- //
- });
- engine.on('cashed_out', function(resp) {
- if(!imCachedOut && resp.username == following) {
- imCachedOut = true;
- engine.cashOut();
- }
- });
- 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());
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement