Viir / bots

Programming bots to play video games
https://botlab.org
MIT License
165 stars 135 forks source link

farm of ore anomalies #79

Open Levris opened 1 year ago

Levris commented 1 year ago

I understand correctly that the bot does not support the function of farming ore anomalies ?

Viir commented 1 year ago

Yes, none of the examples in this repository supports mining ore in anomalies.

Levris commented 1 year ago

Yes, none of the examples in this repository supports mining ore in anomalies.

and how to add the possibility of sending a ship to anomalies ?

Viir commented 1 year ago

and how to add the possibility of sending a ship to anomalies ?

This repository already contains some bots that automatically find and warp into anomalies. Here is an example of a function that checks the probe scanner window and initiates the warping via a matching scan result: https://github.com/Viir/bots/blob/eb1f720a574b5717291533b7649d51d776707d90/implement/applications/eve-online/eve-online-combat-anomaly-bot/Bot.elm#L737-L779

You can copy that function into your bot 👍

Levris commented 1 year ago

2023-04-19_21-33-29 and if, for example, you don't use probes, but just jump to the anomaly that is in the overview panel

Viir commented 1 year ago

When you say 'overview panel', I guess you mean that UI element in the screenshot you added. That screenshot is cropped; a part is missing, but I guess this is the menu you get when clicking the surroundings button. It is easy to adapt a bot to use the entries in there. We can do this by starting with a popular mining bot that already uses the menu from the surroundings button. That way, we only have to adjust the path in the menu. Most people use a submenu that contains the string 'asteroid belts' when they expand that menu to arrive at the representation of their mining site.

As I understand your screenshot, your setup has a submenu called 'Anomalies' in the same menu. So our next experiment is replacing that string used to filter submenus and testing that on your game client.

I made a new bot adapted to your game client. You can run it from https://github.com/Viir/bots/tree/e6a0b6999f506bc1670e01cccc3f403e6a9b5c7e/implement/applications/eve-online/eve-online-mining-bot

image

Following is the changed function:

warpToMiningSite : BotDecisionContext -> DecisionPathNode
warpToMiningSite context =
    useContextMenuCascadeOnListSurroundingsButton
        (useMenuEntryWithTextContaining "Anomalies"
            (useRandomMenuEntry (context.randomIntegers |> List.head |> Maybe.withDefault 0)
                (useMenuEntryWithTextContaining "Warp to Within"
                    (useMenuEntryWithTextContaining "Within 0 m" menuCascadeCompleted)
                )
            )
        )
        context

If you see any problems with that bot, we will fine-tune the detection of the UI elements to match your setup better.

Levris commented 1 year ago

Thank you so much for your help ! The bot started jumping on anomalies, however (as it is written in the code) randomly and often on combat anomalies. Replaced a lot of code with

warpToMiningSite : BotDecisionContext -> DecisionPathNode warpToMiningSite context = useContextMenuCascadeOnListSurroundingsButton (useMenuEntryWithTextContaining "Anomalies" (useMenuEntryWithTextContainingFirstOf ([ "Asteroid", "Cluster" ]) (useMenuEntryWithTextContaining "Warp to Within" (useMenuEntryWithTextContaining "Within 0 m" menuCascadeCompleted) ) ) ) context

and everything worked as it should !

Viir commented 1 year ago

Thank you for the update!

Glad to know everything works for you now!