spartacus17
New Member
- Reaction score
- 0
- Author
- spartacus17
- Contributors
- ElvisWinehouse
- Quickbar Entry
-
javascript:
gameURL = window.location.href.substr(0, window.location.href.indexOf('&'));
if (gameURL == '') {
gameURL = window.location.href;
}
if (window.location.href.includes("&screen=place&mode=scavenge")) {
swa = parseInt(document.getElementById('scavenge_screen').getElementsByTagName('td')[1].querySelector('.units-entry-all').innerHTML.match(/\d+/)[0]);
swInput = $('#scavenge_screen td input').eq(1);
spa = parseInt(document.getElementById('scavenge_screen').getElementsByTagName('td')[0].querySelector('.units-entry-all').innerHTML.match(/\d+/)[0]);
spInput = $('#scavenge_screen td input').eq(0);
if (document.getElementsByClassName('scavenge-option')[3].children[2].lastChild.className=='inactive-view') {
swInput.val(Math.ceil(swa/13)).trigger("change");
spInput.val(Math.ceil(spa/13)).trigger("change");
$('.free_send_button').eq(3).focus();
} else if (document.getElementsByClassName('scavenge-option')[2].children[2].lastChild.className=='inactive-view') {
swInput.val(Math.ceil(swa/8)).trigger("change");
spInput.val(Math.ceil(spa/8)).trigger("change");
$('.free_send_button').eq(2).focus();
} else if (document.getElementsByClassName('scavenge-option')[1].children[2].lastChild.className=='inactive-view') {
swInput.val(Math.ceil(swa/7*2)).trigger("change");
spInput.val(Math.ceil(spa/7*2)).trigger("change");
$('.free_send_button').eq(1).focus();
} else if (document.getElementsByClassName('scavenge-option')[0].children[2].lastChild.className=='inactive-view') {
swInput.val(swa).trigger("change");
spInput.val(spa).trigger("change");
$('.free_send_button').eq(0).focus();
} else {
alert("No Available Slots");
}
} else {
window.location.href = gameURL+"&screen=place&mode=scavenge";
}
- Public?
- Public
This script ensures:
Instructions:
NOTE: This script only uses spearmen and swordsmen. Code needs to be modified for others to be included. Might update it in the future for this purpose.
- utilisation of all spearmen and swordsmen; and
- for all scavenging to last for the same duration (if using this script for all options).
Instructions:
- Run the script (on scavenging page) - Numbers will fill in for the last available scavenging option.
- Press Enter (Focus is set to the last available scavenging button "Start").
- Repeat until all scavenging options are used.
NOTE: This script only uses spearmen and swordsmen. Code needs to be modified for others to be included. Might update it in the future for this purpose.
- Changelog
- 17/05/2022 - Script redirects to scavenging page if not already on it; Script no longer requires refresh between commands.
Last edited:
Upvote
0