Documentation
¶
Overview ¶
Package elite provides real-time data from Elite Dangerous through files written to disk by the game.
Example ¶
package main import ( "fmt" "github.com/BenJuan26/elite" ) func main() { // Errors not handled here system, _ := elite.GetStarSystem() fmt.Println("Current star system is " + system) status, _ := elite.GetStatus() if status.Flags.Docked { fmt.Println("Ship is docked") } else { fmt.Println("Ship is not docked") } }
Output:
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetStarSystem ¶
GetStarSystem returns the current star system.
func GetStarSystemFromPath ¶
GetStarSystemFromPath returns the current star system using the specified log path.
Types ¶
type JournalEntry ¶
JournalEntry is a minimal entry in the Journal file. It is primarily intended for embedding within event types, such as StarSystemEvent.
type Loadout ¶
type Loadout struct { *JournalEntry Ship string `json:"Ship"` ShipID int64 `json:"ShipID"` ShipName string `json:"ShipName"` ShipIdent string `json:"ShipIdent"` HullValue int64 `json:"HullValue"` ModulesValue int64 `json:"ModulesValue"` HullHealth int64 `json:"HullHealth"` UnladenMass float64 `json:"UnladenMass"` CargoCapacity int64 `json:"CargoCapacity"` MaxJumpRange float64 `json:"MaxJumpRange"` FuelCapacity loadout.Fuel `json:"FuelCapacity"` Rebuy int64 `json:"Rebuy"` Modules []loadout.Module `json:"Modules"` }
Loadout contains information about the player's ship, its status, and its modules.
func GetLoadout ¶
GetLoadout reads the current ship loadout from the journal files. It will read them from the default log path, which is the Saved Games folder. The full path is:
C:/Users/<Username>/Saved Games/Frontier Developments/Elite Dangerous
If that path is not suitable, use GetLoadoutFromPath.
func GetLoadoutFromPath ¶
GetLoadoutFromPath reads the current ship loadout from the journal files at the specified path.
type StarSystemEvent ¶
type StarSystemEvent struct { *JournalEntry StarSystem string `json:"StarSystem,omitempty"` }
StarSystemEvent is an event that contains the current star system. It may be a Location, FSDJump, or SupercruiseExit event.
type Statistics ¶
type Statistics struct { *JournalEntry BankAccount stats.BankAccount `json:"Bank_Account"` Combat stats.Combat `json:"Combat"` Crime stats.Crime `json:"Crime"` Smuggling stats.Smuggling `json:"Smuggling"` Trading stats.Trading `json:"Trading"` Mining stats.Mining `json:"Mining"` Exploration stats.Exploration `json:"Exploration"` Passengers stats.Passengers `json:"Passengers"` SearchAndRescue stats.SearchAndRescue `json:"Search_And_Rescue"` Crafting stats.Crafting `json:"Crafting"` // Crew stats.Crew `json:"Crew"` Multicrew stats.Multicrew `json:"Multicrew"` MaterialTrader stats.MaterialTrader `json:"Material_Trader_Stats"` }
Statistics is the main statistics object. The statistics are divided into different categories contains by several fields.
func GetStatistics ¶
func GetStatistics() (*Statistics, error)
GetStatistics reads the game statistics from the journal files. It will read them from the default log path, which is the Saved Games folder. The full path is:
C:/Users/<Username>/Saved Games/Frontier Developments/Elite Dangerous
If that path is not suitable, use GetStatisticsFromPath.
func GetStatisticsFromPath ¶
func GetStatisticsFromPath(logPath string) (*Statistics, error)
GetStatisticsFromPath returns game statistics using the specified log path.
type Status ¶
type Status struct { Timestamp string `json:"timestamp"` Event string `json:"event"` Flags StatusFlags `json:"-"` RawFlags uint32 `json:"Flags"` Pips [3]int32 `json:"Pips"` FireGroup int32 `json:"FireGroup"` GuiFocus int32 `json:"GuiFocus"` Fuel Fuel `json:"Fuel"` Cargo float64 `json:"Cargo"` Latitude float64 `json:"Latitude,omitempty"` Longitude float64 `json:"Longitude,omitempty"` Heading int32 `json:"Heading,omitempty"` Altitude int32 `json:"Altitude,omitempty"` }
Status represents the current state of the player and ship.
func GetStatus ¶
GetStatus reads the current player and ship status from Status.json. It will read them from the default log path, which is the Saved Games folder. The full path is:
C:/Users/<Username>/Saved Games/Frontier Developments/Elite Dangerous
If that path is not suitable, use GetStatusFromPath.
func GetStatusFromBytes ¶
GetStatusFromBytes reads the current player and ship status from the string contained in the byte array.
func GetStatusFromPath ¶
GetStatusFromPath reads the current player and ship status from Status.json at the specified log path.
func (*Status) ExpandFlags ¶
func (status *Status) ExpandFlags()
ExpandFlags parses the RawFlags and sets the Flags values accordingly.
type StatusFlags ¶
type StatusFlags struct { Docked bool Landed bool LandingGearDown bool ShieldsUp bool Supercruise bool FlightAssistOff bool HardpointsDeployed bool InWing bool LightsOn bool CargoScoopDeployed bool SilentRunning bool ScoopingFuel bool SRVHandbrake bool SRVTurret bool SRVUnderShip bool SRVDriveAssist bool FSDMassLocked bool FSDCharging bool FSDCooldown bool LowFuel bool Overheating bool HasLatLong bool IsInDanger bool BeingInterdicted bool InMainShip bool InFighter bool InSRV bool InAnalysisMode bool NightVision bool AltitudeFromAverageRadius bool FSDJump bool SRVHighBeam bool }
StatusFlags contains boolean flags describing the player and ship.