I would like to use Survey Scanner for every even numbers of targets targetted.
My last issue I think is I have no idea how botengine updates botmemory. I tried following the flow but without avail.
Here is my thinking:
- Track the amounts of targets targetted the same way we track timesUnloaded in botmemory
- Make a list of module for Survey Scanner.
- Add a case…of or if…then to my logic tree that would activate survey scanner for every even numbers
Here is what I have so far.
List of Survey Scanner stored into memory
knownSurveyModules : BotDecisionContext -> List EveOnline.ParseUserInterface.ShipUIModuleButton
knownSurveyModules context =
context.readingFromGameClient.shipUI
|> Maybe.map .moduleButtons
|> Maybe.withDefault []
|> List.filter
(EveOnline.AppFramework.getModuleButtonTooltipFromModuleButton context.memory.shipModules
>> Maybe.map tooltipLooksLikeSurveyModule
>> Maybe.withDefault False
)
Added timesTargetted var into botmemory everywhere needed
type alias BotMemory =
{ lastDockedStationNameFromInfoPanel : Maybe String
, timesTargeted : Int
, timesUnloaded : Int
, volumeUnloadedCubicMeters : Int
, lastUsedCapacityInOreHold : Maybe Int
, shipModules : ShipModulesMemory
}
initState : State
initState =
EveOnline.AppFramework.initState
(EveOnline.AppFramework.initStateWithMemoryAndDecisionTree
{ lastDockedStationNameFromInfoPanel = Nothing
, timesTargeted = 0
, timesUnloaded = 0
, volumeUnloadedCubicMeters = 0
, lastUsedCapacityInOreHold = Nothing
, shipModules = EveOnline.AppFramework.initShipModulesMemory
}
)
describeSessionPerformance =
[ ( "times unloaded", context.memory.timesUnloaded )
, ( "volume unloaded / m³", context.memory.volumeUnloadedCubicMeters )
, ( "times targeted", context.memory.timesTargeted )
What should I replace WHAT TO WRITE HERE in the following snippet to store and update targets targeted?
let
[...]
timesTargeted =
botMemoryBefore.timesTargeted
+ (if [WHAT T0 WRITE HERE] then
1
else
0
)
in
{ lastDockedStationNameFromInfoPanel =
[ currentStationNameFromInfoPanel, botMemoryBefore.lastDockedStationNameFromInfoPanel ]
|> List.filterMap identity
|> List.head
, timesTargeted = timesTargeted
[...]
And what should I add in my targetting function to update this counter?
Here is my targeting function
if overviewEntry.commonIndications.targetedByMe || overviewEntry.commonIndications.targeting then
describeBranch "Locking target is in progress, wait for completion." waitForProgressInGame
else
describeBranch "Object is in range. Lock target."
(lockTargetFromOverviewEntry overviewEntry readingFromGameClient)