Professional Documents
Culture Documents
message (1)
message (1)
(function () {
'use strict';
// vars
var slider_val = "1";
var tower_val = "1";
var bombvar = false;
var newcolor = "";
let update = document.createElement('div');
var menuContainer = document.createElement('div');
var changeColor = document.createElement('input');
var guiContent = document.createElement('div');
let currentMethod = "pastGames";
let credits = {
'made_by': 'coxy57'
}
// vars
GM_addStyle(`
@keyframes textGlow {
0% { text-shadow: 0 0 15px #ff00ff, 0 0 30px #ff00ff, 0 0 45px #ff00ff;
opacity: 1; }
50% { text-shadow: 0 0 30px #ff00ff, 0 0 45px #ff00ff, 0 0 60px
#ff00ff; opacity: 0.8; }
100% { text-shadow: 0 0 15px #ff00ff, 0 0 30px #ff00ff, 0 0 45px
#ff00ff; opacity: 0; }
}
.coxy57 {
}
#towerGlow {
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
background-color: #01ff70;
width: 100px;
height: 100px;
border-radius: 10px;
box-shadow: 0 0 10px 5px #01ff70;
animation: glowEffect 2s infinite alternate;
}
@keyframes glowEffect {
0% {
box-shadow: 0 0 10px 5px #01ff70;
}
100% {
box-shadow: 0 0 30px 15px #01ff70;
}
}
#overlay {
position: fixed;
top: 18px;
right: 600px;
display: flex;
justify-content: space-around;
align-items: center;
z-index: 9999;
}
#buttonsContainer {
display: flex;
gap: 1em;
}
#customg {
margin-bottom: 15px;
position: fixed;
bottom: 0;
left: 10px;
width: calc(100% - 20px);
background-color: white;
display: flex;
justify-content: space-between;
padding: 10px;
font-size: 20px;
z-index: 9999;
border-radius: 15px;
}
.custom-ele {
color: black;
cursor: pointer;
margin: 0 10px;
transition: background-color 0.3s ease;
border-radius: 5px;
}
.custom-ele:hover {
background-color: #cccccc;
border-radius: 5px;
}
.custom-ele.clicked {
background-color: #cccccc;
border-radius: 5px;
}
.custom-button {
border-radius: 7px;
background-color: rgb(40, 46, 84);
color: #8690BF;
border: none;
padding: 10px 22px;
cursor: pointer;
font-size: 14px;
display: flex;
align-items: center;
justify-content: center;
margin-right: 10px;
}
.custom-button:hover {
background-color: rgb(30, 36, 64);
}
.coxy57test {
}
#guiContainer {
display: none;
position: fixed;
top: 0;
left: 0;
width: 100%
height: 100%
background: rgba(0, 0, 0, 0.7);
z-index: 9999;
}
#guiContent {
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 400px;
height 2000px;
background: linear-gradient(45deg, #8e44ad, #9b59b6, #a569bd, #bb8fce,
#d2b4e9);
border-radius: 10px;
padding: 20px;
color: #FFF;
z-index: 10000;
}
#guiTitle {
font-size: 18px;
font-weight: bold;
margin-bottom: 10px;
text-align: center;
}
#guiMonkeyCoxy57 {
font-size: 10px;
margin-bottom: 10px;
}
.gui-button-container {
display: flex;
justify-content: space-around;
margin-top: 20px;
}
.gui-button {
background-color: #fff;
color: #3498db;
padding: 12px;
margin: 8px;
border: none;
border-radius: 8px;
cursor: pointer;
font-size: 14px;
transition: background-color 0.3s, color 0.3s;
font-weight: bold;
}
.gui-button:hover {
background-color: #1e2440;
}
#closeButton {
position: absolute;
top: 10px;
right: 10px;
width: 30px;
height: 30px;
background-color: red;
border-radius: 50%;
display: flex;
justify-content: center;
align-items: center;
cursor: pointer;
color: black;
background-color: #2c344e;
color: #fff;
transition: background-color 0.3s, color 0.3s;
}
.slider {
width: 100%;
}
#nigga {
width: 100%;
padding: 10px;
border: none;
border-radius: 5px;
background: linear-gradient(45deg, #8e44ad, #9b59b6, #a569bd, #bb8fce,
#d2b4e9);
color: #FFF;
font-weight: bold;
cursor: pointer;
}
button:hover {
background-color: #5e6a9f;
}
#main-menu {
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
z-index: 9999;
display: flex;
flex-direction: column;
width: 300px;
height: 550px;
padding: 20px;
background: #6495ED;
border-radius: 15px;
box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
color: #fff;
}
#main-title {
color: #fff;
display: flex;
justify-content: space-between;
align-items: center;
font-size: 20px;
font-weight: bold;
margin-bottom: 10px;
}
#settings-item {
color: #3498db;
display: flex;
justify-content: space-between;
align-items: center;
font-size: 20px;
font-weight: bold;
background-color: white;
margin-bottom: 10px;
border-radius: 8px;
padding: 5px;
}
#basic-title {
color: #fff;
display: flex;
font-size: 15px;
font-weight: bold;
align-items: center;
border: none;
border-radius: 8px;
}
#settings-icon {
cursor: pointer;
font-size: 20px;
}
.button-x {
font-weight: bold;
background-color: #fff;
color: #3498db;
padding: 12px;
margin: 8px;
border: none;
margin-bottom: 15px;
border-radius: 8px;
cursor: pointer;
font-size: 14px;
transition: background-color 0.3s, color 0.3s;
}
.button-notif {
margin-top: 10px;
width: 150px;
height: 50px;
padding: 10px;
font-size: 15px;
background-color: #fff;
color: #6495ED;
border: 1px solid #6495ED;
border-radius: 5px;
cursor: pointer;
}
.button-x:hover {
background-color: #1e2440;
}
#main-content {
margin-top: 10px;
}
#button-section {
display: flex;
flex-direction: column;
}
#notificationBox {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
width: 400px;
height: 200px;
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
padding: 20px;
border: 1px solid gray;
z-index: 9999;
background-color: #6495ED;
border-radius: 15px;
box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
color: #fff;
opacity: 0;
transition: opacity 0.5s ease-in-out;
}
#notificationBox.show {
opacity: 1;
}
.notificationLabel {
font-size: 18px;
font-weight: bold;
text-align: center;
display: block;
}
.mines-highlight {
background-color: lightgreen;
box-shadow: 0 0 10px rgba(0, 255, 0, 0.7);
transition: background-color 0.5s ease, box-shadow 0.3s ease;
}
@keyframes pulse {
0% {
transform: scale(1);
}
50% {
transform: scale(1.1);
}
100% {
transform: scale(1);
}
}
.mines-highlight:hover {
animation: pulse 1s infinite;
}
.cartoontxt {
font-family: 'Comic Sans MS', cursive, sans-serif;
font-size: 36px;
font-weight: bold;
color: white;
text-align: center;
text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}
.glowing-background {
box-shadow: 0 0 10px 2px #00ff00;
}
@keyframes glow {
0% {
box-shadow: 0 0 10px 5px rgba(0, 255, 0, 0.8);
}
100% {
box-shadow: 0 0 20px 10px rgba(0, 255, 0, 0.2);
}
}
`);
// credits go to coxy.57 for the mine prediction
function load_presets() {
const tower = localStorage.getItem('coxypredtowers');
const mines = localStorage.getItem('coxypredmines');
const theme = localStorage.getItem('coxypredtheme');
if (tower) {
tower_val = tower.toString();
}
if (mines) {
slider_val = mines.toString()
}
if (theme) {
changeColor.style.value = theme.toString();
menuContainer.style.background = theme.toString();
guiContent.style.background = theme.toString();
}
}
function wait(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
function checkingame(callback,gamemode) {
GM_xmlhttpRequest({
method: 'GET',
url: 'https://api.bloxflip.com/games/' + gamemode,
onload: function (response) {
const ingame = JSON.parse(response.responseText);
const g = ingame.hasGame
callback(g)
},
headers: {
"x-auth-token": localStorage.getItem('_DO_NOT_SHARE_BLOXFLIP_TOKEN')
},
onerror: function (error) {
console.log(error);
}
});
}
function glowEle(element) {
element.classList.add('glowing-background');
}
function notification(t) {
const box = document.createElement('div');
const text = document.createElement('label');
text.textContent = t;
text.className = "notificationLabel"
box.id = "notificationBox";
box.appendChild(text);
box.appendChild(button);
document.body.appendChild(box);
setTimeout(function() {
box.classList.add('show');
}, 100);
function saveData(b,item) {
localStorage.setItem("coxypred" + b,item);
}
function towersPred(difficulty) {
const size = 1000;
const num = 0;
const apiurl = `https://api.bloxflip.com/games/towers/history?size=$
{size}&page=${num}`;
switch (currentMethod) {
case "pastGames":
GM_xmlhttpRequest({
method: "GET",
url: apiurl,
headers: {
"x-auth-token":
localStorage.getItem('_DO_NOT_SHARE_BLOXFLIP_TOKEN')
},
onload: function (response) {
const made_by = ["coxy_57"];
const data = JSON.parse(response.responseText);
const new_data = data.data;
const filter_data = new_data.filter(item =>
item.completedLevels.length >= 1);
const final = filter_data[0].towerLevels;
update.style.fontSize = "13px";
const nn = final.flatMap((row, rowIndex) =>
row.map((element, colIndex) => {
const value = element === 1 ? '✅' : element === 0 ? '❌'
: element;
return colIndex !== row.length - 1 ? value : (colIndex
% 3 === 2) ? value + '<br>' : value;
})
);
update.innerHTML = nn.join('');
case "Neighbors":
GM_xmlhttpRequest({
method: "GET",
url: apiurl,
headers: {
"x-auth-token":
localStorage.getItem('_DO_NOT_SHARE_BLOXFLIP_TOKEN')
},
onload: function (response) {
const made_by = ["coxy_57"];
const data = JSON.parse(response.responseText);
const new_data = data.data;
const filter_data = new_data.filter(item =>
item.completedLevels.length >= 1);
const final = filter_data[0].towerLevels;
const towerNigga = []
for (let i = 0; i < final.length; i++) {
let towerLevel = final[i]
const get_safes = towerLevel.reduce((acc, value, index)
=> (value === 0 ? acc.concat(index) : acc), []);
const eq = Math.abs((get_safes[0] + get_safes[1]))
const n = Math.min(eq,2);
const newRow = new Array(3).fill(0);
newRow[n] = 1
towerNigga.push(newRow)
}
update.style.fontSize = "13px";
const nn = towerNigga.flatMap((row, rowIndex) =>
row.map((element, colIndex) => {
const value = element === 1 ? '✅' : element === 0 ? '❌'
: element;
return colIndex !== row.length - 1 ? value : (colIndex
% 3 === 2) ? value + '<br>' : value;
})
);
update.innerHTML = nn.join('');
function towersAutoPlay(leavegamebtn) {
const size = 1000;
const num = 0;
const apiurl = `https://api.bloxflip.com/games/towers/history?size=$
{size}&page=${num}`;
GM_xmlhttpRequest({
method: "GET",
url: apiurl,
headers: {
"x-auth-token":
localStorage.getItem('_DO_NOT_SHARE_BLOXFLIP_TOKEN')
},
onload: function (response) {
const made_by = ["coxy_57"];
const data = JSON.parse(response.responseText);
const new_data = data.data;
const filter_data = new_data.filter(item =>
item.completedLevels.length >= 1);
const final = filter_data[0].towerLevels;
var checker = 0;
function autoplayMines(mineAmount,j) {
// credits go to coxy.57 for the mine prediction
GM_xmlhttpRequest({
method: 'GET',
url: 'https://api.bloxflip.com/games/mines/history?size=5000&page=0',
onload: function (response) {
const getbomb = JSON.parse(response.responseText);
const mines = getbomb.data.filter(item => item.minesAmount === mineAmount);
const minelocs = mines.map(item => item.mineLocations)
var on = minelocs.flatMap(row => row).slice(0,13);
const dix = document.querySelector('#__next > div.layout_layout__JvcqL >
div > div.layout_layoutColumn__e9oxs > div.game-layout_gameLayout__bgIOR >
div.game-layout_gameLayoutColumn__q01vS.game-layout_gameLayoutColumnRight__oj_7g >
div > div');
if (dix) {
var coxy57 = 0;
// credits go to coxy.57 for the mine prediction
const spots = dix.querySelectorAll('button');
for (const s of on) {
if (coxy57 < parseInt(slider_val)) {
spots[s].click();
coxy57 ++;
// credits go to coxy.57 for the mine prediction
} else {
break;
}
};
checkingame(function (response) {
if (response) {
console.log('clicked');
setTimeout(function () {
j.click();
},4000);
} else {
console.log('Not in game. You have died.');
}
});
} else {
// credits go to coxy.57 for the mine prediction
console.log('Could not get DIV.');
}
},
headers: {
"x-auth-token": localStorage.getItem('_DO_NOT_SHARE_BLOXFLIP_TOKEN')
},
onerror: function (error) {
console.log(error);
}
});
}
function calculateDistance(pt1, pt2) {
const x1 = Math.floor(pt1 / 5);
const y1 = pt1 % 5;
const x2 = Math.floor(pt2 / 5);
const y2 = pt2 % 5;
return Math.sqrt(Math.pow((x1 - x2), 2) + Math.pow((y1 - y2), 2));
}
function bombLocationAlgo(mineAmount) {
// credits go to coxy.57 for the mine prediction
GM_xmlhttpRequest({
method: 'GET',
url: 'https://api.bloxflip.com/games/mines/history?size=5000&page=0',
onload: function (response) {
const getbomb = JSON.parse(response.responseText);
const mines = getbomb.data.filter(item => item.minesAmount === mineAmount);
const minelocs = mines.map(item => item.uncoveredLocations)
var on = minelocs.flatMap(row => row).slice(0,13);
const dix = document.querySelector('#__next > div.layout_layout__JvcqL >
div > div.layout_layoutColumn__e9oxs > div.game-layout_gameLayout__bgIOR >
div.game-layout_gameLayoutColumn__q01vS.game-layout_gameLayoutColumnRight__oj_7g >
div > div');
if (dix) {
var coxy57 = 0;
// credits go to coxy.57 for the mine prediction
const spots = dix.querySelectorAll('button');
for (const button of on) {
if (coxy57 < parseInt(slider_val)) {
spots[button].style.boxShadow = '0 0 30px #ff0000, 0 0 20px #ff0000,
0 0 30px #ff0000';
coxy57 += 1;
} else {
break;
}
};
} else {
// credits go to coxy.57 for the mine prediction
console.log('Could not get DIV.');
}
},
headers: {
"x-auth-token": localStorage.getItem('_DO_NOT_SHARE_BLOXFLIP_TOKEN')
},
onerror: function (error) {
console.log(error);
}
});
}
function caculateAverage(data) {
const weights = [1, 2, 1, 3];
const weightn = weights && weights.length === data.length
? data.map((num, i) => num * weights[i])
: data;
const sortedn = [...weightn].sort((a, b) => a - b);
const trimmed = Math.round(10 * sortedn.length / 100);
const getfinal = sortedn.slice(trimmed, sortedn.length - trimmed);
return Number(average.toFixed(3));
}
function crashPred(history) {
switch (currentMethod) {
case "pastGames":
var c = history.map(item => item.crashPoint);
var prediction = caculateAverage(c)
notification('Predicted Crashpoint: ' + prediction)
break;
case "Neighbors":
break;
default:
console.log(currentMethod)
}
}
function roulettePred(history, currentMethod) {
switch (currentMethod) {
case "pastGames": {
const colors = history.map(item => item.winningColor);
function train_model(data) {
const model = {};
if (!model[cc]) {
model[cc] = {};
}
if (!model[cc][nc]) {
model[cc][nc] = 1;
} else {
model[cc][nc]++;
}
}
return model;
}
if (!possible) {
const counts = data.reduce((acc, color) => {
acc[color] = (acc[color] || 0) + 1;
return acc;
}, {});
const vd = Math.random();
let probability = 0;
return last;
}
if (predict) {
notification('Predicted color: ' + predict);
} else {
notification('An error occurred while trying to predict
color.');
}
break;
}
case "Neighbors":
console.log('neighbor not working yet');
// Implement Neighbors case here
break;
default:
console.log(currentMethod);
}
}
function minesPred(mineAmount) {
switch (currentMethod) {
case "pastGames":
// Credits go to coxy.57 for the mine prediction
GM_xmlhttpRequest({
method: 'GET',
url: 'https://api.bloxflip.com/games/mines/history?
size=5000&page=0',
onload: function (response) {
update.style.marginLeft = "0px";
const getbomb = JSON.parse(response.responseText);
const mines = getbomb.data.filter(item => item.minesAmount
=== mineAmount);
const minelocs = mines.map(item => item.mineLocations)
var on = minelocs.flatMap(row => row).slice(0, 13);
var org = 0
const fit = Array.from({ length: 25 }).fill(0);
for (const button of on) {
if (org < parseInt(slider_val)) {
fit[button] = 1
org++
} else {
break;
}
}
const rr = fit
.map(bit => (bit === 1 ? '✔️
' : '❌'))
.map((symbol, index) => (index % 5 === 4 ? symbol +
'<br>' : symbol))
.join('');
update.innerHTML = rr;
const dix = document.querySelector('#__next >
div.layout_layout__JvcqL > div > div.layout_layoutColumn__e9oxs > div.game-
layout_gameLayout__bgIOR > div.game-layout_gameLayoutColumn__q01vS.game-
layout_gameLayoutColumnRight__oj_7g > div > div');
if (dix) {
var coxy57 = 0;
// Credits go to coxy.57 for the mine prediction
const spots = dix.querySelectorAll('button');
spots.forEach(button => {
button.classList.remove('mines-highlight');
});
if (bombvar) {
bombLocationAlgo(mineAmount);
}
for (const button of on) {
if (coxy57 < parseInt(slider_val)) {
spots[button].classList.add('mines-highlight');
coxy57 += 1;
} else {
break;
}
};
update.style.marginLeft = "10px";
} else {
// Credits go to coxy.57 for the mine prediction
console.log('Could not get DIV.');
}
},
headers: {
"x-auth-token":
localStorage.getItem('_DO_NOT_SHARE_BLOXFLIP_TOKEN')
},
onerror: function (error) {
console.log(error);
}
});
break;
case "Neighbors":
// Credits go to coxy.57 for the mine prediction
GM_xmlhttpRequest({
method: 'GET',
url: 'https://api.bloxflip.com/games/mines/history?
size=5000&page=0',
onload: function (response) {
update.style.marginLeft = "0px";
const getbomb = JSON.parse(response.responseText);
const mines = getbomb.data.filter(item => item.minesAmount
=== mineAmount);
const minelocs = mines.map(item => item.uncoveredLocations)
var on = minelocs.flatMap(row => row).slice(0, 100);
var org = 0
const fit = Array.from({ length: 25 }).fill(0);
for (const button of on) {
if (org < parseInt(slider_val)) {
try {
fit[button] = 1
org++
} catch (e) {
console.log(e);
}
} else {
break;
}
}
const rr = fit
.map(bit => (bit === 1 ? ' ' : '❌'))
.map((symbol, index) => (index % 5 === 4 ? symbol +
'<br>' : symbol))
.join('');
update.innerHTML = rr;
const dix = document.querySelector('#__next >
div.layout_layout__JvcqL > div > div.layout_layoutColumn__e9oxs > div.game-
layout_gameLayout__bgIOR > div.game-layout_gameLayoutColumn__q01vS.game-
layout_gameLayoutColumnRight__oj_7g > div > div');
if (dix) {
var coxy57 = 0;
// Credits go to coxy.57 for the mine prediction
const spots = dix.querySelectorAll('button');
spots.forEach(button => {
button.classList.remove('mines-highlight');
});
if (bombvar) {
bombLocationAlgo(mineAmount);
}
for (const button of on) {
if (coxy57 < parseInt(slider_val)) {
spots[button].classList.add('mines-highlight');
coxy57 += 1;
} else {
break;
}
};
update.style.marginLeft = "10px";
} else {
// Credits go to coxy.57 for the mine prediction
console.log('Could not get DIV.');
}
},
headers: {
"x-auth-token":
localStorage.getItem('_DO_NOT_SHARE_BLOXFLIP_TOKEN')
},
onerror: function (error) {
console.log(error);
}
});
break;
case "CoxyAlgorithm":
// Credits go to coxy.57 for the mine prediction
GM_xmlhttpRequest({
method: 'GET',
url: 'https://api.bloxflip.com/games/mines/history?
size=5000&page=0',
onload: function (response) {
update.style.marginLeft = "0px";
const getbomb = JSON.parse(response.responseText);
const mines = getbomb.data.filter(item => item.minesAmount
=== mineAmount);
const minelocs = mines.map(item => item.mineLocations)
var on = minelocs.flatMap(row => row).slice(0, 100);
var org = 0
const fit = Array.from({ length: 25 }).fill(0);
let counter = 0;
for (let i = 0; i < on.length - 1; i++) {
const dist =
Math.min(Math.round(calculateDistance(on[i], on[i + 1])), 24);
if (fit[dist] === 1) {
continue;
} else {
fit[dist] = 1;
counter++;
}
update.id = "basic-title";
update.style.marginLeft = "10px";
update.style.display = 'flex';
update.style.alignItems = 'center';
update.style.justifyContent = 'center';
const mc = document.createElement('div');
mc.id = 'main-content';
// coxy 57 made this predictor ong
// coxy 57 made this predictor ong
// coxy 57 made this predictor ong
// coxy 57 made this predictor ong
const buttonsec = document.createElement('div');
buttonsec.id = 'button-section';
mc.appendChild(buttonsec);
buttonsec.appendChild(update);
selectBox.addEventListener("change",function() {
currentMethod = selectBox.value;
});
cc.addEventListener('change', function() {
if (cc.checked) {
bombvar = true;
} else {
bombvar = false;
}
});
var hideusername = document.createElement('label');
hideusername.textContent = 'Streamer Mode';
hideusername.id = 'settings-item';
hideusername.style.display = 'flex';
hideusername.style.alignItems = 'center';
// coxy 57 made this predictor ong
// coxy 57 made this predictor ong
// coxy 57 made this predictor ong
// coxy 57 made this predictor ong
// coxy 57 made this predictor ong
var usernametxt = document.createElement('input');
usernametxt.type = 'checkbox';
usernametxt.style.marginRight = '10px';
usernametxt.style.transform = 'scale(1.5)';
usernametxt.style.verticalAlign = 'middle';
usernametxt.style.borderRadius = "10px";
usernametxt.style.border = "3px solid white";
usernametxt.addEventListener('change', function() {
if (usernametxt.checked) {
userSettingsProfile.style.filter = "blur(15px)";
const profileonpage = document.querySelector('#__next >
div.layout_layout__JvcqL > header > div > div.header_headerUser__8phtj > a > span >
span:nth-child(1) > img');
profileonpage.style.filter = "blur(15px)";
const profilebox = document.querySelector('#__next >
div.layout_layout__JvcqL > div > div.layout_layoutColumn__e9oxs > section >
div.Profile_profileMain__llT4J');
profilebox.style.filter = "blur(20px)";
} else {
const robuxamt = document.querySelector('#__next >
div.layout_layout__JvcqL > header > div > div.header_headerUser__8phtj > div > div
> span > span');
robuxamt.style.filter = "";
userSettingsProfile.style.filter = "";
const profileonpage = document.querySelector('#__next >
div.layout_layout__JvcqL > header > div > div.header_headerUser__8phtj > a > span >
span:nth-child(1) > img');
profileonpage.style.filter = "";
}
});
var displayTheme = document.createElement('label');
displayTheme.textContent = 'Theme';
displayTheme.id = 'settings-item';
displayTheme.style.display = 'flex';
displayTheme.style.alignItems = 'center';
var displayThemeInput = document.createElement('input');
displayThemeInput.type = "color";
displayThemeInput.style.width = '30px';
displayThemeInput.className = "slider";
displayThemeInput.style.border = '5px';
displayThemeInput.style.border = '2px solid #ccc';
displayThemeInput.style.borderRadius = '5px';
var newColor = "";
displayThemeInput.addEventListener("input",function() {
saveData('theme',changeColor.value)
newColor = displayThemeInput.value
displayThemeInput.style.value = newColor;
menuContainer.style.background = newColor;
guiContent.style.background = newColor;
});
var tilesML = document.createElement('label');
tilesML.textContent = 'Towers';
tilesML.id = 'settings-item';
tilesML.style.display = 'flex';
tilesML.style.alignItems = 'center';
const towersSlider = document.createElement('input');
towersSlider.className = "coxy57";
towersSlider.type = 'range';
towersSlider.min = '1';
towersSlider.max = '8';
towersSlider.value = slider_val;
towersSlider.style.marginRight = '10px';
towersSlider.style.transform = 'scale(0.8)';
towersSlider.style.verticalAlign = 'middle';
towersSlider.style.borderRadius = "10px";
towersSlider.style.border = "3px solid white";
var tilesLabel = document.createElement('label');
tilesLabel.textContent = 'Mines';
tilesLabel.id = 'settings-item';
tilesLabel.style.display = 'flex';
tilesLabel.style.alignItems = 'center';
const tileSlider = document.createElement('input');
tileSlider.className = "coxy57";
tileSlider.type = 'range';
tileSlider.min = '1';
tileSlider.max = '14';
tileSlider.value = slider_val;
tileSlider.style.marginRight = '10px';
tileSlider.style.transform = 'scale(0.8)';
tileSlider.style.verticalAlign = 'middle';
tileSlider.style.borderRadius = "10px";
tileSlider.style.border = "3px solid white";
var mainSection = document.createElement('label');
mainSection.textContent = 'Main';
mainSection.className = "cartoontxt";
mainSection.style.display = 'flex';
mainSection.style.alignItems = 'center';
var section2 = document.createElement('label');
section2.textContent = `Sliders [${towersSlider.value}|${tileSlider.value}]`;
section2.className = "cartoontxt";
section2.style.display = 'flex';
section2.style.alignItems = 'center';
var unrigButton = document.createElement('button');
unrigButton.textContent = 'Unrig V1';
unrigButton.id = 'settings-item';
unrigButton.style.display = 'flex';
unrigButton.style.alignItems = 'center';
var unrigButton2 = document.createElement('button');
unrigButton2.textContent = 'Unrig V2';
unrigButton2.id = 'settings-item';
unrigButton2.style.display = 'flex';
unrigButton2.style.alignItems = 'center';
unrigButton.addEventListener('click', function () {
GM_xmlhttpRequest({
url: 'https://api.bloxflip.com/provably-fair',
headers: {
'x-auth-token':
localStorage.getItem('_DO_NOT_SHARE_BLOXFLIP_TOKEN')
},
onload: function (response) {
const j = JSON.parse(response.responseText).serverHash
newSeed(function (valid) {
if (valid) {
notification('You have been successfully unrigged! [V1]');
} else {
notification('An error happened while trying to unrig');
}
});
}
});
});
unrigButton2.addEventListener('click', function () {
GM_xmlhttpRequest({
url: 'https://api.bloxflip.com/provably-fair',
headers: {
'x-auth-token':
localStorage.getItem('_DO_NOT_SHARE_BLOXFLIP_TOKEN')
},
onload: function (response) {
const j = JSON.parse(response.responseText).serverHash
newUNRIG(function (valid) {
if (valid) {
notification('You have been successfully unrigged! [V2]');
} else {
notification('An error happened while trying to unrig');
}
});
}
});
});
towersSlider.addEventListener('input',function() {
section2.textContent = `Sliders [${towersSlider.value}|${tileSlider.value}]`;
tower_val = towersSlider.value;
});
tileSlider.addEventListener('input', function () {
section2.textContent = `Sliders [${towersSlider.value}|${tileSlider.value}]`;
slider_val = tileSlider.value;
});
hideusername.style.display = "none";
bombtext.style.display = "none";
displayThemeInput.style.display = "none";
tilesLabel.style.display = "none";
tilesML.appendChild(towersSlider);
tilesLabel.appendChild(tileSlider);
bombtext.appendChild(cc);
hideusername.appendChild(usernametxt);
displayTheme.appendChild(displayThemeInput);
getUserData(function(response) {
update.style.display = "block";
const username = response.user.robloxUsername;
const id = response.user.robloxId;
const wagered = response.wager.toFixed(2);
const totalDepo = response.totalDeposited.toFixed(2);
const timezone = Intl.DateTimeFormat().resolvedOptions().timeZone;
});
});
predictElement.addEventListener("click", function() {
mainSection.style.display = "none";
section2.style.display = "none";
displayTheme.style.display = "none";
bombtext.style.display = "none";
hideusername.style.display = "none";
update.innerHTML = "";
gamemodeSelector.style.display = "block";
autoplay.style.display = "block";
selectBox.style.display = "block";
update.style.display = "flex";
tilesLabel.style.display = "none";
tilesML.style.display = "none";
tilesLabel.style.display = "none";
unrigButton.style.display = "none";
unrigButton2.style.display = "none";
});
function startDrag(e) {
const nighg = e.target.tagName === 'INPUT' || e.target.tagName ===
'SELECT' ||
e.target.closest('input') || e.target.closest('select');
if (!nighg) {
isBeingDragged = true;
document.addEventListener('mousemove', handleDrag);
document.addEventListener('mouseup', stopDrag);
}
}
function handleDrag(e) {
if (isBeingDragged) {
const x = e.clientX - offsetX;
const y = e.clientY - offsetY;
elem.style.left = `${x}px`;
elem.style.top = `${y}px`;
}
}
function stopDrag() {
if (isBeingDragged) {
isBeingDragged = false;
document.removeEventListener('mousemove', handleDrag);
document.removeEventListener('mouseup', stopDrag);
}
}
elem.addEventListener('mousedown', startDrag);
function destroy() {
elem.removeEventListener('mousedown', startDrag);
stopDrag();
}
return {
destroy: destroy
};
}
function crashStart() {
GM_xmlhttpRequest({
method: 'GET',
url: 'https://api.bloxflip.com/games/crash',
onload: function (response) {
const ingame = JSON.parse(response.responseText);
const g = ingame.current.status
if (g === 2) {
crashPred(ingame.history)
} else {
notification('You have to wait until next crash game to predict.');
}
},
headers: {
"x-auth-token": localStorage.getItem('_DO_NOT_SHARE_BLOXFLIP_TOKEN')
},
onerror: function (error) {
console.log(error);
}
});
}
function rouletteStart() {
GM_xmlhttpRequest({
method: 'GET',
url: 'https://api.bloxflip.com/games/roulette',
onload: function (response) {
const ingame = JSON.parse(response.responseText);
const joinable = ingame.current.joinable
if (joinable) {
roulettePred(ingame.history)
} else {
notification('You have to wait until next slide game to predict.');
}
},
headers: {
"x-auth-token": localStorage.getItem('_DO_NOT_SHARE_BLOXFLIP_TOKEN')
},
onerror: function (error) {
console.log(error);
}
});
}
gamemodeSelector.addEventListener('click', function () {
const pathname = window.location.pathname
switch (pathname) {
case "/mines":
minesStart();
break;
case "/towers":
towersStart();
break;
case "/crash":
crashStart();
break;
case "/roulette":
rouletteStart();
break;
default:
notification("Cannot predict " + pathname.split('/')[1] + '
gamemode.');
break;
}
});
function blah(j) {
const pathname = window.location.pathname;
switch (pathname) {
case "/mines":
GM_xmlhttpRequest({
method: 'GET',
url: 'https://api.bloxflip.com/games/mines',
onload: function (response) {
const ingame = JSON.parse(response.responseText);
autoplayMines(ingame.game.minesAmount, j);
},
headers: {
"x-auth-token":
localStorage.getItem('_DO_NOT_SHARE_BLOXFLIP_TOKEN')
},
onerror: function (error) {
console.error(error);
}
});
break;
case "/towers":
GM_xmlhttpRequest({
method: 'GET',
url: 'https://api.bloxflip.com/games/towers',
onload: function (response) {
const ingame = JSON.parse(response.responseText);
towersAutoPlay(j);
},
headers: {
"x-auth-token":
localStorage.getItem('_DO_NOT_SHARE_BLOXFLIP_TOKEN')
},
onerror: function (error) {
console.error(error);
}
});
break;
}
}
autoplay.addEventListener('click', function() {
GM_xmlhttpRequest({
url: 'https://api.bloxflip.com/provably-fair',
headers: {
'x-auth-token': localStorage.getItem('_DO_NOT_SHARE_BLOXFLIP_TOKEN')
},
onload: function (response) {
const j = JSON.parse(response.responseText).serverHash;
newSeed(function (valid) {
if (valid) {
notification('You have been successfully unrigged!');
} else {
notification('An error happened while trying to unrig.');
}
});
}
});
var joingame = document.querySelector('#__next > div.layout_layout__JvcqL >
div > div.layout_layoutColumn__e9oxs > div.game-layout_gameLayout__bgIOR >
div.game-layout_gameLayoutColumn__q01vS.game-layout_gameLayoutColumnLeft__55fuZ >
div > button')
joingame.click();
setTimeout(function () {
blah(joingame);
},2000)
});
}
function guicreate() {
const body = document.querySelector('body');
if (body) {
const guiContainer = document.createElement('div');
guiContainer.id = 'guiContainer';
body.appendChild(guiContainer);
}
}
guicreate();
buttoncreate();
load_presets();
})();