About the game
News
Sign in
Register
Top Players
Forum
7:37
2510
 online
Authorization required
You are not logged in
   Forums-->Creative works-->

Scripts


1|2

AuthorScripts
for ProZyk:
Hey I worked out a solution for the security problems for those comfortable with some light programming. Just download the script locally and load that.


1. Open the script in tampermonkey.


2. Copy the url for the .js the script fetches.


3. Download to your local machine.


4. Replace the start() function with:

async function start() {

let newScript = document.createElement('script');

newScript.src = "FILE_PATH_TO_DOWNLOADED_SCRIPT"

newScript.type = "text/javascript";

document.head.appendChild(newScript);

}


5. Replace FILE_PATH_TO_DOWNLOADED_SCRIPT with the location you downloaded the script to.


6. You will also want to add a @require file line at the top of the tampermonkey script (look this up for your machine).


7. Make sure tampermonkey has access to file urls.


Now the script will load the local version and not the remote one which can change without you knowing. You'll need to redownload if there's an update you want.
Faster if you instead use:

async function start() {

async function saveScript() {

let response = await fetch("file:///Users/seth/Downloads/event_helper.user.js")

let scriptText = await response.text()

let scriptData = {

script: scriptText,

time: Date.now()

}

set("EventHelper", scriptData)

return scriptData

}

set("EventHelperVersion", "16.0.4")

let scriptData = get("EventHelper", null)

if (!scriptData) {

scriptData = await saveScript()

}

let newScript = document.createElement('script');

newScript.innerHTML = scriptData.script

document.head.appendChild(newScript);

}
Replace my filepath with yours
Even simpler method: replace the entire body of the code and add


// @require file://YOUR_FILE_PATH
// @exclude https://www.lordswm.com/inventory.php
// @exclude https://my.lordswm.com/inventory.php
// @exclude https://www.heroeswm.ru/inventory.php


to the user script block in the code
Lovely, thanks!
For folks who would like to tinker around with the script code for themselves - https://github.com/omengod66/hwm-event-helper/tree/master

This is the part that's hosted by hwm.events server (checkout the deployment workflow in the repository) and is downloaded by the events script dynamically. (I guess it's sole purpose is to give a timer for the event and since that information isn't scraped, they hardcode it and upload it from time to time).
1|2
Back to topics list
2008-2024, online games LordsWM