Advertisement
Guest User

Untitled

a guest
Jul 4th, 2015
215
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.52 KB | None | 0 0
  1. //
  2. //
  3. //
  4. //
  5.  
  6. var bet = 1000*100;
  7. var autoTimeOut = 1000*100;
  8. var imPlaying = false;
  9. var imCachedOut = false;
  10.  
  11. var cashedOut = 0;
  12.  
  13. var following = 'mojojojo';
  14.  
  15. engine.on('game_starting', function(info) {
  16. console.log('Game Starting in ' + info.time_till_start);
  17. cashedOut = 0;
  18. imCachedOut = false;
  19. imPlaying = true;
  20. engine.placeBet(bet, autoTimeOut);
  21. });
  22.  
  23. engine.on('game_started', function(data) {
  24. console.log('Game Started', data);
  25. if(imPlaying && !data.hasOwnProperty(following)) {
  26. console.log("Where is " + following + "?");
  27. engine.cashOut();
  28. }
  29. });
  30.  
  31. engine.on('game_crash', function(data) {
  32. console.log('Game crashed at ', data.game_crash);
  33. });
  34.  
  35. engine.on('player_bet', function(data) {
  36. //
  37. //
  38. });
  39.  
  40. engine.on('cashed_out', function(resp) {
  41. if(!imCachedOut && resp.username == following) {
  42. imCachedOut = true;
  43. engine.cashOut();
  44. }
  45. });
  46.  
  47. engine.on('disconnect', function() {
  48. console.log('Client disconnected');
  49. });
  50.  
  51.  
  52. //Getters:
  53. console.log('Balance: ' + engine.getBalance());
  54. console.log('The current payout is: ' + engine.getCurrentPayout());
  55. console.log('My username is: ', engine.getUsername());
  56. console.log('The max current bet is: ', engine.getMaxBet()/100, ' Bits');
  57. console.log('The current maxWin is: ', engine.getMaxWin()/100, ' Bits');
  58. // engine.getEngine() for raw engine
  59.  
  60.  
  61. //Helpers:
  62. console.log('Was the last game played? ', engine.lastGamePlayed()?'Yes':'No');
  63. console.log('Last game status: ', engine.lastGamePlay());
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement