Untitled


SUBMITTED BY: Guest

DATE: Nov. 16, 2013, 7:18 a.m.

FORMAT: Text only

SIZE: 1.6 kB

HITS: 1037

  1. // Customizable variables
  2. var minValue = 0.00000001;
  3. var maxLoss = 0.001;
  4. var aimedProfit = 0.05;
  5. var maxOps = 500000000000000;
  6. // Don't touch anything after this
  7. var endResult = 0;
  8. var ops = 0;
  9. // Bets a given amount on a given button and returns the value ot the callback
  10. var bet = function(value, button, callback) {
  11. var buttonName = button ? 'lo' : 'hi';
  12. // We use site's api
  13. $.get('?op=double_your_btc&m=' + buttonName + '&stake=' + value + '&multiplier=2&jackpot=0', function(result) {
  14. var splittedResult = result.split(':');
  15. // We update the account balance, as we have it juste there
  16. $('#balance').html(splittedResult[3]);
  17. // We finally call the callback
  18. callback(value, button, splittedResult[1] === 'w');
  19. }
  20. );
  21. };
  22. // Main Martingale's method
  23. var martingale = function(value, button, result) {
  24. // We apply Martingale algorithm
  25. if (result || (value >= maxLoss && maxLoss !== 0)) {
  26. button = !button;
  27. newValue = minValue;
  28. }
  29. else
  30. newValue = 2 * value;
  31. // We compute new final result
  32. if (result)
  33. endResult += value;
  34. else
  35. endResult -= value;
  36. // We start over (and log misc data)
  37. console.log((result ? '+' : '-') + value);
  38. ops++;
  39. if ((ops < maxOps || maxOps === 0) && (endResult < aimedProfit || aimedProfit === 0))
  40. bet(newValue, button, martingale);
  41. else {
  42. console.log('Martingale finished in ' + ops + ' operations!');
  43. console.log('Result: ' + endResult);
  44. }
  45. };
  46. // Init operation
  47. martingale(minValue, false, false);

comments powered by Disqus