Forums-->Creative works--> 1|2
Author | Scripts |
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). | https://greasyfork.org/en/scripts/511725-leg-army-filters/code
Wrote a script for additional Leaders army filters.
const customBookmarks = {
'11': { label: 'Lifeless', skills: ['Elemental', 'Undead'] },
'12': { label: 'Penetrate', skills: ['Ignore defense', 'Lizard charge', 'Poison', 'Venom', 'Harvest Soul'] },
'13': { label: 'Utility', skills: ['Caster', 'Mirth', 'Confer Luck', 'Aura of bravery', 'Incentive Presence', 'Shield Allies', 'Mana'] },
'14': { label: 'Shooter', skills: ['Shooter'] },
'15': { label: 'Fast', speed: 8}, // Speed >= 8
'16': { label: 'Infantry', creatures: ['Warlords', 'Orc warriors', 'Dreadlords', 'Valkyries', 'Pikemen', 'Templars', 'Enforcers', 'Sailor-strangers']}
};
This is the code block you can modify if you want to create your own filters. | Redirect heroeswm.ru to lordswm.com (excluding forum pages)
https://greasyfork.org/en/scripts/511726-redirect-heroeswm-ru-to-lordswm-com-excluding-forum-pages
Very simple one | Convert All URLs in Mail to Hyperlinks
https://greasyfork.org/en/scripts/511727-convert-all-urls-in-mail-to-hyperlinks
Another very simple quality-of-life script.
Gonna commit my scripts for when I leave and inevitably come back. | Ban scripts | Says the guy who's used my scripts the longest |
1|2Back to topics list
|