This script is designed to work over time by spending all either available energy or overtime points. It runs in a loop every 5 seconds and checks certain conditions in the response data to decide whether to continue or stop the loop.
-
Open the Browser Console:
- Google Chrome or Brave:
- Right-click on the webpage and select "Inspect," then click on the "Console" tab.
- Alternatively, press
Ctrl+Shift+J
(Windows/Linux) orCmd+Option+J
(Mac).
- Mozilla Firefox:
- Right-click on the webpage and select "Inspect Element," then click on the "Console" tab.
- Alternatively, press
Ctrl+Shift+K
(Windows/Linux) orCmd+Option+K
(Mac).
- Safari:
- First, enable the Develop menu by going to Safari > Preferences > Advanced and checking "Show Develop menu in menu bar."
- Then, press
Cmd+Option+C
to open the Console.
- Microsoft Edge:
- Right-click on the webpage and select "Inspect," then click on the "Console" tab.
- Alternatively, press
Ctrl+Shift+I
.
- Google Chrome or Brave:
-
Run the Script:
- Copy the provided script.
- Paste it into the console and press Enter to run it.
- The script makes an HTTP GET request to
https://www.erepublik.com/en/main/job-data
to find out how many energy and over time points are available to spend. - It parses the JSON response and logs it to the console for viewing.
- It checks if
overTime.points
oroverTime.usableEnergy
in the response is zero. - If either is zero, the script stops making further requests.
- This process repeats every 5 seconds.
- Ensure you have a stable internet connection while running this script.
- Be aware that making automated requests might not be allowed on all websites. Use this script responsibly and in compliance with the website's terms of service.
- If the script does not work as expected, check if the website's API or response format has changed.
- If the script does not run, ensure that you have copied and pasted it correctly into the console.
- Check for any error messages in the console for clues on what might be wrong.
setInterval(function(){var xhr=new XMLHttpRequest();xhr.open('GET','https://www.erepublik.com/en/main/job-data',true);xhr.setRequestHeader('authority','www.erepublik.com');xhr.setRequestHeader('accept','application/json, text/plain, */*');xhr.setRequestHeader('accept-language',navigator.language);xhr.setRequestHeader('cookie','erpk='+document.cookie.match(/erpk=([^;]+)/)[1]);xhr.setRequestHeader('referer',document.location.href);xhr.setRequestHeader('sec-ch-ua',navigator.userAgent);xhr.setRequestHeader('sec-ch-ua-mobile','?0');xhr.setRequestHeader('sec-ch-ua-platform',navigator.platform);xhr.setRequestHeader('sec-fetch-dest','empty');xhr.setRequestHeader('sec-fetch-mode','cors');xhr.setRequestHeader('sec-fetch-site','same-origin');xhr.setRequestHeader('sec-gpc','1');xhr.setRequestHeader('user-agent',navigator.userAgent);xhr.setRequestHeader('x-requested-with','XMLHttpRequest');xhr.onreadystatechange=function(){if(xhr.readyState===4&&xhr.status===200){var response=JSON.parse(xhr.responseText);console.log(response);if(response.overTime.points===0||response.overTime.usableEnergy===0){clearInterval(interval);}}};xhr.send();},5000);