Started messing around with Dscan

This is really basic but could be helpful for people who are interested in running DScan while they are hunting/mining. I have set up my Dscan so that if any entry shows up I want my script to leave.

My issue was figuring out how to send the scan command intermittently. I managed to find a way using
rampRotationMilli. Right now this snippet uses mining modules but I might use my tank module instead for a more reliable timer.

case context |> knownMiningModules |> List.filter (.isActive >> Maybe.withDefault False) |> List.head of
    Nothing ->
          waitForProgressInGame

     Just activeModule ->
          if ((activeModule.rampRotationMilli |> Maybe.withDefault 0) |> modBy 50) > 25 then
              describeBranch "Dscanning"
                  (decideActionForCurrentStep
                          [ EffectOnWindow.KeyDown EffectOnWindow.vkey_V
                           , EffectOnWindow.KeyUp EffectOnWindow.vkey_V
                           ]
                  )
          else
             ....

Here is the part the look for entries in dscan. I’d like to filter the result down the line but this is the beginning.

case context.readingFromGameClient.directionalScannerWindow of
                            Nothing ->
                                describeBranch "Opening directional scanner window."
                                    (decideActionForCurrentStep
                                        [ EffectOnWindow.KeyDown EffectOnWindow.vkey_V
                                        , EffectOnWindow.KeyUp EffectOnWindow.vkey_V
                                        ]
                                    )

                            Just dscanWindow ->
                                if (dscanWindow.scanResults |> List.length) > 0 then
                                    describeBranch "Enemies in dscan range. Leaving"
                                        (returnDronesToBay context
                                            |> Maybe.withDefault (warpToRandomBelt context)
                                        )

                                else
                                  ....
1 Like

Updated my ‘when to activate directional scan’ logic. It now use my shield hardener which makes it much more reliable because it is always on.

case seeUndockingComplete |> tankModuleToActivate |> List.filter (.isActive >> Maybe.withDefault False) |> List.head of
                Nothing ->
                    waitForProgressInGame

                Just tankModule ->
                    if ((tankModule.rampRotationMilli |> Maybe.withDefault 0) |> modBy 50) > 40 then
                        describeBranch "Dscanning"
                            (decideActionForCurrentStep
                                [ EffectOnWindow.KeyDown EffectOnWindow.vkey_V
                                , EffectOnWindow.KeyUp EffectOnWindow.vkey_V
                                ]
                            )

                    else

This makes me dscan a bit randomly once every 4-6 seconds. We can always play with the delay by lowering ‘40’ in this snippet.

I am mostly operating in HS but I lost 2 mining hull in an hour to diamonds rats. Once they show up on overview it is already too late. That is why I decided to start using DScan to detect them before they show up on overview.

1 Like