You need to put the number after the '"Flags":' marker into the "statusFlags" text variable, and after the inline function runs, "statusFlags" will contain the names (as listed in the inline function) of the active flags.
You asked how to get from a number to a set of flags, so I assume you already have a way of getting said number into VoiceAttack.
If not: How is this .json file written? Is it always a single line, or do newer entries get appended?
If it's a single entry, this should work:
Set text [statusFlags] to [C:\Status.json]
Inline C# Function: Elite:Dangerous flags to text, wait until execution finishes
Write [Blue] '{TXT:statusFlags}' to log
Begin Text Compare : [statusFlags] Contains 'InMainShip'
Write [Blue] 'Currently in main ship' to log
Else
Write [Blue] 'Currently not in main ship' to log
End Condition
(Obviously you'll need to substitute the actual path to your Status.json file)
Where "Elite:Dangerous flags to text" contains:
using System;
public class VAInline
{
[Flags]
enum status : uint
{
Docked = 1,
Landed = 2,
LandingGearDown = 4,
ShieldsUp = 8,
SuperCruise = 16,
FlightAssistOff = 32,
HardpointsDeployed = 64,
InWing = 128,
LightsOn = 256,
CargoScoopDeployed = 512,
SilentRunning = 1024,
ScoopingFuel = 2048,
SrvHandbrake = 4096,
SrvUsingTurretView = 8192,
SrvTurretRetracted = 16384,
SrvDriveAssist = 32768,
FsdMassLocked = 65536,
FsdCharging = 131072,
FsdCooldown = 262144,
LowFuel = 524288,
OverHeating = 1048576,
HasLatLong = 2097152,
IsInDanger = 4194304,
BeingInterdicted = 8388608,
InMainShip = 16777216,
InFighter = 33554432,
InSrv = 67108864,
HudInAnalysisMode = 134217728,
NightVision = 268435456,
AltitudeFromAverageRadius = 536870912,
FsdJump = 1073741824,
SrvHighBeam = 2147483648
}
public void main()
{
string statusInfo = VA.GetText("statusFlags") ?? "";
int flagsSectionStart = statusInfo.IndexOf("\"Flags\":") + 8;
if (flagsSectionStart == -1)
{
VA.WriteToLog("Error getting status flags: '\"Flags:\"' section not found", "red");
VA.SetText("statusFlags", "");
return;
}
int flagsSectionEnd = statusInfo.IndexOf(',', flagsSectionStart);
string flagsNumber = statusInfo.Substring(flagsSectionStart, flagsSectionEnd - flagsSectionStart);
int flagsInt;
Int32.TryParse(flagsNumber, out flagsInt);
status flags = (status)flagsInt;
VA.SetText("statusFlags", flags.ToString());
}
}