PrimeDice.com bot many features


SUBMITTED BY: Guest

DATE: March 28, 2014, 7:54 a.m.

FORMAT: Text only

SIZE: 12.3 kB

HITS: 1606

  1. function setBotParams() { params = {
  2. bet: 0.00001, // bet after loss cap
  3. odds: 75.00, // winning chance
  4. type: 1, // high / low roll (1 = low, 0 = high)
  5. runs: 100000, // number of bets to make
  6. pad_bet: 0.000000001, // bet to make while pre-rolling
  7. prerolls: 5, // number of losses before placing bet
  8. on_loss_multi: 2.0, // multiply bet on loss (after pre-rolling)
  9. stop_min: 0.00000000, // stop betting if number drops to/below this number
  10. stop_max: 0.001000000, // stop betting if number reaches this number
  11. all_in_save: true, // go all-in if bet is higher than balance
  12. high_low_swap: true, // invert roll each bet
  13. // -- don't edit below this point --
  14. loss_count: 0,
  15. current_run: 0,
  16. current_bet: 0,
  17. current_run_loss: 0,
  18. capping_loss: false
  19. }; }
  20. var lastmessage = 0,
  21. autobet_speed = -20,
  22. normalbet_speed = -20,
  23. id = 97443,
  24. timedCount, timer, lastYourBet = 0,
  25. lastAllBet = 0,
  26. lastBigBet = 0,
  27. autobet_halt, first_load = true,
  28. autobet_index = false,
  29. prev_balance = 0,
  30. bet_ids = [];
  31. function bet(bet, odds, type, callback) {
  32. $.ajax({
  33. url: '/api/bet.php',
  34. type: 'post',
  35. data: {
  36. 'bet': bet,
  37. 'game': odds,
  38. 'type': type == 0 ? 1 : 0,
  39. 'client_seed': $('#client-seed').val()
  40. },
  41. dataType: 'json',
  42. success: function (data) {
  43. if (data.error) {
  44. autobet_halt = true;
  45. return;
  46. }
  47. var $seed = $('#client-seed'),
  48. seed = $seed.val(),
  49. $parent = $seed.parent(),
  50. i = seed.indexOf('-'),
  51. val;
  52. if (i == -1) {
  53. seed += '-0000';
  54. i = seed.indexOf('-');
  55. }
  56. val = (parseInt(seed.substr(i + 1)) + 1).toString();
  57. while (val.length < 4) {
  58. val = '0' + val;
  59. }
  60. seed = seed.substr(0, i) + '-' + val;
  61. $seed.val(seed);
  62. $parent.find('.pretty-text').text(seed);
  63. $('#server-seed').text(data.next_server_seed);
  64. prev_balance = data.balance;
  65. $('#balance').val(data.balance);
  66. $('#balance-value').text(data.balance).stop(true, true).css({
  67. color: data.result == "1" ? '#0f0' : '#f66'
  68. }).animate({
  69. color: '#fff'
  70. }, 500);
  71. addRows($('#table-1'), [data], autobet_index !== false ? autobet_index + 1 : false);
  72. addRows($('#table-2'), [data]);
  73. },
  74. error: function (jqXHR) {
  75. autobet_halt = true;
  76. },
  77. complete: function (jqXHR) {
  78. var data;
  79. try {
  80. data = $.parseJSON(jqXHR.responseText);
  81. } catch (e) {
  82. data = false;
  83. }
  84. if (typeof callback === 'function') {
  85. callback(data);
  86. }
  87. }
  88. });
  89. }
  90. function auto_bet(params) {
  91. if (bot_enabled === true) {
  92. if (params.current_run === params.runs) {
  93. botoff();
  94. alert("Bot stopped- completed " + params.runs + " runs");
  95. } else {
  96. setTimeout(function () {
  97. var current_balance = parseFloat($('#balance-value').text());
  98. if (current_balance === 0) {
  99. autobet_index = false;
  100. alert("Bot stopped- balance is zero")
  101. return;
  102. } else if (params.current_bet > current_balance) {
  103. if (parmas.all_in_save === true) {
  104. params.current_bet = current_balance;
  105. } else {
  106. botoff();
  107. alert("Bot stopped- bet is higher than balance");
  108. return;
  109. }
  110. } else if (current_balance < params.stop_min) {
  111. botoff();
  112. alert("Bot stopped- balance below " + params.stop_min);
  113. return;
  114. } else if (current_balance === params.stop_min) {
  115. botoff();
  116. alert("Bot stopped- balance below " + params.stop_min);
  117. return;
  118. } else if (current_balance > params.stop_max) {
  119. botoff();
  120. alert("Bot stopped- balance reached " + params.stop_min);
  121. return;
  122. } else if (current_balance === params.stop_max) {
  123. botoff();
  124. alert("Bot stopped- balance reached " + params.stop_min);
  125. return;
  126. }
  127. bet(params.current_bet, params.odds, params.type, function (data) {
  128. var i, a, j, curbet;
  129. if (data) {
  130. params.current_run++;
  131. autobet_index = params.current_run;
  132. if (data.result == 0) {
  133. if (params.capping_loss == true) {
  134. params.current_bet *= params.on_loss_multi;
  135. } else {
  136. if (params.current_run_loss == params.prerolls) {
  137. params.capping_loss = true;
  138. params.current_run_loss = 1;
  139. params.current_bet = params.bet;
  140. } else {
  141. params.current_run_loss += 1;
  142. }
  143. }
  144. params.loss_count += 1;
  145. } else {
  146. params.current_bet = 0;
  147. params.current_run_loss = 1;
  148. params.capping_loss = false;
  149. params.loss_count = 1;
  150. }
  151. curbet = params.current_bet.toString();
  152. if (curbet.indexOf('e') > -1) {
  153. i = parseInt(curbet.substr(0, curbet.indexOf('e')).replace('.', ''));
  154. a = parseInt(curbet.substr(curbet.indexOf('e') + 2));
  155. curbet = i.toString();
  156. for (j = 1; j < a; j++) {
  157. curbet = '0' + curbet;
  158. }
  159. params.current_bet = '0.' + curbet;
  160. }
  161. params.current_bet = +('' + params.current_bet).substr(0, ('' +params.current_bet).indexOf('.') + 9);
  162. if (data.balance < data.current_bet) {
  163. return;
  164. }
  165. }
  166. if (params.current_run < 10000000) {
  167. if (params.high_low_swap === true) {
  168. if (params.type === 1) {
  169. params.type = 0;
  170. params.odds = 100 - params.odds
  171. } else {
  172. params.type = 1;
  173. params.odds = 100 - params.odds
  174. }
  175. }
  176. if(params.current_bet < params.pad_bet)
  177. params.current_bet = params.pad_bet;
  178. auto_bet(params);
  179. } else {
  180. setBotParams();
  181. params.current_bet = params.pad_bet;
  182. autobet_index = false;
  183. auto_bet(params);
  184. return;
  185. }
  186. })
  187. }, autobet_speed);
  188. }
  189. }
  190. }
  191. function addRows($table, rows, autobet_i) {
  192. var table_selector = $table.selector,
  193. td_tmpl = '<td class="tabs__table-column tabs__table-cell"',
  194. $tableod, $tr, top, new_top, count = 0,
  195. need_placeholder = false,
  196. trhtml = '';
  197. if (rows.error) {
  198. return;
  199. }
  200. // console.log('new rows!');
  201. $table.stop(true);
  202. $tableod = $table.clone();
  203. if ($tableod.find('tr.placeholder').length) {
  204. need_placeholder = true;
  205. $tableod.find('tr.placeholder').remove();
  206. // console.log(need_placeholder ? 'Has Placeholder' : 'No Placeholder');
  207. }
  208. top = parseInt($table.css('top'));
  209. if (isNaN(top)) top = 0;
  210. $.each(rows, function (i, data) {
  211. if (data.error) {
  212. return;
  213. }
  214. if (count == 30 || (!autobet_i && data.bet_id && $.inArray(data.bet_id, bet_ids) !== -1)) return;
  215. need_placeholder = !need_placeholder;
  216. count++;
  217. bet_ids.push(data.bet_id);
  218. var value = data.winnings.toString(),
  219. multiplier = data.multiplier.toString();
  220. if (value.indexOf('.') !== -1) {
  221. value += '00000000';
  222. }
  223. value = value.substr(0, value.indexOf('.') + 9);
  224. value = value.indexOf('-') != -1 ? value.substr(1) : value;
  225. value = (data.result == "1" ? '+' : '-') + value;
  226. if (multiplier.indexOf('.') == -1) {
  227. multiplier += '.00000';
  228. } else {
  229. multiplier += '00000';
  230. multiplier = multiplier.substr(0, multiplier.indexOf('.') + 6);
  231. }
  232. trhtml += '<tr class="tabs__table-row bet-' + data.bet_id + '">' + td_tmpl + '<a class="action-fancybox" href="/modals/bet.html?id=' + data.bet_id + '">' + data.bet_id + '</a>' + (autobet_i ? ' (' + params.loss_count + ') (' + autobet_i + ')' : '') + '</td>' + td_tmpl + '>' + data.username + '</td>' + td_tmpl + '>' + data.elapsed + '</td>' + td_tmpl+ '>' + data.bet + '</td>' + td_tmpl + '>' + multiplier + '</td>' + td_tmpl + '>' + data.game + '</td>' + td_tmpl+ '>' + data.roll + '</td>' + td_tmpl + ' style="color: ' + (data.result == "1" ? 'green' : 'red') + '">' + value+ '</td>' + '</tr>';
  233. });
  234. $tableod.prepend(trhtml);
  235. if (need_placeholder) {
  236. $tableod.find('tr:first').clone().addClass('placeholder').prependTo($tableod);
  237. top = -(count * 34) - 34;
  238. new_top = -34;
  239. } else {
  240. top = -(count * 34);
  241. new_top = 0;
  242. }
  243. $tableod.css('top', top);
  244. $tableod.find('tr:gt(30)').addClass('removing');
  245. $table.replaceWith($tableod);
  246. $tableod.stop().animate({
  247. 'top': new_top
  248. });
  249. $tableod.find('tr.removing').animate({
  250. opacity: 0
  251. }, function () {
  252. $(this).remove();
  253. });
  254. // console.log($tableod.find('tr:first').is('.placeholder') ? 'Has Placeholder' : 'No Placeholder');
  255. }
  256. function updateYourBets() {
  257. $.ajax({
  258. url: '/api/get_bets.php',
  259. data: {
  260. id: parseInt($('#user-id').text()),
  261. count: '30',
  262. bet_id: lastYourBet
  263. },
  264. type: 'post',
  265. dataType: 'json',
  266. success: function (data) {
  267. if (!data || data.length === 0) return;
  268. lastYourBet = data[0].bet_id;
  269. addRows($('#table-1'), data);
  270. }
  271. });
  272. }
  273. function updateBigBets(callback) {
  274. $.ajax({
  275. url: '/api/get_bets.php',
  276. data: {
  277. value: '.5',
  278. count: '30',
  279. bet_id: lastBigBet
  280. },
  281. type: 'post',
  282. dataType: 'json',
  283. success: function (data) {
  284. if (!data || data.length === 0) return;
  285. lastBigBet = data[0].bet_id;
  286. addRows($('#table-3'), data);
  287. },
  288. complete: function () {
  289. if (typeof callback == 'function') callback();
  290. }
  291. });
  292. }
  293. function updateAllBets(callback, first) {
  294. if (first) {
  295. $.ajax({
  296. url: '/api/get_bets.php',
  297. data: {
  298. count: '30',
  299. bet_id: lastAllBet
  300. },
  301. type: 'post',
  302. dataType: 'json',
  303. success: function (data) {
  304. if (!data || data.length === 0) return;
  305. lastAllBet = data[0].bet_id;
  306. addRows($('#table-2'), data.reverse());
  307. },
  308. complete: callback
  309. });
  310. return;
  311. }
  312. var did_one = false,
  313. checker = function () {
  314. if (did_one && typeof callback == 'function') callback();
  315. did_one = true;
  316. };
  317. $.ajax({
  318. url: '/api/get_bets.php',
  319. data: {
  320. count: '30',
  321. bet_id: lastAllBet,
  322. value: '0.1'
  323. },
  324. type: 'post',
  325. dataType: 'json',
  326. success: function (data) {
  327. if (!data || data.length === 0) return;
  328. lastAllBet = data[0].bet_id;
  329. addRows($('#table-2'), data.reverse());
  330. },
  331. complete: checker
  332. });
  333. $.ajax({
  334. url: '/api/get_bets.php',
  335. data: {
  336. count: '1',
  337. bet_id: lastAllBet,
  338. less: '0.1'
  339. },
  340. type: 'post',
  341. dataType: 'json',
  342. success: function (data) {
  343. if (!data || data.length === 0) return;
  344. lastAllBet = data[0].bet_id;
  345. addRows($('#table-2'), data.reverse());
  346. },
  347. complete: checker
  348. });
  349. }
  350. function updateBalance(checker) {
  351. $.ajax({
  352. url: '/api/get_balance.php',
  353. dataType: 'json',
  354. success: function (data) {
  355. $('#balance').val(data.balance);
  356. $('#balance-value').text(data.balance);
  357. },
  358. complete: checker
  359. });
  360. }
  361. function update(callback) {
  362. var did_count = 0,
  363. checked = function () {
  364. did_count++;
  365. if (did_count == 4 && typeof callback == 'function') callback();
  366. }
  367. updateStats(checked);
  368. updateAllBets(checked, first_load);
  369. updateBigBets(checked);
  370. updateBalance(checked);
  371. first_load = false;
  372. }
  373. function updateStats(checked) {
  374. $.ajax({
  375. url: '/api/stats.php',
  376. type: 'get',
  377. dataType: 'json',
  378. success: function (data) {
  379. $('#stats-wagered').text(data.wagered);
  380. $('#stats-bets').text(data.bets);
  381. $('#stats-bank').text(data.bank);
  382. },
  383. complete: checked
  384. })
  385. }
  386. function botoff() { bot_enabled = false; }
  387. setBotParams();
  388. params.current_bet = params.pad_bet;
  389. autobet_halt = false;
  390. bot_enabled = true;
  391. autobet_index = 0;
  392. auto_bet(params);

comments powered by Disqus