Advertisement
kiwiboi

Untitled

Dec 29th, 2017
925
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.22 KB | None | 0 0
  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.  
  6. // Please note the strategy editor executes arbitrary
  7. // javascript without a sandbox and as such, only use
  8. // strategies from trusted sources, as they can be
  9. // backdoored to lose all your money or have
  10. // intentional exploitable weaknesses etc.
  11.  
  12. // To see the full engine API see this mirror:
  13. ///https://github.com/kungfuant/webserver/blob/master/client_new/scripts/game-logic/script-controller.js
  14.  
  15. //Engine events:
  16.  
  17. engine.on('game_starting', function(info) {
  18. console.log('Game Starting in ' + info.time_till_start);
  19. });
  20.  
  21. engine.on('game_started', function(data) {
  22. console.log('Game Started', data);
  23. });
  24.  
  25. engine.on('game_crash', function(data) {
  26. console.log('Game crashed at ', data.game_crash);
  27. });
  28.  
  29. engine.on('player_bet', function(data) {
  30. console.log('The player ', data.username, ' placed a bet. This player could be me :o.')
  31. });
  32.  
  33. engine.on('cashed_out', function(resp) {
  34. console.log('The player ', resp.username, ' cashed out. This could be me.');
  35. });
  36.  
  37. engine.on('msg', function(data) {
  38. console.log('Chat message!...');
  39. });
  40.  
  41. engine.on('connect', function() {
  42. console.log('Client connected, this wont happen when you run the script');
  43. });
  44.  
  45. engine.on('disconnect', function() {
  46. console.log('Client disconnected');
  47. });
  48.  
  49.  
  50. //Getters:
  51. console.log('Balance: ' + engine.getBalance());
  52. console.log('The current payout is: ' + engine.getCurrentPayout());
  53. console.log('My username is: ', engine.getUsername());
  54. console.log('The max current bet is: ', engine.getMaxBet()/100, ' ethos');
  55. console.log('The current maxWin is: ', engine.getMaxWin()/100, ' ethos');
  56. // engine.getEngine() for raw engine
  57.  
  58.  
  59. //Helpers:
  60. console.log('Was the last game played? ', engine.lastGamePlayed()?'Yes':'No');
  61. console.log('Last game status: ', engine.lastGamePlay());
  62.  
  63.  
  64. //Actions:
  65. //Do this between the 'game_starting' and 'game_started' events
  66. //engine.placeBet(betInSatoshis, autoCashOutinPercent, autoPlay);
  67.  
  68. //engine.cashOut(); //Do this when playing
  69. //engine.stop(); //Stops the strategy
  70. //engine.chat('Hello Spam');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement