You are on page 1of 15

// ==UserScript==

// @name SHITTY MYSTIC - provided by lifetime mystic customer (who


suspected it was randomized)
// @namespace Molly <-- daddy of us all (LunaR's daddy)
// @description LunaR-V4 Test
// @include https://bloxflip.com/*
// @version 0.1
// @grant GM_addStyle
// @grant GM_xmlhttpRequest
// @require https://code.jquery.com/jquery-3.7.1.min.js
// ==/UserScript==

let container = document.createElement("div");


container.className = "Mysticcontainer";
container.style.position = "fixed";
container.style.backgroundPosition = 'center';
container.style.top = '50%';
container.style.left = '50%';
container.style.transform = 'translate(-50%, -50%)';
container.style.zIndex = 9999;
container.style.boxShadow = '0 0 10px 0 rgba(0, 0, 0, 0.5)';
document.body.appendChild(container);

let text = document.createElement("div");


text.className = "MysticWelcomeText";
text.innerHTML = "Welcome To Mystic V2.0";
text.style.fontSize = "30px";
text.style.textAlign = "center";
text.style.color = "white";
text.style.position = "relative";
text.style.top = "50%";
text.style.left = "50%";
text.style.transform = 'translate(-50%, -50%)';
text.style.whiteSpace = "nowrap";
text.style.width = "100%";
container.appendChild(text);

let tabBox = document.createElement("div");


tabBox.className = "TabBox";
tabBox.style.width = "180px";
tabBox.style.height = "295px";
tabBox.style.borderRadius = "15px";
tabBox.style.backgroundColor = "rgba(61, 61, 61, 0.2)";
tabBox.style.position = "absolute";
tabBox.style.top = "10px";
tabBox.style.left = "10px";
tabBox.style.opacity = 0;
container.appendChild(tabBox);

let userProfileBox = document.createElement("div");


userProfileBox.className = "UserProfileBox";
userProfileBox.style.width = "175px";
userProfileBox.style.height = "58px";
userProfileBox.style.backgroundColor = "rgba(61, 61, 61, 0.2)";
userProfileBox.style.position = "absolute";
userProfileBox.style.bottom = "10px";
userProfileBox.style.left = "10px";
userProfileBox.style.borderRadius = "15px";
userProfileBox.style.opacity = 0;
container.appendChild(userProfileBox);

let userProfilePicture = document.createElement("img");


userProfilePicture.src = "niger";
userProfilePicture.style.width = "50px";
userProfilePicture.style.height = "50px";
userProfilePicture.style.borderRadius = "50%";
userProfilePicture.style.position = "absolute";
userProfilePicture.style.top = "4px";
userProfilePicture.style.left = "4px";
userProfilePicture.style.opacity = 0;
userProfileBox.appendChild(userProfilePicture);

let username = document.createElement("div");


username.innerHTML = "UNKNOWN"; // i mean >:(
username.style.color = "white";
username.style.position = "absolute";
username.style.top = "15px";
username.style.left = "70px";
username.style.opacity = 0;
username.style.whiteSpace = "nowrap";
username.style.fontSize = "14px";
userProfileBox.appendChild(username);

let contentBox = document.createElement("div");


contentBox.className = "ContentBox";
contentBox.style.width = "345px";
contentBox.style.height = "385px";
contentBox.style.backgroundColor = "rgba(61, 61, 61, 0.2)";
contentBox.style.position = "absolute";
contentBox.style.top = "10px";
contentBox.style.right = "10px";
contentBox.style.borderRadius = "15px";
contentBox.style.opacity = 0;
container.appendChild(contentBox);

let mainTab = document.createElement("div");


mainTab.className = "Tab";
mainTab.innerHTML = "Main";
mainTab.style.borderRadius = "10px";
mainTab.style.width = "100%";
mainTab.style.padding = "10px 0";
mainTab.style.backgroundColor = "rgba(61, 61, 61, 0.6)";
mainTab.style.color = "white";
mainTab.style.textAlign = "center";
mainTab.style.cursor = "pointer";
mainTab.style.fontSize = "14px";
tabBox.appendChild(mainTab);

const spacing = document.createElement("div");


spacing.style.height = "10px";
tabBox.appendChild(spacing);
let minesTab = document.createElement("div");
minesTab.className = "Tab";
minesTab.innerHTML = "Mines";
minesTab.style.borderRadius = "10px";
minesTab.style.width = "100%";
minesTab.style.padding = "10px 0";
minesTab.style.backgroundColor = "rgba(61, 61, 61, 0.6)";
minesTab.style.color = "white";
minesTab.style.textAlign = "center";
minesTab.style.cursor = "pointer";
minesTab.style.fontSize = "14px";
tabBox.appendChild(minesTab);

const spacing_1 = document.createElement("div");


spacing_1.style.height = "10px";
tabBox.appendChild(spacing_1);

let TowersTab = document.createElement("div");


TowersTab.className = "Tab";
TowersTab.innerHTML = "Towers";
TowersTab.style.borderRadius = "10px";
TowersTab.style.width = "100%";
TowersTab.style.padding = "10px 0";
TowersTab.style.backgroundColor = "rgba(61, 61, 61, 0.6)";
TowersTab.style.color = "white";
TowersTab.style.textAlign = "center";
TowersTab.style.cursor = "pointer";
TowersTab.style.fontSize = "14px";
tabBox.appendChild(TowersTab);

let displayPrediction = document.createElement('div');


displayPrediction.textContent = 'None';
displayPrediction.style.position = 'fixed';
displayPrediction.style.top = '50%';
displayPrediction.style.left = '60%';
displayPrediction.style.transform = 'translate(-50%, -50%)';
displayPrediction.style.fontSize = '20px';
displayPrediction.style.fontWeight = 'bold';
displayPrediction.style.display = 'block';
contentBox.appendChild(displayPrediction);

const spacing_2 = document.createElement("div");


spacing_2.style.height = "10px";
tabBox.appendChild(spacing_2);

let CrashTab = document.createElement("div");


CrashTab.className = "Tab";
CrashTab.innerHTML = "Crash";
CrashTab.style.borderRadius = "10px";
CrashTab.style.width = "100%";
CrashTab.style.padding = "10px 0";
CrashTab.style.backgroundColor = "rgba(61, 61, 61, 0.6)";
CrashTab.style.color = "white";
CrashTab.style.textAlign = "center";
CrashTab.style.cursor = "pointer";
CrashTab.style.fontSize = "14px";
tabBox.appendChild(CrashTab);
const spacing_3 = document.createElement("div");
spacing_3.style.height = "10px";
tabBox.appendChild(spacing_3);

let SlideTab = document.createElement("div");


SlideTab.className = "Tab";
SlideTab.innerHTML = "Slide";
SlideTab.style.borderRadius = "10px";
SlideTab.style.width = "100%";
SlideTab.style.padding = "10px 0";
SlideTab.style.backgroundColor = "rgba(61, 61, 61, 0.6)";
SlideTab.style.color = "white";
SlideTab.style.textAlign = "center";
SlideTab.style.cursor = "pointer";
SlideTab.style.fontSize = "14px";
tabBox.appendChild(SlideTab);
let number_of_tiles = document.createElement("div");
number_of_tiles.type = "text";
number_of_tiles.placeholder = "Number of tiles to predict";
number_of_tiles.style.fontSize = "14px";
number_of_tiles.style.fontFamily = "inherit";
number_of_tiles.style.width = "85%";
number_of_tiles.style.margin = "20px auto 0";
number_of_tiles.style.padding = "10px 0";
number_of_tiles.style.backgroundColor = "rgba(61, 61, 61, 0.6)";
number_of_tiles.style.color = "white";
number_of_tiles.style.textAlign = "center";
number_of_tiles.style.cursor = "pointer";
number_of_tiles.style.display = "none";
contentBox.appendChild(number_of_tiles);
let predictButton = document.createElement("div");
predictButton.innerHTML = "Predict Safe-Spots";
predictButton.style.borderRadius = "10px";
predictButton.style.width = "85%";
predictButton.style.margin = "20px auto 0";
predictButton.style.padding = "10px 0";
predictButton.style.backgroundColor = "rgba(61, 61, 61, 0.6)";
predictButton.style.color = "white";
predictButton.style.textAlign = "center";
predictButton.style.cursor = "pointer";
predictButton.style.display = "none";
predictButton.style.fontSize = "14px";
contentBox.appendChild(predictButton);

let unrigButton = document.createElement("div");


unrigButton.innerHTML = "Unrig V2.0";
unrigButton.style.borderRadius = "10px";
unrigButton.style.width = "85%";
unrigButton.style.margin = "20px auto 0";
unrigButton.style.padding = "10px 0";
unrigButton.style.backgroundColor = "rgba(61, 61, 61, 0.6)";
unrigButton.style.color = "white";
unrigButton.style.textAlign = "center";
unrigButton.style.cursor = "pointer";
unrigButton.style.display = "none";
unrigButton.style.fontSize = "14px";
contentBox.appendChild(unrigButton);

unrigButton.addEventListener("click", function() {
const auth = localStorage.getItem('_DO_NOT_SHARE_BLOXFLIP_TOKEN');
if (!auth) {
console.error('[Mystic 2.0] Auth token not found in local storage.');
return;
}
const data = {
"mines": 3,
"betAmount": 5
}
for (let i = 0; i < 3; i++) {
GM_xmlhttpRequest({
method: 'POST',
url: `https://api.bloxflip.com/games/mines/create`,
data: JSON.stringify(data),
headers: {
'X-Auth-Token': auth,
},
onload: function(response) {
const data = response.responseText;
const mine = Math.floor(Math.random() * 25);
const dataactionmine = {
"cashout": false,
"mine": mine,
}
GM_xmlhttpRequest({
method: 'POST',
url: `https://api.bloxflip.com/games/mines/action`,
data: JSON.stringify(dataactionmine),
headers: {
'X-Auth-Token': auth,
},
onload: function(response) {
response = JSON.parse(response.responseText);
if (response.exploded == false) {
console.log("[Mystic 2.0] Unrig status: UNRIGGED");
} else {
alert("[Mystic 2.0] Unrig status: RIGGED");
return
}
var datacash = {
"cashout": true
}
GM_xmlhttpRequest({
method: 'POST',
url: `https://api.bloxflip.com/games/mines/action`,
data: JSON.stringify(datacash),
headers: {
'X-Auth-Token': auth,
},
onload: function(response) {
alert("[Mystic 2.0] Unrig status: UNRIGGED");
}
})
}
})
}
})
}
});
function minesPred() {
const allItems = document.querySelectorAll(".mines_minesGameItem__S2ytQ");
allItems.forEach(item => {
item.style.backgroundColor = '';
});

const auth = localStorage.getItem('_DO_NOT_SHARE_BLOXFLIP_TOKEN');

if (!auth) {
console.error('[Mystic 2.0] Auth token not found in local storage.');
return;
}
// alert('Note: Mines prediction will be slow due to slow api, this process will
take 15-25 seconds.')
GM_xmlhttpRequest({
method: 'GET',
url: `https://api.bloxflip.com/games/mines/history?size=50&page=0`,
headers: {
'X-Auth-Token': auth,
},
onload: function(response) {
const historyData = JSON.parse(response.responseText);
console.log(historyData);

if (historyData && historyData.data) {


const formData = new FormData();
formData.append('auth', auth);
formData.append('responsebloxflip', JSON.stringify(historyData));
//formData.append('numberOfMines', numberOfMines);

GM_xmlhttpRequest({
method: 'POST',
url: 'http://negrosdfdsfdfssdfsdff.lol/minesprediction',
data: formData,
headers: {
'Content-Type': 'application/x-www-form-urlencoded;
charset=UTF-8',
'auth': auth,
'responsebloxflip': JSON.stringify(historyData),
'numberOfMines': 5,
},
onload: function(response) {
const data = JSON.parse(response.responseText);
console.log(data);

if (data.error === 'Rig detected! play new game to unrig')


{
alert("Rig detected! Play a new game to unrig without
the predictor");
return;
}

const gridString = data.grid;


const grid = gridString.split('\n').map(row => row.split('
'));
const items =
document.querySelectorAll('.mines_minesGameItem__S2ytQ');
for (let i = 0; i < grid.length; i++) {
for (let j = 0; j < grid[i].length; j++) {
if (grid[i][j] === '1') {
const index = i * grid[i].length + j;
if (index < items.length) {
items[index].style.backgroundColor =
"rgb(50,205,50)";
}
}
if (grid[i][j] === '0') {
const index = i * grid[i].length + j;
if (index < items.length) {
items[index].style.backgroundColor =
"yellow";
}
}
}
}
},
onerror: function(error) {
console.error('[Mystic] Error in minesprediction:', error);
},
});
} else {
console.error('[Mystic] No data in the history response.');
}
},
onerror: function(error) {
console.error('[Mystic] Error in history request:', error);
},
});
};

GM_addStyle(`
@keyframes fade-in {
from { opacity: 0; }
to { opacity: 1; }
}
`);

function getprofilepic() {
const token = localStorage.getItem('_DO_NOT_SHARE_BLOXFLIP_TOKEN'); // this
nigger tried hiding ;)
GM_xmlhttpRequest({
method: 'GET',
url: 'https://api.bloxflip.com/user',
headers: {
'X-Auth-Token': token
},
onload: function(response) {
const data = JSON.parse(response.responseText);
const robloxId = data.user.robloxId;
const robloxUsername = "CrackedByLunaR"
const profilePictureUrl =
`https://cdn.discordapp.com/attachments/1184586264385687612/1191834431825125526/
image.png?
ex=65a6e14f&is=65946c4f&hm=afd6c2b12babc8896bd89c3c6d25f4d2d8775e0112c1538f4bd7a8d3
d0ae4f34&`;
userProfilePicture.src = profilePictureUrl;
username.innerHTML = robloxUsername;
}
});
}

setTimeout(function() {
getprofilepic(); // this fucker tried erroring but i cummed on it :/
tabBox.style.animation = 'fade-in 1s forwards';
userProfileBox.style.animation = 'fade-in 1s forwards';
userProfilePicture.style.animation = 'fade-in 1s forwards';
username.style.animation = 'fade-in 1s forwards';
contentBox.style.animation = 'fade-in 1s forwards';
minesTab.style.animation = 'fade-in 1s forwards';
predictButton.style.animation = 'fade-in 1s forwards';
unrigButton.style.animation = 'fade-in 1s forwards';

text.style.animation = 'fade-out 1s forwards';


setTimeout(function() {
text.remove();

}, 1000);
}, 1000);

GM_addStyle(`
.Mysticcontainer {
width: 569px;
height: 415px;
border-radius: 10px;
background-color: rgba(31, 31, 31, 1);
}

@keyframes fade-out {
from { opacity: 1; }
to { opacity: 0; }
}
@keyframes fade-in {
from { opacity: 0; }
to { opacity: 1; }
}

.TabBox {
/* Styles for the tab box */
}

.UserProfileBox {
/* Styles for the user profile box */
}
`);

// Function to make the GUI draggable


function makeDraggable(element) {
let pos1 = 0, pos2 = 0, pos3 = 0, pos4 = 0;
if (document.getElementById(element.id + "-header")) {
// If the element has a header/title, allow dragging from there
document.getElementById(element.id + "-header").onmousedown =
dragMouseDown;
} else {
// Otherwise, enable dragging from anywhere in the element
element.onmousedown = dragMouseDown;
}

function dragMouseDown(e) {
e = e || window.event;
e.preventDefault();
pos3 = e.clientX;
pos4 = e.clientY;
document.onmouseup = closeDragElement;
document.onmousemove = elementDrag;
}

function elementDrag(e) {
e = e || window.event;
e.preventDefault();
pos1 = pos3 - e.clientX;
pos2 = pos4 - e.clientY;
pos3 = e.clientX;
pos4 = e.clientY;
element.style.top = (element.offsetTop - pos2) + "px";
element.style.left = (element.offsetLeft - pos1) + "px";
}

function closeDragElement() {
document.onmouseup = null;
document.onmousemove = null;
}
}

// Make the menu container draggable


makeDraggable(container);

function towersPred() {
GM_xmlhttpRequest({
method: "GET",
url: "https://api.bloxflip.com/games/towers/history?size=6&page=0",
headers: {
"x-auth-token": localStorage.getItem('_DO_NOT_SHARE_BLOXFLIP_TOKEN')
},
onload: function (response) {
try {
const data = JSON.parse(response.responseText);
const raw = data.data[0].towerLevels;

const predictedLevels = raw.map(row => row.map(level => level === 1


? 'green' : ''));

const accuracy = calculateAccuracy(predictedLevels);

displayPrediction1(predictedLevels, accuracy);
} catch (error) {
console.log('Error:', error);
displayPrediction1([], 0);
}
},
onerror: function (response) {
console.log('Request failed:', response);
displayPrediction1([], 0);
}
});
}

function calculateAccuracy(predictedLevels) {
const path = `div.game-layout_gameLayoutColumnRight__oj_7g > div > div > div`;
const buttons = document.querySelectorAll(path);

if (!buttons || buttons.length === 0) {


return 0;
}

let correctCount = 0;
let totalCount = 0;

predictedLevels.forEach((row, i) => {
row.forEach((color, j) => {
const button = document.querySelector(`${path} > div:nth-child(${i +
1}) > div:nth-child(${j + 1}) > button`);

if (button) {
const buttonColor = button.style.backgroundColor;
if (buttonColor === color) {
correctCount++;
}
totalCount++;
}
});
});

return (correctCount / totalCount) * 100;


}

function displayPrediction1(predictedLevels, accuracy) {


predictedLevels.forEach((row, i) => {
row.forEach((color, j) => {
const path = `div.game-layout_gameLayoutColumnRight__oj_7g > div > div
> div:nth-child(${i + 1}) > div:nth-child(${j + 1}) > button`;
const button = document.querySelector(path);

if (button) {
button.style.backgroundColor = color;
}
});
});

console.log(`Accuracy: ${accuracy.toFixed(2)}%`);
}

function handleTabSelection(tab) {
const tabContents = document.querySelectorAll(".TabContent");
tabContents.forEach(content => {
content.style.display = "none";
});
const tabs = document.querySelectorAll(".Tab");
tabs.forEach(t => {
t.style.backgroundColor = "rgba(61, 61, 61, 0.6)";
});
tab.style.backgroundColor = "rgba(91, 91, 91, 0.6)";

if (tab === mainTab) {


number_of_tiles.style.display = "none";
predictButton.style.display = "none";
unrigButton.style.display = "block";
} else if (tab === minesTab) {
predictButton.style.display = "block";
number_of_tiles.style.display = "none";
unrigButton.style.display = "none";
predictButton.removeEventListener("click",towersPred);
predictButton.addEventListener("click",minesPred);
} else if (tab === TowersTab) {
displayPrediction.style.display = "none"
predictButton.style.display = "block";
unrigButton.style.display = "none";
predictButton.removeEventListener("click",minesPred);
predictButton.addEventListener("click", towersPred);
} else if (tab === CrashTab) {
number_of_tiles.style.display = "none";
predictButton.style.display = "none";
unrigButton.style.display = "block";
displayPrediction.style.display = "block";
crashpred(displayPrediction)
} else if (tab === SlideTab) {
number_of_tiles.style.display = "none";
predictButton.style.display = "none";
unrigButton.style.display = "block";
displayPrediction.style.display = "block";
slidePred(displayPrediction)
}
}

function crashpred(displayPrediction) {
const size = 5;

function h(response) {
try {
const crashresponse = JSON.parse(response.responseText);

if (crashresponse && crashresponse.history &&


Array.isArray(crashresponse.history)) {
const history = crashresponse.history;

if (history.length >= 7) {
const crashresp = history.map(item => item.crashPoint).slice(0,
7);

const safePrediction = calc(crashresp, size);


const riskyPrediction = calcRisky(crashresp, size);

displayPrediction.innerHTML = `
Safe Bet: ${safePrediction.toFixed(2)}<br>
Risky Bet: ${riskyPrediction.toFixed(2)}
`;
return;
}
}
throw new Error('Invalid response data structure or insufficient
history data.');
} catch (error) {
console.log(error);
}
displayPrediction.textContent = 'Prediction data unavailable or invalid.'
}

function calc(data, size) {


const lastData = data.slice(-size);
const sum_x = lastData.reduce((acc, val) => acc + val, 0);
const avg = sum_x / size;

return Math.max(avg, 0);


}

function calcRisky(data, size) {


const lastData = data.slice(-size);
const max = Math.max(...lastData);

return max > 1 ? max * 1.5 : max + 0.5; // Example of a risky prediction
}

function calculateAccuracy(history, size, testIterations, prediction) {


let correctPredictions = 0;

for (let i = 0; i < testIterations; i++) {


const testData = history.slice(i, i + size);
const actualCrash = history[i + size];

if (prediction >= actualCrash) {


correctPredictions++;
}
}

return (correctPredictions / testIterations) * 100;


}

GM_xmlhttpRequest({
method: "GET",
url: "https://api.bloxflip.com/games/crash",
onload: h,
onerror: function (response) {
alert('An error has occurred' + response);
}
});
};

let model = {};


let colors = [];
let isPredicting = false; // Track if a prediction is in progress

function slidePred(x) {
// Check if a prediction is in progress, if so, return
if (isPredicting) {
return;
}

isPredicting = true; // Set prediction in progress


x.disabled = true; // Disable the button during prediction

GM_xmlhttpRequest({
method: "GET",
url: "https://api.bloxflip.com/games/roulette",
onload: function (response) {
const data = JSON.parse(response.responseText).history;
const newColors = data.map(item => item.winningColor);

colors = [...colors, ...newColors];


model = trainModel(colors);

const testIterations = 1000;


let correctPredictions = 0;

for (let i = 0; i < testIterations; i++) {


const predictedColor = getColor(colors, model);
const actualColor = colors[colors.length - 1];

if (predictedColor === actualColor) {


correctPredictions++;
}

colors.push(predictedColor);
}

const accuracy = (correctPredictions / testIterations) * 100;


const prediction = getColor(colors, model);

x.textContent = `Predicted Color: ${prediction}, Accuracy: $


{accuracy.toFixed(2)}%`;

x.disabled = false; // Re-enable the button


isPredicting = false; // Set prediction completed
},
onerror: function (response) {
alert('An error has occurred: ' + response);
x.disabled = false; // Re-enable the button if an error occurs
isPredicting = false; // Set prediction completed
}
});
}

// Function to train the model


function trainModel(data) {
const newModel = {};

for (let i = 0; i < data.length - 1; i++) {


const currentColor = data[i];
const nextColor = data[i + 1];

if (!newModel[currentColor]) {
newModel[currentColor] = {};
}

if (!newModel[currentColor][nextColor]) {
newModel[currentColor][nextColor] = 1;
} else {
newModel[currentColor][nextColor]++;
}
}

for (const color in newModel) {


const transitions = newModel[color];
const totalCount = Object.values(transitions).reduce((sum, count) => sum +
count, 0);

for (const next in transitions) {


transitions[next] /= totalCount;
}
}

return newModel;
}

// Function to get the next color based on the model


function getColor(data, model) {
const lastColor = data[data.length - 1];
const possibleTransitions = model[lastColor];

if (!possibleTransitions) {
const index = Math.floor(Math.random() * data.length);
return data[index];
}

const randomValue = Math.random();


let probabilitySum = 0;

for (const nextColor in possibleTransitions) {


probabilitySum += possibleTransitions[nextColor];
if (randomValue <= probabilitySum) {
return nextColor;
}
}

return lastColor;
}

mainTab.addEventListener("click", function() {
handleTabSelection(mainTab);
});

minesTab.addEventListener("click", function() {
predictButton.addEventListener("click",minesPred());
handleTabSelection(minesTab);
});

TowersTab.addEventListener("click", function() {
handleTabSelection(TowersTab);
})
CrashTab.addEventListener("click", function() {
handleTabSelection(CrashTab);
})

SlideTab.addEventListener("click", function() {
handleTabSelection(SlideTab);
})

You might also like