Advertisement
Guest User

Untitled

a guest
May 21st, 2019
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.96 KB | None | 0 0
  1. // ==UserScript==
  2. // @name Brudasy
  3. // @version
  4. // @description opis
  5. // @author czop czop
  6. // @match *.margonem.pl*
  7. // @grant none
  8. // ==/UserScript==
  9.  
  10. function enemiesOnMap(a) {
  11. var clans = ["eternals", "revolutions", "robię salto", "illuminators", "Evolution", "Czeka nas chwała"];
  12. var people = ['Dylu Dylu','Kaizereq','Kaizer','Mati Orangutan','Kairuś','Erdi'];
  13. people = people.map(element=>element.toLowerCase());
  14. var lista = [];
  15. var enemies = [];
  16. fetch(`/engine?t=friends&a=show&ev=${g.ev}&browser_token=${g.browser_token}&aid=${g.aid}`).then(body => body.json()).then(jsonFriends => {
  17. g.ev=jsonFriends.ev;
  18. jsonFriends.enemies.filter((_, index, _name) => !(index % 6)).forEach(enemy => enemies.push(enemy));
  19. newOther(g.other);
  20. });
  21. var czek = false;
  22. var oldnewOther = newOther;
  23. newOther = function (b) {
  24. oldnewOther(b);
  25. for (var c in b) {
  26. if (b[c].nick !== undefined) {
  27. var czas = new Date();
  28. var godzina = czas.getHours();
  29. if (godzina < 10) godzina = "0" + godzina;
  30. var minuta = czas.getMinutes();
  31. if (minuta < 10) minuta = "0" + minuta;
  32. var sekunda = czas.getSeconds();
  33. if (sekunda < 10) sekunda = "0" + sekunda;
  34. for (var i = 0; i < lista.length; i++) {
  35. if (lista[i] == b[c].id) {
  36. czek = true;
  37. break;
  38. } else {
  39. czek = false;
  40. continue;
  41. }
  42. }
  43. if (((b[c].clan && clans.includes(b[c].clan.name.toLowerCase()) && map.pvp == 2) || enemies.includes(c) || people.includes(b[c].nick.toLowerCase())) && czek == false) {
  44. lista.push(b[c].id);
  45. message('<span style="color: red; font-weight: bold">Wróg: ' + b[c].nick + '</span>');
  46. if (hero.clan) {
  47. chatSend("/k Wróg " + b[c].nick + " " + b[c].lvl + b[c].prof + " z klanu " + b[c].clan.name + " na mapie " + map.name + " na kordach " + b[c].x + "," + b[c].y + " - " + godzina + ":" + minuta + ":" + sekunda + ".");
  48. } else {
  49. chatSend("/k Wróg " + b[c].nick + " " + b[c].lvl + b[c].prof + " na mapie " + map.name + " na kordach " + b[c].x + "," + b[c].y + " - " + godzina + ":" + minuta + ":" + sekunda + ".");
  50. }
  51. for (var i = 0; i < lista.length; i++) {
  52. if (lista[i] == b[c].id) {
  53. setTimeout(function () {
  54. lista.splice(i, 1);
  55. }, 6e4);
  56. break;
  57. }
  58. }
  59. }
  60. }
  61. }
  62. };
  63. }
  64.  
  65. g.loadQueue.push({
  66. fun: enemiesOnMap
  67. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement