bombs

try to take over the world!

  1. // ==UserScript==
  2. // @name bombs
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description try to take over the world!
  6. // @author lesungera
  7. // @match https://www.erepublik.com/*/military/battlefield/*
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11.  
  12. function small() {
  13. bomb(21);
  14. }
  15.  
  16. function cruise() {
  17. bomb(215);
  18. }
  19.  
  20. function big(){
  21. bomb(22);
  22. }
  23.  
  24.  
  25. async function bomb(id) {
  26. while(1) {
  27. await fetch("https://www.erepublik.com/en/military/deploy-bomb", {
  28. "credentials": "include",
  29. "headers": {
  30. "accept": "*/*",
  31. "accept-language": "en-US,en;q=0.9,bg-BG;q=0.8,bg;q=0.7",
  32. "content-type": "application/x-www-form-urlencoded; charset=UTF-8",
  33. "x-requested-with": "XMLHttpRequest"
  34. },
  35. "referrer": "https://www.erepublik.com/en/military/battlefield/" + SERVER_DATA.battleId,
  36. "referrerPolicy": "same-origin",
  37. "body": "battleId=" + SERVER_DATA.battleId + "&_token=" + SERVER_DATA.csrfToken + "&bombId=" + id,
  38. "method": "POST",
  39. "mode": "cors"
  40. });
  41. await sleep(800);
  42. }
  43. }
  44.  
  45. function sleep(ms) {
  46. return new Promise(resolve => setTimeout(resolve, ms));
  47. }
  48.  
  49. window.small = small;
  50. window.cruise = cruise;
  51. window.big = big;
  52.