Turn off one module before each warp

Hello!
Im testing EVE Online Anomaly Ratting Bot Release now. It works fine but i would really apretiate if someone could help and add feature to Turn off one module before each warp (for Example second module).
The reason is that it will be more safer for users cause turning off Afterburner will decrease time of warp off (im using ishar with 10 mn Afterburner).

If this feature already exists - please tell me how to deal with it.
Thanks a lot

1 Like

Hello Moom,

Here’s a solution to help you implement this feature:

To achieve this, you’ll need to integrate two new functions into your bot’s code (I used bot 8cab38824b as the basis):

Function to Identify and Deactivate Modules:

deactivateModulesBeforeWarp : BotDecisionContext -> Maybe DecisionPathNode
deactivateModulesBeforeWarp context =
    context
        |> modulesToDeactivateBeforeWarp
        |> List.filter (Tuple.second >> moduleIsActiveOrReloading)
        |> List.head
        |> Maybe.map
            (\(moduleMatchingText, moduleToDeactivate) ->
                describeBranch ("Deactivating active module '" ++ moduleMatchingText ++ "' before warp.")
                    (clickModuleButtonButWaitIfClickedInPreviousStep context moduleToDeactivate)
            )

This function checks for active or reloading modules that you wish to deactivate before warp (e.g., Afterburner) and prepares the deactivation command.

Function to List Modules for Deactivation:


modulesToDeactivateBeforeWarp :
    BotDecisionContext
    -> List (String, EveOnline.ParseUserInterface.ShipUIModuleButton)
modulesToDeactivateBeforeWarp context =
    context.readingFromGameClient.shipUI
        |> Maybe.map .moduleButtons
        |> Maybe.withDefault []
        |> List.filterMap
            (\moduleButton ->
                moduleButton
                    |> EveOnline.BotFramework.getModuleButtonTooltipFromModuleButton context.memory.shipModules
                    |> Maybe.andThen
                        (.allContainedDisplayTextsWithRegion
                            >> List.filterMap
                                (\(tooltipText, _) ->
                                    if tooltipText |> stringContainsIgnoringCase "afterburner" then
                                        Just tooltipText
                                    else
                                        Nothing
                                )
                            >> List.head
                        )
                    |> Maybe.map (\moduleName -> (moduleName, moduleButton))
            )

This helper function compiles a list of modules, like Afterburners, to be deactivated based on the ship’s UI.

Integrating with the Bot’s Warping Process

After defining these functions, incorporate them into the bot’s warping sequence:

[...]
            Just anomalyScanResult ->
                describeBranch "Initiating warp to anomaly."
                    (deactivateModulesBeforeWarp context
                        |> Maybe.withDefault
                            (useContextMenuCascade
                                ("Scan result", anomalyScanResult.uiNode)
                                (useMenuEntryWithTextContaining "Warp to Within"
                                    (useMenuEntryWithTextContaining
                                        context.eventContext.botSettings.warpToAnomalyDistance
                                        menuCascadeCompleted
                                    )
                                )
                                context
                            )
                    )

Here, before the bot warps to an anomaly, it first executes deactivateModulesBeforeWarp . This function ensures any specified modules (like the Afterburner) are turned off.

Hope this helps! Let me know if you have any questions or need further assistance. Happy botting! :rocket:

Thank you for fast response. I did all the changes and its very good

Im still testing New feature but it seems it works!
Now bot turns off Afterburner before warp to Anomaly.

But he is still dont do it before warp to station when neutral comes to the system. I need him to do that in both case:

  1. Warp to Anomaly
  2. Warp to station when neutral comes to local chat
    Can you advice what i have to change to do that?

Now that you mention it, I see the path to hiding from neutrals was not covered in that version above.

I added another change to also cover the warping to station.
You can see the code change in this commit: https://github.com/Viir/bots/commit/bb2cc1083f0d29e1e35020d3df3099a1c86b8460

You can also run this bot from https://github.com/Viir/bots/tree/bb2cc1083f0d29e1e35020d3df3099a1c86b8460/implement/applications/eve-online/eve-online-combat-anomaly-bot