PrimeDice Strategy Script 2016 Jan


SUBMITTED BY: bongsh2002

DATE: Jan. 13, 2016, 1:42 p.m.

FORMAT: Text only

SIZE: 82.3 kB

HITS: 78754

  1. 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;
  2. var balancebefore;var chart='';
  3. betspeed=500;
  4. seedcount = 0;
  5. currentloss = 0;
  6. lmultcount = 0;
  7. wmultcount = 0;
  8. prerollcount = 0;
  9. wins = 0;
  10. losses = 0;
  11. profit = 0;
  12. swaplosscount = 0;
  13. swapwincount = 0;
  14. incrementwincount = 0;
  15. loopenabled = false;
  16. manualenabled = false;
  17. loopcount = 0;
  18. seedlength = 5;
  19. counter = 0;
  20. charset = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ123';
  21. everyxrolls = 3;
  22. var JSINJ = '';
  23. JSINJ += '<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.1/jquery-ui.js"></script>';
  24. JSINJ += '<link rel="stylesheet" type="text/css" href="https://jquery-ui.googlecode.com/svn/tags/latest/themes/dot-luv/jquery-ui.css">';
  25. JSINJ += '<script src="https://code.highcharts.com/highcharts.js"></script>';
  26. JSINJ += '<script src="https://code.highcharts.com/modules/exporting.js"></script>';
  27. $(JSINJ).appendTo('head');
  28. function initializeUI() {
  29. // Begin UI
  30. $('.hero__main').empty();
  31. var UI = '';
  32. UI += '<div id="result">';
  33. UI += '<ul>';
  34. UI += '<li><a href="/play#result-1">Last Bets: </a></li>';
  35. UI += '<li><a href="/play#result-2">Bet History: </a></li>';
  36. UI += '<li><a href="/play#result-1" id="lagfix">Browser Lag?: Click Here </a></li>';
  37. UI += '</ul>';
  38. UI += '<div id="result-1">';
  39. UI += '<table id="lastbet">';
  40. UI += '<tr><th>Bet</th><th>Payout</th><th>Game</th><th>Roll</th><th>Profit</th></tr></table>';
  41. UI += '<table id="lastbet2">';
  42. UI += '</table>';
  43. UI += '<table id="lastbet">';
  44. UI += '<tr><th>Balance</th><th>Loss Streak</th><th>Total Wins</th><th>Total Losses</th><th>Total Profit</th></tr></table>';
  45. UI += '<table id="lastbet3">';
  46. UI += '</table>';
  47. UI += '</div>';
  48. UI += '<div id="result-2">';
  49. UI += '<table id="lastbet">';
  50. UI += '<tr><th>Bet</th><th>Payout</th><th>Game</th><th>Roll</th><th>Profit</th></tr></table>';
  51. UI += '<div style="max-height:84px !important;overflow-y: scroll;overflow-x: hidden;"id="historycontainer">';
  52. UI += '<table id="lastbet2">';
  53. UI += '</table>';
  54. UI += '</div>';
  55. UI += '</div>';
  56. UI += '</div>';
  57. UI += '<div id="params">';
  58. UI += '<h3>Basic Settings</h3>';
  59. UI += '<div>';
  60. UI += '<table id="params1">';
  61. UI += '<tr><th>Basebet:</th><th>Multiplier:</th><th>Hi/Lo/Swap</th></tr>';
  62. 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>';
  63. 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>';
  64. UI += '<tr><th></th><th># of Prerolls</th><th>Preroll Bet</th></tr>';
  65. 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>';
  66. 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>';
  67. UI += '</table>';
  68. UI += '</div>';
  69. UI += '<h3>Win/Loss Settings</h3>';
  70. UI += '<div>';
  71. UI += '<table id="params1">';
  72. 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>';
  73. 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>';
  74. UI += '<td><input id="winlossmultiplier" placeholder="2 (2x), 1.5 (1.5x) etc"/></tr>';
  75. 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>';
  76. 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>';
  77. UI += '</table>';
  78. UI += '</div>';
  79. UI += '<h3>Advanced Settings</h3>';
  80. UI += '<div>';
  81. UI += '<table id="params1">';
  82. 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>';
  83. UI += '<tr><td><input style="width:85px;" id="stoplosses" placeholder="# of losses"/></td><td></td>';
  84. UI += '<td><input id="swaprolls" type="text" placeholder="# of rolls"></tr>';
  85. 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>';
  86. 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>';
  87. 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>';
  88. 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>';
  89. UI += '<tr><td><input id="swapafterlosses"></td><td></td><td><input id="swapafterwins"></td></tr>';
  90. UI += '<tr><p>Note: Use Total Profit as your reference for stop loss/profit. Do NOT enter a balance.</p></tr>';
  91. UI += '</table>';
  92. UI += '</div>';
  93. UI += '<h3>Seed Settings</h3>';
  94. UI += '<div>';
  95. UI += '<table id="params1">';
  96. 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>';
  97. UI += '<tr><td><input style="color:red;text-align:center;"id="currentseed"/></td><td><input id="charset" placeholder="Optional"/></td>';
  98. UI += '<td><input id="seedxrolls" placeholder="ex. 1, 10, 20"/></tr>';
  99. 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>';
  100. UI += '</table>';
  101. UI += '</div>';
  102. UI += '</div>';
  103. UI += '<div id="manual" style="display:none;">';
  104. 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>';
  105. //Manual Mode HTML
  106. UI += '<table id="params1"><tr>';
  107. 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>';
  108. 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>';
  109. 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>';
  110. //<label for="numrolls">Number of Rolls: <input id="numrollsenabled" type="checkbox"></label><input style="width:85px;" id="numrolls"/>
  111. $(UI).appendTo('.hero__main');
  112. $(function(){
  113. 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);
  114. });
  115. //jQ-UI Settings
  116. jQSettings = '';
  117. jQSettings += '<script>';
  118. // Settings Here
  119. jQSettings += '';
  120. jQSettings += '$(function(){';
  121. jQSettings += 'dialog = $( "#dialog-form" ).dialog({autoOpen: false,height: 350,width: 450,modal: true, buttons: {Close: function() {dialog.dialog( "close" )}}});';
  122. 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]}]});';
  123. jQSettings += '$("#basebetslider").slider({value:0.00000000,min: 0.00000000,max: 0.00020001,step: 0.0000000010, slide: function( event, ui ) {$( "#basebet" ).val( ui.value );}});';
  124. jQSettings += '$("#payoutslider").slider({value:5.0,min: 1,max: 100,step: 1, slide: function( event, ui ) {$( "#payout" ).val( ui.value );}});';
  125. jQSettings += '$("#buttonz button").button();$("input:checkbox").button();$("div#hilo").buttonset();';
  126. jQSettings += '$("#themeseed").buttonset();$("#setsavereset").buttonset();$("#startstop").buttonset();';
  127. jQSettings += '$("#result").tabs();$("#manualhilo").buttonset(); $( "#params" ).accordion({collapsible: true});});';
  128. jQSettings += '</script>';
  129. $(jQSettings).appendTo('head');
  130. var UICSS = '';
  131. UICSS += '<style>';
  132. UICSS += 'span.ui-slider-handle { width: 12px !important; }';
  133. UICSS += '#basebetslider , #basebet, #payoutslider, #payout { width: 100% !important; }';
  134. UICSS += '#params h3 { padding: 5px; }';
  135. UICSS += '#params label { width: auto !important; }';
  136. UICSS += 'span.ui-button-text { font-size: 9px; }';
  137. UICSS += '#params, #result { border-radius: 0px; width: auto !important; }';
  138. UICSS += '.hero__main { padding: 2px; margin: 5px; }';
  139. UICSS += '.hero__main {font-size: 10px !important;}';
  140. UICSS += '.ui-accordion-content { height: auto !important; padding: 5px !important;}';
  141. UICSS += '.ui-accordion .ui-accordion-content {margin-left: 3px !important; margin-right: 3px;margin-top: 0.5px;}';
  142. UICSS += 'table#params1 input:text { width: auto; height: auto; }';
  143. UICSS += 'table#params1 th, table#params1 td, table#params1 label { width: 33% !important; padding:5px !important; }';
  144. UICSS += '#buttonz { margin:2px; padding: 1px; text-align: center; font-size: 12px;}';
  145. UICSS += '#toolbar { width:100%;display: inline-block; padding: 0px; margin-top:3px; }';
  146. UICSS += '#params *, #result * { font-size: 10px;}';
  147. UICSS += '#toolbar button { margin: 1px; }';
  148. UICSS += 'label.ui-button span, label .ui-button { padding: 2px !important; }';
  149. UICSS += '#manual { margin: 10px 0px 10px 60px;}';
  150. UICSS += 'body > div.ui-widget-overlay.ui-front { display: none !important; }';
  151. UICSS += '.ui-button-icon-primary { top: 0 !important; left: 0 !important;}';
  152. UICSS += '</style>';
  153. setTimeout(function () {
  154. $(UICSS).appendTo('head');
  155. }, 3000);
  156. }
  157. setTimeout(function () {
  158. initializeUI();
  159. }, 1000);
  160. function darkTheme() {
  161. var css = '',
  162. backgroundurl = 'http://cdn.wonderfulengineering.com/wp-content/uploads/2014/01/HD-backgrounds-3.jpg';
  163. css += '<style id="paraDark">';
  164. 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;}';
  165. css += 'time{color:#ccc !important;}';
  166. css += 'div.tabs > div > div.live-data-header > div{background-color:#111111;border-top:1px solid #777; border-bottom:1px solid #777;}';
  167. 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;}';
  168. 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;}';
  169. css += '.hero{margin-bottom:0px;background:url("' + backgroundurl + '") no-repeat 50% 50%;}';
  170. css += '.slideout *{color:#ccc;}';
  171. css += '.tabs{padding-top:20px;border-top:1px solid #777 !important;}';
  172. css += 'header{border: 1px solid #777 !important;border-left:none !important;border-right:none !important;}';
  173. css += '.rollrow-thin, .rollrow-dark .chat__input-holder {background-color:#212121;}';
  174. css += '.input{background-color:#323232 !important;color:#ccc;}';
  175. css += '.action-open-slideout{background-color:#121212 !important;}';
  176. css += 'span.admin{color:red !important}';
  177. css += '</style>';
  178. $(css).appendTo('head');
  179. }
  180. darkTheme();
  181. var mixcount = 0;
  182. betstarted = false;
  183. var swapswap = 2,
  184. swapcount = 0,
  185. lossprerollcount = 0,
  186. lossprerollson;
  187. 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;
  188. function bet() {
  189. if (betstarted === true) {} else {
  190. betstarted = true;
  191. if (manualenabled === true) {
  192. manualamount = Math.floor($('#manualamount').val() * 100000000);
  193. if ($('#manualhi').is(':checked') === true) {
  194. manualcondition = '>';
  195. manualtarget = (99.99 - (99 / $('#manualtarget').val())).toFixed(2);
  196. } else if ($('#manuallow').is(':checked') === true) {
  197. manualcondition = '<';
  198. manualtarget = (99 / $('#manualtarget').val()).toFixed(2);
  199. }
  200. var betData = {
  201. amount: manualamount,
  202. condition: manualcondition,
  203. target: manualtarget,
  204. },
  205. url = 'https://api.primedice.com/api/bet?access_token=' + localStorage.token;
  206. } else {
  207. if ($('#resetprofitenabled').is(':checked') === true) {
  208. if (parseFloat(profit) >= $('#resetprofit').val()) {
  209. betval = basebet;
  210. curbet = betval;
  211. profit = 0;
  212. wmultcount = 0;
  213. /*betval = basebet;
  214. wmultcount = 0;
  215. profit = 0;
  216. if ($('#payout').val() == '5') {
  217. $('#payout').val(10);
  218. } else {
  219. $('#payout').val(5);
  220. }
  221. if (condition2 == '>') {
  222. target2 = (99.99 - (99 / $('#payout').val())).toFixed(2);
  223. } else if (condition2 == '<') {
  224. target2 = (99 / $('#payout').val()).toFixed(2);
  225. }*/
  226. }
  227. }
  228. if ($('#stopprofitenabled').is(':checked') === true) {
  229. if (profit >= $('#stopprofitamount').val()) {
  230. clearInterval(loop);
  231. loopenabled = false;
  232. loopcount = 0;
  233. }
  234. }
  235. if ($('#resetlossenabled').is(':checked') === true && prerollsenabled === false) {
  236. if ($('#resetlosses').val() <= currentloss) {
  237. betval = basebet;
  238. lmultcount = 0;
  239. wmultcount = 0;
  240. currentloss = 0;
  241. }
  242. }
  243. if ($('#stoploss2enabled').is(':checked') === true) {
  244. if (profit <= (-1 * $('#stoplossamount').val())) {
  245. clearInterval(loop);
  246. loopenabled = false;
  247. loopcount = 0;
  248. }
  249. }
  250. if (prerollsenabled === true) {
  251. prebet = Math.floor($('#prerollbet').val() * 100000000);
  252. curbet = prebet;
  253. } else {
  254. curbet = betval;
  255. }
  256. if ($('#lossprerollenabled').is(':checked') === true) {
  257. if (lossprerollson === true) {
  258. curbet = prebet;
  259. } else {
  260. curbet = betval;
  261. }
  262. }
  263. var betData = {
  264. amount: curbet,
  265. condition: condition2,
  266. target: target2,
  267. },
  268. url = 'https://api.primedice.com/api/bet?access_token=' + localStorage.token;
  269. }
  270. if (curbet > curbalance) {
  271. clearInterval(loop);
  272. loopenabled = false;
  273. loopcount = 0;
  274. }
  275. $.ajax({
  276. url: url,
  277. type: 'POST',
  278. data: betData,
  279. datatype: 'json',
  280. async: true,
  281. success: function (data, textStatus, jqXHR) {
  282. if ($('#seedchangeon').is(':checked') === true) {
  283. if ($('#charset').val() !== '') {
  284. charset = $('#charset').val();
  285. }
  286. if ($('#seedxrolls').val() === '') {} else {
  287. seedcount++;
  288. if (seedcount >= $('#seedxrolls').val()) {
  289. seedchange();
  290. seedcount = 0;
  291. }
  292. }
  293. }
  294. data1 = data;
  295. profit = profit = (parseFloat(profit) + parseFloat((data1.bet.profit / 100000000))).toFixed(8);
  296. curbalance = data1.user.balance;
  297. addRow();
  298. if (loopenabled === true) {
  299. loopcount++;
  300. }
  301. if ($('input:radio[name=hilo]:checked').val() == 'swap') {
  302. if ($('#swaprollsenabled').is(':checked') === true) {
  303. swapswap = $('#swaprolls').val();
  304. swapcount++;
  305. if (swapcount >= swapswap) {
  306. swap();
  307. swapcount = 0;
  308. }
  309. } else {
  310. swap();
  311. }
  312. }
  313. $('.btn__text.select div').text((data1.user.balance / 100000000).toFixed(8));
  314. if (data.bet.win === true) {
  315. win();
  316. if (prerollson === true) {
  317. if (prerollsenabled === false) {
  318. prerollsenabled = true;
  319. prerollcount = 0;
  320. }
  321. }
  322. $('.btn__text.select div').attr('style', 'color:green;');
  323. } else {
  324. lose();
  325. $('.btn__text.select div').attr('style', 'color:red;');
  326. }
  327. if (data.bet.win === true) {
  328. $('#result-1 #proff:nth(0), #result-2 #proff:nth(0)').attr('style', 'text-align: center; width: 20%; padding: 5px;color:green;');
  329. } else {
  330. $('#result-1 #proff:nth(0), #result-2 #proff:nth(0)').attr('style', 'text-align: center; width: 20%; padding: 5px;color:red;');
  331. }
  332. betstarted = false;
  333. },
  334. error: function (jqXHR, textStatus, errorThrown) {
  335. betstarted = false;
  336. }
  337. });
  338. }
  339. }
  340. function seedchange() {
  341. function seedgen() {
  342. var seed = '';
  343. for (var i = 0; i <= seedlength; i++)
  344. seed += charset.charAt(Math.floor(Math.random() * charset.length));
  345. return seed;
  346. }
  347. var s = seedgen(),
  348. url = 'https://api.primedice.com/api/seed?access_token=' + localStorage.token,
  349. sData = {
  350. seed: s
  351. };
  352. $.ajax({
  353. url: url,
  354. type: 'POST',
  355. data: sData,
  356. datatype: 'json',
  357. success: function (data, textStatus, jqXHR) {
  358. data2 = data;
  359. $('#currentseed').val(data2.seeds.client);
  360. },
  361. error: function (jqXHR, textStatus, errorThrown) {
  362. return false;
  363. }
  364. });
  365. }
  366. function addRow() {
  367. // Update Chart
  368. chart.addPoint([parseFloat(wins+losses), parseFloat(profit)]);
  369. chart2.addPoint([parseFloat(wins+losses), parseFloat((data1.bet.profit/100000000).toFixed(8))]);
  370. $('#lastID').text('Last Bet ID: ' + data1.bet.id);
  371. var bettable = '',
  372. bettab = '#result-1 #lastbet2';
  373. var bettab2 = '#result-2 #lastbet2';
  374. bettable += '<tr><td>' + (data1.bet.amount / 100000000).toFixed(8) + '</td>';
  375. bettable += '<td>' + data1.bet.multiplier + 'x' + '</td>'; /* return bet payout */
  376. bettable += '<td>' + (data1.bet.target).toFixed(2) + '</td>'; /* return target*/
  377. bettable += '<td>' + data1.bet.roll + '</td>'; /* return roll */
  378. bettable += '<td id="proff">' + (data1.bet.profit / 100000000).toFixed(8) + '</td></tr>';
  379. var stattable = '',
  380. stattab = '#lastbet3';
  381. 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>';
  382. $(stattab).empty();
  383. $(stattab).prepend(stattable);
  384. stattable = '';
  385. $(bettab2).prepend(bettable);
  386. if ($(bettab + ' tbody tr').length >= 3) {
  387. $(bettab + ' tr').last().remove();
  388. $(bettab).prepend(bettable);
  389. bettable = '';
  390. } else if ($(bettab).length < 3) {
  391. $(bettab).prepend(bettable);
  392. bettable = '';
  393. }
  394. $('#lastbet2 *, #lastbet3 *, #lastbet *, #proff').css('text-align', 'center');
  395. $('#lastbet2 *, #lastbet3 *, #lastbet *').css('width', '20%');
  396. $('#lastbet *').css('padding', '5px');
  397. $('#lastbet *').css('border-bottom', '1px solid #ccc');
  398. $('#result-1').css('padding', '5px');
  399. $('#lastbet2 *, #lastbet3 *, #proff').css('padding', '5px');
  400. $('#lastbet > tbody > tr > th:nth-child(2)').css('border-top', '1px solid #ddd');
  401. if (profit >= 0) {
  402. $('#profit').css('color', 'green');
  403. } else {
  404. $('#profit').css('color', 'red');
  405. }
  406. }
  407. function win() {
  408. if ($('#incrementbaseenabled').is(':checked') === true) {
  409. incrementwincount++;
  410. if (incrementwincount >= $('#incrementafterwins').val()) {
  411. incrementwincount = 0;
  412. basebet = Math.floor(basebet + ($('#incrementwin').val() * 100000000));
  413. if (basebet >= Math.floor($('#resetincrementbasebet').val() * 100000000)) {
  414. basebet = Math.floor($('#basebet').val() * 100000000)
  415. }
  416. }
  417. }
  418. if ($('#swaponlossenabled').is(':checked') === true) {
  419. swaplosscount = 0;
  420. }
  421. if ($('#swaponwinenabled').is(':checked') === true) {
  422. swapwincount++;
  423. if (swapwincount >= $('#swapafterwins').val()) {
  424. swapwincount = 0;
  425. swap();
  426. }
  427. }
  428. if ($('#stopwinenabled').is(':checked') === true && prerollsenabled === false) {
  429. clearInterval(loop);
  430. currentloss = 0;
  431. loopcount = 0;
  432. loopenabled = false;
  433. }
  434. if (prerollson === true) {
  435. if (prerollsenabled === true) {
  436. prerollcount = 0;
  437. }
  438. }
  439. if ($('#seedchangeonwin').is(':checked') === true) {
  440. seedchange();
  441. }
  442. wins++;
  443. currentloss = 0;
  444. if ($('#winmultenabled').is(':checked') === true) {
  445. if (prerollsenabled === true) {} else {
  446. if (prerollson === true && prerollsenabled === false) {
  447. prerollsenabled = true;
  448. prerollcount = 0;
  449. }
  450. if (lossprerollson === true) {} else {
  451. wmultcount++;
  452. if (wmultcount < $('#resetwin').val()) {
  453. betval = betval * $('#winlossmultiplier').val();
  454. } else if (wmultcount >= $('#resetwin').val()) {
  455. betval = basebet;
  456. wmultcount = 0;
  457. }
  458. }
  459. }
  460. if ($('#lossprerollenabled').is(':checked') === true) {
  461. if (lossprerollson === true) {
  462. lossprerollcount = $('#prerollafterlosses').val();
  463. lossprerollson = true;
  464. } else {
  465. lossprerollcount = 0;
  466. lossprerollson = false;
  467. }
  468. }
  469. }
  470. if ($('#lossmultenabled').is(':checked') === true) {
  471. if (prerollsenabled === true) {
  472. prerollcount = 0;
  473. } else {
  474. if (prerollson === true && prerollsenabled === false) {
  475. prerollsenabled = true;
  476. prerollcount = 0;
  477. }
  478. if (lossprerollson === true) {
  479. lmultcount = 0;
  480. lossprerollcount = $('#prerollafterlosses').val();
  481. } else {
  482. betval = basebet;
  483. lmultcount = 0;
  484. lossprerollcount = 0;
  485. }
  486. }
  487. }
  488. }
  489. function lose() {
  490. if ($('#swaponlossenabled').is(':checked') === true) {
  491. swaplosscount++;
  492. if (swaplosscount >= $('#swapafterlosses').val()) {
  493. swap();
  494. swaplosscount = 0;
  495. }
  496. }
  497. if ($('#lossprerollenabled').is(':checked') === true) {
  498. lossprerollcount++;
  499. if (lossprerollcount == $('#prerollafterlosses').val()) {
  500. lossprerollson = true;
  501. }
  502. if (lossprerollcount >= (parseFloat($('#numlossprerolls').val()) + parseFloat($('#prerollafterlosses').val()))) {
  503. curbet = betval;
  504. lossprerollson = false;
  505. lossprerollcount = 0;
  506. }
  507. }
  508. if ($('#seedchangeonloss').is(':checked') === true) {
  509. seedcount = 0;
  510. seedchange();
  511. }
  512. currentloss++;
  513. if ($('#stoplossenabled').is(':checked') === true) {
  514. if ($('#stoplosses').val() <= currentloss) {
  515. clearInterval(loop);
  516. currentloss = 0;
  517. loopcount = 0;
  518. loopenabled = false;
  519. }
  520. }
  521. if (prerollson === true) {
  522. if (prerollsenabled === true) {
  523. prerollcount++;
  524. if (prerollcount >= $('#numprerolls').val()) {
  525. prerollsenabled = false;
  526. }
  527. }
  528. }
  529. losses++;
  530. if ($('#lossmultenabled').is(':checked') === true) {
  531. if (prerollsenabled === true) {} else {
  532. if (lossprerollson === true) {} else {
  533. lmultcount++;
  534. if (lmultcount >= $('#multloss').val()) {
  535. betval = betval * $('#winlossmultiplier').val();
  536. lmultcount = 0;
  537. }
  538. }
  539. }
  540. }
  541. }
  542. function swap() {
  543. if (condition2 == '<') {
  544. condition2 = '>';
  545. target2 = (99.99 - (99 / $('#payout').val())).toFixed(2);
  546. } else if (condition2 == '>') {
  547. condition2 = '<';
  548. target2 = (99 / $('#payout').val()).toFixed(2);
  549. }
  550. }
  551. var themeoff = false;
  552. // Click Funcs
  553. function init2() {
  554. $('#darktheme').click(function () {
  555. if (themeoff === true) {
  556. darkTheme();
  557. $('#smoothness').remove();
  558. var jqCSS = document.createElement('link');
  559. jqCSS.href = 'https://jquery-ui.googlecode.com/svn/tags/latest/themes/dot-luv/jquery-ui.css';
  560. jqCSS.type = 'text/css';
  561. jqCSS.rel = 'stylesheet';
  562. jqCSS.id = 'dark';
  563. document.getElementsByTagName('head')[0].appendChild(jqCSS);
  564. themeoff = false;
  565. } else if (themeoff === false) {
  566. removeTheme();
  567. $('#dark').remove();
  568. var jqCSS = document.createElement('link');
  569. jqCSS.href = 'https://jquery-ui.googlecode.com/svn/tags/latest/themes/smoothness/jquery-ui.css';
  570. jqCSS.type = 'text/css';
  571. jqCSS.rel = 'stylesheet';
  572. jqCSS.id = 'smoothness';
  573. document.getElementsByTagName('head')[0].appendChild(jqCSS);
  574. themeoff = true;
  575. }
  576. });
  577. $('#spinner2').click(function () {
  578. bet();
  579. });
  580. if ($('#params label.ui-button').prev().is(':checked') === false && $('#params label.ui-button').prev().attr('type') != 'radio') {
  581. $('#params label.ui-button').text('On');
  582. } else {
  583. if ($('#params label.ui-button').prev().attr('type') != 'radio') {
  584. $('#params label.ui-button').text('Off');
  585. }
  586. }
  587. $('#params label.ui-button').click(function () {
  588. if ($(this).prev().is(':checked') === false && $(this).prev().attr('type') != 'radio') {
  589. $(this).text('On');
  590. } else {
  591. if ($(this).prev().attr('type') != 'radio') {
  592. $(this).text('Off');
  593. }
  594. }
  595. })
  596. $('#seedchange').click(function () {
  597. seedchange();
  598. });
  599. $('#detach').click(function () {
  600. $('#result').draggable();
  601. });
  602. $('#manualmode').click(function () {
  603. if ($(this).text() == 'Manual Mode') {
  604. manualenabled = true;
  605. $('#params').hide();
  606. $('#manual').show();
  607. $(this).text('Auto Mode');
  608. return;
  609. } else if ($(this).text() == 'Auto Mode') {
  610. manualenabled = false;
  611. $('#params').show();
  612. $('#manual').hide();
  613. $(this).text('Manual Mode');
  614. return;
  615. }
  616. })
  617. $('#setparams').click(function () {
  618. if ($('#lossprerollenabled').is(':checked') === false) {
  619. lossprerollson = false;
  620. }
  621. lmultcount = 0;
  622. currentloss = 0;
  623. wmultcount = 0;
  624. loopcount = 0;
  625. if ($('#prerollbet').val() !== "") {
  626. prebet = $('#prerollbet').val();
  627. } else {
  628. prebet = 0;
  629. }
  630. if ($('#prerollsenabled').is(':checked') === true) {
  631. prerollson = true;
  632. prerollcount = 0;
  633. prerollsenabled = true;
  634. prebet = Math.floor($('#prerollbet').val() * 100000000);
  635. basebet = Math.floor($('#basebet').val() * 100000000);
  636. betval = basebet;
  637. } else if ($('#prerollsenabled').is(':checked') === false) {
  638. prerollson = false;
  639. prerollsenabled = false;
  640. basebet = Math.floor($('#basebet').val() * 100000000);
  641. betval = basebet;
  642. }
  643. if ($('input:radio[name=hilo]:checked').val() == 'hi') {
  644. condition2 = '>';
  645. target2 = (99.99 - (99 / $('#payout').val())).toFixed(2);
  646. } else if ($('input:radio[name=hilo]:checked').val() == 'lo') {
  647. condition2 = '<';
  648. target2 = (99 / $('#payout').val()).toFixed(2);
  649. } else if ($('input:radio[name=hilo]:checked').val() == 'swap') {
  650. condition2 = '<';
  651. target2 = 0 + (99 / $('#payout').val()).toFixed(2);
  652. swapenabled = true;
  653. }
  654. });
  655. $('#lagfix').click(function () {
  656. $('#result-2 table:nth(1)').empty();
  657. chart.setData([]);chart2.setData([]);
  658. });
  659. $('#saveparams').click(function () {
  660. localStorage.setItem('params-stored', true);
  661. localStorage.setItem('basebet', $('#basebet').val());
  662. localStorage.setItem('payout', $('#payout').val());
  663. localStorage.setItem('prerollbet', $('#prerollbet').val());
  664. localStorage.setItem('prerollenabled', $('#prerollsenabled').is(':checked'));
  665. localStorage.setItem('numprerolls', $('#numprerolls').val());
  666. localStorage.setItem('lossenabled', $('#lossmultenabled').is(':checked'));
  667. localStorage.setItem('winenabled', $('#winmultenabled').is(':checked'));
  668. localStorage.setItem('resetwin', $('#resetwin').val());
  669. localStorage.setItem('xlosses', $('#multloss').val());
  670. localStorage.setItem('wlmult', $('#winlossmultiplier').val());
  671. localStorage.setItem('seedchangeon', $('#seedchangeon').is(':checked'));
  672. localStorage.setItem('seedxrolls', $('#seedxrolls').val());
  673. localStorage.setItem('swapxrolls', $('#swaprolls').val());
  674. localStorage.setItem('swapenabled', $('#swaprollsenabled').is(':checked'));
  675. });
  676. $('#openChart').click(function(){
  677. $('#dialog-form').dialog("open");
  678. })
  679. if (localStorage.getItem('params-stored') === 'true') {
  680. $('#basebet').val(localStorage.getItem('basebet'));
  681. $('#payout').val(localStorage.getItem('payout'));
  682. $('#prerollbet').val(localStorage.getItem('prerollbet'));
  683. if (localStorage.getItem('prerollenabled') === 'true') {
  684. $('#prerollsenabled').click();
  685. } else {
  686. $('#prerollsenabled').prop('checked', false);
  687. }
  688. $('#numprerolls').val(localStorage.getItem('numprerolls'));
  689. if (localStorage.getItem('lossenabled') === 'true') {
  690. $('#lossmultenabled').click();
  691. $('#lossmultenabled').prop('checked', false);
  692. }
  693. if (localStorage.getItem('winenabled') === 'true') {
  694. $('#winmultenabled').click();
  695. } else {
  696. $('#winmultenabled').prop('checked', false);
  697. }
  698. $('#resetwin').val(localStorage.getItem('resetwin'));
  699. $('#multloss').val(localStorage.getItem('xlosses'));
  700. $('#winlossmultiplier').val(localStorage.getItem('wlmult'));
  701. if (localStorage.getItem('seedchangeon') === 'true') {
  702. $('#seedchangeon').click();
  703. } else {
  704. $('#seedchangeon').prop('checked', false);
  705. }
  706. $('#seedxrolls').val(localStorage.getItem('seedxrolls'));
  707. if (localStorage.getItem('swapenabled') === 'true') {
  708. $('#swaprollsenabled').click();
  709. } else {
  710. $('#swaprollsenabled').prop('checked', false);
  711. }
  712. $('#swaprolls').val(localStorage.getItem('swapxrolls'));
  713. }
  714. chart = Highcharts.charts[0].series[0];
  715. chart2 = Highcharts.charts[0].series[1];
  716. loopenabled = false;
  717. loopcount = 0;
  718. $('#start').click(function () {
  719. if ($('#numrollsenabled').is(':checked') === true) {
  720. looptimes = $('#numrolls').val();
  721. } else {
  722. looptimes = 999999999;
  723. }
  724. if (loopenabled === false) {
  725. loopenabled = true;
  726. loop = setInterval(function () {
  727. if (loopcount >= looptimes) {
  728. clearInterval(loop);
  729. loopcount = 0;
  730. loopenabled = false;
  731. } else {
  732. if (betstarted === true) {} else {
  733. bet();
  734. }
  735. }
  736. }, betspeed);
  737. }
  738. });
  739. function removeTheme() {
  740. $('#paraDark').remove();
  741. }
  742. $('#stop').click(function () {
  743. clearInterval(loop);
  744. loopenabled = false;
  745. loopcount = 0;
  746. });
  747. $('#resetstats').click(function () {
  748. wins = 0;
  749. chart.setData([]);
  750. chart2.setData([]);
  751. losses = 0;
  752. profit = 0;
  753. currentloss = 0;
  754. addRow();
  755. wmultcount = 0;
  756. lmultcount = 0;
  757. });
  758. }
  759. setTimeout(function () {
  760. init2();
  761. }, 2000);
  762. RAW Paste Data
  763. 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;
  764. var balancebefore;var chart='';
  765. betspeed=500;
  766. seedcount = 0;
  767. currentloss = 0;
  768. lmultcount = 0;
  769. wmultcount = 0;
  770. prerollcount = 0;
  771. wins = 0;
  772. losses = 0;
  773. profit = 0;
  774. swaplosscount = 0;
  775. swapwincount = 0;
  776. incrementwincount = 0;
  777. loopenabled = false;
  778. manualenabled = false;
  779. loopcount = 0;
  780. seedlength = 5;
  781. counter = 0;
  782. charset = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ123';
  783. everyxrolls = 3;
  784. var JSINJ = '';
  785. JSINJ += '<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.1/jquery-ui.js"></script>';
  786. JSINJ += '<link rel="stylesheet" type="text/css" href="https://jquery-ui.googlecode.com/svn/tags/latest/themes/dot-luv/jquery-ui.css">';
  787. JSINJ += '<script src="https://code.highcharts.com/highcharts.js"></script>';
  788. JSINJ += '<script src="https://code.highcharts.com/modules/exporting.js"></script>';
  789. $(JSINJ).appendTo('head');
  790. function initializeUI() {
  791. // Begin UI
  792. $('.hero__main').empty();
  793. var UI = '';
  794. UI += '<div id="result">';
  795. UI += '<ul>';
  796. UI += '<li><a href="/play#result-1">Last Bets: </a></li>';
  797. UI += '<li><a href="/play#result-2">Bet History: </a></li>';
  798. UI += '<li><a href="/play#result-1" id="lagfix">Browser Lag?: Click Here </a></li>';
  799. UI += '</ul>';
  800. UI += '<div id="result-1">';
  801. UI += '<table id="lastbet">';
  802. UI += '<tr><th>Bet</th><th>Payout</th><th>Game</th><th>Roll</th><th>Profit</th></tr></table>';
  803. UI += '<table id="lastbet2">';
  804. UI += '</table>';
  805. UI += '<table id="lastbet">';
  806. UI += '<tr><th>Balance</th><th>Loss Streak</th><th>Total Wins</th><th>Total Losses</th><th>Total Profit</th></tr></table>';
  807. UI += '<table id="lastbet3">';
  808. UI += '</table>';
  809. UI += '</div>';
  810. UI += '<div id="result-2">';
  811. UI += '<table id="lastbet">';
  812. UI += '<tr><th>Bet</th><th>Payout</th><th>Game</th><th>Roll</th><th>Profit</th></tr></table>';
  813. UI += '<div style="max-height:84px !important;overflow-y: scroll;overflow-x: hidden;"id="historycontainer">';
  814. UI += '<table id="lastbet2">';
  815. UI += '</table>';
  816. UI += '</div>';
  817. UI += '</div>';
  818. UI += '</div>';
  819. UI += '<div id="params">';
  820. UI += '<h3>Basic Settings</h3>';
  821. UI += '<div>';
  822. UI += '<table id="params1">';
  823. UI += '<tr><th>Basebet:</th><th>Multiplier:</th><th>Hi/Lo/Swap</th></tr>';
  824. 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>';
  825. 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>';
  826. UI += '<tr><th></th><th># of Prerolls</th><th>Preroll Bet</th></tr>';
  827. 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>';
  828. 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>';
  829. UI += '</table>';
  830. UI += '</div>';
  831. UI += '<h3>Win/Loss Settings</h3>';
  832. UI += '<div>';
  833. UI += '<table id="params1">';
  834. 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>';
  835. 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>';
  836. UI += '<td><input id="winlossmultiplier" placeholder="2 (2x), 1.5 (1.5x) etc"/></tr>';
  837. 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>';
  838. 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>';
  839. UI += '</table>';
  840. UI += '</div>';
  841. UI += '<h3>Advanced Settings</h3>';
  842. UI += '<div>';
  843. UI += '<table id="params1">';
  844. 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>';
  845. UI += '<tr><td><input style="width:85px;" id="stoplosses" placeholder="# of losses"/></td><td></td>';
  846. UI += '<td><input id="swaprolls" type="text" placeholder="# of rolls"></tr>';
  847. 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>';
  848. 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>';
  849. 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>';
  850. 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>';
  851. UI += '<tr><td><input id="swapafterlosses"></td><td></td><td><input id="swapafterwins"></td></tr>';
  852. UI += '<tr><p>Note: Use Total Profit as your reference for stop loss/profit. Do NOT enter a balance.</p></tr>';
  853. UI += '</table>';
  854. UI += '</div>';
  855. UI += '<h3>Seed Settings</h3>';
  856. UI += '<div>';
  857. UI += '<table id="params1">';
  858. 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>';
  859. UI += '<tr><td><input style="color:red;text-align:center;"id="currentseed"/></td><td><input id="charset" placeholder="Optional"/></td>';
  860. UI += '<td><input id="seedxrolls" placeholder="ex. 1, 10, 20"/></tr>';
  861. 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>';
  862. UI += '</table>';
  863. UI += '</div>';
  864. UI += '</div>';
  865. UI += '<div id="manual" style="display:none;">';
  866. 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>';
  867. //Manual Mode HTML
  868. UI += '<table id="params1"><tr>';
  869. 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>';
  870. 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>';
  871. 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>';
  872. //<label for="numrolls">Number of Rolls: <input id="numrollsenabled" type="checkbox"></label><input style="width:85px;" id="numrolls"/>
  873. $(UI).appendTo('.hero__main');
  874. $(function(){
  875. 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);
  876. });
  877. //jQ-UI Settings
  878. jQSettings = '';
  879. jQSettings += '<script>';
  880. // Settings Here
  881. jQSettings += '';
  882. jQSettings += '$(function(){';
  883. jQSettings += 'dialog = $( "#dialog-form" ).dialog({autoOpen: false,height: 350,width: 450,modal: true, buttons: {Close: function() {dialog.dialog( "close" )}}});';
  884. 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]}]});';
  885. jQSettings += '$("#basebetslider").slider({value:0.00000000,min: 0.00000000,max: 0.00020001,step: 0.0000000010, slide: function( event, ui ) {$( "#basebet" ).val( ui.value );}});';
  886. jQSettings += '$("#payoutslider").slider({value:5.0,min: 1,max: 100,step: 1, slide: function( event, ui ) {$( "#payout" ).val( ui.value );}});';
  887. jQSettings += '$("#buttonz button").button();$("input:checkbox").button();$("div#hilo").buttonset();';
  888. jQSettings += '$("#themeseed").buttonset();$("#setsavereset").buttonset();$("#startstop").buttonset();';
  889. jQSettings += '$("#result").tabs();$("#manualhilo").buttonset(); $( "#params" ).accordion({collapsible: true});});';
  890. jQSettings += '</script>';
  891. $(jQSettings).appendTo('head');
  892. var UICSS = '';
  893. UICSS += '<style>';
  894. UICSS += 'span.ui-slider-handle { width: 12px !important; }';
  895. UICSS += '#basebetslider , #basebet, #payoutslider, #payout { width: 100% !important; }';
  896. UICSS += '#params h3 { padding: 5px; }';
  897. UICSS += '#params label { width: auto !important; }';
  898. UICSS += 'span.ui-button-text { font-size: 9px; }';
  899. UICSS += '#params, #result { border-radius: 0px; width: auto !important; }';
  900. UICSS += '.hero__main { padding: 2px; margin: 5px; }';
  901. UICSS += '.hero__main {font-size: 10px !important;}';
  902. UICSS += '.ui-accordion-content { height: auto !important; padding: 5px !important;}';
  903. UICSS += '.ui-accordion .ui-accordion-content {margin-left: 3px !important; margin-right: 3px;margin-top: 0.5px;}';
  904. UICSS += 'table#params1 input:text { width: auto; height: auto; }';
  905. UICSS += 'table#params1 th, table#params1 td, table#params1 label { width: 33% !important; padding:5px !important; }';
  906. UICSS += '#buttonz { margin:2px; padding: 1px; text-align: center; font-size: 12px;}';
  907. UICSS += '#toolbar { width:100%;display: inline-block; padding: 0px; margin-top:3px; }';
  908. UICSS += '#params *, #result * { font-size: 10px;}';
  909. UICSS += '#toolbar button { margin: 1px; }';
  910. UICSS += 'label.ui-button span, label .ui-button { padding: 2px !important; }';
  911. UICSS += '#manual { margin: 10px 0px 10px 60px;}';
  912. UICSS += 'body > div.ui-widget-overlay.ui-front { display: none !important; }';
  913. UICSS += '.ui-button-icon-primary { top: 0 !important; left: 0 !important;}';
  914. UICSS += '</style>';
  915. setTimeout(function () {
  916. $(UICSS).appendTo('head');
  917. }, 3000);
  918. }
  919. setTimeout(function () {
  920. initializeUI();
  921. }, 1000);
  922. function darkTheme() {
  923. var css = '',
  924. backgroundurl = 'http://cdn.wonderfulengineering.com/wp-content/uploads/2014/01/HD-backgrounds-3.jpg';
  925. css += '<style id="paraDark">';
  926. 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;}';
  927. css += 'time{color:#ccc !important;}';
  928. css += 'div.tabs > div > div.live-data-header > div{background-color:#111111;border-top:1px solid #777; border-bottom:1px solid #777;}';
  929. 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;}';
  930. 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;}';
  931. css += '.hero{margin-bottom:0px;background:url("' + backgroundurl + '") no-repeat 50% 50%;}';
  932. css += '.slideout *{color:#ccc;}';
  933. css += '.tabs{padding-top:20px;border-top:1px solid #777 !important;}';
  934. css += 'header{border: 1px solid #777 !important;border-left:none !important;border-right:none !important;}';
  935. css += '.rollrow-thin, .rollrow-dark .chat__input-holder {background-color:#212121;}';
  936. css += '.input{background-color:#323232 !important;color:#ccc;}';
  937. css += '.action-open-slideout{background-color:#121212 !important;}';
  938. css += 'span.admin{color:red !important}';
  939. css += '</style>';
  940. $(css).appendTo('head');
  941. }
  942. darkTheme();
  943. var mixcount = 0;
  944. betstarted = false;
  945. var swapswap = 2,
  946. swapcount = 0,
  947. lossprerollcount = 0,
  948. lossprerollson;
  949. 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;
  950. function bet() {
  951. if (betstarted === true) {} else {
  952. betstarted = true;
  953. if (manualenabled === true) {
  954. manualamount = Math.floor($('#manualamount').val() * 100000000);
  955. if ($('#manualhi').is(':checked') === true) {
  956. manualcondition = '>';
  957. manualtarget = (99.99 - (99 / $('#manualtarget').val())).toFixed(2);
  958. } else if ($('#manuallow').is(':checked') === true) {
  959. manualcondition = '<';
  960. manualtarget = (99 / $('#manualtarget').val()).toFixed(2);
  961. }
  962. var betData = {
  963. amount: manualamount,
  964. condition: manualcondition,
  965. target: manualtarget,
  966. },
  967. url = 'https://api.primedice.com/api/bet?access_token=' + localStorage.token;
  968. } else {
  969. if ($('#resetprofitenabled').is(':checked') === true) {
  970. if (parseFloat(profit) >= $('#resetprofit').val()) {
  971. betval = basebet;
  972. curbet = betval;
  973. profit = 0;
  974. wmultcount = 0;
  975. /*betval = basebet;
  976. wmultcount = 0;
  977. profit = 0;
  978. if ($('#payout').val() == '5') {
  979. $('#payout').val(10);
  980. } else {
  981. $('#payout').val(5);
  982. }
  983. if (condition2 == '>') {
  984. target2 = (99.99 - (99 / $('#payout').val())).toFixed(2);
  985. } else if (condition2 == '<') {
  986. target2 = (99 / $('#payout').val()).toFixed(2);
  987. }*/
  988. }
  989. }
  990. if ($('#stopprofitenabled').is(':checked') === true) {
  991. if (profit >= $('#stopprofitamount').val()) {
  992. clearInterval(loop);
  993. loopenabled = false;
  994. loopcount = 0;
  995. }
  996. }
  997. if ($('#resetlossenabled').is(':checked') === true && prerollsenabled === false) {
  998. if ($('#resetlosses').val() <= currentloss) {
  999. betval = basebet;
  1000. lmultcount = 0;
  1001. wmultcount = 0;
  1002. currentloss = 0;
  1003. }
  1004. }
  1005. if ($('#stoploss2enabled').is(':checked') === true) {
  1006. if (profit <= (-1 * $('#stoplossamount').val())) {
  1007. clearInterval(loop);
  1008. loopenabled = false;
  1009. loopcount = 0;
  1010. }
  1011. }
  1012. if (prerollsenabled === true) {
  1013. prebet = Math.floor($('#prerollbet').val() * 100000000);
  1014. curbet = prebet;
  1015. } else {
  1016. curbet = betval;
  1017. }
  1018. if ($('#lossprerollenabled').is(':checked') === true) {
  1019. if (lossprerollson === true) {
  1020. curbet = prebet;
  1021. } else {
  1022. curbet = betval;
  1023. }
  1024. }
  1025. var betData = {
  1026. amount: curbet,
  1027. condition: condition2,
  1028. target: target2,
  1029. },
  1030. url = 'https://api.primedice.com/api/bet?access_token=' + localStorage.token;
  1031. }
  1032. if (curbet > curbalance) {
  1033. clearInterval(loop);
  1034. loopenabled = false;
  1035. loopcount = 0;
  1036. }
  1037. $.ajax({
  1038. url: url,
  1039. type: 'POST',
  1040. data: betData,
  1041. datatype: 'json',
  1042. async: true,
  1043. success: function (data, textStatus, jqXHR) {
  1044. if ($('#seedchangeon').is(':checked') === true) {
  1045. if ($('#charset').val() !== '') {
  1046. charset = $('#charset').val();
  1047. }
  1048. if ($('#seedxrolls').val() === '') {} else {
  1049. seedcount++;
  1050. if (seedcount >= $('#seedxrolls').val()) {
  1051. seedchange();
  1052. seedcount = 0;
  1053. }
  1054. }
  1055. }
  1056. data1 = data;
  1057. profit = profit = (parseFloat(profit) + parseFloat((data1.bet.profit / 100000000))).toFixed(8);
  1058. curbalance = data1.user.balance;
  1059. addRow();
  1060. if (loopenabled === true) {
  1061. loopcount++;
  1062. }
  1063. if ($('input:radio[name=hilo]:checked').val() == 'swap') {
  1064. if ($('#swaprollsenabled').is(':checked') === true) {
  1065. swapswap = $('#swaprolls').val();
  1066. swapcount++;
  1067. if (swapcount >= swapswap) {
  1068. swap();
  1069. swapcount = 0;
  1070. }
  1071. } else {
  1072. swap();
  1073. }
  1074. }
  1075. $('.btn__text.select div').text((data1.user.balance / 100000000).toFixed(8));
  1076. if (data.bet.win === true) {
  1077. win();
  1078. if (prerollson === true) {
  1079. if (prerollsenabled === false) {
  1080. prerollsenabled = true;
  1081. prerollcount = 0;
  1082. }
  1083. }
  1084. $('.btn__text.select div').attr('style', 'color:green;');
  1085. } else {
  1086. lose();
  1087. $('.btn__text.select div').attr('style', 'color:red;');
  1088. }
  1089. if (data.bet.win === true) {
  1090. $('#result-1 #proff:nth(0), #result-2 #proff:nth(0)').attr('style', 'text-align: center; width: 20%; padding: 5px;color:green;');
  1091. } else {
  1092. $('#result-1 #proff:nth(0), #result-2 #proff:nth(0)').attr('style', 'text-align: center; width: 20%; padding: 5px;color:red;');
  1093. }
  1094. betstarted = false;
  1095. },
  1096. error: function (jqXHR, textStatus, errorThrown) {
  1097. betstarted = false;
  1098. }
  1099. });
  1100. }
  1101. }
  1102. function seedchange() {
  1103. function seedgen() {
  1104. var seed = '';
  1105. for (var i = 0; i <= seedlength; i++)
  1106. seed += charset.charAt(Math.floor(Math.random() * charset.length));
  1107. return seed;
  1108. }
  1109. var s = seedgen(),
  1110. url = 'https://api.primedice.com/api/seed?access_token=' + localStorage.token,
  1111. sData = {
  1112. seed: s
  1113. };
  1114. $.ajax({
  1115. url: url,
  1116. type: 'POST',
  1117. data: sData,
  1118. datatype: 'json',
  1119. success: function (data, textStatus, jqXHR) {
  1120. data2 = data;
  1121. $('#currentseed').val(data2.seeds.client);
  1122. },
  1123. error: function (jqXHR, textStatus, errorThrown) {
  1124. return false;
  1125. }
  1126. });
  1127. }
  1128. function addRow() {
  1129. // Update Chart
  1130. chart.addPoint([parseFloat(wins+losses), parseFloat(profit)]);
  1131. chart2.addPoint([parseFloat(wins+losses), parseFloat((data1.bet.profit/100000000).toFixed(8))]);
  1132. $('#lastID').text('Last Bet ID: ' + data1.bet.id);
  1133. var bettable = '',
  1134. bettab = '#result-1 #lastbet2';
  1135. var bettab2 = '#result-2 #lastbet2';
  1136. bettable += '<tr><td>' + (data1.bet.amount / 100000000).toFixed(8) + '</td>';
  1137. bettable += '<td>' + data1.bet.multiplier + 'x' + '</td>'; /* return bet payout */
  1138. bettable += '<td>' + (data1.bet.target).toFixed(2) + '</td>'; /* return target*/
  1139. bettable += '<td>' + data1.bet.roll + '</td>'; /* return roll */
  1140. bettable += '<td id="proff">' + (data1.bet.profit / 100000000).toFixed(8) + '</td></tr>';
  1141. var stattable = '',
  1142. stattab = '#lastbet3';
  1143. 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>';
  1144. $(stattab).empty();
  1145. $(stattab).prepend(stattable);
  1146. stattable = '';
  1147. $(bettab2).prepend(bettable);
  1148. if ($(bettab + ' tbody tr').length >= 3) {
  1149. $(bettab + ' tr').last().remove();
  1150. $(bettab).prepend(bettable);
  1151. bettable = '';
  1152. } else if ($(bettab).length < 3) {
  1153. $(bettab).prepend(bettable);
  1154. bettable = '';
  1155. }
  1156. $('#lastbet2 *, #lastbet3 *, #lastbet *, #proff').css('text-align', 'center');
  1157. $('#lastbet2 *, #lastbet3 *, #lastbet *').css('width', '20%');
  1158. $('#lastbet *').css('padding', '5px');
  1159. $('#lastbet *').css('border-bottom', '1px solid #ccc');
  1160. $('#result-1').css('padding', '5px');
  1161. $('#lastbet2 *, #lastbet3 *, #proff').css('padding', '5px');
  1162. $('#lastbet > tbody > tr > th:nth-child(2)').css('border-top', '1px solid #ddd');
  1163. if (profit >= 0) {
  1164. $('#profit').css('color', 'green');
  1165. } else {
  1166. $('#profit').css('color', 'red');
  1167. }
  1168. }
  1169. function win() {
  1170. if ($('#incrementbaseenabled').is(':checked') === true) {
  1171. incrementwincount++;
  1172. if (incrementwincount >= $('#incrementafterwins').val()) {
  1173. incrementwincount = 0;
  1174. basebet = Math.floor(basebet + ($('#incrementwin').val() * 100000000));
  1175. if (basebet >= Math.floor($('#resetincrementbasebet').val() * 100000000)) {
  1176. basebet = Math.floor($('#basebet').val() * 100000000)
  1177. }
  1178. }
  1179. }
  1180. if ($('#swaponlossenabled').is(':checked') === true) {
  1181. swaplosscount = 0;
  1182. }
  1183. if ($('#swaponwinenabled').is(':checked') === true) {
  1184. swapwincount++;
  1185. if (swapwincount >= $('#swapafterwins').val()) {
  1186. swapwincount = 0;
  1187. swap();
  1188. }
  1189. }
  1190. if ($('#stopwinenabled').is(':checked') === true && prerollsenabled === false) {
  1191. clearInterval(loop);
  1192. currentloss = 0;
  1193. loopcount = 0;
  1194. loopenabled = false;
  1195. }
  1196. if (prerollson === true) {
  1197. if (prerollsenabled === true) {
  1198. prerollcount = 0;
  1199. }
  1200. }
  1201. if ($('#seedchangeonwin').is(':checked') === true) {
  1202. seedchange();
  1203. }
  1204. wins++;
  1205. currentloss = 0;
  1206. if ($('#winmultenabled').is(':checked') === true) {
  1207. if (prerollsenabled === true) {} else {
  1208. if (prerollson === true && prerollsenabled === false) {
  1209. prerollsenabled = true;
  1210. prerollcount = 0;
  1211. }
  1212. if (lossprerollson === true) {} else {
  1213. wmultcount++;
  1214. if (wmultcount < $('#resetwin').val()) {
  1215. betval = betval * $('#winlossmultiplier').val();
  1216. } else if (wmultcount >= $('#resetwin').val()) {
  1217. betval = basebet;
  1218. wmultcount = 0;
  1219. }
  1220. }
  1221. }
  1222. if ($('#lossprerollenabled').is(':checked') === true) {
  1223. if (lossprerollson === true) {
  1224. lossprerollcount = $('#prerollafterlosses').val();
  1225. lossprerollson = true;
  1226. } else {
  1227. lossprerollcount = 0;
  1228. lossprerollson = false;
  1229. }
  1230. }
  1231. }
  1232. if ($('#lossmultenabled').is(':checked') === true) {
  1233. if (prerollsenabled === true) {
  1234. prerollcount = 0;
  1235. } else {
  1236. if (prerollson === true && prerollsenabled === false) {
  1237. prerollsenabled = true;
  1238. prerollcount = 0;
  1239. }
  1240. if (lossprerollson === true) {
  1241. lmultcount = 0;
  1242. lossprerollcount = $('#prerollafterlosses').val();
  1243. } else {
  1244. betval = basebet;
  1245. lmultcount = 0;
  1246. lossprerollcount = 0;
  1247. }
  1248. }
  1249. }
  1250. }
  1251. function lose() {
  1252. if ($('#swaponlossenabled').is(':checked') === true) {
  1253. swaplosscount++;
  1254. if (swaplosscount >= $('#swapafterlosses').val()) {
  1255. swap();
  1256. swaplosscount = 0;
  1257. }
  1258. }
  1259. if ($('#lossprerollenabled').is(':checked') === true) {
  1260. lossprerollcount++;
  1261. if (lossprerollcount == $('#prerollafterlosses').val()) {
  1262. lossprerollson = true;
  1263. }
  1264. if (lossprerollcount >= (parseFloat($('#numlossprerolls').val()) + parseFloat($('#prerollafterlosses').val()))) {
  1265. curbet = betval;
  1266. lossprerollson = false;
  1267. lossprerollcount = 0;
  1268. }
  1269. }
  1270. if ($('#seedchangeonloss').is(':checked') === true) {
  1271. seedcount = 0;
  1272. seedchange();
  1273. }
  1274. currentloss++;
  1275. if ($('#stoplossenabled').is(':checked') === true) {
  1276. if ($('#stoplosses').val() <= currentloss) {
  1277. clearInterval(loop);
  1278. currentloss = 0;
  1279. loopcount = 0;
  1280. loopenabled = false;
  1281. }
  1282. }
  1283. if (prerollson === true) {
  1284. if (prerollsenabled === true) {
  1285. prerollcount++;
  1286. if (prerollcount >= $('#numprerolls').val()) {
  1287. prerollsenabled = false;
  1288. }
  1289. }
  1290. }
  1291. losses++;
  1292. if ($('#lossmultenabled').is(':checked') === true) {
  1293. if (prerollsenabled === true) {} else {
  1294. if (lossprerollson === true) {} else {
  1295. lmultcount++;
  1296. if (lmultcount >= $('#multloss').val()) {
  1297. betval = betval * $('#winlossmultiplier').val();
  1298. lmultcount = 0;
  1299. }
  1300. }
  1301. }
  1302. }
  1303. }
  1304. function swap() {
  1305. if (condition2 == '<') {
  1306. condition2 = '>';
  1307. target2 = (99.99 - (99 / $('#payout').val())).toFixed(2);
  1308. } else if (condition2 == '>') {
  1309. condition2 = '<';
  1310. target2 = (99 / $('#payout').val()).toFixed(2);
  1311. }
  1312. }
  1313. var themeoff = false;
  1314. // Click Funcs
  1315. function init2() {
  1316. $('#darktheme').click(function () {
  1317. if (themeoff === true) {
  1318. darkTheme();
  1319. $('#smoothness').remove();
  1320. var jqCSS = document.createElement('link');
  1321. jqCSS.href = 'https://jquery-ui.googlecode.com/svn/tags/latest/themes/dot-luv/jquery-ui.css';
  1322. jqCSS.type = 'text/css';
  1323. jqCSS.rel = 'stylesheet';
  1324. jqCSS.id = 'dark';
  1325. document.getElementsByTagName('head')[0].appendChild(jqCSS);
  1326. themeoff = false;
  1327. } else if (themeoff === false) {
  1328. removeTheme();
  1329. $('#dark').remove();
  1330. var jqCSS = document.createElement('link');
  1331. jqCSS.href = 'https://jquery-ui.googlecode.com/svn/tags/latest/themes/smoothness/jquery-ui.css';
  1332. jqCSS.type = 'text/css';
  1333. jqCSS.rel = 'stylesheet';
  1334. jqCSS.id = 'smoothness';
  1335. document.getElementsByTagName('head')[0].appendChild(jqCSS);
  1336. themeoff = true;
  1337. }
  1338. });
  1339. $('#spinner2').click(function () {
  1340. bet();
  1341. });
  1342. if ($('#params label.ui-button').prev().is(':checked') === false && $('#params label.ui-button').prev().attr('type') != 'radio') {
  1343. $('#params label.ui-button').text('On');
  1344. } else {
  1345. if ($('#params label.ui-button').prev().attr('type') != 'radio') {
  1346. $('#params label.ui-button').text('Off');
  1347. }
  1348. }
  1349. $('#params label.ui-button').click(function () {
  1350. if ($(this).prev().is(':checked') === false && $(this).prev().attr('type') != 'radio') {
  1351. $(this).text('On');
  1352. } else {
  1353. if ($(this).prev().attr('type') != 'radio') {
  1354. $(this).text('Off');
  1355. }
  1356. }
  1357. })
  1358. $('#seedchange').click(function () {
  1359. seedchange();
  1360. });
  1361. $('#detach').click(function () {
  1362. $('#result').draggable();
  1363. });
  1364. $('#manualmode').click(function () {
  1365. if ($(this).text() == 'Manual Mode') {
  1366. manualenabled = true;
  1367. $('#params').hide();
  1368. $('#manual').show();
  1369. $(this).text('Auto Mode');
  1370. return;
  1371. } else if ($(this).text() == 'Auto Mode') {
  1372. manualenabled = false;
  1373. $('#params').show();
  1374. $('#manual').hide();
  1375. $(this).text('Manual Mode');
  1376. return;
  1377. }
  1378. })
  1379. $('#setparams').click(function () {
  1380. if ($('#lossprerollenabled').is(':checked') === false) {
  1381. lossprerollson = false;
  1382. }
  1383. lmultcount = 0;
  1384. currentloss = 0;
  1385. wmultcount = 0;
  1386. loopcount = 0;
  1387. if ($('#prerollbet').val() !== "") {
  1388. prebet = $('#prerollbet').val();
  1389. } else {
  1390. prebet = 0;
  1391. }
  1392. if ($('#prerollsenabled').is(':checked') === true) {
  1393. prerollson = true;
  1394. prerollcount = 0;
  1395. prerollsenabled = true;
  1396. prebet = Math.floor($('#prerollbet').val() * 100000000);
  1397. basebet = Math.floor($('#basebet').val() * 100000000);
  1398. betval = basebet;
  1399. } else if ($('#prerollsenabled').is(':checked') === false) {
  1400. prerollson = false;
  1401. prerollsenabled = false;
  1402. basebet = Math.floor($('#basebet').val() * 100000000);
  1403. betval = basebet;
  1404. }
  1405. if ($('input:radio[name=hilo]:checked').val() == 'hi') {
  1406. condition2 = '>';
  1407. target2 = (99.99 - (99 / $('#payout').val())).toFixed(2);
  1408. } else if ($('input:radio[name=hilo]:checked').val() == 'lo') {
  1409. condition2 = '<';
  1410. target2 = (99 / $('#payout').val()).toFixed(2);
  1411. } else if ($('input:radio[name=hilo]:checked').val() == 'swap') {
  1412. condition2 = '<';
  1413. target2 = 0 + (99 / $('#payout').val()).toFixed(2);
  1414. swapenabled = true;
  1415. }
  1416. });
  1417. $('#lagfix').click(function () {
  1418. $('#result-2 table:nth(1)').empty();
  1419. chart.setData([]);chart2.setData([]);
  1420. });
  1421. $('#saveparams').click(function () {
  1422. localStorage.setItem('params-stored', true);
  1423. localStorage.setItem('basebet', $('#basebet').val());
  1424. localStorage.setItem('payout', $('#payout').val());
  1425. localStorage.setItem('prerollbet', $('#prerollbet').val());
  1426. localStorage.setItem('prerollenabled', $('#prerollsenabled').is(':checked'));
  1427. localStorage.setItem('numprerolls', $('#numprerolls').val());
  1428. localStorage.setItem('lossenabled', $('#lossmultenabled').is(':checked'));
  1429. localStorage.setItem('winenabled', $('#winmultenabled').is(':checked'));
  1430. localStorage.setItem('resetwin', $('#resetwin').val());
  1431. localStorage.setItem('xlosses', $('#multloss').val());
  1432. localStorage.setItem('wlmult', $('#winlossmultiplier').val());
  1433. localStorage.setItem('seedchangeon', $('#seedchangeon').is(':checked'));
  1434. localStorage.setItem('seedxrolls', $('#seedxrolls').val());
  1435. localStorage.setItem('swapxrolls', $('#swaprolls').val());
  1436. localStorage.setItem('swapenabled', $('#swaprollsenabled').is(':checked'));
  1437. });
  1438. $('#openChart').click(function(){
  1439. $('#dialog-form').dialog("open");
  1440. })
  1441. if (localStorage.getItem('params-stored') === 'true') {
  1442. $('#basebet').val(localStorage.getItem('basebet'));
  1443. $('#payout').val(localStorage.getItem('payout'));
  1444. $('#prerollbet').val(localStorage.getItem('prerollbet'));
  1445. if (localStorage.getItem('prerollenabled') === 'true') {
  1446. $('#prerollsenabled').click();
  1447. } else {
  1448. $('#prerollsenabled').prop('checked', false);
  1449. }
  1450. $('#numprerolls').val(localStorage.getItem('numprerolls'));
  1451. if (localStorage.getItem('lossenabled') === 'true') {
  1452. $('#lossmultenabled').click();
  1453. $('#lossmultenabled').prop('checked', false);
  1454. }
  1455. if (localStorage.getItem('winenabled') === 'true') {
  1456. $('#winmultenabled').click();
  1457. } else {
  1458. $('#winmultenabled').prop('checked', false);
  1459. }
  1460. $('#resetwin').val(localStorage.getItem('resetwin'));
  1461. $('#multloss').val(localStorage.getItem('xlosses'));
  1462. $('#winlossmultiplier').val(localStorage.getItem('wlmult'));
  1463. if (localStorage.getItem('seedchangeon') === 'true') {
  1464. $('#seedchangeon').click();
  1465. } else {
  1466. $('#seedchangeon').prop('checked', false);
  1467. }
  1468. $('#seedxrolls').val(localStorage.getItem('seedxrolls'));
  1469. if (localStorage.getItem('swapenabled') === 'true') {
  1470. $('#swaprollsenabled').click();
  1471. } else {
  1472. $('#swaprollsenabled').prop('checked', false);
  1473. }
  1474. $('#swaprolls').val(localStorage.getItem('swapxrolls'));
  1475. }
  1476. chart = Highcharts.charts[0].series[0];
  1477. chart2 = Highcharts.charts[0].series[1];
  1478. loopenabled = false;
  1479. loopcount = 0;
  1480. $('#start').click(function () {
  1481. if ($('#numrollsenabled').is(':checked') === true) {
  1482. looptimes = $('#numrolls').val();
  1483. } else {
  1484. looptimes = 999999999;
  1485. }
  1486. if (loopenabled === false) {
  1487. loopenabled = true;
  1488. loop = setInterval(function () {
  1489. if (loopcount >= looptimes) {
  1490. clearInterval(loop);
  1491. loopcount = 0;
  1492. loopenabled = false;
  1493. } else {
  1494. if (betstarted === true) {} else {
  1495. bet();
  1496. }
  1497. }
  1498. }, betspeed);
  1499. }
  1500. });
  1501. function removeTheme() {
  1502. $('#paraDark').remove();
  1503. }
  1504. $('#stop').click(function () {
  1505. clearInterval(loop);
  1506. loopenabled = false;
  1507. loopcount = 0;
  1508. });
  1509. $('#resetstats').click(function () {
  1510. wins = 0;
  1511. chart.setData([]);
  1512. chart2.setData([]);
  1513. losses = 0;
  1514. profit = 0;
  1515. currentloss = 0;
  1516. addRow();
  1517. wmultcount = 0;
  1518. lmultcount = 0;
  1519. });
  1520. }
  1521. setTimeout(function () {
  1522. init2();
  1523. }, 2000);

comments powered by Disqus