PMD3


SUBMITTED BY: xtra007

DATE: Dec. 2, 2015, 10:14 a.m.

FORMAT: Text only

SIZE: 41.2 kB

HITS: 1988

  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);

comments powered by Disqus