primedice.com script bot :)


SUBMITTED BY: Guest

DATE: Aug. 18, 2014, 8:21 a.m.

FORMAT: HTML

SIZE: 12.3 kB

HITS: 2690

  1. function setBotParams() { params = {
  2. bet: 0.00000010, // SET TO YOUR INITIAL START BET AFTER PREROLL
  3. odds: 10, // winning chance
  4. type: 1, // high / low roll (1 = low, 0 = high)
  5. runs: 100000, // number of bets to make
  6. pad_bet: 0.00000000, // bet to make while pre-rolling
  7. prerolls: 15, // NUMBER OF LOSSES BEFORE STARTS BETTING
  8. on_loss_multi: 1.1134, // multiply bet on loss (after pre-rolling) (1.1134 = 11.34% on LOSS)
  9. stop_min: 0.00000000, // stop betting if number drops to/below this number
  10. stop_max: 0.02000000, // stop betting if number reaches this number
  11. all_in_save: false, // go all-in if bet is higher than balance
  12. high_low_swap: false, // 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 = -20,
  21. autobet_speed = -200000,
  22. normalbet_speed = -20000,
  23. id = 0,
  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. },
  72. error: function (jqXHR) {
  73. autobet_halt = true;
  74. },
  75. complete: function (jqXHR) {
  76. var data;
  77. try {
  78. data = $.parseJSON(jqXHR.responseText);
  79. } catch (e) {
  80. data = false;
  81. }
  82. if (typeof callback === 'function') {
  83. callback(data);
  84. }
  85. }
  86. });
  87. }
  88. function auto_bet(params) {
  89. if (bot_enabled === true) {
  90. if (params.current_run === params.runs) {
  91. botoff();
  92. alert("Bot stopped- completed " + params.runs + " runs");
  93. } else {
  94. setTimeout(function () {
  95. var current_balance = parseFloat($('#balance-value').text());
  96. if (current_balance === 0) {
  97. autobet_index = false;
  98. alert("Bot stopped- balance is zero")
  99. return;
  100. } else if (params.current_bet > current_balance) {
  101. if (params.all_in_save === true) {
  102. params.current_bet = current_balance;
  103. } else {
  104. botoff();
  105. alert("Bot stopped- bet is higher than balance");
  106. return;
  107. }
  108. } else if (current_balance < params.stop_min) {
  109. botoff();
  110. alert("Bot stopped- balance below " + params.stop_min);
  111. return;
  112. } else if (current_balance === params.stop_min) {
  113. botoff();
  114. alert("Bot stopped- balance below " + params.stop_min);
  115. return;
  116. } else if (current_balance > params.stop_max) {
  117. botoff();
  118. alert("Bot stopped- balance reached " + params.stop_min);
  119. return;
  120. } else if (current_balance === params.stop_max) {
  121. botoff();
  122. alert("Bot stopped- balance reached " + params.stop_min);
  123. return;
  124. }
  125. bet(params.current_bet, params.odds, params.type, function (data) {
  126. var i, a, j, curbet;
  127. if (data) {
  128. params.current_run++;
  129. autobet_index = params.current_run;
  130. if (data.result == 0) {
  131. if (params.capping_loss == true) {
  132. params.current_bet *= params.on_loss_multi;
  133. } else {
  134. if (params.current_run_loss == params.prerolls) {
  135. params.capping_loss = true;
  136. params.current_run_loss = 1;
  137. params.current_bet = params.bet;
  138. } else {
  139. params.current_run_loss += 1;
  140. }
  141. }
  142. params.loss_count += 1;
  143. } else {
  144. params.current_bet = 0;
  145. params.current_run_loss = 1;
  146. params.capping_loss = false;
  147. params.loss_count = 1;
  148. }
  149. curbet = params.current_bet.toString();
  150. if (curbet.indexOf('e') > -1) {
  151. i = parseInt(curbet.substr(0, curbet.indexOf('e')).replace('.', ''));
  152. a = parseInt(curbet.substr(curbet.indexOf('e') + 2));
  153. curbet = i.toString();
  154. for (j = 1; j < a; j++) {
  155. curbet = '0' + curbet;
  156. }
  157. params.current_bet = '0.' + curbet;
  158. }
  159. params.current_bet = +('' + params.current_bet).substr(0, ('' +params.current_bet).indexOf('.') + 9);
  160. if (data.balance < data.current_bet) {
  161. return;
  162. }
  163. }
  164. if (params.current_run < 10000000) {
  165. if (params.high_low_swap === true) {
  166. if (params.type === 1) {
  167. params.type = 0;
  168. params.odds = 100 - params.odds
  169. } else {
  170. params.type = 1;
  171. params.odds = 100 - params.odds
  172. }
  173. }
  174. if(params.current_bet < params.pad_bet)
  175. params.current_bet = params.pad_bet;
  176. auto_bet(params);
  177. } else {
  178. setBotParams();
  179. params.current_bet = params.pad_bet;
  180. autobet_index = false;
  181. auto_bet(params);
  182. return;
  183. }
  184. })
  185. }, autobet_speed);
  186. }
  187. }
  188. console.clear();
  189. console.clear(); console.log("Current loss streak: " +params.current_run_loss);
  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