code bustabit


SUBMITTED BY: haho

DATE: Feb. 28, 2016, 12:33 p.m.

FORMAT: Text only

SIZE: 2.3 kB

HITS: 2049

  1. // This strategy editor is in BETA mode, please
  2. // exercise extreme caution and use exclusively at
  3. // your own risk. No bets can or will be refunded in
  4. // case of errors.
  5. // Please note the strategy editor executes arbitrary
  6. // javascript without a sandbox and as such, only use
  7. // strategies from trusted sources, as they can be
  8. // backdoored to lose all your money or have
  9. // intentional exploitable weaknesses etc.
  10. // To see the full engine API go to:
  11. ///https://github.com/moneypot/webserver/blob/master/client_new/scripts/game-logic/script-controller.js
  12. //Engine events:
  13. engine.on('game_starting', function(info) {
  14. console.log('Game Starting in ' + info.time_till_start);
  15. });
  16. engine.on('game_started', function(data) {
  17. console.log('Game Started', data);
  18. });
  19. engine.on('game_crash', function(data) {
  20. console.log('Game crashed at ', data.game_crash);
  21. });
  22. engine.on('player_bet', function(data) {
  23. console.log('The player ', data.username, ' placed a bet. This player could be me :o.')
  24. });
  25. engine.on('cashed_out', function(resp) {
  26. console.log('The player ', resp.username, ' cashed out. This could be me.');
  27. });
  28. engine.on('msg', function(data) {
  29. console.log('Chat message!...');
  30. });
  31. engine.on('connect', function() {
  32. console.log('Client connected, this wont happen when you run the script');
  33. });
  34. engine.on('disconnect', function() {
  35. console.log('Client disconnected');
  36. });
  37. //Getters:
  38. console.log('Balance: ' + engine.getBalance());
  39. console.log('The current payout is: ' + engine.getCurrentPayout());
  40. console.log('My username is: ', engine.getUsername());
  41. console.log('The max current bet is: ', engine.getMaxBet()/100, ' Bits');
  42. console.log('The current maxWin is: ', engine.getMaxWin()/100, ' Bits');
  43. // engine.getEngine() for raw engine
  44. //Helpers:
  45. console.log('Was the last game played? ', engine.lastGamePlayed()?'Yes':'No');
  46. console.log('Last game status: ', engine.lastGamePlay());
  47. //Actions:
  48. //Do this between the 'game_starting' and 'game_started' events
  49. //engine.placeBet(betInSatoshis, autoCashOutinPercent, autoPlay);
  50. //engine.cashOut(); //Do this when playing
  51. //engine.stop(); //Stops the strategy
  52. //engine.chat('Hello Spam');

comments powered by Disqus