[v7] How to pre-select amount of fleet in fleetdispatch page for your script

  • 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 :


    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).

  • Why does it want ID in Ogame account?

    There are at least two kinds of games. One could be called finite, the other infinite. A finite game is played for the purpose of winning, an infinite game for the purpose of continuing the play.

    James P. Carse

  • here is my solution with the "next" button working. It's ugly so a better one would be much appreciated :)


    clicking on the ship image select all the ships available. But this value can be found in the "shipsOnPlanet" variable. So i keep this value. Update the variable with the number of ships i want, click the image and then restore the variable to it's previous value.


  • EDIT : whoops it doesn't keep the value... I've hidden my solution that doesn't work currently

    Edited once, last by OddWH ().

  • You can also just use the in-page vanilla OGame scripts. This is how I do it in AGR via an injected in-page script:


    Code
    1. window.fleetDispatcher.selectShip(id, count);
    2. window.fleetDispatcher.refresh();

    2rabnrop.png

    Rumors are carried by haters, spread by fools, and accepted by idiots.


    Developer of AntiGameReborn - Link to the AGR Discord