Converting from old engine to new

Hi All - I used Sandeling to run a simple dscan scipt that would randomly “press” the “V” button to initiate a Dscan. This was under the 32bit client.

I’ve been able to get the newest version of botengine installed… though, when I point the app-source to the directory my old scripts live in, it doesn’t seem to find what it is looking for.

The complaint is: “I did not find anything at “path”, please choose a directory containing the code of an app”

So, I am wondering if I need to translate the old *.cs file to the new method of doing things?


Edit: Here is the simple code I am trying to use:

/// Simple function to dscan no error checking
/// Default usage runs for 10 times with a delay of 10 seconds

// Didn’t explain it too well this method can be called several different ways
// DScanner(19,3) will run 20 times at 3 second intervals
// DScanner(19) will run 20 times at Delay=10 intervals
// DScanner() will run 10 times at Delay=10 intervals
// the int HowMany=9 and int Delay=10 are placeholders for arguments they will
// default to 9 and 10 if they are not present

/// The following code is contained in a ‘method’ and only executed when this method is called →
var MinimDelayDscan = 5;//in seconds //random number range mimimun
var MaximDelayDscan = 15;//in seconds //random number range maximum

void DScanner(int HowMany=9,int Delay=10) //???
var Capa=Sanderling?.MemoryMeasurementParsed?.Value?.ShipUi?.Center; //find this bit of the UI
Sanderling.MouseClickLeft(Capa); //click this bit to insure ‘chat’ is not focused ^^
while (true)//(0 < HowMany) uncomment this and replace true to set number of cycles #1
//Random rnd = new Random(); //random number code
Random rnd = new System.Random(); //another random number code
int DelayTime = rnd.Next(MinimDelayDscan, MaximDelayDscan); //random number code
Host.Log("Dscan in : " + DelayTime+ " s "); //echo in log what is happening
Sanderling.KeyboardPress(VirtualKeyCode.VK_V); //virtual keyboard press “v”
//Host.Delay(789Delay); //time to wait between code runs
1000); //=> delay of random generated in seconds
//HowMany–; uncomment this to set number of cycles #2
// This is a method call
DScanner();//(10, 10); uncomment this to set number of cycles #3

Not in this case.
As long as you do not read from the game client, you don’t need Sanderling.
For such a simple task, I don’t see a use for time-travel debugging, simulations, or other botengine features, so you might as well use a tool like AutoIt instead of botengine.

That being said, here is a complete app containing your dscan script:

You can run it with this command:

botengine  run

Wow! Thanks so much for spending the time to do that for me. This will allow me to reverse-engineer some simple things. I should be able to add the random timers in there to mimic this bit:

var MinimDelayDscan = 5;//in seconds //random number range mimimun
var MaximDelayDscan = 15;//in seconds //random number range maximum
Random rnd = new System.Random(); //another random number code

I put that bit in the original so things look more human… not that anyone would be looking for V key-presses :slight_smile:

Thanks again!

This is the line that should produce the random times:

You can see the actual resulting times of the steps in a session using the time-travel debugger (

Fantastic - I am able to do some modifications to the scripts with your help here!

I am getting a little bolder, and I was attempting to modify the warp-to-0 script. Ultimately, I am trying to make the script perform the Cloak + MWD technique for moving a DST around HS.

I am a little embarrassed to admit, that I can’t seem to figure out how to do the basic action of activating one module.

What should be the proper string for a botsettings variable, for a module? I have this:

defaultBotSettings : BotSettings
defaultBotSettings =
{ modulesToActivateAlways = [“covert ops cloaking device II”] }

parseBotSettings : String → Result String BotSettings
parseBotSettings =
AppSettings.parseSimpleListOfAssignments { assignmentsSeparators = [ “,”, “\n” ] }
([ ( “module-to-activate-always”
, AppSettings.valueTypeString (\moduleName → \settings → { settings | modulesToActivateAlways = moduleName :: settings.modulesToActivateAlways })
|> Dict.fromList

type alias BotSettings =
{ modulesToActivateAlways : List String

type alias BotMemory =
{ lastSolarSystemName : Maybe String
, jumpsCompleted : Int
, shipModules : ShipModulesMemory

But, it doesn’t seem to work. The app launches ok, and it starts to do the work for warping to zero - but, it never tries to activate this module which is in the first slot. Any thoughts?

The trick is to look into the description that is displayed for the app. You can also see the description in the catalog entry: FrontendWeb.Main

Here is the part of the description most important now:

 + `module-to-activate-always` : Text found in tooltips of ship modules that should always be active. For example: "cloaking device".

So the proper value for the app-settings is the display text you copy from the module button tooltip.

Any string from getAllContainedDisplayTexts on the tooltip should work.

In the alternate UI you have the getAllContainedDisplayTexts for every node: