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!