Cellcraft - Io Infinite Powers Script
Cellcraft - Io Infinite Powers Script
Cellcraft - Io Infinite Powers Script
(() => {
const realSettings = {
bypassNameBlock: false,
bypassChatCensor: false,
skinChanger: false,
infinitePowers: false,
};
const settings = new Proxy(realSettings, {
set(target, prop, newValue, receiver) {
let ret = Reflect.set(...arguments);
localStorage.setItem(
'extrasSettings',
JSON.stringify(realSettings)
);
return ret;
},
});
let _pSettings;
if ((_pSettings = localStorage.getItem('extrasSettings'))) {
try {
let parsed = JSON.parse(_pSettings);
for (let item in parsed) {
settings[item] = parsed[item];
}
} catch (e) {
localStorage.removeItem('extrasSettings');
}
}
bypassNameBlock: {
const blockedNamed = [
'hitler',
'nazi',
'porno',
'fuck',
'lul',
'eikel',
'isis',
'penis',
'sora',
'admin',
'administrator',
'hate',
'terrorist',
];
let pindexOf = Array.prototype.indexOf;
Array.prototype.indexOf = function (str) {
if (
typeof str == 'string' &&
blockedNamed.includes(str.replace(/ /g, '').toLowerCase()) &&
settings.bypassNameBlock
)
return -1;
return pindexOf.apply(this, arguments);
};
}
bypassChatCensor: {
function unfilter(value) {
if (value.startsWith('/')) return value;
return value.replace(/([^:\w]|^)(\w)(\w+)/g, '$1$2\u206a$3');
}
setInterval(() => {
if (isAlive && pSendNick && settings.skinChanger) {
pSendNick();
}
}, 50);
}
infinitePowers: {
/** @type {WebSocket} */
let gameSocket = null;
let websockSendFromGame = null;
(call => {
Function.prototype.call = function (thisArg, ...args) {
// console.log(this, thisArg, ...args);
if (thisArg instanceof WebSocket) {
if (thisArg.url.includes('cellcraft.io')) {
gameSocket = thisArg;
if (this.name == 'send') websockSendFromGame = this;
}
}
return call.apply(this, [thisArg, ...args]);
};
})(Function.prototype.call);
function sendLogin() {
const username = localStorage.getItem('username');
if (!username) return;
const drum = localStorage.getItem('drum');
let password;
if (drum) password = localStorage.getItem(window.md5(drum));
else password = localStorage.getItem('password');
if (!password) return;
packet[idx++] = 0x02;
addToSettings: {
const settingsMenu = document.querySelector(
'div.modal.settings > div.body'
);
const settingsNav = settingsMenu.querySelector('div.settings-nav');
const settingsButton = document.createElement('button');
settingsButton.setAttribute('settings-nav', 'extras');
settingsButton.innerText = ' Extras ';
settingsButton.onclick = () => {
for (const elm of settingsNav.children) {
elm.classList.remove('active');
}
settingsButton.classList.add('active');
settingLabel.appendChild(document.createElement('span'));
settingLabel.appendChild(
new Text(
setting
.replace(/([A-Z])/g, ' $1')
.replace(/^(\w)/, (_, $1) => $1.toUpperCase())
)
);
settingCheckbox.appendChild(settingInput);
settingCheckbox.appendChild(settingLabel);
settingElm.appendChild(settingCheckbox);
lastSettingWrapper.appendChild(settingElm);
if (wasASettingWrapper) {
settingsPage.appendChild(lastSettingWrapper);
lastSettingWrapper = null;
}
}
if (lastSettingWrapper) {
settingsPage.appendChild(lastSettingWrapper);
lastSettingWrapper = null;
}
settingsMenu.appendChild(settingsPage);
}
addHiddenItems: {
function createShopItem(
title,
price,
prodId,
type,
tooltip,
picture,
time = null
) {
const skinCard = document.createElement('div');
skinCard.classList.add('skin-card');
if (time) {
const timeDiv = document.createElement('div');
timeDiv.classList.add('time');
timeDiv.innerText = time;
skinDiv.appendChild(timeDiv);
}
skinDiv.appendChild(productImage);
infoPrice.appendChild(coinI);
infoPrice.appendChild(new Text(price.toString()));
infoBtn.appendChild(infoButtonIcon);
buyButton.appendChild(new Text('Buy'));
buttonsDiv.appendChild(infoBtn);
buttonsDiv.appendChild(buyButton);
infoDiv.appendChild(infoTitle);
infoDiv.appendChild(infoPrice);
infoDiv.appendChild(buttonsDiv);
skinCard.appendChild(skinDiv);
skinCard.appendChild(infoDiv);
return skinCard;
}
function addItemToShop(
targetDiv,
title,
price,
prodId,
type,
tooltip,
picture,
time = null
) {
const elm = createShopItem(
title,
price,
prodId,
type,
tooltip,
picture,
time
);
/** @type { HTMLParagraphElement | null } */
let lowest = null;
for (const child of targetDiv.children) {
/** @type { HTMLParagraphElement | null } */
let npriceElm = child.querySelector('p.price');
if (!npriceElm) {
continue;
}
let nprice = parseInt(npriceElm.innerText);
if (isNaN(nprice)) {
continue;
}
let oprice = lowest
? parseInt(lowest.querySelector('p.price').innerText)
: Infinity;