PrimeDice Bot


SUBMITTED BY: Guest

DATE: Nov. 8, 2015, 5:11 a.m.

FORMAT: Text only

SIZE: 41.3 kB

HITS: 575

  1. Go to Primedice.com
  2. press f12 and paste this into it
  3. set up your settings
  4. click set params to tell the bot what to do
  5. click start.
  6. var loop, currentloss, betspeed, dialog, swapwincount, incrementwincount, swaplosscount, curbet, basebet, seedcount, prebet, prerollsenabled, profit, prerollson, prerollcount, betval, currentwin, target2, condition2, wincount, xhr, tstatus, seedlength, counter, charset, everyxrolls, wins, losses, data1, data2, swapenabled, betstarted, wmultcount, lmultcount, storebet, manualenabled;
  7. var balancebefore;var chart='';
  8. betspeed=500;
  9. seedcount = 0;
  10. currentloss = 0;
  11. lmultcount = 0;
  12. wmultcount = 0;
  13. prerollcount = 0;
  14. wins = 0;
  15. losses = 0;
  16. profit = 0;
  17. swaplosscount = 0;
  18. swapwincount = 0;
  19. incrementwincount = 0;
  20. loopenabled = false;
  21. manualenabled = false;
  22. loopcount = 0;
  23. seedlength = 5;
  24. counter = 0;
  25. charset = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ123';
  26. everyxrolls = 3;
  27. var JSINJ = '';
  28. JSINJ += '<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.1/jquery-ui.js"></script>';
  29. JSINJ += '<link rel="stylesheet" type="text/css" href="https://jquery-ui.googlecode.com/svn/tags/latest/themes/dot-luv/jquery-ui.css">';
  30. JSINJ += '<script src="https://code.highcharts.com/highcharts.js"></script>';
  31. JSINJ += '<script src="https://code.highcharts.com/modules/exporting.js"></script>';
  32. $(JSINJ).appendTo('head');
  33. function initializeUI() {
  34. // Begin UI
  35. $('.hero__main').empty();
  36. var UI = '';
  37. UI += '<div id="result">';
  38. UI += '<ul>';
  39. UI += '<li><a href="/play#result-1">Last Bets: </a></li>';
  40. UI += '<li><a href="/play#result-2">Bet History: </a></li>';
  41. UI += '<li><a href="/play#result-1" id="lagfix">Browser Lag?: Click Here </a></li>';
  42. UI += '</ul>';
  43. UI += '<div id="result-1">';
  44. UI += '<table id="lastbet">';
  45. UI += '<tr><th>Bet</th><th>Payout</th><th>Game</th><th>Roll</th><th>Profit</th></tr></table>';
  46. UI += '<table id="lastbet2">';
  47. UI += '</table>';
  48. UI += '<table id="lastbet">';
  49. UI += '<tr><th>Balance</th><th>Loss Streak</th><th>Total Wins</th><th>Total Losses</th><th>Total Profit</th></tr></table>';
  50. UI += '<table id="lastbet3">';
  51. UI += '</table>';
  52. UI += '</div>';
  53. UI += '<div id="result-2">';
  54. UI += '<table id="lastbet">';
  55. UI += '<tr><th>Bet</th><th>Payout</th><th>Game</th><th>Roll</th><th>Profit</th></tr></table>';
  56. UI += '<div style="max-height:84px !important;overflow-y: scroll;overflow-x: hidden;"id="historycontainer">';
  57. UI += '<table id="lastbet2">';
  58. UI += '</table>';
  59. UI += '</div>';
  60. UI += '</div>';
  61. UI += '</div>';
  62. UI += '<div id="params">';
  63. UI += '<h3>Basic Settings</h3>';
  64. UI += '<div>';
  65. UI += '<table id="params1">';
  66. UI += '<tr><th>Basebet:</th><th>Multiplier:</th><th>Hi/Lo/Swap</th></tr>';
  67. UI += '<tr><td><input id="basebet" type="text" placeholder="Basebet"/><br><div id="basebetslider"></div></td><td><input id="payout" type="text" placeholder="ex. 10, 90"/><br><div id="payoutslider"></div></td>';
  68. UI += '<td><div id="hilo"><input type="radio" id="hi" value="hi" name="hilo"><label for="hi">Hi</label><input type="radio" id="lo" value="lo" name="hilo" checked="checked"><label for="lo">Lo</label><input type="radio" id="swap" value="swap" name="hilo"><label for="swap">Swap</label></div></td></tr>';
  69. UI += '<tr><th></th><th># of Prerolls</th><th>Preroll Bet</th></tr>';
  70. UI += '<tr><td> Prerolls: <input id="prerollsenabled" type="checkbox"/><label style="width: auto !important;" for="prerollsenabled">Off</label></td><td><input id="numprerolls" type="text" /></td><td><input type="text" id="prerollbet"/></td></tr>';
  71. UI += '<tr><th><label>Loss Preroll: <input id="lossprerollenabled" type="checkbox"><label style="width: auto !important;" for="lossprerollenabled">Off</label></label></th><th><label>After # Losses: <input style="width:85px;" id="prerollafterlosses" type="text" placeholder="After # of losses"/></th><th># of Prerolls After Loss: <input style="width:85px;" type="text" id="numlossprerolls" placeholder="# of prerolls"/></th></tr>';
  72. UI += '</table>';
  73. UI += '</div>';
  74. UI += '<h3>Win/Loss Settings</h3>';
  75. UI += '<div>';
  76. UI += '<table id="params1">';
  77. UI += '<tr><th>Multiply On Loss: <input id="lossmultenabled" type="checkbox"/><label style="width: auto !important;" for="lossmultenabled">Off</label></th><th>Multiply on Win: <input id="winmultenabled" type="checkbox"/><label style="width: auto !important;" for="winmultenabled">Off</label></th><th>Multiplier on W/L</th></tr>';
  78. UI += '<tr><td><label for="multloss">Mutiply After X Losses:</label><br><input id="multloss" placeholder="Multiply Every X Rolls"/></td><td><label for="multwin">Reset After X Wins:</label><br><input id="resetwin" placeholder="Reset After X Wins"/></td>';
  79. UI += '<td><input id="winlossmultiplier" placeholder="2 (2x), 1.5 (1.5x) etc"/></tr>';
  80. UI += '<tr><td><label>Increment Basebet by: <input id="incrementbaseenabled" style="padding: 2px !important;" type="checkbox"/><label style="width: auto !important;" for="incrementbaseenabled">Off</label></label></td><td><input placeholder="ex 0.00000100" id="incrementwin"> BTC </td><td><input placeholder="after #wins" id="incrementafterwins"></td></tr>';
  81. UI += '<tr><td>Reset base after base reaches: <input placeholder="ex 0.00000500"id="resetincrementbasebet"> </td><td> Reset to Base After Profit: <input type="checkbox" id="resetprofitenabled"><label style="width: auto !important;" for="resetprofitenabled">Off</label> </td><td><input placeholder="ex. reset after profit=0.00100000" id="resetprofit"></td></tr>';
  82. UI += '</table>';
  83. UI += '</div>';
  84. UI += '<h3>Advanced Settings</h3>';
  85. UI += '<div>';
  86. UI += '<table id="params1">';
  87. UI += '<tr><th><label>Stop After: <input id="stoplossenabled" type="checkbox"><label style="width: auto !important;" for="stoplossenabled">Off</label></label></th><th><label>Stop On Win: <input id="stopwinenabled" type="checkbox"><label style="width: auto !important;" for="stopwinenabled">Off</label></label></th><th>Swap After: <input id="swaprollsenabled" type="checkbox"><label style="width: auto !important;" for="swaprollsenabled">Off</label></th></tr>';
  88. UI += '<tr><td><input style="width:85px;" id="stoplosses" placeholder="# of losses"/></td><td></td>';
  89. UI += '<td><input id="swaprolls" type="text" placeholder="# of rolls"></tr>';
  90. UI += '<tr><th>Stop on Profit:<input id="stopprofitenabled" type="checkbox"><label style="width: auto !important;" for="stopprofitenabled">Off</label></th><th>Stop on Loss: <input id="stoploss2enabled" type="checkbox"><label style="width: auto !important;" for="stoploss2enabled">Off</label></th><th>Reset After: <input id="resetlossenabled" type="checkbox"><label style="width: auto !important;" for="resetlossenabled">Off</label></th></tr>';
  91. UI += '<tr><td><input id="stopprofitamount" type="text"/> </td><td>-<input id="stoplossamount" type="text"/></td><td><input id="resetlosses" placeholder="# Losses" type="text"/></td></tr>';
  92. UI += '<tr><th>Swap On Loss: <input id="swaponlossenabled" type="checkbox"><label style="width: auto !important;" for="swaponlossenabled">Off</label></th><th></th><th>Swap On Win:<input id="swaponwinenabled" type="checkbox"><label style="width: auto !important;"for="swaponwinenabled">Off</label></th></tr>';
  93. UI += '<tr><th><label for="swapafterlosses">Swap After X Losses</label></th><th></th><th><label for="swapafterwins">Swap After X Wins</label></th></tr>';
  94. UI += '<tr><td><input id="swapafterlosses"></td><td></td><td><input id="swapafterwins"></td></tr>';
  95. UI += '<tr><p>Note: Use Total Profit as your reference for stop loss/profit. Do NOT enter a balance.</p></tr>';
  96. UI += '</table>';
  97. UI += '</div>';
  98. UI += '<h3>Seed Settings</h3>';
  99. UI += '<div>';
  100. UI += '<table id="params1">';
  101. UI += '<tr><th>Current Seed:</th><th>Charset:</th><th>Change Every #: <input id="seedchangeon" type="checkbox"/><label style="width: auto !important;" for="seedchangeon">Off</label></th></tr>';
  102. UI += '<tr><td><input style="color:red;text-align:center;"id="currentseed"/></td><td><input id="charset" placeholder="Optional"/></td>';
  103. UI += '<td><input id="seedxrolls" placeholder="ex. 1, 10, 20"/></tr>';
  104. UI += '<tr><td>Change on Win: <input style="width: auto !important;" id="seedchangeonwin" type="checkbox"/><label style="width: auto !important;" for="seedchangeonloss">Off</label> </td><td>Change on Loss: <input id="seedchangeonloss" type="checkbox"/><label for="seedchangeonloss">Off</label></td></tr>';
  105. UI += '</table>';
  106. UI += '</div>';
  107. UI += '</div>';
  108. UI += '<div id="manual" style="display:none;">';
  109. UI += '<div style = "padding: 0 !important; z-index: 1000 !important;width:450px !important;height:350px !important;"id="dialog-form" title="Profit Over Time"><div id="chartContainer"></div></div>';
  110. //Manual Mode HTML
  111. UI += '<table id="params1"><tr>';
  112. UI += '<th><label for="manualamount">Bet Amount: </label></th><th><label for="manualttarget">Multiplier: </label></th><th><label for="manualthilo">High/Low: </label></th></tr>';
  113. UI += '<tr><td><input id="manualamount"><td><input id="manualtarget"></td><td><div id="manualhilo"><input type="radio" id="manualhi" value="High" name="manualhilo"><label for="manualhi">Hi</label><input type="radio" id="manuallow" name="manualhilo" checked="checked"><label for="manuallow">Low</label></td></tr></table></div>';
  114. UI += '</div><center><div id="toolbar" class="ui-widget-header ui-corner-all"><div id="buttonz"><span id="startstop"><button id="start">Start</button><button id="stop">Stop</button></span><span id="setsavereset"><button id="setparams">Set Params</button><button id="saveparams">Save Params</button><button id="resetstats">Reset Stats</button></span><span id="themeseed"><button id="seedchange">Change Seed</button><button id="darktheme">Theme - On/Off</button></span><button id="openChart">Show Chart</button><button style="padding:2px;font-size:10px;"id="manualmode">Manual Mode</button></div></div></center><br><center><button class="btn btn--primary btn--huge btn--limited btn--block text--center" id="spinner2">Roll</button></center>';
  115. //<label for="numrolls">Number of Rolls: <input id="numrollsenabled" type="checkbox"></label><input style="width:85px;" id="numrolls"/>
  116. $(UI).appendTo('.hero__main');
  117. $(function(){
  118. Highcharts.createElement('link',{href:'http://fonts.googleapis.com/css?family=Unica+One',rel:'stylesheet',type:'text/css'},null,document.getElementsByTagName('head')[0]);Highcharts.theme={colors:["#2b908f","#90ee7e","#f45b5b","#7798BF","#aaeeee","#ff0066","#eeaaee","#55BF3B","#DF5353","#7798BF","#aaeeee"],chart:{backgroundColor:{linearGradient:{x1:0,y1:0,x2:1,y2:1},stops:[[0,'#2a2a2b'],[1,'#3e3e40']]},style:{fontFamily:"'Unica One', sans-serif"},plotBorderColor:'#606063'},title:{style:{color:'#E0E0E3',textTransform:'uppercase',fontSize:'20px'}},subtitle:{style:{color:'#E0E0E3',textTransform:'uppercase'}},xAxis:{gridLineColor:'#707073',labels:{style:{color:'#E0E0E3'}},lineColor:'#707073',minorGridLineColor:'#505053',tickColor:'#707073',title:{style:{color:'#A0A0A3'}}},yAxis:{gridLineColor:'#707073',labels:{style:{color:'#E0E0E3'}},lineColor:'#707073',minorGridLineColor:'#505053',tickColor:'#707073',tickWidth:1,title:{style:{color:'#A0A0A3'}}},tooltip:{backgroundColor:'rgba(0, 0, 0, 0.85)',style:{color:'#F0F0F0'}},plotOptions:{series:{dataLabels:{color:'#B0B0B3'},marker:{lineColor:'#333'}},boxplot:{fillColor:'#505053'},candlestick:{lineColor:'white'},errorbar:{color:'white'}},legend:{itemStyle:{color:'#E0E0E3'},itemHoverStyle:{color:'#FFF'},itemHiddenStyle:{color:'#606063'}},credits:{style:{color:'#666'}},labels:{style:{color:'#707073'}},drilldown:{activeAxisLabelStyle:{color:'#F0F0F3'},activeDataLabelStyle:{color:'#F0F0F3'}},navigation:{buttonOptions:{symbolStroke:'#DDDDDD',theme:{fill:'#505053'}}},rangeSelector:{buttonTheme:{fill:'#505053',stroke:'#000000',style:{color:'#CCC'},states:{hover:{fill:'#707073',stroke:'#000000',style:{color:'white'}},select:{fill:'#000003',stroke:'#000000',style:{color:'white'}}}},inputBoxBorderColor:'#505053',inputStyle:{backgroundColor:'#333',color:'silver'},labelStyle:{color:'silver'}},navigator:{handles:{backgroundColor:'#666',borderColor:'#AAA'},outlineColor:'#CCC',maskFill:'rgba(255,255,255,0.1)',series:{color:'#7798BF',lineColor:'#A6C7ED'},xAxis:{gridLineColor:'#505053'}},scrollbar:{barBackgroundColor:'#808083',barBorderColor:'#808083',buttonArrowColor:'#CCC',buttonBackgroundColor:'#606063',buttonBorderColor:'#606063',rifleColor:'#FFF',trackBackgroundColor:'#404043',trackBorderColor:'#404043'},legendBackgroundColor:'rgba(0, 0, 0, 0.5)',background2:'#505053',dataLabelsColor:'#B0B0B3',textColor:'#C0C0C0',contrastTextColor:'#F0F0F3',maskColor:'rgba(255,255,255,0.3)'};Highcharts.setOptions(Highcharts.theme);
  119. });
  120. //jQ-UI Settings
  121. jQSettings = '';
  122. jQSettings += '<script>';
  123. // Settings Here
  124. jQSettings += '';
  125. jQSettings += '$(function(){';
  126. jQSettings += 'dialog = $( "#dialog-form" ).dialog({autoOpen: false,height: 350,width: 450,modal: true, buttons: {Close: function() {dialog.dialog( "close" )}}});';
  127. jQSettings += 'chart = $("#chartContainer").highcharts({chart: {height: 350, width: 450},credits: { enabled: false }, title:{text:"Total Profit vs. # of Bets",x:-20}, subtitle:{text: "Bet Profit vs. # Bets"},yAxis:{title:{text:"Profit/Total Profit"},data:[0]},xAxis:{title:{text:"# of Bets"},data:[0]},series:[{name:"Total Profit",data:[0]},{name: "Bet Profit",data: [0]}]});';
  128. jQSettings += '$("#basebetslider").slider({value:0.00000000,min: 0.00000000,max: 0.00020001,step: 0.0000000010, slide: function( event, ui ) {$( "#basebet" ).val( ui.value );}});';
  129. jQSettings += '$("#payoutslider").slider({value:5.0,min: 1,max: 100,step: 1, slide: function( event, ui ) {$( "#payout" ).val( ui.value );}});';
  130. jQSettings += '$("#buttonz button").button();$("input:checkbox").button();$("div#hilo").buttonset();';
  131. jQSettings += '$("#themeseed").buttonset();$("#setsavereset").buttonset();$("#startstop").buttonset();';
  132. jQSettings += '$("#result").tabs();$("#manualhilo").buttonset(); $( "#params" ).accordion({collapsible: true});});';
  133. jQSettings += '</script>';
  134. $(jQSettings).appendTo('head');
  135. var UICSS = '';
  136. UICSS += '<style>';
  137. UICSS += 'span.ui-slider-handle { width: 12px !important; }';
  138. UICSS += '#basebetslider , #basebet, #payoutslider, #payout { width: 100% !important; }';
  139. UICSS += '#params h3 { padding: 5px; }';
  140. UICSS += '#params label { width: auto !important; }';
  141. UICSS += 'span.ui-button-text { font-size: 9px; }';
  142. UICSS += '#params, #result { border-radius: 0px; width: auto !important; }';
  143. UICSS += '.hero__main { padding: 2px; margin: 5px; }';
  144. UICSS += '.hero__main {font-size: 10px !important;}';
  145. UICSS += '.ui-accordion-content { height: auto !important; padding: 5px !important;}';
  146. UICSS += '.ui-accordion .ui-accordion-content {margin-left: 3px !important; margin-right: 3px;margin-top: 0.5px;}';
  147. UICSS += 'table#params1 input:text { width: auto; height: auto; }';
  148. UICSS += 'table#params1 th, table#params1 td, table#params1 label { width: 33% !important; padding:5px !important; }';
  149. UICSS += '#buttonz { margin:2px; padding: 1px; text-align: center; font-size: 12px;}';
  150. UICSS += '#toolbar { width:100%;display: inline-block; padding: 0px; margin-top:3px; }';
  151. UICSS += '#params *, #result * { font-size: 10px;}';
  152. UICSS += '#toolbar button { margin: 1px; }';
  153. UICSS += 'label.ui-button span, label .ui-button { padding: 2px !important; }';
  154. UICSS += '#manual { margin: 10px 0px 10px 60px;}';
  155. UICSS += 'body > div.ui-widget-overlay.ui-front { display: none !important; }';
  156. UICSS += '.ui-button-icon-primary { top: 0 !important; left: 0 !important;}';
  157. UICSS += '</style>';
  158. setTimeout(function () {
  159. $(UICSS).appendTo('head');
  160. }, 3000);
  161. }
  162. setTimeout(function () {
  163. initializeUI();
  164. }, 1000);
  165. function darkTheme() {
  166. var css = '',
  167. backgroundurl = 'http://cdn.wonderfulengineering.com/wp-content/uploads/2014/01/HD-backgrounds-3.jpg';
  168. css += '<style id="paraDark">';
  169. css += 'header, .tabs, .slideout__content__inside, .chat__you *, .btn, .hero__main, .rollrow-dark, .rollbox--prominent, .chat__input-holder{background-color:#121212 !important;color:#ccc !important;}';
  170. css += 'time{color:#ccc !important;}';
  171. css += 'div.tabs > div > div.live-data-header > div{background-color:#111111;border-top:1px solid #777; border-bottom:1px solid #777;}';
  172. css += '.btn,.btn--secondary.btn--active,.btn--secondary.btn--selector, .btn--submit:last-child{border:1px solid #777 !important;background-color:#242130 !important;color:#ccc!important;}';
  173. css += '.btn:hover,.btn--secondary.btn--active:hover,.btn--secondary.btn--selector:hover{border:1px solid #777 !important;background-color:#322E47 !important;color:#ccc!important;}';
  174. css += '.hero{margin-bottom:0px;background:url("' + backgroundurl + '") no-repeat 50% 50%;}';
  175. css += '.slideout *{color:#ccc;}';
  176. css += '.tabs{padding-top:20px;border-top:1px solid #777 !important;}';
  177. css += 'header{border: 1px solid #777 !important;border-left:none !important;border-right:none !important;}';
  178. css += '.rollrow-thin, .rollrow-dark .chat__input-holder {background-color:#212121;}';
  179. css += '.input{background-color:#323232 !important;color:#ccc;}';
  180. css += '.action-open-slideout{background-color:#121212 !important;}';
  181. css += 'span.admin{color:red !important}';
  182. css += '</style>';
  183. $(css).appendTo('head');
  184. }
  185. darkTheme();
  186. var mixcount = 0;
  187. betstarted = false;
  188. var swapswap = 2,
  189. swapcount = 0,
  190. lossprerollcount = 0,
  191. lossprerollson;
  192. var curbalance = $('div.hero > div.hero__content > div > div.grid__item.S--one-whole.M--one-whole.custom--one-whole > aside > div.grid.grid--bottom.grid--reversed > div:nth-child(2) > span.btn.btn--tertiary.btn--large.btn--limited.btn--block > span.btn__text.select div').text() * 100000000;
  193. function bet() {
  194. if (betstarted === true) {} else {
  195. betstarted = true;
  196. if (manualenabled === true) {
  197. manualamount = Math.floor($('#manualamount').val() * 100000000);
  198. if ($('#manualhi').is(':checked') === true) {
  199. manualcondition = '>';
  200. manualtarget = (99.99 - (99 / $('#manualtarget').val())).toFixed(2);
  201. } else if ($('#manuallow').is(':checked') === true) {
  202. manualcondition = '<';
  203. manualtarget = (99 / $('#manualtarget').val()).toFixed(2);
  204. }
  205. var betData = {
  206. amount: manualamount,
  207. condition: manualcondition,
  208. target: manualtarget,
  209. },
  210. url = 'https://api.primedice.com/api/bet?access_token=' + localStorage.token;
  211. } else {
  212. if ($('#resetprofitenabled').is(':checked') === true) {
  213. if (parseFloat(profit) >= $('#resetprofit').val()) {
  214. betval = basebet;
  215. curbet = betval;
  216. profit = 0;
  217. wmultcount = 0;
  218. /*betval = basebet;
  219. wmultcount = 0;
  220. profit = 0;
  221. if ($('#payout').val() == '5') {
  222. $('#payout').val(10);
  223. } else {
  224. $('#payout').val(5);
  225. }
  226. if (condition2 == '>') {
  227. target2 = (99.99 - (99 / $('#payout').val())).toFixed(2);
  228. } else if (condition2 == '<') {
  229. target2 = (99 / $('#payout').val()).toFixed(2);
  230. }*/
  231. }
  232. }
  233. if ($('#stopprofitenabled').is(':checked') === true) {
  234. if (profit >= $('#stopprofitamount').val()) {
  235. clearInterval(loop);
  236. loopenabled = false;
  237. loopcount = 0;
  238. }
  239. }
  240. if ($('#resetlossenabled').is(':checked') === true && prerollsenabled === false) {
  241. if ($('#resetlosses').val() <= currentloss) {
  242. betval = basebet;
  243. lmultcount = 0;
  244. wmultcount = 0;
  245. currentloss = 0;
  246. }
  247. }
  248. if ($('#stoploss2enabled').is(':checked') === true) {
  249. if (profit <= (-1 * $('#stoplossamount').val())) {
  250. clearInterval(loop);
  251. loopenabled = false;
  252. loopcount = 0;
  253. }
  254. }
  255. if (prerollsenabled === true) {
  256. prebet = Math.floor($('#prerollbet').val() * 100000000);
  257. curbet = prebet;
  258. } else {
  259. curbet = betval;
  260. }
  261. if ($('#lossprerollenabled').is(':checked') === true) {
  262. if (lossprerollson === true) {
  263. curbet = prebet;
  264. } else {
  265. curbet = betval;
  266. }
  267. }
  268. var betData = {
  269. amount: curbet,
  270. condition: condition2,
  271. target: target2,
  272. },
  273. url = 'https://api.primedice.com/api/bet?access_token=' + localStorage.token;
  274. }
  275. if (curbet > curbalance) {
  276. clearInterval(loop);
  277. loopenabled = false;
  278. loopcount = 0;
  279. }
  280. $.ajax({
  281. url: url,
  282. type: 'POST',
  283. data: betData,
  284. datatype: 'json',
  285. async: true,
  286. success: function (data, textStatus, jqXHR) {
  287. if ($('#seedchangeon').is(':checked') === true) {
  288. if ($('#charset').val() !== '') {
  289. charset = $('#charset').val();
  290. }
  291. if ($('#seedxrolls').val() === '') {} else {
  292. seedcount++;
  293. if (seedcount >= $('#seedxrolls').val()) {
  294. seedchange();
  295. seedcount = 0;
  296. }
  297. }
  298. }
  299. data1 = data;
  300. profit = profit = (parseFloat(profit) + parseFloat((data1.bet.profit / 100000000))).toFixed(8);
  301. curbalance = data1.user.balance;
  302. addRow();
  303. if (loopenabled === true) {
  304. loopcount++;
  305. }
  306. if ($('input:radio[name=hilo]:checked').val() == 'swap') {
  307. if ($('#swaprollsenabled').is(':checked') === true) {
  308. swapswap = $('#swaprolls').val();
  309. swapcount++;
  310. if (swapcount >= swapswap) {
  311. swap();
  312. swapcount = 0;
  313. }
  314. } else {
  315. swap();
  316. }
  317. }
  318. $('.btn__text.select div').text((data1.user.balance / 100000000).toFixed(8));
  319. if (data.bet.win === true) {
  320. win();
  321. if (prerollson === true) {
  322. if (prerollsenabled === false) {
  323. prerollsenabled = true;
  324. prerollcount = 0;
  325. }
  326. }
  327. $('.btn__text.select div').attr('style', 'color:green;');
  328. } else {
  329. lose();
  330. $('.btn__text.select div').attr('style', 'color:red;');
  331. }
  332. if (data.bet.win === true) {
  333. $('#result-1 #proff:nth(0), #result-2 #proff:nth(0)').attr('style', 'text-align: center; width: 20%; padding: 5px;color:green;');
  334. } else {
  335. $('#result-1 #proff:nth(0), #result-2 #proff:nth(0)').attr('style', 'text-align: center; width: 20%; padding: 5px;color:red;');
  336. }
  337. betstarted = false;
  338. },
  339. error: function (jqXHR, textStatus, errorThrown) {
  340. betstarted = false;
  341. }
  342. });
  343. }
  344. }
  345. function seedchange() {
  346. function seedgen() {
  347. var seed = '';
  348. for (var i = 0; i <= seedlength; i++)
  349. seed += charset.charAt(Math.floor(Math.random() * charset.length));
  350. return seed;
  351. }
  352. var s = seedgen(),
  353. url = 'https://api.primedice.com/api/seed?access_token=' + localStorage.token,
  354. sData = {
  355. seed: s
  356. };
  357. $.ajax({
  358. url: url,
  359. type: 'POST',
  360. data: sData,
  361. datatype: 'json',
  362. success: function (data, textStatus, jqXHR) {
  363. data2 = data;
  364. $('#currentseed').val(data2.seeds.client);
  365. },
  366. error: function (jqXHR, textStatus, errorThrown) {
  367. return false;
  368. }
  369. });
  370. }
  371. function addRow() {
  372. // Update Chart
  373. chart.addPoint([parseFloat(wins+losses), parseFloat(profit)]);
  374. chart2.addPoint([parseFloat(wins+losses), parseFloat((data1.bet.profit/100000000).toFixed(8))]);
  375. $('#lastID').text('Last Bet ID: ' + data1.bet.id);
  376. var bettable = '',
  377. bettab = '#result-1 #lastbet2';
  378. var bettab2 = '#result-2 #lastbet2';
  379. bettable += '<tr><td>' + (data1.bet.amount / 100000000).toFixed(8) + '</td>';
  380. bettable += '<td>' + data1.bet.multiplier + 'x' + '</td>'; /* return bet payout */
  381. bettable += '<td>' + (data1.bet.target).toFixed(2) + '</td>'; /* return target*/
  382. bettable += '<td>' + data1.bet.roll + '</td>'; /* return roll */
  383. bettable += '<td id="proff">' + (data1.bet.profit / 100000000).toFixed(8) + '</td></tr>';
  384. var stattable = '',
  385. stattab = '#lastbet3';
  386. stattable += '<tr><td style="color:green;">' + (data1.user.balance / 100000000).toFixed(8) + '</td><td style="color:red;">' + currentloss + '</td><td style="color:green;">' + wins + '</td><td style="color:red;">' + losses + '</td><td id="profit">' + profit + '</td></tr>';
  387. $(stattab).empty();
  388. $(stattab).prepend(stattable);
  389. stattable = '';
  390. $(bettab2).prepend(bettable);
  391. if ($(bettab + ' tbody tr').length >= 3) {
  392. $(bettab + ' tr').last().remove();
  393. $(bettab).prepend(bettable);
  394. bettable = '';
  395. } else if ($(bettab).length < 3) {
  396. $(bettab).prepend(bettable);
  397. bettable = '';
  398. }
  399. $('#lastbet2 *, #lastbet3 *, #lastbet *, #proff').css('text-align', 'center');
  400. $('#lastbet2 *, #lastbet3 *, #lastbet *').css('width', '20%');
  401. $('#lastbet *').css('padding', '5px');
  402. $('#lastbet *').css('border-bottom', '1px solid #ccc');
  403. $('#result-1').css('padding', '5px');
  404. $('#lastbet2 *, #lastbet3 *, #proff').css('padding', '5px');
  405. $('#lastbet > tbody > tr > th:nth-child(2)').css('border-top', '1px solid #ddd');
  406. if (profit >= 0) {
  407. $('#profit').css('color', 'green');
  408. } else {
  409. $('#profit').css('color', 'red');
  410. }
  411. }
  412. function win() {
  413. if ($('#incrementbaseenabled').is(':checked') === true) {
  414. incrementwincount++;
  415. if (incrementwincount >= $('#incrementafterwins').val()) {
  416. incrementwincount = 0;
  417. basebet = Math.floor(basebet + ($('#incrementwin').val() * 100000000));
  418. if (basebet >= Math.floor($('#resetincrementbasebet').val() * 100000000)) {
  419. basebet = Math.floor($('#basebet').val() * 100000000)
  420. }
  421. }
  422. }
  423. if ($('#swaponlossenabled').is(':checked') === true) {
  424. swaplosscount = 0;
  425. }
  426. if ($('#swaponwinenabled').is(':checked') === true) {
  427. swapwincount++;
  428. if (swapwincount >= $('#swapafterwins').val()) {
  429. swapwincount = 0;
  430. swap();
  431. }
  432. }
  433. if ($('#stopwinenabled').is(':checked') === true && prerollsenabled === false) {
  434. clearInterval(loop);
  435. currentloss = 0;
  436. loopcount = 0;
  437. loopenabled = false;
  438. }
  439. if (prerollson === true) {
  440. if (prerollsenabled === true) {
  441. prerollcount = 0;
  442. }
  443. }
  444. if ($('#seedchangeonwin').is(':checked') === true) {
  445. seedchange();
  446. }
  447. wins++;
  448. currentloss = 0;
  449. if ($('#winmultenabled').is(':checked') === true) {
  450. if (prerollsenabled === true) {} else {
  451. if (prerollson === true && prerollsenabled === false) {
  452. prerollsenabled = true;
  453. prerollcount = 0;
  454. }
  455. if (lossprerollson === true) {} else {
  456. wmultcount++;
  457. if (wmultcount < $('#resetwin').val()) {
  458. betval = betval * $('#winlossmultiplier').val();
  459. } else if (wmultcount >= $('#resetwin').val()) {
  460. betval = basebet;
  461. wmultcount = 0;
  462. }
  463. }
  464. }
  465. if ($('#lossprerollenabled').is(':checked') === true) {
  466. if (lossprerollson === true) {
  467. lossprerollcount = $('#prerollafterlosses').val();
  468. lossprerollson = true;
  469. } else {
  470. lossprerollcount = 0;
  471. lossprerollson = false;
  472. }
  473. }
  474. }
  475. if ($('#lossmultenabled').is(':checked') === true) {
  476. if (prerollsenabled === true) {
  477. prerollcount = 0;
  478. } else {
  479. if (prerollson === true && prerollsenabled === false) {
  480. prerollsenabled = true;
  481. prerollcount = 0;
  482. }
  483. if (lossprerollson === true) {
  484. lmultcount = 0;
  485. lossprerollcount = $('#prerollafterlosses').val();
  486. } else {
  487. betval = basebet;
  488. lmultcount = 0;
  489. lossprerollcount = 0;
  490. }
  491. }
  492. }
  493. }
  494. function lose() {
  495. if ($('#swaponlossenabled').is(':checked') === true) {
  496. swaplosscount++;
  497. if (swaplosscount >= $('#swapafterlosses').val()) {
  498. swap();
  499. swaplosscount = 0;
  500. }
  501. }
  502. if ($('#lossprerollenabled').is(':checked') === true) {
  503. lossprerollcount++;
  504. if (lossprerollcount == $('#prerollafterlosses').val()) {
  505. lossprerollson = true;
  506. }
  507. if (lossprerollcount >= (parseFloat($('#numlossprerolls').val()) + parseFloat($('#prerollafterlosses').val()))) {
  508. curbet = betval;
  509. lossprerollson = false;
  510. lossprerollcount = 0;
  511. }
  512. }
  513. if ($('#seedchangeonloss').is(':checked') === true) {
  514. seedcount = 0;
  515. seedchange();
  516. }
  517. currentloss++;
  518. if ($('#stoplossenabled').is(':checked') === true) {
  519. if ($('#stoplosses').val() <= currentloss) {
  520. clearInterval(loop);
  521. currentloss = 0;
  522. loopcount = 0;
  523. loopenabled = false;
  524. }
  525. }
  526. if (prerollson === true) {
  527. if (prerollsenabled === true) {
  528. prerollcount++;
  529. if (prerollcount >= $('#numprerolls').val()) {
  530. prerollsenabled = false;
  531. }
  532. }
  533. }
  534. losses++;
  535. if ($('#lossmultenabled').is(':checked') === true) {
  536. if (prerollsenabled === true) {} else {
  537. if (lossprerollson === true) {} else {
  538. lmultcount++;
  539. if (lmultcount >= $('#multloss').val()) {
  540. betval = betval * $('#winlossmultiplier').val();
  541. lmultcount = 0;
  542. }
  543. }
  544. }
  545. }
  546. }
  547. function swap() {
  548. if (condition2 == '<') {
  549. condition2 = '>';
  550. target2 = (99.99 - (99 / $('#payout').val())).toFixed(2);
  551. } else if (condition2 == '>') {
  552. condition2 = '<';
  553. target2 = (99 / $('#payout').val()).toFixed(2);
  554. }
  555. }
  556. var themeoff = false;
  557. // Click Funcs
  558. function init2() {
  559. $('#darktheme').click(function () {
  560. if (themeoff === true) {
  561. darkTheme();
  562. $('#smoothness').remove();
  563. var jqCSS = document.createElement('link');
  564. jqCSS.href = 'https://jquery-ui.googlecode.com/svn/tags/latest/themes/dot-luv/jquery-ui.css';
  565. jqCSS.type = 'text/css';
  566. jqCSS.rel = 'stylesheet';
  567. jqCSS.id = 'dark';
  568. document.getElementsByTagName('head')[0].appendChild(jqCSS);
  569. themeoff = false;
  570. } else if (themeoff === false) {
  571. removeTheme();
  572. $('#dark').remove();
  573. var jqCSS = document.createElement('link');
  574. jqCSS.href = 'https://jquery-ui.googlecode.com/svn/tags/latest/themes/smoothness/jquery-ui.css';
  575. jqCSS.type = 'text/css';
  576. jqCSS.rel = 'stylesheet';
  577. jqCSS.id = 'smoothness';
  578. document.getElementsByTagName('head')[0].appendChild(jqCSS);
  579. themeoff = true;
  580. }
  581. });
  582. $('#spinner2').click(function () {
  583. bet();
  584. });
  585. if ($('#params label.ui-button').prev().is(':checked') === false && $('#params label.ui-button').prev().attr('type') != 'radio') {
  586. $('#params label.ui-button').text('On');
  587. } else {
  588. if ($('#params label.ui-button').prev().attr('type') != 'radio') {
  589. $('#params label.ui-button').text('Off');
  590. }
  591. }
  592. $('#params label.ui-button').click(function () {
  593. if ($(this).prev().is(':checked') === false && $(this).prev().attr('type') != 'radio') {
  594. $(this).text('On');
  595. } else {
  596. if ($(this).prev().attr('type') != 'radio') {
  597. $(this).text('Off');
  598. }
  599. }
  600. })
  601. $('#seedchange').click(function () {
  602. seedchange();
  603. });
  604. $('#detach').click(function () {
  605. $('#result').draggable();
  606. });
  607. $('#manualmode').click(function () {
  608. if ($(this).text() == 'Manual Mode') {
  609. manualenabled = true;
  610. $('#params').hide();
  611. $('#manual').show();
  612. $(this).text('Auto Mode');
  613. return;
  614. } else if ($(this).text() == 'Auto Mode') {
  615. manualenabled = false;
  616. $('#params').show();
  617. $('#manual').hide();
  618. $(this).text('Manual Mode');
  619. return;
  620. }
  621. })
  622. $('#setparams').click(function () {
  623. if ($('#lossprerollenabled').is(':checked') === false) {
  624. lossprerollson = false;
  625. }
  626. lmultcount = 0;
  627. currentloss = 0;
  628. wmultcount = 0;
  629. loopcount = 0;
  630. if ($('#prerollbet').val() !== "") {
  631. prebet = $('#prerollbet').val();
  632. } else {
  633. prebet = 0;
  634. }
  635. if ($('#prerollsenabled').is(':checked') === true) {
  636. prerollson = true;
  637. prerollcount = 0;
  638. prerollsenabled = true;
  639. prebet = Math.floor($('#prerollbet').val() * 100000000);
  640. basebet = Math.floor($('#basebet').val() * 100000000);
  641. betval = basebet;
  642. } else if ($('#prerollsenabled').is(':checked') === false) {
  643. prerollson = false;
  644. prerollsenabled = false;
  645. basebet = Math.floor($('#basebet').val() * 100000000);
  646. betval = basebet;
  647. }
  648. if ($('input:radio[name=hilo]:checked').val() == 'hi') {
  649. condition2 = '>';
  650. target2 = (99.99 - (99 / $('#payout').val())).toFixed(2);
  651. } else if ($('input:radio[name=hilo]:checked').val() == 'lo') {
  652. condition2 = '<';
  653. target2 = (99 / $('#payout').val()).toFixed(2);
  654. } else if ($('input:radio[name=hilo]:checked').val() == 'swap') {
  655. condition2 = '<';
  656. target2 = 0 + (99 / $('#payout').val()).toFixed(2);
  657. swapenabled = true;
  658. }
  659. });
  660. $('#lagfix').click(function () {
  661. $('#result-2 table:nth(1)').empty();
  662. chart.setData([]);chart2.setData([]);
  663. });
  664. $('#saveparams').click(function () {
  665. localStorage.setItem('params-stored', true);
  666. localStorage.setItem('basebet', $('#basebet').val());
  667. localStorage.setItem('payout', $('#payout').val());
  668. localStorage.setItem('prerollbet', $('#prerollbet').val());
  669. localStorage.setItem('prerollenabled', $('#prerollsenabled').is(':checked'));
  670. localStorage.setItem('numprerolls', $('#numprerolls').val());
  671. localStorage.setItem('lossenabled', $('#lossmultenabled').is(':checked'));
  672. localStorage.setItem('winenabled', $('#winmultenabled').is(':checked'));
  673. localStorage.setItem('resetwin', $('#resetwin').val());
  674. localStorage.setItem('xlosses', $('#multloss').val());
  675. localStorage.setItem('wlmult', $('#winlossmultiplier').val());
  676. localStorage.setItem('seedchangeon', $('#seedchangeon').is(':checked'));
  677. localStorage.setItem('seedxrolls', $('#seedxrolls').val());
  678. localStorage.setItem('swapxrolls', $('#swaprolls').val());
  679. localStorage.setItem('swapenabled', $('#swaprollsenabled').is(':checked'));
  680. });
  681. $('#openChart').click(function(){
  682. $('#dialog-form').dialog("open");
  683. })
  684. if (localStorage.getItem('params-stored') === 'true') {
  685. $('#basebet').val(localStorage.getItem('basebet'));
  686. $('#payout').val(localStorage.getItem('payout'));
  687. $('#prerollbet').val(localStorage.getItem('prerollbet'));
  688. if (localStorage.getItem('prerollenabled') === 'true') {
  689. $('#prerollsenabled').click();
  690. } else {
  691. $('#prerollsenabled').prop('checked', false);
  692. }
  693. $('#numprerolls').val(localStorage.getItem('numprerolls'));
  694. if (localStorage.getItem('lossenabled') === 'true') {
  695. $('#lossmultenabled').click();
  696. $('#lossmultenabled').prop('checked', false);
  697. }
  698. if (localStorage.getItem('winenabled') === 'true') {
  699. $('#winmultenabled').click();
  700. } else {
  701. $('#winmultenabled').prop('checked', false);
  702. }
  703. $('#resetwin').val(localStorage.getItem('resetwin'));
  704. $('#multloss').val(localStorage.getItem('xlosses'));
  705. $('#winlossmultiplier').val(localStorage.getItem('wlmult'));
  706. if (localStorage.getItem('seedchangeon') === 'true') {
  707. $('#seedchangeon').click();
  708. } else {
  709. $('#seedchangeon').prop('checked', false);
  710. }
  711. $('#seedxrolls').val(localStorage.getItem('seedxrolls'));
  712. if (localStorage.getItem('swapenabled') === 'true') {
  713. $('#swaprollsenabled').click();
  714. } else {
  715. $('#swaprollsenabled').prop('checked', false);
  716. }
  717. $('#swaprolls').val(localStorage.getItem('swapxrolls'));
  718. }
  719. chart = Highcharts.charts[0].series[0];
  720. chart2 = Highcharts.charts[0].series[1];
  721. loopenabled = false;
  722. loopcount = 0;
  723. $('#start').click(function () {
  724. if ($('#numrollsenabled').is(':checked') === true) {
  725. looptimes = $('#numrolls').val();
  726. } else {
  727. looptimes = 999999999;
  728. }
  729. if (loopenabled === false) {
  730. loopenabled = true;
  731. loop = setInterval(function () {
  732. if (loopcount >= looptimes) {
  733. clearInterval(loop);
  734. loopcount = 0;
  735. loopenabled = false;
  736. } else {
  737. if (betstarted === true) {} else {
  738. bet();
  739. }
  740. }
  741. }, betspeed);
  742. }
  743. });
  744. function removeTheme() {
  745. $('#paraDark').remove();
  746. }
  747. $('#stop').click(function () {
  748. clearInterval(loop);
  749. loopenabled = false;
  750. loopcount = 0;
  751. });
  752. $('#resetstats').click(function () {
  753. wins = 0;
  754. chart.setData([]);
  755. chart2.setData([]);
  756. losses = 0;
  757. profit = 0;
  758. currentloss = 0;
  759. addRow();
  760. wmultcount = 0;
  761. lmultcount = 0;
  762. });
  763. }
  764. setTimeout(function () {
  765. init2();
  766. }, 2000);

comments powered by Disqus