Here is a script that does some stuff, but the most importantly, it constantly changes the value of inDynamicEditMode from 0 to 1 and from 1 to 0. I'm trying to create a function that'd redefine the function payx() if inDynamicEditMode is 0 (or 1). I'm posting the entire script just in case I delete something important.
var start = 0.01
var $input = $("#oddsInput")
var $odds = $("#oddsOverUnder")
var $button = $("#roll")
var $bet = $("#bet")
var $pay = $("#oddsPayout.btn.btn-primary.btn-xlg.btn-block")
var inDynamicEditMode = true;
function basex() {
$bet.val(start)
}
function timesx() {
var lol = document.getElementById('bet').value;
$bet.val(lol * 8)
}
function paylowx() {
$pay.click()
document.getElementById("oddsInput").value = "1.2";
$odds.click()
}
function payhighx() {
$pay.click()
document.getElementById("oddsInput").value = "5.2";
$odds.click()
}
function payx(){
}
var mars = document.createElement('div');
mars.innerHTML = '' +
'<div class="form-group">' +
'<div class="text-center col-sm-6 col-sm-offset-3">' +
'<input id="base" type="button" value="BASE" onClick="basex()">' +
'<input id="times" type="button" value="x8" onClick="timesx()">' +
'<input id="paylow" type="button" value="1.2" onClick="paylowx()">' +
'<input id="payhigh" type="button" value="5.2" onClick="payhighx()">' +
'</div>' +
'</div>';
document.getElementsByClassName('text-center col-sm-6 col-sm-offset-3')[0].appendChild(mars);
var mybase = document.querySelector("#base");
mybase.style.backgroundColor = "#131313";
mybase.style.borderStyle = "none";
mybase.style.borderRadius = "6px 0px 0px 0px"
mybase.style.color = "#fff"
mybase.style.fontSize = "18px"
mybase.style.width = "80px"
mybase.style.height = "40px"
var mytimes = document.querySelector("#times");
mytimes.style.backgroundColor = "#131313";
mytimes.style.borderStyle = "none";
mytimes.style.borderRadius = "0px 6px 0px 0px"
mytimes.style.color = "#fff"
mytimes.style.fontSize = "18px"
mytimes.style.width = "80px"
mytimes.style.height = "40px"
var mypaylow = document.querySelector("#paylow");
mypaylow.style.backgroundColor = "#131313";
mypaylow.style.borderStyle = "none";
mypaylow.style.borderRadius = "0px 0px 0px 6px"
mypaylow.style.color = "#fff"
mypaylow.style.fontSize = "18px"
mypaylow.style.width = "80px"
mypaylow.style.height = "40px"
var mypayhigh = document.querySelector("#payhigh");
mypayhigh.style.backgroundColor = "#131313";
mypayhigh.style.borderStyle = "none";
mypayhigh.style.borderRadius = "0px 0px 6px 0px"
mypayhigh.style.color = "#fff"
mypayhigh.style.fontSize = "18px"
mypayhigh.style.width = "80px"
mypayhigh.style.height = "40px"
var myhalf = document.querySelector("#halfBetButton");
myhalf.style.display = "none"
var mydouble = document.querySelector("#doubleBetButton");
mydouble.style.display = "none"
function roll() {
$bet.val(start)
$button.click()
setTimeout(function() {
var tr = document.querySelector("#myBetsTable tr:nth-child(2)")
var cls = tr.getAttribute('class')
if (cls === 'success'){
payx()
}
else{
payx()
inDynamicEditMode ^= true
}
$button.click();
setTimeout(function() {
$button.click();
},1000);
},1000);
}
setInterval(roll, 2000)
Here are the two functions
if(inDynamicEditMode == 0){
function payx() {
$pay.click()
document.getElementById("oddsInput").value = "1.2";
$odds.click()
}
if(inDynamicEditMode == 1){
function payx() {
$pay.click()
document.getElementById("oddsInput").value = "5.2";
$odds.click()
}