Hi,
I found a solution for O-Table that NoMoreAngel suggested I should share.
In fact, this solution has been mostly suggested by Chouette in the french community, I just customized it for O-Table.
Ok, you might have seen that if you use old links to pre-select amount of fleet for your script, no fleet are pre-selected when you go in fleetdispatch page.
For O-Table, I added this code :
- //Checks if current page is fleetdispatch and launch a function
- if (CurrentURL.search("fleetdispatch") >= 0) {
- if (CurrentURL.search("Otable") >= 0) {
- var ShipAmount = CurrentURL.split('Otable')[1].split('=')[1];
- var ShipType = CurrentURL.split('Otable')[1].split('=')[0];
- console.log("[O-Table] : Current Page is fleetdispatch");
- let element = document.querySelector("input[name='" + ShipType + "']");
- element.focus();
- element.value = ShipAmount;
- }
- }
This code is direcly in the script (not in a function).
For each spy report in my spy report table, I generate these kind of links :
https://s802-en.ogame.gameforg…letransporterSmall=131111
It checks if there is "fleetdispatch" in the URL and then splits the custom link at "Otable".
After that, you just get the type of ship + amount from the link, and you put that in the inputbox from the page.
And that's done
Note : at this point, the "next" button stays grey, like if nothing was entered in the input box. User has to press enter key once and that's good, but an error message appears.
I put a element.focus to avoid to have to click on the inputbox each time.
I'll add soon a 1x auto enter to do a small workaround for this issue (this auto enter will be removed once GF fixes his own function).