// ==UserScript==
// @name 🎀હਐ SCRIPTS હਐ🎀 Adelita#5366
// @namespace 🎀હਐ SCRIPTS હਐ🎀 Adelita#5366
// @version 1.1 [Beta]
// @description Support extension for Fightz.IO :D
// @author clan of Silcon of Moon
// @require https://code.jquery.com/jquery-latest.min.js
// @match *.fightz.io
// @grant ur mum
// ==/UserScript==
var aimbot = false;
var tracers = false;
var staying = false;
var Назад = false;
var КлайниБог = false;
var isAimbotActive = false;
function onUpdate() {
if(staying) {
socket.emit('keyPress', {
inputId: 'mouseDistance',
state: 0
});
}
if(aimbot) {
var prevPlayer = {};
var diffX;
var diffY;
for(var playerId in Player.list) {
if(playerId != selfId) {
var otherPlayer = Player.list[playerId];
if(otherPlayer.map != undefined && otherPlayer.map != "menu") {
diffX = otherPlayer.x - Player.list[selfId].x;
diffY = otherPlayer.y - Player.list[selfId].y;
var currentDistance = Math.sqrt(Math.pow(diffX, 2) +
Math.pow(diffY, 2));
if(prevPlayer.distance != undefined) {
if(currentDistance <= prevPlayer.distance) {
prevPlayer.player = otherPlayer;
prevPlayer.distance = currentDistance;
}
} else {
prevPlayer.player = otherPlayer;
prevPlayer.distance = currentDistance;
}
}
}
}
if(isAimbotActive = (prevPlayer.distance != undefined && !
isNaN(prevPlayer.distance) && prevPlayer.distance <= 500)) {
diffX = prevPlayer.player.x - Player.list[selfId].x;
diffY = prevPlayer.player.y - Player.list[selfId].y;
mouseAngle = (Math.atan2(diffY, diffX) * 180 / Math.PI);
//AutoAttack
socket.emit('keyPress', {
inputId: 'angle',
state: Назад ? (mouseAngle + 180) % 360 : mouseAngle
});
socket['emit']('keyPress', {
inputId: 'leftButton',
state: true
});
}
}
}
setInterval(onUpdate, 100);
document.onmousemove = function (info) {
if (info.clientX < 110 && info.clientY > window.innerHeight - 310) {
return;
}
if (Player.list[selfId] && Player.list[selfId].map != 'menu') {
var x = -canvasWIDTH / 2 + info.clientX;
var y = -canvasHEIGHT / 2 + info.clientY;
if(!isAimbotActive) {
mouseAngle = Math.atan2(y, x) / Math.PI * 180;
}
mouseDistance = 1;
if (getDistance(x, y, 0, 0) < canvasWIDTH * canvasWIDTH / 324) {
mouseDistance = 1 * (getDistance(x, y, 0, 0) / (canvasWIDTH *
canvasWIDTH / 324));
} else {
mouseDistance = 1;
}
}
}
document.onkeyup = function (key) {
switch(key.keyCode) {
case 69: //on E
Назад = false;
if(!aimbot) {
socket.emit('keyPress', {
inputId: 'angle',
state: mouseAngle
});
}
socket.emit('keyPress', {
inputId: 'mouseDistance',
state: 1
});
break;
case 87: //on W
inputAttack(false);
break;
case 32: //on SPACE
inputDash(false);
break;
case 13:
inputChat(); //on ENTER
break;
case 80: //on P
if(!typing) {
tFunction();
}
break;
default:
break;
}
}
document.onkeydown = function (key) {
//if(document.getElementById('chatMessage') == null) {
if(!typing) {
switch(key.keyCode) {
case 68: //on D
КлайниБог = !КлайниБог;
respawn();
break;
case 81: //on Q
aimbot = !aimbot;
if(!aimbot) {
socket['emit']('keyPress', {
inputId: 'leftButton',
state: false
});
isAimbotActive = false;
}
break;
case 90: //on Z
tracers = !tracers;
break;
case 84: //on с
showMessage();
break;
case 82: //on r
howMessagge();
break;
case 65: //on A
staying = !staying;
break;
case 69: //on E
if(!aimbot && !Назад) {
socket.emit('keyPress', {
inputId: 'angle',
state: ((mouseAngle + 180) % 360)
});
}
socket.emit('keyPress', {
inputId: 'mouseDistance',
state: -5
});
Назад = true;
break;
case 87: //on W
inputAttack(true);
break;
case 32: //on Space
inputDash(true);
break;
default:
break;
}
}
}
function showMessage() {
setTimeout(function () {
$('#buttonChat').mousedown();
$('#chatMessage').val(':>');
$('#buttonChat').mousedown();
},0);
setTimeout(function () {
$('#buttonChat').mousedown();
$('#chatMessage').val('не');
$('#buttonChat').mousedown();
},500);
setTimeout(function () {
$('#buttonChat').mousedown();
$('#chatMessage').val('надо');
$('#buttonChat').mousedown();
},1000)
setTimeout(function () {
$('#buttonChat').mousedown();
$('#chatMessage').val('дядя');
$('#buttonChat').mousedown();
},1000);setTimeout(function () {
$('#buttonChat').mousedown();
$('#chatMessage').val('НЯЯ');
$('#buttonChat').mousedown();
},1000);
}
function howMessagge() {
setTimeout(function () {
$('#buttonChat').mousedown();
$('#chatMessage').val('я');
$('#buttonChat').mousedown();
},0);
setTimeout(function () {
$('#buttonChat').mousedown();
$('#chatMessage').val('тебя');
$('#buttonChat').mousedown();
},250);
setTimeout(function () {
$('#buttonChat').mousedown();
$('#chatMessage').val('люблю');
$('#buttonChat').mousedown();
},400);
setTimeout(function () {
$('#buttonChat').mousedown();
$('#chatMessage').val(':>');
$('#buttonChat').mousedown();
},550);
}
function respawn()
{
togglePause();
$('#respawnButton').click();
$('#signDiv-signIn').click();
}
function onRender() {
if(tracers && Player.list[selfId] != undefined && Player.list[selfId].map !=
undefined && Player.list[selfId].map != 'menu') {
for(var playerId in Player.list) {
if(playerId != selfId) {
var target = Player.list[playerId];
var diffX = target.x - Player.list[selfId].x;
var diffY = target.y - Player.list[selfId].y;
var currentDistance = Math.sqrt(Math.pow(diffX, 2) +
Math.pow(diffY, 2));
if(currentDistance != undefined && !isNaN(currentDistance) &&
currentDistance <= 1000) {
ctx.beginPath();
ctx.moveTo(WIDTH / 2, HEIGHT / 2);
ctx.arc(WIDTH / 2, HEIGHT / 2, 1, 0, 2 * Math.PI, true);
ctx.lineTo(diffX + WIDTH / 2, diffY + HEIGHT / 2);
ctx.arc(diffX + WIDTH / 2, diffY + HEIGHT / 2, 1, 0, 2 *
Math.PI, true);
ctx.lineWidth = 2;
ctx.strokeStyle = "#4B0082";
ctx.stroke();
}
}
}
}
ctx.font = "20px Comic Sans MS";
ctx.textAlign = "center";
ctx.fillStyle = aimbot ? "#0000FF" : "#4B0082";
ctx.fillText("Хуйня [Q]", 80, 130);
ctx.fillStyle = tracers ? "#0000FF" : "#4B0082";
ctx.fillText("Вх [Z]", 80, 155);
ctx.fillStyle = staying ? "#0000FF" : "#4B0082";
ctx.fillText("Стопка xD [A]", 80, 180);
ctx.fillStyle = Назад ? "#0000FF" : "#4B0082";
ctx.fillText("Назад [E]", 80, 205);
ctx.fillStyle = КлайниБог ? "#00FFFF" : "#00FFFF";
ctx.fillText("КлайниБог [D]", 80, 230);
requestAnimationFrame(onRender);
}
onRender();
animate == function() {
intervalTimer++;
requestAnimationFrame(animate);
if (!selfId) {
return;
}
ctx.clearRect(0, 0, WIDTH, HEIGHT);
for (var PlayerID in Player.list) {
Player.list[PlayerID].update();
}
for (var NpcID in NPC.list) {
NPC.list[NpcID].update();
}
for (var MobID in Mob.list) {
Mob.list[MobID].update();
}
for (var BulletID in Bullet.list) {
Bullet.list[BulletID].update();
}
drawMap();
if (intervalTimer % FPS == 0) {
manageMusic();
}
if (intervalTimer % 4 == 0 && Player.list[selfId].map == 'menu') {
manageShop();
manageHighScore();
}
if (Player['list'][selfId]['map'] == 'menu') {
if (adTimer2++ > 60 * FPS) {
aipDisplayTag['refresh']('fightz-io_336x280');
aipDisplayTag['refresh']('fightz-io_300x250');
adTimer2 = 0;
}
} else {
adTimer2 = 0;
}
if (intervalTimer % 8 == 0 && Player['list'][selfId]['map'] !== 'menu') {
if (Math['abs'](angleStatus - mouseAngle) > 1 || Math['abs'](distanceStatus
- mouseDistance) > 0.1) {
if(!isAimbotActive) {
socket.emit('keyPress', {
inputId: 'angle',
state: Назад ? (mouseAngle + 180) % 360 : mouseAngle
});
}
socket.emit('keyPress', {
inputId: 'mouseDistance',
state: Назад ? -5 : (staying ? 0 : mouseDistance)
});
angleStatus = mouseAngle;
distanceStatus = mouseDistance;
}
}
for (var DecorationID in Decoration.list) {
if (Decoration.list[DecorationID].type != 35) {
Decoration.list[DecorationID].draw();
}
}
for (var foodID in Food.list) {
Food.list[foodID].draw();
}
for (var mobID in Mob.list) {
Mob.list[mobID].draw();
}
for (var ncpID in NPC.list) {
NPC.list[ncpID].draw();
}
for (var bulletID in Bullet.list) {
Bullet.list[bulletID].draw();
}
for (var playerID in Player.list) {
Player.list[playerID].draw();
}
for (var decorationID in Decoration.list) {
if (Decoration.list[decorationID].type == 35) {
Decoration.list[decorationID].draw();
}
}
for (var PLAYERID in Player.list) {
Player.list[PLAYERID].drawMessage();
}
if (!(Player.list[selfId].score <= scoreRecord)) {
scoreRecord = Player.list[selfId].score;
levelRecord = Player.list[selfId].level;
setCookie('scoreRecord', scoreRecord, 365);
setCookie('levelRecord', levelRecord, 365);
}
if (!(Player.list[selfId].score <= scoreRecordThisGame)) {
scoreRecordThisGame = Player.list[selfId].score;
levelRecordThisGame = Player.list[selfId].level;
}
if (Player.list[selfId].map != 'menu') {
drawLeaderboard();
homeDiv.style.display = 'none';
document.getElementById('controlContainer').style.display = 'block';
} else {
if (homeDiv.style.display == 'none' && deathTimer++ >= (FPS * 1)) {
deathTimer = 0;
homeDiv.style.display = 'block';
if (firstLogin == 1) {
respawnDiv.style.display = 'block';
readyDiv.style.display = 'none';
scoreRecordThisGame = 0;
levelRecordThisGame = 0;
}
document.getElementById('controlContainer').style.display = 'none';
signDivSignIn.style.display = 'none';
signDivLoading.style.display = 'inline-block';
if (finishLoading == 0 && loadPlayButton == 1) {
signDivSignIn.style.display = 'inline-block';
signDivLoading.style.display = 'none';
}
if (typing == true) {
document.getElementById('chatContainer').innerHTML = '';
typing = false;
}
if (firstLogin == 1) {
spawnMessage.style.display = 'block';
spawnMessage.innerHTML = 'You died. You\'ll spawn with +' +
Player.list[selfId].score + ' score!';
}
}
}
}