swordz.IO Hack

Support extension for SwOrDz.Io

  1. // ==UserScript==
  2. // @name swordz.IO Hack
  3. // @namespace Sasha
  4. // @version 1.4.8
  5. // @description Support extension for SwOrDz.Io
  6. // @author Sasha2210
  7. // @match *.swordz.io
  8. // @grant ur mum
  9. // ==/UserScript==
  10.  
  11. (function() {
  12. //Вырубаем сразу же после загрузки звуки и музыку
  13. toggleSound();
  14. toggleMusic();
  15.  
  16. //Вырубаем отрисовку говнотутора
  17. Img.other[1].src= "";
  18. })();
  19.  
  20. /*
  21. А это шляпа с сообщеницами :D Осторожно, говнокод.
  22. var msgQueue = 0;
  23. function msgMeme() {
  24. if(Player.list[selfId].map != 'menu') {
  25. var msg;
  26. switch(msgQueue) {
  27. case 0:
  28. msg = '🌑 Qmaks 🌑';
  29. break;
  30. case 1:
  31. msg = '🌒 Qmaks 🌒';
  32. break;
  33. case 2:
  34. msg = '🌓 Qmaks 🌓';
  35. break;
  36. case 3:
  37. msg = '🌔 Qmaks 🌔';
  38. break;
  39. case 4:
  40. msg = '🌕 Qmaks 🌕';
  41. break;
  42. case 5:
  43. msg = '🌖 Qmaks 🌖';
  44. break;
  45. case 6:
  46. msg = '🌗 Qmaks 🌗';
  47. break;
  48. case 7:
  49. msg = '🌘 Qmaks 🌘';
  50. break;
  51. default:
  52. break;
  53. }
  54. if(msgQueue >= 0 && msgQueue <= 7) {
  55. msgQueue++;
  56. if(msgQueue == 7) {
  57. msgQueue = 0;
  58. }
  59. }
  60. socket.emit('keyPress', {
  61. inputId: 'chatMessage',
  62. state: msg
  63. });
  64. typing = false;
  65. }
  66. }
  67. setInterval(msgMeme, 250);*/
  68.  
  69. var aimbot = false;
  70. var tracers = true;
  71. var staying = false;
  72. var speedhack = false;
  73. var autorespawn = false;
  74. var isAimbotActive = false;
  75.  
  76. function onUpdate() {
  77. if(autorespawn && Player.list[selfId].map == "menu" && respawnButton.style.display != " ") {
  78. respawnButton.click();
  79. playButton.click();
  80. }
  81. if(Player.list[selfId].map != undefined && Player.list[selfId].map != 'menu') {
  82. if(staying) {
  83. socket.emit('keyPress', {
  84. inputId: 'mouseDistance',
  85. state: 0
  86. });
  87. }
  88. if(aimbot) {
  89. var prevPlayer = {};
  90.  
  91. var diffX;
  92. var diffY;
  93.  
  94. for(var playerId in Player.list) {
  95. if(playerId != selfId) {
  96. var otherPlayer = Player.list[playerId];
  97. if(otherPlayer.map != undefined && otherPlayer.map != "menu") {
  98. diffX = otherPlayer.x - Player.list[selfId].x;
  99. diffY = otherPlayer.y - Player.list[selfId].y;
  100. var currentDistance = Math.sqrt(Math.pow(diffX, 2) + Math.pow(diffY, 2));
  101. if(prevPlayer.distance != undefined) {
  102. if(currentDistance <= prevPlayer.distance) {
  103. prevPlayer.player = otherPlayer;
  104. prevPlayer.distance = currentDistance;
  105. }
  106. } else {
  107. prevPlayer.player = otherPlayer;
  108. prevPlayer.distance = currentDistance;
  109. }
  110. }
  111. }
  112. }
  113.  
  114. if(isAimbotActive = (prevPlayer.distance != undefined && !isNaN(prevPlayer.distance) && prevPlayer.distance <= 500)) {
  115. diffX = prevPlayer.player.x - Player.list[selfId].x;
  116. diffY = prevPlayer.player.y - Player.list[selfId].y;
  117. mouseAngle = (Math.atan2(diffY, diffX) * 180 / Math.PI);
  118. //AutoAttack
  119. socket.emit('keyPress', {
  120. inputId: 'angle',
  121. state: speedhack ? (mouseAngle + 180) % 360 : mouseAngle
  122. });
  123. socket['emit']('keyPress', {
  124. inputId: 'leftButton',
  125. state: true
  126. });
  127. }
  128. }
  129. }
  130. }
  131.  
  132. setInterval(onUpdate, 100);
  133.  
  134. document.onmousemove = function (info) {
  135. if (info.clientX < 110 && info.clientY > window.innerHeight - 310) {
  136. return;
  137. }
  138. if (Player.list[selfId] && Player.list[selfId].map != 'menu') {
  139. var x = -canvasWIDTH / 2 + info.clientX;
  140. var y = -canvasHEIGHT / 2 + info.clientY;
  141. if(!isAimbotActive) {
  142. mouseAngle = Math.atan2(y, x) / Math.PI * 180;
  143. }
  144. mouseDistance = 1;
  145. if (getDistance(x, y, 0, 0) < canvasWIDTH * canvasWIDTH / 324) {
  146. mouseDistance = 1 * (getDistance(x, y, 0, 0) / (canvasWIDTH * canvasWIDTH / 324));
  147. } else {
  148. mouseDistance = 1;
  149. }
  150. }
  151. }
  152.  
  153. document.onkeyup = function (key) {
  154. switch(key.keyCode) {
  155. case 69: //on E
  156. speedhack = false;
  157. if(!aimbot) {
  158. socket.emit('keyPress', {
  159. inputId: 'angle',
  160. state: mouseAngle
  161. });
  162. }
  163. socket.emit('keyPress', {
  164. inputId: 'mouseDistance',
  165. state: 1
  166. });
  167. break;
  168. case 87: //on W
  169. inputAttack(false);
  170. break;
  171. case 32: //on SPACE
  172. inputDash(false);
  173. break;
  174. case 13:
  175. inputChat(); //on ENTER
  176. break;
  177. case 80: //on P
  178. if(!typing) {
  179. tFunction();
  180. }
  181. break;
  182. default:
  183. break;
  184. }
  185. }
  186.  
  187. document.onkeydown = function (key) {
  188. //if(document.getElementById('chatMessage') == null) {
  189. if(!typing) {
  190. switch(key.keyCode) {
  191. case 68: //on D
  192. autorespawn = !autorespawn;
  193. break;
  194. case 81: //on Q
  195. aimbot = !aimbot;
  196. if(!aimbot) {
  197. socket['emit']('keyPress', {
  198. inputId: 'leftButton',
  199. state: false
  200. });
  201. isAimbotActive = false;
  202. }
  203. break;
  204. case 90: //on Z
  205. tracers = !tracers;
  206. break;
  207. case 65: //on A
  208. staying = !staying;
  209. break;
  210. case 69: //on E
  211. if(!aimbot && !speedhack) {
  212. socket.emit('keyPress', {
  213. inputId: 'angle',
  214. state: ((mouseAngle + 180) % 360)
  215. });
  216. }
  217. socket.emit('keyPress', {
  218. inputId: 'mouseDistance',
  219. state: -67343687834436746237846234783246
  220. });
  221. speedhack = true;
  222. break;
  223. case 87: //on W
  224. inputAttack(true);
  225. break;
  226. case 32: //on Space
  227. inputDash(true);
  228. break;
  229. default:
  230. break;
  231. }
  232. }
  233. }
  234.  
  235. function onRender() {
  236. if(tracers && Player.list[selfId] != undefined && Player.list[selfId].map != undefined && Player.list[selfId].map != 'menu') {
  237. for(var playerId in Player.list) {
  238. if(playerId != selfId) {
  239. var target = Player.list[playerId];
  240. var diffX = target.x - Player.list[selfId].x;
  241. var diffY = target.y - Player.list[selfId].y;
  242. var currentDistance = Math.sqrt(Math.pow(diffX, 2) + Math.pow(diffY, 2));
  243. if(currentDistance != undefined && !isNaN(currentDistance) && currentDistance <= 1000) {
  244. ctx.beginPath();
  245. ctx.moveTo(WIDTH / 2, HEIGHT / 2);
  246. ctx.arc(WIDTH / 2, HEIGHT / 2, 1, 0, 2 * Math.PI, true);
  247. ctx.lineTo(diffX + WIDTH / 2, diffY + HEIGHT / 2);
  248. ctx.arc(diffX + WIDTH / 2, diffY + HEIGHT / 2, 1, 0, 2 * Math.PI, true);
  249. ctx.lineWidth = 2;
  250. ctx.strokeStyle = "#e74c3c";
  251. ctx.stroke();
  252. }
  253. }
  254. }
  255. }
  256.  
  257. ctx.font = "20px Comic Sans MS";
  258. ctx.textAlign = "center";
  259.  
  260. ctx.fillStyle = aimbot ? "green" : "red";
  261. ctx.fillText("AimBot [Q]", 80, 80);
  262.  
  263. ctx.fillStyle = tracers ? "green" : "red";
  264. ctx.fillText("Tracers [Z]", 80, 105);
  265.  
  266. ctx.fillStyle = staying ? "green" : "red";
  267. ctx.fillText("Staying [A]", 80, 130);
  268.  
  269. ctx.fillStyle = speedhack ? "green" : "red";
  270. ctx.fillText("SpeedHack [E]", 80, 155);
  271.  
  272. ctx.fillStyle = autorespawn ? "green" : "red";
  273. ctx.fillText("AutoRespawn [D]", 80, 180);
  274.  
  275. requestAnimationFrame(onRender);
  276. }
  277.  
  278. onRender();
  279.  
  280. animate = function() {
  281. intervalTimer++;
  282. requestAnimationFrame(animate);
  283. if (!selfId) {
  284. return;
  285. }
  286. ctx.clearRect(0, 0, WIDTH, HEIGHT);
  287. for (var PlayerID in Player.list) {
  288. Player.list[PlayerID].update();
  289. }
  290. for (var NpcID in NPC.list) {
  291. NPC.list[NpcID].update();
  292. }
  293. for (var MobID in Mob.list) {
  294. Mob.list[MobID].update();
  295. }
  296. for (var BulletID in Bullet.list) {
  297. Bullet.list[BulletID].update();
  298. }
  299. drawMap();
  300. if (intervalTimer % FPS == 0) {
  301. manageMusic();
  302. }
  303. if (intervalTimer % 4 == 0 && Player.list[selfId].map == 'menu') {
  304. manageShop();
  305. manageHighScore();
  306. }
  307. if (Player['list'][selfId]['map'] == 'menu') {
  308. if (adTimer2++ > 60 * FPS) {
  309. aipDisplayTag['refresh']('fightz-io_336x280');
  310. aipDisplayTag['refresh']('fightz-io_300x250');
  311. adTimer2 = 0;
  312. }
  313. } else {
  314. adTimer2 = 0;
  315. }
  316. if (intervalTimer % 8 == 0 && Player['list'][selfId]['map'] !== 'menu') {
  317. if (Math['abs'](angleStatus - mouseAngle) > 1 || Math['abs'](distanceStatus - mouseDistance) > 0.1) {
  318. if(!isAimbotActive) {
  319. socket.emit('keyPress', {
  320. inputId: 'angle',
  321. state: speedhack ? (mouseAngle + 180) % 360 : mouseAngle
  322. });
  323. }
  324. socket.emit('keyPress', {
  325. inputId: 'mouseDistance',
  326. state: speedhack ? -5 : (staying ? 0 : mouseDistance)
  327. });
  328. angleStatus = mouseAngle;
  329. distanceStatus = mouseDistance;
  330. }
  331. }
  332. for (var DecorationID in Decoration.list) {
  333. if (Decoration.list[DecorationID].type != 35) {
  334. Decoration.list[DecorationID].draw();
  335. }
  336. }
  337. for (var foodID in Food.list) {
  338. Food.list[foodID].draw();
  339. }
  340. for (var mobID in Mob.list) {
  341. Mob.list[mobID].draw();
  342. }
  343. for (var ncpID in NPC.list) {
  344. NPC.list[ncpID].draw();
  345. }
  346. for (var bulletID in Bullet.list) {
  347. Bullet.list[bulletID].draw();
  348. }
  349. for (var playerID in Player.list) {
  350. Player.list[playerID].draw();
  351. }
  352. for (var decorationID in Decoration.list) {
  353. if (Decoration.list[decorationID].type == 35) {
  354. Decoration.list[decorationID].draw();
  355. }
  356. }
  357. for (var PLAYERID in Player.list) {
  358. Player.list[PLAYERID].drawMessage();
  359. }
  360. if (!(Player.list[selfId].score <= scoreRecord)) {
  361. scoreRecord = Player.list[selfId].score;
  362. levelRecord = Player.list[selfId].level;
  363. setCookie('scoreRecord', scoreRecord, 365);
  364. setCookie('levelRecord', levelRecord, 365);
  365. }
  366. if (!(Player.list[selfId].score <= scoreRecordThisGame)) {
  367. scoreRecordThisGame = Player.list[selfId].score;
  368. levelRecordThisGame = Player.list[selfId].level;
  369. }
  370. if (Player.list[selfId].map != 'menu') {
  371. drawLeaderboard();
  372. homeDiv.style.display = 'none';
  373. document.getElementById('controlContainer').style.display = 'block';
  374. } else {
  375. if (homeDiv.style.display == 'none' && deathTimer++ >= (FPS * 1)) {
  376. deathTimer = 0;
  377. homeDiv.style.display = 'block';
  378. if (firstLogin == 1) {
  379. respawnDiv.style.display = 'block';
  380. readyDiv.style.display = 'none';
  381. scoreRecordThisGame = 0;
  382. levelRecordThisGame = 0;
  383. }
  384. document.getElementById('controlContainer').style.display = 'none';
  385. signDivSignIn.style.display = 'none';
  386. signDivLoading.style.display = 'inline-block';
  387. if (finishLoading == 0 && loadPlayButton == 1) {
  388. signDivSignIn.style.display = 'inline-block';
  389. signDivLoading.style.display = 'none';
  390. }
  391. if (typing == true) {
  392. document.getElementById('chatContainer').innerHTML = '';
  393. typing = false;
  394. }
  395. if (firstLogin == 1) {
  396. spawnMessage.style.display = 'block';
  397. spawnMessage.innerHTML = 'You died. You\'ll spawn with +' + Player.list[selfId].score + ' score!';
  398. }
  399. }
  400. }
  401. }