Here is my warpToMiningSite function using personal locations
warpToMiningSite : ReadingFromGameClient -> DecisionPathNode
warpToMiningSite readingFromGameClient =
readingFromGameClient
|> useContextMenuCascadeOnListSurroundingsButton
(useMenuEntryWithTextContaining "locations"
(useRandomMenuEntry
(useMenuEntryWithTextContaining "within 0 m" menuCascadeCompleted)
)
)
There is no way to useRandomEntryWithTextContaining so the bot sometimes try to click on Personal Locations or the folder. It’s not a problem at all but it made me think about trying to create something like this. This obviously does not work in this project but by itself it works well
useRandomMenuEntryWithTextContaining : String -> UseContextMenuCascadeNode -> UseContextMenuCascadeNode
useRandomMenuEntryWithTextContaining textToSearch =
useMenuEntryInLastContextMenuInCascade
{ describeChoice = "with text containing '" ++ textToSearch ++ "'"
, chooseEntry =
(Random.initialSeed (getEntropyIntFromReadingFromGameClient readingFromGameClient))
|> Random.step (Random.List.shuffle ((List.filter (.text >> String.toLower >> String.contains (textToSearch |> String.toLower))) |> List.filter (String.contains textToSearch )))
|> Tuple.first
|> List.head
}
The current implementation of useEntryWithTextContaining does not allow for randomness. Always chooses the top of the list with List.head
https://github.com/Viir/bots/blob/main/implement/applications/eve-online/eve-online-mining-bot/EveOnline/AppFramework.elm#L1167-L1174
I’d love to be able to add this by myself but I couldn’t figure out how to make it compatible with all the different types. .text is really throwing a wrench in my method of doing it.