Mining bot Efficiency

Great job on the bot, however right now the biggest pain point is how slow it is between trips as it sits 20 km away from the nears asteroid, is there a way to make the bot take a marker of the last asteroid and warp to it instead of to the belt?

As far as I remember, EVE Online lets you create a bookmark for an asteroid and warp closer to this bookmark.
What do you get when you rightclick on an asteroid?

It is easily doable by bookmarking the place you want your ship to warp to and changing the text “Asteroid Belt” with “Locations” in bot.elm. Then you have to change the menu entry text as well (found in the lines below “Asteroid belt”) to the corresponding menu entries (check the appropriate entries in-game).

Due to how the Locations menu is sorted, the first two entries are always unclickable, is there a way to ignore the first two?

Yes, you can define the order by sorting the menu entries vertically, based on their display region:

sortMenuEntriesDownward :
    List EveOnline.ParseUserInterface.ContextMenuEntry
    -> List EveOnline.ParseUserInterface.ContextMenuEntry
sortMenuEntriesDownward =
    sortByDisplayRegionDownward .uiNode

sortByDisplayRegionDownward :
    (element -> EveOnline.ParseUserInterface.UITreeNodeWithDisplayRegion)
    -> List element
    -> List element
sortByDisplayRegionDownward getUINode =
    List.sortBy (getUINode >> .totalDisplayRegion >> .y)

Then you can use List.drop 2 to ignore the first two elements:

menuEntriesMinusFirstTwo :
    List EveOnline.ParseUserInterface.ContextMenuEntry
    -> List EveOnline.ParseUserInterface.ContextMenuEntry
menuEntriesMinusFirstTwo =
    sortMenuEntriesDownward >> List.drop 2
1 Like

I’m having trouble getting this to work… from what I can understand “menuEntriesMinusFirstTwo” needs to be called somewhere here:

            , ( "Click on one of the menu entries."
          , lastContextMenuOrSubmenu
                >> Maybe.andThen
                    (.entries >> listElementAtWrappedIndex (getEntropyIntFromUserInterface parsedUserInterface))
                >> (.uiNode >> clickOnUIElement MouseButtonLeft >> List.singleton)

but I can’t seem to make it work…

No, that is not necessary. I would use a more common approach to pick the menu entry, because it is easier to find in the examples.
I found one example here:

What the bot does here is to filter the menu entries by their label text.
So when your bookmark is named “my mining site”, you can use this action to click the menu entry:

[ ( "Click menu entry 'my mining site'."
  , lastContextMenuOrSubmenu
        >> Maybe.andThen (menuEntryContainingTextIgnoringCase "my mining site")
        >> (.uiNode >> clickOnUIElement MouseButtonLeft >> List.singleton)

Seeing this discussion, I think maybe I can add library functions to make this easier.
I see 13 usages of lastContextMenuOrSubmenu in the example app linked above.
Maybe a specialised helper would improve these apps, something like

clickEntryInLastContextMenu : (EveOnline.ParseUserInterface.ContextMenuEntry -> Bool) -> ( String, ReadingFromGameClient -> Maybe (List VolatileHostInterface.EffectOnWindowStructure) )


I will experiment with this in the example projects.

I added this framework to make using context menu cascades easier:

1 Like

A few days later, I had another idea of how to improve the context menu cascade model. This change made yesterday avoids some problems, such as in apps that use branching in context menus: