diff --git a/DataDefinitions/Status.cs b/DataDefinitions/Status.cs index da2cd9e78d..7d4ddad319 100644 --- a/DataDefinitions/Status.cs +++ b/DataDefinitions/Status.cs @@ -69,7 +69,8 @@ public enum Flags2 : uint OnFootExterior = 0x00008000, // On Foot Exterior (Not sure when this would actually be set. Space walks maybe?) BreathableAtmosphere = 0x00010000, // Breathable Atmosphere TelepresenceMulticrew = 0x00020000, // Telepresence Multicrew - PhysicalMulticrew = 0x00040000 // Physical Multicrew + PhysicalMulticrew = 0x00040000, // Physical Multicrew + FsdHyperDriveCharging = 0x00080000 // Fsd hyperdrive charging } // Variables set from status flags (when not signed in, this is set to '0') @@ -100,10 +101,13 @@ public enum Flags2 : uint [PublicAPI] public string fsd_status => - ((flags & Flags.FsdCooldown) != 0) ? "cooldown" - : ((flags & Flags.FsdCharging) != 0) ? "charging" - : ((flags & Flags.FsdMassLocked) != 0) ? "masslock" - : "ready"; + ((flags & Flags.FsdCooldown) != 0) ? "cooldown" : + ((flags & Flags.FsdCharging) != 0) ? "charging" : + ((flags & Flags.FsdMassLocked) != 0) ? "masslock" : + "ready"; + + [PublicAPI] + public bool fsd_hyperdrive_charging => (flags2 & Flags2.FsdHyperDriveCharging) != 0; [PublicAPI] public bool srv_drive_assist => (flags & Flags.SrvDriveAssist) != 0 && (flags & Flags.InSRV) != 0; diff --git a/EDDI/ChangeLog.md b/EDDI/ChangeLog.md index 73f45a0891..4092ac7e21 100644 --- a/EDDI/ChangeLog.md +++ b/EDDI/ChangeLog.md @@ -5,8 +5,13 @@ Full details of the variables available for each noted event, and VoiceAttack in ## 4.0.3 * Navigation Monitor * Fix `Shortest Missions Route` reports all distances as zero (0) light-years #2488 + * The `status` object now contains a new property `fsd_hyperdrive_charging` (`{BOOL:Status fsd hyperdrive charging}` in VoiceAttack), which contains a boolean value indicating whether the FSD is currently charging for a jump to hyperspace. * Speech Responder + * Events + * `Ship FSD` event now includes a new boolean `hyperdrive_charging`. * Changes to existing scripts + * `Fsd engaged` (triggered after the FSD is engaged) no longer warns about hazardous or non-scoopable arrival stars. + * `Ship FSD` (triggered before the FSD is engaged) now warns about nearby hazardous stars or no charted scoopable stars in your arrival system. * `Swapout check` updated to fix a bug that was causing false positives. * VoiceAttack Responder * Fixed a bug that prevented current ship variables from being updated properly on a ship change. #2482 diff --git a/Events/ShipFsdEvent.cs b/Events/ShipFsdEvent.cs index 5edac5db9c..79f7a0fa30 100644 --- a/Events/ShipFsdEvent.cs +++ b/Events/ShipFsdEvent.cs @@ -8,14 +8,18 @@ public class ShipFsdEvent : Event { public const string NAME = "Ship fsd"; public const string DESCRIPTION = "Triggered when there is a change to the status of your ship's fsd"; - public const string SAMPLE = null; + public static ShipFsdEvent SAMPLE = new ShipFsdEvent(DateTime.UtcNow, "charging", true); [PublicAPI("The status of your ship's fsd ('cooldown', 'cooldown complete', 'charging', 'charging cancelled', 'charging complete', 'masslock', or 'masslock cleared')")] public string fsd_status { get; private set; } - public ShipFsdEvent(DateTime timestamp, string fsdStatus) : base(timestamp, NAME) + [PublicAPI("True if the FSD is currently charging for a jump to hyperspace.")] + public bool hyperdrive_charging { get; private set; } + + public ShipFsdEvent(DateTime timestamp, string fsdStatus, bool hyperdriveCharging = false) : base(timestamp, NAME) { this.fsd_status = fsdStatus; + this.hyperdrive_charging = hyperdriveCharging; } } } diff --git a/SpeechResponder/Variables.md b/SpeechResponder/Variables.md index 253694583e..b2bf04cd9a 100644 --- a/SpeechResponder/Variables.md +++ b/SpeechResponder/Variables.md @@ -758,6 +758,7 @@ Any values might be missing, depending on EDDI's configuration. - *overheating* - a boolean value indicating whether the commander's vehicle is overheating - *low_fuel* - a boolean value indicating whether the commander has less than 25% fuel remaining - *fsd_status* - the current status of the ship's frame shift drive. Can be one of "ready", "cooldown", "charging", or "masslock" + - *fsd_hyperdrive_charging* - a boolean value indicating whether the FSD is currently charging for a jump to hyperspace. - *srv_drive_assist* - a boolean value indicating whether SRV drive assist is active - *srv_highbeam* - true if the lights in your SRV are set to the high beam mode. - *srv_under_ship* - a boolean value indicating whether the SRV in within the proximity zone around the ship diff --git a/SpeechResponder/eddi.cs.json b/SpeechResponder/eddi.cs.json index ed3c0408f0..79244df4d5 100644 --- a/SpeechResponder/eddi.cs.json +++ b/SpeechResponder/eddi.cs.json @@ -1045,7 +1045,7 @@ "enabled": true, "priority": 3, "responder": true, - "script": "{_ Context }\r\n{SetState('eddi_context_last_subject', 'fsd')}\r\n{SetState('eddi_context_last_action', 'engage')}\r\n{SetState('eddi_context_system_name', event.system)}\r\n{SetState('eddi_context_system_system', event.system)}\r\n{SetState('eddi_context_fsd_target', event.target)}\r\n{SetState('eddi_context_system_lastvisit', system.lastVisitSeconds)}\r\n\r\n{_ Zero the 'remaining jump' context to only use values following this event _}\r\n{SetState('eddi_context_remaining_jumps', 0)}\r\n\r\n{if event.target = 'Hyperspace':\r\n {_ Rewrite context to represent a jump }\r\n {SetState('eddi_context_last_subject', 'jump')}\r\n {SetState('eddi_context_last_action', 'start')}\r\n\r\n {set reportsystem to SystemDetails(event.system)}\r\n\r\n {_ Wait for the FSD countdown and initial jump}\r\n {Pause(5000)}\r\n\r\n {OneOf(\"Destination confirmed\",\"Jump in progress\",\"Telemetry obtained\")}.\r\n {ShipName()} is {OneOf(\"heading to\", \"on route to\", \"travelling to\", \"in transit to\")} the {P(reportsystem.name, \"starsystem\")} system.\r\n {if reportsystem.name = homesystem.name:\r\n Welcome home, {F(\"Honorific\")}\r\n |else:\r\n {set scoopables to [\"O\", \"B\", \"A\", \"F\", \"G\", \"K\", \"M\"]}\r\n {if slice(event.stellarclass, 0, 1) = \"D\":\r\n Caution: white dwarf detected.\r\n |elif event.stellarclass = \"N\":\r\n Caution: neutron star detected.\r\n |elif event.stellarclass = \"H\":\r\n Caution: black hole detected.\r\n |elif find(scoopables, event.stellarclass) = -1:\r\n {Occasionally(2, \"Information: \")}\r\n Arrival star is not scoopable.\r\n }\r\n \r\n {if lastsystem.allegiance && lastsystem.allegiance != \"None\" && lastsystem.allegiance != \"Independent\" && (!reportsystem.allegiance || reportsystem.allegiance = \"None\" || reportsystem.allegiance = \"Independent\"):\r\n You {OneOf(\"are leaving\", \"have left\", \"are no longer in\")} {lastsystem.allegiance} space.\r\n |elif lastsystem.allegiance && lastsystem.allegiance != reportsystem.allegiance && system.allegiance && system.allegiance != \"None\":\r\n You {OneOf(\"are now in\", \"have entered\", \"are entering\")} {reportsystem.allegiance} space.\r\n {if cmdr.title != \"Commander\":\r\n Welcome back {F(\"Honorific\")}.\r\n }\r\n }\r\n\r\n {if reportsystem.visits = 0:\r\n This is your first visit to this system.\r\n |elif reportsystem.visits = 1:\r\n This is your second visit to this system.\r\n |elif reportsystem.visits = 2:\r\n {Occasionally(2, \"This is your third visit to this system.\")}\r\n |elif reportsystem.visits = 3:\r\n {Occasionally(2, \"This is your fourth visit to this system.\")}\r\n |else:\r\n {Occasionally(3, \"You have visited this system {reportsystem.visits} times.\")}\r\n }\r\n\r\n {if !reportsystem.population && lastsystem.population:\r\n {OneOf(\"This system is not populated\",\"There is no human presence here\", \"Humans have yet to colonise this system\")}.\r\n |elif reportsystem.population:\r\n {if SecondsSince(reportsystem.lastVisitSeconds) > 3600:\r\n {F(\"System report\")}\r\n }\r\n }\r\n\r\n {if reportsystem.distancefromhome:\r\n {set ReportDistanceFromHome() to:\r\n \t{return cat(\r\n \t OneOf(\"You are\", \"Current location is\", \"You are now\"), \" \",\r\n\t Humanise(reportsystem.distancefromhome), \" lightyears from \",\r\n\t OneOf(\"home\", \"{P(homesystem.name, 'starsystem')}\"), \".\"\r\n\t )}\r\n } \r\n {Occasionally(7, ReportDistanceFromHome())}\r\n }\r\n\r\n {if reportsystem.comment:\r\n You made a {OneOf(\"note\", \"comment\", \"remark\")} {OneOf(\"about\", \"for\", \"on\")} this system. It {OneOf(\"is as follows\", \"says\", \"reads\", \"is\")} {reportsystem.comment}.\r\n }\r\n }\r\n}", + "script": "{_ Context }\r\n{SetState('eddi_context_last_subject', 'fsd')}\r\n{SetState('eddi_context_last_action', 'engage')}\r\n{SetState('eddi_context_system_name', event.system)}\r\n{SetState('eddi_context_system_system', event.system)}\r\n{SetState('eddi_context_fsd_target', event.target)}\r\n{SetState('eddi_context_system_lastvisit', system.lastVisitSeconds)}\r\n\r\n{_ Zero the 'remaining jump' context to only use values following this event _}\r\n{SetState('eddi_context_remaining_jumps', 0)}\r\n\r\n{if event.target = 'Hyperspace':\r\n {_ Rewrite context to represent a jump }\r\n {SetState('eddi_context_last_subject', 'jump')}\r\n {SetState('eddi_context_last_action', 'start')}\r\n\r\n {set reportsystem to SystemDetails(event.system)}\r\n\r\n {_ Wait for the FSD countdown and initial jump}\r\n {Pause(5000)}\r\n\r\n {OneOf(\"Destination confirmed\",\"Jump in progress\",\"Telemetry obtained\")}.\r\n {ShipName()} is {OneOf(\"heading to\", \"on route to\", \"travelling to\", \"in transit to\")} the {P(reportsystem.name, \"starsystem\")} system.\r\n {if reportsystem.name = homesystem.name:\r\n Welcome home, {F(\"Honorific\")}.\r\n |else:\r\n {if lastsystem.allegiance && lastsystem.allegiance != \"None\" && lastsystem.allegiance != \"Independent\" && (!reportsystem.allegiance || reportsystem.allegiance = \"None\" || reportsystem.allegiance = \"Independent\"):\r\n You {OneOf(\"are leaving\", \"have left\", \"are no longer in\")} {lastsystem.allegiance} space.\r\n |elif lastsystem.allegiance && lastsystem.allegiance != reportsystem.allegiance && system.allegiance && system.allegiance != \"None\":\r\n You {OneOf(\"are now in\", \"have entered\", \"are entering\")} {reportsystem.allegiance} space.\r\n {if cmdr.title != \"Commander\":\r\n Welcome back {F(\"Honorific\")}.\r\n }\r\n }\r\n\r\n {if reportsystem.visits = 0:\r\n This is your first visit to this system.\r\n |elif reportsystem.visits = 1:\r\n This is your second visit to this system.\r\n |elif reportsystem.visits = 2:\r\n {Occasionally(2, \"This is your third visit to this system.\")}\r\n |elif reportsystem.visits = 3:\r\n {Occasionally(2, \"This is your fourth visit to this system.\")}\r\n |else:\r\n {Occasionally(3, \"You have visited this system {reportsystem.visits} times.\")}\r\n }\r\n }\r\n}", "default": true, "name": "FSD engaged", "description": "Triggered when your FSD has engaged" @@ -2053,7 +2053,7 @@ "enabled": true, "priority": 3, "responder": true, - "script": null, + "script": "{set hazardDistance to 100} {_ Warn me when hazardous stars are within this distance (in ls) from the main star }\r\n\r\n{_ Fetch from context _}\r\n{if state.eddi_context_next_system_name:\r\n {set reportSystem to SystemDetails(state.eddi_context_selected_system_name)}\r\n|else:\r\n {set reportSystem to nextsystem}\r\n}\r\n\r\n{if event.fsd_status = 'charging' && event.hyperdrive_charging: \r\n {if len(reportSystem.systemname) > 0:\r\n \r\n {Pause(2000)}\r\n \r\n {if reportSystem.systemname != homesystem.systemname:\r\n {for compartment in ship.compartments:\r\n {if compartment.module.invariantName = 'Fuel Scoop':\r\n {set scoop_present to true}\r\n }\r\n } \r\n \r\n {set scoop_present to true}\r\n\r\n {set nearbyWhiteDwarfStars to []}\r\n {set nearbyNeutronStars to []}\r\n {set nearbyBlackHolesStars to []}\r\n {for aBody in reportSystem.bodies:\r\n {if aBody.bodyType.invariantName = 'Star':\r\n {if aBody.mainstar:\r\n {set mainstar to aBody}\r\n |elif scoop_present && aBody.scoopable && aBody.distance < secondaryScoopStar.distance:\r\n {set secondaryScoopStar to aBody)}\r\n }\r\n {if slice(aBody.stellarclass, 0, 1) = \"D\" && aBody.distance < hazardDistance:\r\n {set nearbyWhiteDwarfStars to cat(nearbyWhiteDwarfStars, [aBody])} \r\n |elif aBody.stellarclass = 'N' && aBody.distance < hazardDistance:\r\n {set nearbyNeutronStars to cat(nearbyNeutronStars, [aBody])}\r\n |elif aBody.stellarclass = 'H' && aBody.distance < hazardDistance: \r\n {set nearbyBlackHolesStars to cat(nearbyBlackHolesStars, [aBody])}\r\n }\r\n }\r\n }\r\n \r\n {set nearbyHazards to []} \r\n {if len(nearbyWhiteDwarfStars) > 0:\r\n {set hazard to: White Dwarf{if len(nearbyWhiteDwarfStars) > 1:s}}\r\n {set nearbyHazards to cat(nearbyHazards, [hazard])}\r\n }\r\n {if len(nearbyNeutronStars) > 0:\r\n {set hazard to: Neutron Star{if len(nearbyNeutronStars) > 1:s}}\r\n {set nearbyHazards to cat(nearbyHazards, [hazard])}\r\n }\r\n {if len(nearbyBlackHolesStars) > 0:\r\n {set hazard to: Black Hole{if len(nearbyBlackHolesStars) > 1:s}}\r\n {set nearbyHazards to cat(nearbyHazards, [hazard])}\r\n }\r\n \r\n {if len(nearbyHazards) > 0:\r\n Caution: {List(nearbyHazards)} detected. \r\n }\r\n\r\n {if scoop_present && mainstar && !mainstar.scoopable && !secondaryScoopStar:\r\n {if len(nearbyHazards) = 0: {Occasionally(2, \"Alert: \")}}\r\n No scoopable stars charted\r\n {Occasionally(2, \"in arrival system\")}.\r\n }\r\n }\r\n }\r\n}", "default": true, "name": "Ship fsd", "description": "Triggered when there is a change to the status of your ship's fsd" diff --git a/SpeechResponder/eddi.de.json b/SpeechResponder/eddi.de.json index ed3c0408f0..79244df4d5 100644 --- a/SpeechResponder/eddi.de.json +++ b/SpeechResponder/eddi.de.json @@ -1045,7 +1045,7 @@ "enabled": true, "priority": 3, "responder": true, - "script": "{_ Context }\r\n{SetState('eddi_context_last_subject', 'fsd')}\r\n{SetState('eddi_context_last_action', 'engage')}\r\n{SetState('eddi_context_system_name', event.system)}\r\n{SetState('eddi_context_system_system', event.system)}\r\n{SetState('eddi_context_fsd_target', event.target)}\r\n{SetState('eddi_context_system_lastvisit', system.lastVisitSeconds)}\r\n\r\n{_ Zero the 'remaining jump' context to only use values following this event _}\r\n{SetState('eddi_context_remaining_jumps', 0)}\r\n\r\n{if event.target = 'Hyperspace':\r\n {_ Rewrite context to represent a jump }\r\n {SetState('eddi_context_last_subject', 'jump')}\r\n {SetState('eddi_context_last_action', 'start')}\r\n\r\n {set reportsystem to SystemDetails(event.system)}\r\n\r\n {_ Wait for the FSD countdown and initial jump}\r\n {Pause(5000)}\r\n\r\n {OneOf(\"Destination confirmed\",\"Jump in progress\",\"Telemetry obtained\")}.\r\n {ShipName()} is {OneOf(\"heading to\", \"on route to\", \"travelling to\", \"in transit to\")} the {P(reportsystem.name, \"starsystem\")} system.\r\n {if reportsystem.name = homesystem.name:\r\n Welcome home, {F(\"Honorific\")}\r\n |else:\r\n {set scoopables to [\"O\", \"B\", \"A\", \"F\", \"G\", \"K\", \"M\"]}\r\n {if slice(event.stellarclass, 0, 1) = \"D\":\r\n Caution: white dwarf detected.\r\n |elif event.stellarclass = \"N\":\r\n Caution: neutron star detected.\r\n |elif event.stellarclass = \"H\":\r\n Caution: black hole detected.\r\n |elif find(scoopables, event.stellarclass) = -1:\r\n {Occasionally(2, \"Information: \")}\r\n Arrival star is not scoopable.\r\n }\r\n \r\n {if lastsystem.allegiance && lastsystem.allegiance != \"None\" && lastsystem.allegiance != \"Independent\" && (!reportsystem.allegiance || reportsystem.allegiance = \"None\" || reportsystem.allegiance = \"Independent\"):\r\n You {OneOf(\"are leaving\", \"have left\", \"are no longer in\")} {lastsystem.allegiance} space.\r\n |elif lastsystem.allegiance && lastsystem.allegiance != reportsystem.allegiance && system.allegiance && system.allegiance != \"None\":\r\n You {OneOf(\"are now in\", \"have entered\", \"are entering\")} {reportsystem.allegiance} space.\r\n {if cmdr.title != \"Commander\":\r\n Welcome back {F(\"Honorific\")}.\r\n }\r\n }\r\n\r\n {if reportsystem.visits = 0:\r\n This is your first visit to this system.\r\n |elif reportsystem.visits = 1:\r\n This is your second visit to this system.\r\n |elif reportsystem.visits = 2:\r\n {Occasionally(2, \"This is your third visit to this system.\")}\r\n |elif reportsystem.visits = 3:\r\n {Occasionally(2, \"This is your fourth visit to this system.\")}\r\n |else:\r\n {Occasionally(3, \"You have visited this system {reportsystem.visits} times.\")}\r\n }\r\n\r\n {if !reportsystem.population && lastsystem.population:\r\n {OneOf(\"This system is not populated\",\"There is no human presence here\", \"Humans have yet to colonise this system\")}.\r\n |elif reportsystem.population:\r\n {if SecondsSince(reportsystem.lastVisitSeconds) > 3600:\r\n {F(\"System report\")}\r\n }\r\n }\r\n\r\n {if reportsystem.distancefromhome:\r\n {set ReportDistanceFromHome() to:\r\n \t{return cat(\r\n \t OneOf(\"You are\", \"Current location is\", \"You are now\"), \" \",\r\n\t Humanise(reportsystem.distancefromhome), \" lightyears from \",\r\n\t OneOf(\"home\", \"{P(homesystem.name, 'starsystem')}\"), \".\"\r\n\t )}\r\n } \r\n {Occasionally(7, ReportDistanceFromHome())}\r\n }\r\n\r\n {if reportsystem.comment:\r\n You made a {OneOf(\"note\", \"comment\", \"remark\")} {OneOf(\"about\", \"for\", \"on\")} this system. It {OneOf(\"is as follows\", \"says\", \"reads\", \"is\")} {reportsystem.comment}.\r\n }\r\n }\r\n}", + "script": "{_ Context }\r\n{SetState('eddi_context_last_subject', 'fsd')}\r\n{SetState('eddi_context_last_action', 'engage')}\r\n{SetState('eddi_context_system_name', event.system)}\r\n{SetState('eddi_context_system_system', event.system)}\r\n{SetState('eddi_context_fsd_target', event.target)}\r\n{SetState('eddi_context_system_lastvisit', system.lastVisitSeconds)}\r\n\r\n{_ Zero the 'remaining jump' context to only use values following this event _}\r\n{SetState('eddi_context_remaining_jumps', 0)}\r\n\r\n{if event.target = 'Hyperspace':\r\n {_ Rewrite context to represent a jump }\r\n {SetState('eddi_context_last_subject', 'jump')}\r\n {SetState('eddi_context_last_action', 'start')}\r\n\r\n {set reportsystem to SystemDetails(event.system)}\r\n\r\n {_ Wait for the FSD countdown and initial jump}\r\n {Pause(5000)}\r\n\r\n {OneOf(\"Destination confirmed\",\"Jump in progress\",\"Telemetry obtained\")}.\r\n {ShipName()} is {OneOf(\"heading to\", \"on route to\", \"travelling to\", \"in transit to\")} the {P(reportsystem.name, \"starsystem\")} system.\r\n {if reportsystem.name = homesystem.name:\r\n Welcome home, {F(\"Honorific\")}.\r\n |else:\r\n {if lastsystem.allegiance && lastsystem.allegiance != \"None\" && lastsystem.allegiance != \"Independent\" && (!reportsystem.allegiance || reportsystem.allegiance = \"None\" || reportsystem.allegiance = \"Independent\"):\r\n You {OneOf(\"are leaving\", \"have left\", \"are no longer in\")} {lastsystem.allegiance} space.\r\n |elif lastsystem.allegiance && lastsystem.allegiance != reportsystem.allegiance && system.allegiance && system.allegiance != \"None\":\r\n You {OneOf(\"are now in\", \"have entered\", \"are entering\")} {reportsystem.allegiance} space.\r\n {if cmdr.title != \"Commander\":\r\n Welcome back {F(\"Honorific\")}.\r\n }\r\n }\r\n\r\n {if reportsystem.visits = 0:\r\n This is your first visit to this system.\r\n |elif reportsystem.visits = 1:\r\n This is your second visit to this system.\r\n |elif reportsystem.visits = 2:\r\n {Occasionally(2, \"This is your third visit to this system.\")}\r\n |elif reportsystem.visits = 3:\r\n {Occasionally(2, \"This is your fourth visit to this system.\")}\r\n |else:\r\n {Occasionally(3, \"You have visited this system {reportsystem.visits} times.\")}\r\n }\r\n }\r\n}", "default": true, "name": "FSD engaged", "description": "Triggered when your FSD has engaged" @@ -2053,7 +2053,7 @@ "enabled": true, "priority": 3, "responder": true, - "script": null, + "script": "{set hazardDistance to 100} {_ Warn me when hazardous stars are within this distance (in ls) from the main star }\r\n\r\n{_ Fetch from context _}\r\n{if state.eddi_context_next_system_name:\r\n {set reportSystem to SystemDetails(state.eddi_context_selected_system_name)}\r\n|else:\r\n {set reportSystem to nextsystem}\r\n}\r\n\r\n{if event.fsd_status = 'charging' && event.hyperdrive_charging: \r\n {if len(reportSystem.systemname) > 0:\r\n \r\n {Pause(2000)}\r\n \r\n {if reportSystem.systemname != homesystem.systemname:\r\n {for compartment in ship.compartments:\r\n {if compartment.module.invariantName = 'Fuel Scoop':\r\n {set scoop_present to true}\r\n }\r\n } \r\n \r\n {set scoop_present to true}\r\n\r\n {set nearbyWhiteDwarfStars to []}\r\n {set nearbyNeutronStars to []}\r\n {set nearbyBlackHolesStars to []}\r\n {for aBody in reportSystem.bodies:\r\n {if aBody.bodyType.invariantName = 'Star':\r\n {if aBody.mainstar:\r\n {set mainstar to aBody}\r\n |elif scoop_present && aBody.scoopable && aBody.distance < secondaryScoopStar.distance:\r\n {set secondaryScoopStar to aBody)}\r\n }\r\n {if slice(aBody.stellarclass, 0, 1) = \"D\" && aBody.distance < hazardDistance:\r\n {set nearbyWhiteDwarfStars to cat(nearbyWhiteDwarfStars, [aBody])} \r\n |elif aBody.stellarclass = 'N' && aBody.distance < hazardDistance:\r\n {set nearbyNeutronStars to cat(nearbyNeutronStars, [aBody])}\r\n |elif aBody.stellarclass = 'H' && aBody.distance < hazardDistance: \r\n {set nearbyBlackHolesStars to cat(nearbyBlackHolesStars, [aBody])}\r\n }\r\n }\r\n }\r\n \r\n {set nearbyHazards to []} \r\n {if len(nearbyWhiteDwarfStars) > 0:\r\n {set hazard to: White Dwarf{if len(nearbyWhiteDwarfStars) > 1:s}}\r\n {set nearbyHazards to cat(nearbyHazards, [hazard])}\r\n }\r\n {if len(nearbyNeutronStars) > 0:\r\n {set hazard to: Neutron Star{if len(nearbyNeutronStars) > 1:s}}\r\n {set nearbyHazards to cat(nearbyHazards, [hazard])}\r\n }\r\n {if len(nearbyBlackHolesStars) > 0:\r\n {set hazard to: Black Hole{if len(nearbyBlackHolesStars) > 1:s}}\r\n {set nearbyHazards to cat(nearbyHazards, [hazard])}\r\n }\r\n \r\n {if len(nearbyHazards) > 0:\r\n Caution: {List(nearbyHazards)} detected. \r\n }\r\n\r\n {if scoop_present && mainstar && !mainstar.scoopable && !secondaryScoopStar:\r\n {if len(nearbyHazards) = 0: {Occasionally(2, \"Alert: \")}}\r\n No scoopable stars charted\r\n {Occasionally(2, \"in arrival system\")}.\r\n }\r\n }\r\n }\r\n}", "default": true, "name": "Ship fsd", "description": "Triggered when there is a change to the status of your ship's fsd" diff --git a/SpeechResponder/eddi.es.json b/SpeechResponder/eddi.es.json index 6f4a32e2a9..bcc58d8435 100644 --- a/SpeechResponder/eddi.es.json +++ b/SpeechResponder/eddi.es.json @@ -2051,7 +2051,7 @@ "enabled": true, "priority": 2, "responder": true, - "script": null, + "script": "{set hazardDistance to 100} {_ Warn me when hazardous stars are within this distance (in ls) from the main star }\r\n\r\n{_ Fetch from context _}\r\n{if state.eddi_context_next_system_name:\r\n {set reportSystem to SystemDetails(state.eddi_context_selected_system_name)}\r\n|else:\r\n {set reportSystem to nextsystem}\r\n}\r\n\r\n{if event.fsd_status = 'charging' && event.hyperdrive_charging: \r\n {if len(reportSystem.systemname) > 0:\r\n \r\n {Pause(2000)}\r\n \r\n {if reportSystem.systemname != homesystem.systemname:\r\n {for compartment in ship.compartments:\r\n {if compartment.module.invariantName = 'Fuel Scoop':\r\n {set scoop_present to true}\r\n }\r\n } \r\n \r\n {set scoop_present to true}\r\n\r\n {set nearbyWhiteDwarfStars to []}\r\n {set nearbyNeutronStars to []}\r\n {set nearbyBlackHolesStars to []}\r\n {for aBody in reportSystem.bodies:\r\n {if aBody.bodyType.invariantName = 'Star':\r\n {if aBody.mainstar:\r\n {set mainstar to aBody}\r\n |elif scoop_present && aBody.scoopable && aBody.distance < secondaryScoopStar.distance:\r\n {set secondaryScoopStar to aBody)}\r\n }\r\n {if slice(aBody.stellarclass, 0, 1) = \"D\" && aBody.distance < hazardDistance:\r\n {set nearbyWhiteDwarfStars to cat(nearbyWhiteDwarfStars, [aBody])} \r\n |elif aBody.stellarclass = 'N' && aBody.distance < hazardDistance:\r\n {set nearbyNeutronStars to cat(nearbyNeutronStars, [aBody])}\r\n |elif aBody.stellarclass = 'H' && aBody.distance < hazardDistance: \r\n {set nearbyBlackHolesStars to cat(nearbyBlackHolesStars, [aBody])}\r\n }\r\n }\r\n }\r\n \r\n {set nearbyHazards to []} \r\n {if len(nearbyWhiteDwarfStars) > 0:\r\n {set hazard to: White Dwarf{if len(nearbyWhiteDwarfStars) > 1:s}}\r\n {set nearbyHazards to cat(nearbyHazards, [hazard])}\r\n }\r\n {if len(nearbyNeutronStars) > 0:\r\n {set hazard to: Neutron Star{if len(nearbyNeutronStars) > 1:s}}\r\n {set nearbyHazards to cat(nearbyHazards, [hazard])}\r\n }\r\n {if len(nearbyBlackHolesStars) > 0:\r\n {set hazard to: Black Hole{if len(nearbyBlackHolesStars) > 1:s}}\r\n {set nearbyHazards to cat(nearbyHazards, [hazard])}\r\n }\r\n \r\n {if len(nearbyHazards) > 0:\r\n Caution: {List(nearbyHazards)} detected. \r\n }\r\n\r\n {if scoop_present && mainstar && !mainstar.scoopable && !secondaryScoopStar:\r\n {if len(nearbyHazards) = 0: {Occasionally(2, \"Alert: \")}}\r\n No scoopable stars charted\r\n {Occasionally(2, \"in arrival system\")}.\r\n }\r\n }\r\n }\r\n}", "name": "Ship fsd", "description": "Se activa cuando hay un cambio en el estado del FSD de su nave" }, diff --git a/SpeechResponder/eddi.fr.json b/SpeechResponder/eddi.fr.json index c2b94ee3db..b5e6bd5a2d 100644 --- a/SpeechResponder/eddi.fr.json +++ b/SpeechResponder/eddi.fr.json @@ -2064,7 +2064,7 @@ "enabled": true, "priority": 3, "responder": true, - "script": null, + "script": "{set hazardDistance to 100} {_ Warn me when hazardous stars are within this distance (in ls) from the main star }\r\n\r\n{_ Fetch from context _}\r\n{if state.eddi_context_next_system_name:\r\n {set reportSystem to SystemDetails(state.eddi_context_selected_system_name)}\r\n|else:\r\n {set reportSystem to nextsystem}\r\n}\r\n\r\n{if event.fsd_status = 'charging' && event.hyperdrive_charging: \r\n {if len(reportSystem.systemname) > 0:\r\n \r\n {Pause(2000)}\r\n \r\n {if reportSystem.systemname != homesystem.systemname:\r\n {for compartment in ship.compartments:\r\n {if compartment.module.invariantName = 'Fuel Scoop':\r\n {set scoop_present to true}\r\n }\r\n } \r\n \r\n {set scoop_present to true}\r\n\r\n {set nearbyWhiteDwarfStars to []}\r\n {set nearbyNeutronStars to []}\r\n {set nearbyBlackHolesStars to []}\r\n {for aBody in reportSystem.bodies:\r\n {if aBody.bodyType.invariantName = 'Star':\r\n {if aBody.mainstar:\r\n {set mainstar to aBody}\r\n |elif scoop_present && aBody.scoopable && aBody.distance < secondaryScoopStar.distance:\r\n {set secondaryScoopStar to aBody)}\r\n }\r\n {if slice(aBody.stellarclass, 0, 1) = \"D\" && aBody.distance < hazardDistance:\r\n {set nearbyWhiteDwarfStars to cat(nearbyWhiteDwarfStars, [aBody])} \r\n |elif aBody.stellarclass = 'N' && aBody.distance < hazardDistance:\r\n {set nearbyNeutronStars to cat(nearbyNeutronStars, [aBody])}\r\n |elif aBody.stellarclass = 'H' && aBody.distance < hazardDistance: \r\n {set nearbyBlackHolesStars to cat(nearbyBlackHolesStars, [aBody])}\r\n }\r\n }\r\n }\r\n \r\n {set nearbyHazards to []} \r\n {if len(nearbyWhiteDwarfStars) > 0:\r\n {set hazard to: White Dwarf{if len(nearbyWhiteDwarfStars) > 1:s}}\r\n {set nearbyHazards to cat(nearbyHazards, [hazard])}\r\n }\r\n {if len(nearbyNeutronStars) > 0:\r\n {set hazard to: Neutron Star{if len(nearbyNeutronStars) > 1:s}}\r\n {set nearbyHazards to cat(nearbyHazards, [hazard])}\r\n }\r\n {if len(nearbyBlackHolesStars) > 0:\r\n {set hazard to: Black Hole{if len(nearbyBlackHolesStars) > 1:s}}\r\n {set nearbyHazards to cat(nearbyHazards, [hazard])}\r\n }\r\n \r\n {if len(nearbyHazards) > 0:\r\n Caution: {List(nearbyHazards)} detected. \r\n }\r\n\r\n {if scoop_present && mainstar && !mainstar.scoopable && !secondaryScoopStar:\r\n {if len(nearbyHazards) = 0: {Occasionally(2, \"Alert: \")}}\r\n No scoopable stars charted\r\n {Occasionally(2, \"in arrival system\")}.\r\n }\r\n }\r\n }\r\n}", "default": true, "name": "Ship fsd", "description": "Triggered when there is a change to the status of your ship's fsd" diff --git a/SpeechResponder/eddi.hu.json b/SpeechResponder/eddi.hu.json index ed3c0408f0..79244df4d5 100644 --- a/SpeechResponder/eddi.hu.json +++ b/SpeechResponder/eddi.hu.json @@ -1045,7 +1045,7 @@ "enabled": true, "priority": 3, "responder": true, - "script": "{_ Context }\r\n{SetState('eddi_context_last_subject', 'fsd')}\r\n{SetState('eddi_context_last_action', 'engage')}\r\n{SetState('eddi_context_system_name', event.system)}\r\n{SetState('eddi_context_system_system', event.system)}\r\n{SetState('eddi_context_fsd_target', event.target)}\r\n{SetState('eddi_context_system_lastvisit', system.lastVisitSeconds)}\r\n\r\n{_ Zero the 'remaining jump' context to only use values following this event _}\r\n{SetState('eddi_context_remaining_jumps', 0)}\r\n\r\n{if event.target = 'Hyperspace':\r\n {_ Rewrite context to represent a jump }\r\n {SetState('eddi_context_last_subject', 'jump')}\r\n {SetState('eddi_context_last_action', 'start')}\r\n\r\n {set reportsystem to SystemDetails(event.system)}\r\n\r\n {_ Wait for the FSD countdown and initial jump}\r\n {Pause(5000)}\r\n\r\n {OneOf(\"Destination confirmed\",\"Jump in progress\",\"Telemetry obtained\")}.\r\n {ShipName()} is {OneOf(\"heading to\", \"on route to\", \"travelling to\", \"in transit to\")} the {P(reportsystem.name, \"starsystem\")} system.\r\n {if reportsystem.name = homesystem.name:\r\n Welcome home, {F(\"Honorific\")}\r\n |else:\r\n {set scoopables to [\"O\", \"B\", \"A\", \"F\", \"G\", \"K\", \"M\"]}\r\n {if slice(event.stellarclass, 0, 1) = \"D\":\r\n Caution: white dwarf detected.\r\n |elif event.stellarclass = \"N\":\r\n Caution: neutron star detected.\r\n |elif event.stellarclass = \"H\":\r\n Caution: black hole detected.\r\n |elif find(scoopables, event.stellarclass) = -1:\r\n {Occasionally(2, \"Information: \")}\r\n Arrival star is not scoopable.\r\n }\r\n \r\n {if lastsystem.allegiance && lastsystem.allegiance != \"None\" && lastsystem.allegiance != \"Independent\" && (!reportsystem.allegiance || reportsystem.allegiance = \"None\" || reportsystem.allegiance = \"Independent\"):\r\n You {OneOf(\"are leaving\", \"have left\", \"are no longer in\")} {lastsystem.allegiance} space.\r\n |elif lastsystem.allegiance && lastsystem.allegiance != reportsystem.allegiance && system.allegiance && system.allegiance != \"None\":\r\n You {OneOf(\"are now in\", \"have entered\", \"are entering\")} {reportsystem.allegiance} space.\r\n {if cmdr.title != \"Commander\":\r\n Welcome back {F(\"Honorific\")}.\r\n }\r\n }\r\n\r\n {if reportsystem.visits = 0:\r\n This is your first visit to this system.\r\n |elif reportsystem.visits = 1:\r\n This is your second visit to this system.\r\n |elif reportsystem.visits = 2:\r\n {Occasionally(2, \"This is your third visit to this system.\")}\r\n |elif reportsystem.visits = 3:\r\n {Occasionally(2, \"This is your fourth visit to this system.\")}\r\n |else:\r\n {Occasionally(3, \"You have visited this system {reportsystem.visits} times.\")}\r\n }\r\n\r\n {if !reportsystem.population && lastsystem.population:\r\n {OneOf(\"This system is not populated\",\"There is no human presence here\", \"Humans have yet to colonise this system\")}.\r\n |elif reportsystem.population:\r\n {if SecondsSince(reportsystem.lastVisitSeconds) > 3600:\r\n {F(\"System report\")}\r\n }\r\n }\r\n\r\n {if reportsystem.distancefromhome:\r\n {set ReportDistanceFromHome() to:\r\n \t{return cat(\r\n \t OneOf(\"You are\", \"Current location is\", \"You are now\"), \" \",\r\n\t Humanise(reportsystem.distancefromhome), \" lightyears from \",\r\n\t OneOf(\"home\", \"{P(homesystem.name, 'starsystem')}\"), \".\"\r\n\t )}\r\n } \r\n {Occasionally(7, ReportDistanceFromHome())}\r\n }\r\n\r\n {if reportsystem.comment:\r\n You made a {OneOf(\"note\", \"comment\", \"remark\")} {OneOf(\"about\", \"for\", \"on\")} this system. It {OneOf(\"is as follows\", \"says\", \"reads\", \"is\")} {reportsystem.comment}.\r\n }\r\n }\r\n}", + "script": "{_ Context }\r\n{SetState('eddi_context_last_subject', 'fsd')}\r\n{SetState('eddi_context_last_action', 'engage')}\r\n{SetState('eddi_context_system_name', event.system)}\r\n{SetState('eddi_context_system_system', event.system)}\r\n{SetState('eddi_context_fsd_target', event.target)}\r\n{SetState('eddi_context_system_lastvisit', system.lastVisitSeconds)}\r\n\r\n{_ Zero the 'remaining jump' context to only use values following this event _}\r\n{SetState('eddi_context_remaining_jumps', 0)}\r\n\r\n{if event.target = 'Hyperspace':\r\n {_ Rewrite context to represent a jump }\r\n {SetState('eddi_context_last_subject', 'jump')}\r\n {SetState('eddi_context_last_action', 'start')}\r\n\r\n {set reportsystem to SystemDetails(event.system)}\r\n\r\n {_ Wait for the FSD countdown and initial jump}\r\n {Pause(5000)}\r\n\r\n {OneOf(\"Destination confirmed\",\"Jump in progress\",\"Telemetry obtained\")}.\r\n {ShipName()} is {OneOf(\"heading to\", \"on route to\", \"travelling to\", \"in transit to\")} the {P(reportsystem.name, \"starsystem\")} system.\r\n {if reportsystem.name = homesystem.name:\r\n Welcome home, {F(\"Honorific\")}.\r\n |else:\r\n {if lastsystem.allegiance && lastsystem.allegiance != \"None\" && lastsystem.allegiance != \"Independent\" && (!reportsystem.allegiance || reportsystem.allegiance = \"None\" || reportsystem.allegiance = \"Independent\"):\r\n You {OneOf(\"are leaving\", \"have left\", \"are no longer in\")} {lastsystem.allegiance} space.\r\n |elif lastsystem.allegiance && lastsystem.allegiance != reportsystem.allegiance && system.allegiance && system.allegiance != \"None\":\r\n You {OneOf(\"are now in\", \"have entered\", \"are entering\")} {reportsystem.allegiance} space.\r\n {if cmdr.title != \"Commander\":\r\n Welcome back {F(\"Honorific\")}.\r\n }\r\n }\r\n\r\n {if reportsystem.visits = 0:\r\n This is your first visit to this system.\r\n |elif reportsystem.visits = 1:\r\n This is your second visit to this system.\r\n |elif reportsystem.visits = 2:\r\n {Occasionally(2, \"This is your third visit to this system.\")}\r\n |elif reportsystem.visits = 3:\r\n {Occasionally(2, \"This is your fourth visit to this system.\")}\r\n |else:\r\n {Occasionally(3, \"You have visited this system {reportsystem.visits} times.\")}\r\n }\r\n }\r\n}", "default": true, "name": "FSD engaged", "description": "Triggered when your FSD has engaged" @@ -2053,7 +2053,7 @@ "enabled": true, "priority": 3, "responder": true, - "script": null, + "script": "{set hazardDistance to 100} {_ Warn me when hazardous stars are within this distance (in ls) from the main star }\r\n\r\n{_ Fetch from context _}\r\n{if state.eddi_context_next_system_name:\r\n {set reportSystem to SystemDetails(state.eddi_context_selected_system_name)}\r\n|else:\r\n {set reportSystem to nextsystem}\r\n}\r\n\r\n{if event.fsd_status = 'charging' && event.hyperdrive_charging: \r\n {if len(reportSystem.systemname) > 0:\r\n \r\n {Pause(2000)}\r\n \r\n {if reportSystem.systemname != homesystem.systemname:\r\n {for compartment in ship.compartments:\r\n {if compartment.module.invariantName = 'Fuel Scoop':\r\n {set scoop_present to true}\r\n }\r\n } \r\n \r\n {set scoop_present to true}\r\n\r\n {set nearbyWhiteDwarfStars to []}\r\n {set nearbyNeutronStars to []}\r\n {set nearbyBlackHolesStars to []}\r\n {for aBody in reportSystem.bodies:\r\n {if aBody.bodyType.invariantName = 'Star':\r\n {if aBody.mainstar:\r\n {set mainstar to aBody}\r\n |elif scoop_present && aBody.scoopable && aBody.distance < secondaryScoopStar.distance:\r\n {set secondaryScoopStar to aBody)}\r\n }\r\n {if slice(aBody.stellarclass, 0, 1) = \"D\" && aBody.distance < hazardDistance:\r\n {set nearbyWhiteDwarfStars to cat(nearbyWhiteDwarfStars, [aBody])} \r\n |elif aBody.stellarclass = 'N' && aBody.distance < hazardDistance:\r\n {set nearbyNeutronStars to cat(nearbyNeutronStars, [aBody])}\r\n |elif aBody.stellarclass = 'H' && aBody.distance < hazardDistance: \r\n {set nearbyBlackHolesStars to cat(nearbyBlackHolesStars, [aBody])}\r\n }\r\n }\r\n }\r\n \r\n {set nearbyHazards to []} \r\n {if len(nearbyWhiteDwarfStars) > 0:\r\n {set hazard to: White Dwarf{if len(nearbyWhiteDwarfStars) > 1:s}}\r\n {set nearbyHazards to cat(nearbyHazards, [hazard])}\r\n }\r\n {if len(nearbyNeutronStars) > 0:\r\n {set hazard to: Neutron Star{if len(nearbyNeutronStars) > 1:s}}\r\n {set nearbyHazards to cat(nearbyHazards, [hazard])}\r\n }\r\n {if len(nearbyBlackHolesStars) > 0:\r\n {set hazard to: Black Hole{if len(nearbyBlackHolesStars) > 1:s}}\r\n {set nearbyHazards to cat(nearbyHazards, [hazard])}\r\n }\r\n \r\n {if len(nearbyHazards) > 0:\r\n Caution: {List(nearbyHazards)} detected. \r\n }\r\n\r\n {if scoop_present && mainstar && !mainstar.scoopable && !secondaryScoopStar:\r\n {if len(nearbyHazards) = 0: {Occasionally(2, \"Alert: \")}}\r\n No scoopable stars charted\r\n {Occasionally(2, \"in arrival system\")}.\r\n }\r\n }\r\n }\r\n}", "default": true, "name": "Ship fsd", "description": "Triggered when there is a change to the status of your ship's fsd" diff --git a/SpeechResponder/eddi.it.json b/SpeechResponder/eddi.it.json index ed3c0408f0..79244df4d5 100644 --- a/SpeechResponder/eddi.it.json +++ b/SpeechResponder/eddi.it.json @@ -1045,7 +1045,7 @@ "enabled": true, "priority": 3, "responder": true, - "script": "{_ Context }\r\n{SetState('eddi_context_last_subject', 'fsd')}\r\n{SetState('eddi_context_last_action', 'engage')}\r\n{SetState('eddi_context_system_name', event.system)}\r\n{SetState('eddi_context_system_system', event.system)}\r\n{SetState('eddi_context_fsd_target', event.target)}\r\n{SetState('eddi_context_system_lastvisit', system.lastVisitSeconds)}\r\n\r\n{_ Zero the 'remaining jump' context to only use values following this event _}\r\n{SetState('eddi_context_remaining_jumps', 0)}\r\n\r\n{if event.target = 'Hyperspace':\r\n {_ Rewrite context to represent a jump }\r\n {SetState('eddi_context_last_subject', 'jump')}\r\n {SetState('eddi_context_last_action', 'start')}\r\n\r\n {set reportsystem to SystemDetails(event.system)}\r\n\r\n {_ Wait for the FSD countdown and initial jump}\r\n {Pause(5000)}\r\n\r\n {OneOf(\"Destination confirmed\",\"Jump in progress\",\"Telemetry obtained\")}.\r\n {ShipName()} is {OneOf(\"heading to\", \"on route to\", \"travelling to\", \"in transit to\")} the {P(reportsystem.name, \"starsystem\")} system.\r\n {if reportsystem.name = homesystem.name:\r\n Welcome home, {F(\"Honorific\")}\r\n |else:\r\n {set scoopables to [\"O\", \"B\", \"A\", \"F\", \"G\", \"K\", \"M\"]}\r\n {if slice(event.stellarclass, 0, 1) = \"D\":\r\n Caution: white dwarf detected.\r\n |elif event.stellarclass = \"N\":\r\n Caution: neutron star detected.\r\n |elif event.stellarclass = \"H\":\r\n Caution: black hole detected.\r\n |elif find(scoopables, event.stellarclass) = -1:\r\n {Occasionally(2, \"Information: \")}\r\n Arrival star is not scoopable.\r\n }\r\n \r\n {if lastsystem.allegiance && lastsystem.allegiance != \"None\" && lastsystem.allegiance != \"Independent\" && (!reportsystem.allegiance || reportsystem.allegiance = \"None\" || reportsystem.allegiance = \"Independent\"):\r\n You {OneOf(\"are leaving\", \"have left\", \"are no longer in\")} {lastsystem.allegiance} space.\r\n |elif lastsystem.allegiance && lastsystem.allegiance != reportsystem.allegiance && system.allegiance && system.allegiance != \"None\":\r\n You {OneOf(\"are now in\", \"have entered\", \"are entering\")} {reportsystem.allegiance} space.\r\n {if cmdr.title != \"Commander\":\r\n Welcome back {F(\"Honorific\")}.\r\n }\r\n }\r\n\r\n {if reportsystem.visits = 0:\r\n This is your first visit to this system.\r\n |elif reportsystem.visits = 1:\r\n This is your second visit to this system.\r\n |elif reportsystem.visits = 2:\r\n {Occasionally(2, \"This is your third visit to this system.\")}\r\n |elif reportsystem.visits = 3:\r\n {Occasionally(2, \"This is your fourth visit to this system.\")}\r\n |else:\r\n {Occasionally(3, \"You have visited this system {reportsystem.visits} times.\")}\r\n }\r\n\r\n {if !reportsystem.population && lastsystem.population:\r\n {OneOf(\"This system is not populated\",\"There is no human presence here\", \"Humans have yet to colonise this system\")}.\r\n |elif reportsystem.population:\r\n {if SecondsSince(reportsystem.lastVisitSeconds) > 3600:\r\n {F(\"System report\")}\r\n }\r\n }\r\n\r\n {if reportsystem.distancefromhome:\r\n {set ReportDistanceFromHome() to:\r\n \t{return cat(\r\n \t OneOf(\"You are\", \"Current location is\", \"You are now\"), \" \",\r\n\t Humanise(reportsystem.distancefromhome), \" lightyears from \",\r\n\t OneOf(\"home\", \"{P(homesystem.name, 'starsystem')}\"), \".\"\r\n\t )}\r\n } \r\n {Occasionally(7, ReportDistanceFromHome())}\r\n }\r\n\r\n {if reportsystem.comment:\r\n You made a {OneOf(\"note\", \"comment\", \"remark\")} {OneOf(\"about\", \"for\", \"on\")} this system. It {OneOf(\"is as follows\", \"says\", \"reads\", \"is\")} {reportsystem.comment}.\r\n }\r\n }\r\n}", + "script": "{_ Context }\r\n{SetState('eddi_context_last_subject', 'fsd')}\r\n{SetState('eddi_context_last_action', 'engage')}\r\n{SetState('eddi_context_system_name', event.system)}\r\n{SetState('eddi_context_system_system', event.system)}\r\n{SetState('eddi_context_fsd_target', event.target)}\r\n{SetState('eddi_context_system_lastvisit', system.lastVisitSeconds)}\r\n\r\n{_ Zero the 'remaining jump' context to only use values following this event _}\r\n{SetState('eddi_context_remaining_jumps', 0)}\r\n\r\n{if event.target = 'Hyperspace':\r\n {_ Rewrite context to represent a jump }\r\n {SetState('eddi_context_last_subject', 'jump')}\r\n {SetState('eddi_context_last_action', 'start')}\r\n\r\n {set reportsystem to SystemDetails(event.system)}\r\n\r\n {_ Wait for the FSD countdown and initial jump}\r\n {Pause(5000)}\r\n\r\n {OneOf(\"Destination confirmed\",\"Jump in progress\",\"Telemetry obtained\")}.\r\n {ShipName()} is {OneOf(\"heading to\", \"on route to\", \"travelling to\", \"in transit to\")} the {P(reportsystem.name, \"starsystem\")} system.\r\n {if reportsystem.name = homesystem.name:\r\n Welcome home, {F(\"Honorific\")}.\r\n |else:\r\n {if lastsystem.allegiance && lastsystem.allegiance != \"None\" && lastsystem.allegiance != \"Independent\" && (!reportsystem.allegiance || reportsystem.allegiance = \"None\" || reportsystem.allegiance = \"Independent\"):\r\n You {OneOf(\"are leaving\", \"have left\", \"are no longer in\")} {lastsystem.allegiance} space.\r\n |elif lastsystem.allegiance && lastsystem.allegiance != reportsystem.allegiance && system.allegiance && system.allegiance != \"None\":\r\n You {OneOf(\"are now in\", \"have entered\", \"are entering\")} {reportsystem.allegiance} space.\r\n {if cmdr.title != \"Commander\":\r\n Welcome back {F(\"Honorific\")}.\r\n }\r\n }\r\n\r\n {if reportsystem.visits = 0:\r\n This is your first visit to this system.\r\n |elif reportsystem.visits = 1:\r\n This is your second visit to this system.\r\n |elif reportsystem.visits = 2:\r\n {Occasionally(2, \"This is your third visit to this system.\")}\r\n |elif reportsystem.visits = 3:\r\n {Occasionally(2, \"This is your fourth visit to this system.\")}\r\n |else:\r\n {Occasionally(3, \"You have visited this system {reportsystem.visits} times.\")}\r\n }\r\n }\r\n}", "default": true, "name": "FSD engaged", "description": "Triggered when your FSD has engaged" @@ -2053,7 +2053,7 @@ "enabled": true, "priority": 3, "responder": true, - "script": null, + "script": "{set hazardDistance to 100} {_ Warn me when hazardous stars are within this distance (in ls) from the main star }\r\n\r\n{_ Fetch from context _}\r\n{if state.eddi_context_next_system_name:\r\n {set reportSystem to SystemDetails(state.eddi_context_selected_system_name)}\r\n|else:\r\n {set reportSystem to nextsystem}\r\n}\r\n\r\n{if event.fsd_status = 'charging' && event.hyperdrive_charging: \r\n {if len(reportSystem.systemname) > 0:\r\n \r\n {Pause(2000)}\r\n \r\n {if reportSystem.systemname != homesystem.systemname:\r\n {for compartment in ship.compartments:\r\n {if compartment.module.invariantName = 'Fuel Scoop':\r\n {set scoop_present to true}\r\n }\r\n } \r\n \r\n {set scoop_present to true}\r\n\r\n {set nearbyWhiteDwarfStars to []}\r\n {set nearbyNeutronStars to []}\r\n {set nearbyBlackHolesStars to []}\r\n {for aBody in reportSystem.bodies:\r\n {if aBody.bodyType.invariantName = 'Star':\r\n {if aBody.mainstar:\r\n {set mainstar to aBody}\r\n |elif scoop_present && aBody.scoopable && aBody.distance < secondaryScoopStar.distance:\r\n {set secondaryScoopStar to aBody)}\r\n }\r\n {if slice(aBody.stellarclass, 0, 1) = \"D\" && aBody.distance < hazardDistance:\r\n {set nearbyWhiteDwarfStars to cat(nearbyWhiteDwarfStars, [aBody])} \r\n |elif aBody.stellarclass = 'N' && aBody.distance < hazardDistance:\r\n {set nearbyNeutronStars to cat(nearbyNeutronStars, [aBody])}\r\n |elif aBody.stellarclass = 'H' && aBody.distance < hazardDistance: \r\n {set nearbyBlackHolesStars to cat(nearbyBlackHolesStars, [aBody])}\r\n }\r\n }\r\n }\r\n \r\n {set nearbyHazards to []} \r\n {if len(nearbyWhiteDwarfStars) > 0:\r\n {set hazard to: White Dwarf{if len(nearbyWhiteDwarfStars) > 1:s}}\r\n {set nearbyHazards to cat(nearbyHazards, [hazard])}\r\n }\r\n {if len(nearbyNeutronStars) > 0:\r\n {set hazard to: Neutron Star{if len(nearbyNeutronStars) > 1:s}}\r\n {set nearbyHazards to cat(nearbyHazards, [hazard])}\r\n }\r\n {if len(nearbyBlackHolesStars) > 0:\r\n {set hazard to: Black Hole{if len(nearbyBlackHolesStars) > 1:s}}\r\n {set nearbyHazards to cat(nearbyHazards, [hazard])}\r\n }\r\n \r\n {if len(nearbyHazards) > 0:\r\n Caution: {List(nearbyHazards)} detected. \r\n }\r\n\r\n {if scoop_present && mainstar && !mainstar.scoopable && !secondaryScoopStar:\r\n {if len(nearbyHazards) = 0: {Occasionally(2, \"Alert: \")}}\r\n No scoopable stars charted\r\n {Occasionally(2, \"in arrival system\")}.\r\n }\r\n }\r\n }\r\n}", "default": true, "name": "Ship fsd", "description": "Triggered when there is a change to the status of your ship's fsd" diff --git a/SpeechResponder/eddi.ja.json b/SpeechResponder/eddi.ja.json index ed3c0408f0..79244df4d5 100644 --- a/SpeechResponder/eddi.ja.json +++ b/SpeechResponder/eddi.ja.json @@ -1045,7 +1045,7 @@ "enabled": true, "priority": 3, "responder": true, - "script": "{_ Context }\r\n{SetState('eddi_context_last_subject', 'fsd')}\r\n{SetState('eddi_context_last_action', 'engage')}\r\n{SetState('eddi_context_system_name', event.system)}\r\n{SetState('eddi_context_system_system', event.system)}\r\n{SetState('eddi_context_fsd_target', event.target)}\r\n{SetState('eddi_context_system_lastvisit', system.lastVisitSeconds)}\r\n\r\n{_ Zero the 'remaining jump' context to only use values following this event _}\r\n{SetState('eddi_context_remaining_jumps', 0)}\r\n\r\n{if event.target = 'Hyperspace':\r\n {_ Rewrite context to represent a jump }\r\n {SetState('eddi_context_last_subject', 'jump')}\r\n {SetState('eddi_context_last_action', 'start')}\r\n\r\n {set reportsystem to SystemDetails(event.system)}\r\n\r\n {_ Wait for the FSD countdown and initial jump}\r\n {Pause(5000)}\r\n\r\n {OneOf(\"Destination confirmed\",\"Jump in progress\",\"Telemetry obtained\")}.\r\n {ShipName()} is {OneOf(\"heading to\", \"on route to\", \"travelling to\", \"in transit to\")} the {P(reportsystem.name, \"starsystem\")} system.\r\n {if reportsystem.name = homesystem.name:\r\n Welcome home, {F(\"Honorific\")}\r\n |else:\r\n {set scoopables to [\"O\", \"B\", \"A\", \"F\", \"G\", \"K\", \"M\"]}\r\n {if slice(event.stellarclass, 0, 1) = \"D\":\r\n Caution: white dwarf detected.\r\n |elif event.stellarclass = \"N\":\r\n Caution: neutron star detected.\r\n |elif event.stellarclass = \"H\":\r\n Caution: black hole detected.\r\n |elif find(scoopables, event.stellarclass) = -1:\r\n {Occasionally(2, \"Information: \")}\r\n Arrival star is not scoopable.\r\n }\r\n \r\n {if lastsystem.allegiance && lastsystem.allegiance != \"None\" && lastsystem.allegiance != \"Independent\" && (!reportsystem.allegiance || reportsystem.allegiance = \"None\" || reportsystem.allegiance = \"Independent\"):\r\n You {OneOf(\"are leaving\", \"have left\", \"are no longer in\")} {lastsystem.allegiance} space.\r\n |elif lastsystem.allegiance && lastsystem.allegiance != reportsystem.allegiance && system.allegiance && system.allegiance != \"None\":\r\n You {OneOf(\"are now in\", \"have entered\", \"are entering\")} {reportsystem.allegiance} space.\r\n {if cmdr.title != \"Commander\":\r\n Welcome back {F(\"Honorific\")}.\r\n }\r\n }\r\n\r\n {if reportsystem.visits = 0:\r\n This is your first visit to this system.\r\n |elif reportsystem.visits = 1:\r\n This is your second visit to this system.\r\n |elif reportsystem.visits = 2:\r\n {Occasionally(2, \"This is your third visit to this system.\")}\r\n |elif reportsystem.visits = 3:\r\n {Occasionally(2, \"This is your fourth visit to this system.\")}\r\n |else:\r\n {Occasionally(3, \"You have visited this system {reportsystem.visits} times.\")}\r\n }\r\n\r\n {if !reportsystem.population && lastsystem.population:\r\n {OneOf(\"This system is not populated\",\"There is no human presence here\", \"Humans have yet to colonise this system\")}.\r\n |elif reportsystem.population:\r\n {if SecondsSince(reportsystem.lastVisitSeconds) > 3600:\r\n {F(\"System report\")}\r\n }\r\n }\r\n\r\n {if reportsystem.distancefromhome:\r\n {set ReportDistanceFromHome() to:\r\n \t{return cat(\r\n \t OneOf(\"You are\", \"Current location is\", \"You are now\"), \" \",\r\n\t Humanise(reportsystem.distancefromhome), \" lightyears from \",\r\n\t OneOf(\"home\", \"{P(homesystem.name, 'starsystem')}\"), \".\"\r\n\t )}\r\n } \r\n {Occasionally(7, ReportDistanceFromHome())}\r\n }\r\n\r\n {if reportsystem.comment:\r\n You made a {OneOf(\"note\", \"comment\", \"remark\")} {OneOf(\"about\", \"for\", \"on\")} this system. It {OneOf(\"is as follows\", \"says\", \"reads\", \"is\")} {reportsystem.comment}.\r\n }\r\n }\r\n}", + "script": "{_ Context }\r\n{SetState('eddi_context_last_subject', 'fsd')}\r\n{SetState('eddi_context_last_action', 'engage')}\r\n{SetState('eddi_context_system_name', event.system)}\r\n{SetState('eddi_context_system_system', event.system)}\r\n{SetState('eddi_context_fsd_target', event.target)}\r\n{SetState('eddi_context_system_lastvisit', system.lastVisitSeconds)}\r\n\r\n{_ Zero the 'remaining jump' context to only use values following this event _}\r\n{SetState('eddi_context_remaining_jumps', 0)}\r\n\r\n{if event.target = 'Hyperspace':\r\n {_ Rewrite context to represent a jump }\r\n {SetState('eddi_context_last_subject', 'jump')}\r\n {SetState('eddi_context_last_action', 'start')}\r\n\r\n {set reportsystem to SystemDetails(event.system)}\r\n\r\n {_ Wait for the FSD countdown and initial jump}\r\n {Pause(5000)}\r\n\r\n {OneOf(\"Destination confirmed\",\"Jump in progress\",\"Telemetry obtained\")}.\r\n {ShipName()} is {OneOf(\"heading to\", \"on route to\", \"travelling to\", \"in transit to\")} the {P(reportsystem.name, \"starsystem\")} system.\r\n {if reportsystem.name = homesystem.name:\r\n Welcome home, {F(\"Honorific\")}.\r\n |else:\r\n {if lastsystem.allegiance && lastsystem.allegiance != \"None\" && lastsystem.allegiance != \"Independent\" && (!reportsystem.allegiance || reportsystem.allegiance = \"None\" || reportsystem.allegiance = \"Independent\"):\r\n You {OneOf(\"are leaving\", \"have left\", \"are no longer in\")} {lastsystem.allegiance} space.\r\n |elif lastsystem.allegiance && lastsystem.allegiance != reportsystem.allegiance && system.allegiance && system.allegiance != \"None\":\r\n You {OneOf(\"are now in\", \"have entered\", \"are entering\")} {reportsystem.allegiance} space.\r\n {if cmdr.title != \"Commander\":\r\n Welcome back {F(\"Honorific\")}.\r\n }\r\n }\r\n\r\n {if reportsystem.visits = 0:\r\n This is your first visit to this system.\r\n |elif reportsystem.visits = 1:\r\n This is your second visit to this system.\r\n |elif reportsystem.visits = 2:\r\n {Occasionally(2, \"This is your third visit to this system.\")}\r\n |elif reportsystem.visits = 3:\r\n {Occasionally(2, \"This is your fourth visit to this system.\")}\r\n |else:\r\n {Occasionally(3, \"You have visited this system {reportsystem.visits} times.\")}\r\n }\r\n }\r\n}", "default": true, "name": "FSD engaged", "description": "Triggered when your FSD has engaged" @@ -2053,7 +2053,7 @@ "enabled": true, "priority": 3, "responder": true, - "script": null, + "script": "{set hazardDistance to 100} {_ Warn me when hazardous stars are within this distance (in ls) from the main star }\r\n\r\n{_ Fetch from context _}\r\n{if state.eddi_context_next_system_name:\r\n {set reportSystem to SystemDetails(state.eddi_context_selected_system_name)}\r\n|else:\r\n {set reportSystem to nextsystem}\r\n}\r\n\r\n{if event.fsd_status = 'charging' && event.hyperdrive_charging: \r\n {if len(reportSystem.systemname) > 0:\r\n \r\n {Pause(2000)}\r\n \r\n {if reportSystem.systemname != homesystem.systemname:\r\n {for compartment in ship.compartments:\r\n {if compartment.module.invariantName = 'Fuel Scoop':\r\n {set scoop_present to true}\r\n }\r\n } \r\n \r\n {set scoop_present to true}\r\n\r\n {set nearbyWhiteDwarfStars to []}\r\n {set nearbyNeutronStars to []}\r\n {set nearbyBlackHolesStars to []}\r\n {for aBody in reportSystem.bodies:\r\n {if aBody.bodyType.invariantName = 'Star':\r\n {if aBody.mainstar:\r\n {set mainstar to aBody}\r\n |elif scoop_present && aBody.scoopable && aBody.distance < secondaryScoopStar.distance:\r\n {set secondaryScoopStar to aBody)}\r\n }\r\n {if slice(aBody.stellarclass, 0, 1) = \"D\" && aBody.distance < hazardDistance:\r\n {set nearbyWhiteDwarfStars to cat(nearbyWhiteDwarfStars, [aBody])} \r\n |elif aBody.stellarclass = 'N' && aBody.distance < hazardDistance:\r\n {set nearbyNeutronStars to cat(nearbyNeutronStars, [aBody])}\r\n |elif aBody.stellarclass = 'H' && aBody.distance < hazardDistance: \r\n {set nearbyBlackHolesStars to cat(nearbyBlackHolesStars, [aBody])}\r\n }\r\n }\r\n }\r\n \r\n {set nearbyHazards to []} \r\n {if len(nearbyWhiteDwarfStars) > 0:\r\n {set hazard to: White Dwarf{if len(nearbyWhiteDwarfStars) > 1:s}}\r\n {set nearbyHazards to cat(nearbyHazards, [hazard])}\r\n }\r\n {if len(nearbyNeutronStars) > 0:\r\n {set hazard to: Neutron Star{if len(nearbyNeutronStars) > 1:s}}\r\n {set nearbyHazards to cat(nearbyHazards, [hazard])}\r\n }\r\n {if len(nearbyBlackHolesStars) > 0:\r\n {set hazard to: Black Hole{if len(nearbyBlackHolesStars) > 1:s}}\r\n {set nearbyHazards to cat(nearbyHazards, [hazard])}\r\n }\r\n \r\n {if len(nearbyHazards) > 0:\r\n Caution: {List(nearbyHazards)} detected. \r\n }\r\n\r\n {if scoop_present && mainstar && !mainstar.scoopable && !secondaryScoopStar:\r\n {if len(nearbyHazards) = 0: {Occasionally(2, \"Alert: \")}}\r\n No scoopable stars charted\r\n {Occasionally(2, \"in arrival system\")}.\r\n }\r\n }\r\n }\r\n}", "default": true, "name": "Ship fsd", "description": "Triggered when there is a change to the status of your ship's fsd" diff --git a/SpeechResponder/eddi.json b/SpeechResponder/eddi.json index 6c037665d0..df768e99a3 100644 --- a/SpeechResponder/eddi.json +++ b/SpeechResponder/eddi.json @@ -1045,7 +1045,7 @@ "enabled": true, "priority": 3, "responder": true, - "script": "{_ Context }\r\n{SetState('eddi_context_last_subject', 'fsd')}\r\n{SetState('eddi_context_last_action', 'engage')}\r\n{SetState('eddi_context_system_name', event.system)}\r\n{SetState('eddi_context_system_system', event.system)}\r\n{SetState('eddi_context_fsd_target', event.target)}\r\n{SetState('eddi_context_system_lastvisit', system.lastVisitSeconds)}\r\n\r\n{_ Zero the 'remaining jump' context to only use values following this event _}\r\n{SetState('eddi_context_remaining_jumps', 0)}\r\n\r\n{if event.target = 'Hyperspace':\r\n {_ Rewrite context to represent a jump }\r\n {SetState('eddi_context_last_subject', 'jump')}\r\n {SetState('eddi_context_last_action', 'start')}\r\n\r\n {set reportsystem to SystemDetails(event.system)}\r\n\r\n {_ Wait for the FSD countdown and initial jump}\r\n {Pause(5000)}\r\n\r\n {OneOf(\"Destination confirmed\",\"Jump in progress\",\"Telemetry obtained\")}.\r\n {ShipName()} is {OneOf(\"heading to\", \"on route to\", \"travelling to\", \"in transit to\")} the {P(reportsystem.name, \"starsystem\")} system.\r\n {if reportsystem.name = homesystem.name:\r\n Welcome home, {F(\"Honorific\")}\r\n |else:\r\n {set scoopables to [\"O\", \"B\", \"A\", \"F\", \"G\", \"K\", \"M\"]}\r\n {if slice(event.stellarclass, 0, 1) = \"D\":\r\n Caution: white dwarf detected.\r\n |elif event.stellarclass = \"N\":\r\n Caution: neutron star detected.\r\n |elif event.stellarclass = \"H\":\r\n Caution: black hole detected.\r\n |elif find(scoopables, event.stellarclass) = -1:\r\n {Occasionally(2, \"Information: \")}\r\n Arrival star is not scoopable.\r\n }\r\n \r\n {if lastsystem.allegiance && lastsystem.allegiance != \"None\" && lastsystem.allegiance != \"Independent\" && (!reportsystem.allegiance || reportsystem.allegiance = \"None\" || reportsystem.allegiance = \"Independent\"):\r\n You {OneOf(\"are leaving\", \"have left\", \"are no longer in\")} {lastsystem.allegiance} space.\r\n |elif lastsystem.allegiance && lastsystem.allegiance != reportsystem.allegiance && system.allegiance && system.allegiance != \"None\":\r\n You {OneOf(\"are now in\", \"have entered\", \"are entering\")} {reportsystem.allegiance} space.\r\n {if cmdr.title != \"Commander\":\r\n Welcome back {F(\"Honorific\")}.\r\n }\r\n }\r\n\r\n {if reportsystem.visits = 0:\r\n This is your first visit to this system.\r\n |elif reportsystem.visits = 1:\r\n This is your second visit to this system.\r\n |elif reportsystem.visits = 2:\r\n {Occasionally(2, \"This is your third visit to this system.\")}\r\n |elif reportsystem.visits = 3:\r\n {Occasionally(2, \"This is your fourth visit to this system.\")}\r\n |else:\r\n {Occasionally(3, \"You have visited this system {reportsystem.visits} times.\")}\r\n }\r\n }\r\n}", + "script": "{_ Context }\r\n{SetState('eddi_context_last_subject', 'fsd')}\r\n{SetState('eddi_context_last_action', 'engage')}\r\n{SetState('eddi_context_system_name', event.system)}\r\n{SetState('eddi_context_system_system', event.system)}\r\n{SetState('eddi_context_fsd_target', event.target)}\r\n{SetState('eddi_context_system_lastvisit', system.lastVisitSeconds)}\r\n\r\n{_ Zero the 'remaining jump' context to only use values following this event _}\r\n{SetState('eddi_context_remaining_jumps', 0)}\r\n\r\n{if event.target = 'Hyperspace':\r\n {_ Rewrite context to represent a jump }\r\n {SetState('eddi_context_last_subject', 'jump')}\r\n {SetState('eddi_context_last_action', 'start')}\r\n\r\n {set reportsystem to SystemDetails(event.system)}\r\n\r\n {_ Wait for the FSD countdown and initial jump}\r\n {Pause(5000)}\r\n\r\n {OneOf(\"Destination confirmed\",\"Jump in progress\",\"Telemetry obtained\")}.\r\n {ShipName()} is {OneOf(\"heading to\", \"on route to\", \"travelling to\", \"in transit to\")} the {P(reportsystem.name, \"starsystem\")} system.\r\n {if reportsystem.name = homesystem.name:\r\n Welcome home, {F(\"Honorific\")}.\r\n |else:\r\n {if lastsystem.allegiance && lastsystem.allegiance != \"None\" && lastsystem.allegiance != \"Independent\" && (!reportsystem.allegiance || reportsystem.allegiance = \"None\" || reportsystem.allegiance = \"Independent\"):\r\n You {OneOf(\"are leaving\", \"have left\", \"are no longer in\")} {lastsystem.allegiance} space.\r\n |elif lastsystem.allegiance && lastsystem.allegiance != reportsystem.allegiance && system.allegiance && system.allegiance != \"None\":\r\n You {OneOf(\"are now in\", \"have entered\", \"are entering\")} {reportsystem.allegiance} space.\r\n {if cmdr.title != \"Commander\":\r\n Welcome back {F(\"Honorific\")}.\r\n }\r\n }\r\n\r\n {if reportsystem.visits = 0:\r\n This is your first visit to this system.\r\n |elif reportsystem.visits = 1:\r\n This is your second visit to this system.\r\n |elif reportsystem.visits = 2:\r\n {Occasionally(2, \"This is your third visit to this system.\")}\r\n |elif reportsystem.visits = 3:\r\n {Occasionally(2, \"This is your fourth visit to this system.\")}\r\n |else:\r\n {Occasionally(3, \"You have visited this system {reportsystem.visits} times.\")}\r\n }\r\n }\r\n}", "default": true, "name": "FSD engaged", "description": "Triggered when your FSD has engaged" @@ -2053,7 +2053,7 @@ "enabled": true, "priority": 3, "responder": true, - "script": null, + "script": "{set hazardDistance to 100} {_ Warn me when hazardous stars are within this distance (in ls) from the main star }\r\n\r\n{_ Fetch from context _}\r\n{if state.eddi_context_next_system_name:\r\n {set reportSystem to SystemDetails(state.eddi_context_selected_system_name)}\r\n|else:\r\n {set reportSystem to nextsystem}\r\n}\r\n\r\n{if event.fsd_status = 'charging' && event.hyperdrive_charging: \r\n {if len(reportSystem.systemname) > 0:\r\n \r\n {Pause(2000)}\r\n \r\n {if reportSystem.systemname != homesystem.systemname:\r\n {for compartment in ship.compartments:\r\n {if compartment.module.invariantName = 'Fuel Scoop':\r\n {set scoop_present to true}\r\n }\r\n } \r\n \r\n {set scoop_present to true}\r\n\r\n {set nearbyWhiteDwarfStars to []}\r\n {set nearbyNeutronStars to []}\r\n {set nearbyBlackHolesStars to []}\r\n {for aBody in reportSystem.bodies:\r\n {if aBody.bodyType.invariantName = 'Star':\r\n {if aBody.mainstar:\r\n {set mainstar to aBody}\r\n |elif scoop_present && aBody.scoopable && aBody.distance < secondaryScoopStar.distance:\r\n {set secondaryScoopStar to aBody)}\r\n }\r\n {if slice(aBody.stellarclass, 0, 1) = \"D\" && aBody.distance < hazardDistance:\r\n {set nearbyWhiteDwarfStars to cat(nearbyWhiteDwarfStars, [aBody])} \r\n |elif aBody.stellarclass = 'N' && aBody.distance < hazardDistance:\r\n {set nearbyNeutronStars to cat(nearbyNeutronStars, [aBody])}\r\n |elif aBody.stellarclass = 'H' && aBody.distance < hazardDistance: \r\n {set nearbyBlackHolesStars to cat(nearbyBlackHolesStars, [aBody])}\r\n }\r\n }\r\n }\r\n \r\n {set nearbyHazards to []} \r\n {if len(nearbyWhiteDwarfStars) > 0:\r\n {set hazard to: White Dwarf{if len(nearbyWhiteDwarfStars) > 1:s}}\r\n {set nearbyHazards to cat(nearbyHazards, [hazard])}\r\n }\r\n {if len(nearbyNeutronStars) > 0:\r\n {set hazard to: Neutron Star{if len(nearbyNeutronStars) > 1:s}}\r\n {set nearbyHazards to cat(nearbyHazards, [hazard])}\r\n }\r\n {if len(nearbyBlackHolesStars) > 0:\r\n {set hazard to: Black Hole{if len(nearbyBlackHolesStars) > 1:s}}\r\n {set nearbyHazards to cat(nearbyHazards, [hazard])}\r\n }\r\n \r\n {if len(nearbyHazards) > 0:\r\n Caution: {List(nearbyHazards)} detected. \r\n }\r\n\r\n {if scoop_present && mainstar && !mainstar.scoopable && !secondaryScoopStar:\r\n {if len(nearbyHazards) = 0: {Occasionally(2, \"Alert: \")}}\r\n No scoopable stars charted\r\n {Occasionally(2, \"in arrival system\")}.\r\n }\r\n }\r\n }\r\n}", "default": true, "name": "Ship fsd", "description": "Triggered when there is a change to the status of your ship's fsd" diff --git a/SpeechResponder/eddi.pt-BR.json b/SpeechResponder/eddi.pt-BR.json index fc59c5b0ef..420a4563b7 100644 --- a/SpeechResponder/eddi.pt-BR.json +++ b/SpeechResponder/eddi.pt-BR.json @@ -2261,7 +2261,7 @@ "enabled": true, "priority": 3, "responder": true, - "script": null, + "script": "{set hazardDistance to 100} {_ Warn me when hazardous stars are within this distance (in ls) from the main star }\r\n\r\n{_ Fetch from context _}\r\n{if state.eddi_context_next_system_name:\r\n {set reportSystem to SystemDetails(state.eddi_context_selected_system_name)}\r\n|else:\r\n {set reportSystem to nextsystem}\r\n}\r\n\r\n{if event.fsd_status = 'charging' && event.hyperdrive_charging: \r\n {if len(reportSystem.systemname) > 0:\r\n \r\n {Pause(2000)}\r\n \r\n {if reportSystem.systemname != homesystem.systemname:\r\n {for compartment in ship.compartments:\r\n {if compartment.module.invariantName = 'Fuel Scoop':\r\n {set scoop_present to true}\r\n }\r\n } \r\n \r\n {set scoop_present to true}\r\n\r\n {set nearbyWhiteDwarfStars to []}\r\n {set nearbyNeutronStars to []}\r\n {set nearbyBlackHolesStars to []}\r\n {for aBody in reportSystem.bodies:\r\n {if aBody.bodyType.invariantName = 'Star':\r\n {if aBody.mainstar:\r\n {set mainstar to aBody}\r\n |elif scoop_present && aBody.scoopable && aBody.distance < secondaryScoopStar.distance:\r\n {set secondaryScoopStar to aBody)}\r\n }\r\n {if slice(aBody.stellarclass, 0, 1) = \"D\" && aBody.distance < hazardDistance:\r\n {set nearbyWhiteDwarfStars to cat(nearbyWhiteDwarfStars, [aBody])} \r\n |elif aBody.stellarclass = 'N' && aBody.distance < hazardDistance:\r\n {set nearbyNeutronStars to cat(nearbyNeutronStars, [aBody])}\r\n |elif aBody.stellarclass = 'H' && aBody.distance < hazardDistance: \r\n {set nearbyBlackHolesStars to cat(nearbyBlackHolesStars, [aBody])}\r\n }\r\n }\r\n }\r\n \r\n {set nearbyHazards to []} \r\n {if len(nearbyWhiteDwarfStars) > 0:\r\n {set hazard to: White Dwarf{if len(nearbyWhiteDwarfStars) > 1:s}}\r\n {set nearbyHazards to cat(nearbyHazards, [hazard])}\r\n }\r\n {if len(nearbyNeutronStars) > 0:\r\n {set hazard to: Neutron Star{if len(nearbyNeutronStars) > 1:s}}\r\n {set nearbyHazards to cat(nearbyHazards, [hazard])}\r\n }\r\n {if len(nearbyBlackHolesStars) > 0:\r\n {set hazard to: Black Hole{if len(nearbyBlackHolesStars) > 1:s}}\r\n {set nearbyHazards to cat(nearbyHazards, [hazard])}\r\n }\r\n \r\n {if len(nearbyHazards) > 0:\r\n Caution: {List(nearbyHazards)} detected. \r\n }\r\n\r\n {if scoop_present && mainstar && !mainstar.scoopable && !secondaryScoopStar:\r\n {if len(nearbyHazards) = 0: {Occasionally(2, \"Alert: \")}}\r\n No scoopable stars charted\r\n {Occasionally(2, \"in arrival system\")}.\r\n }\r\n }\r\n }\r\n}", "name": "Ship fsd", "description": "Triggered when there is a change to the status of your ship's fsd", "default": true diff --git a/SpeechResponder/eddi.ru.json b/SpeechResponder/eddi.ru.json index ed3c0408f0..79244df4d5 100644 --- a/SpeechResponder/eddi.ru.json +++ b/SpeechResponder/eddi.ru.json @@ -1045,7 +1045,7 @@ "enabled": true, "priority": 3, "responder": true, - "script": "{_ Context }\r\n{SetState('eddi_context_last_subject', 'fsd')}\r\n{SetState('eddi_context_last_action', 'engage')}\r\n{SetState('eddi_context_system_name', event.system)}\r\n{SetState('eddi_context_system_system', event.system)}\r\n{SetState('eddi_context_fsd_target', event.target)}\r\n{SetState('eddi_context_system_lastvisit', system.lastVisitSeconds)}\r\n\r\n{_ Zero the 'remaining jump' context to only use values following this event _}\r\n{SetState('eddi_context_remaining_jumps', 0)}\r\n\r\n{if event.target = 'Hyperspace':\r\n {_ Rewrite context to represent a jump }\r\n {SetState('eddi_context_last_subject', 'jump')}\r\n {SetState('eddi_context_last_action', 'start')}\r\n\r\n {set reportsystem to SystemDetails(event.system)}\r\n\r\n {_ Wait for the FSD countdown and initial jump}\r\n {Pause(5000)}\r\n\r\n {OneOf(\"Destination confirmed\",\"Jump in progress\",\"Telemetry obtained\")}.\r\n {ShipName()} is {OneOf(\"heading to\", \"on route to\", \"travelling to\", \"in transit to\")} the {P(reportsystem.name, \"starsystem\")} system.\r\n {if reportsystem.name = homesystem.name:\r\n Welcome home, {F(\"Honorific\")}\r\n |else:\r\n {set scoopables to [\"O\", \"B\", \"A\", \"F\", \"G\", \"K\", \"M\"]}\r\n {if slice(event.stellarclass, 0, 1) = \"D\":\r\n Caution: white dwarf detected.\r\n |elif event.stellarclass = \"N\":\r\n Caution: neutron star detected.\r\n |elif event.stellarclass = \"H\":\r\n Caution: black hole detected.\r\n |elif find(scoopables, event.stellarclass) = -1:\r\n {Occasionally(2, \"Information: \")}\r\n Arrival star is not scoopable.\r\n }\r\n \r\n {if lastsystem.allegiance && lastsystem.allegiance != \"None\" && lastsystem.allegiance != \"Independent\" && (!reportsystem.allegiance || reportsystem.allegiance = \"None\" || reportsystem.allegiance = \"Independent\"):\r\n You {OneOf(\"are leaving\", \"have left\", \"are no longer in\")} {lastsystem.allegiance} space.\r\n |elif lastsystem.allegiance && lastsystem.allegiance != reportsystem.allegiance && system.allegiance && system.allegiance != \"None\":\r\n You {OneOf(\"are now in\", \"have entered\", \"are entering\")} {reportsystem.allegiance} space.\r\n {if cmdr.title != \"Commander\":\r\n Welcome back {F(\"Honorific\")}.\r\n }\r\n }\r\n\r\n {if reportsystem.visits = 0:\r\n This is your first visit to this system.\r\n |elif reportsystem.visits = 1:\r\n This is your second visit to this system.\r\n |elif reportsystem.visits = 2:\r\n {Occasionally(2, \"This is your third visit to this system.\")}\r\n |elif reportsystem.visits = 3:\r\n {Occasionally(2, \"This is your fourth visit to this system.\")}\r\n |else:\r\n {Occasionally(3, \"You have visited this system {reportsystem.visits} times.\")}\r\n }\r\n\r\n {if !reportsystem.population && lastsystem.population:\r\n {OneOf(\"This system is not populated\",\"There is no human presence here\", \"Humans have yet to colonise this system\")}.\r\n |elif reportsystem.population:\r\n {if SecondsSince(reportsystem.lastVisitSeconds) > 3600:\r\n {F(\"System report\")}\r\n }\r\n }\r\n\r\n {if reportsystem.distancefromhome:\r\n {set ReportDistanceFromHome() to:\r\n \t{return cat(\r\n \t OneOf(\"You are\", \"Current location is\", \"You are now\"), \" \",\r\n\t Humanise(reportsystem.distancefromhome), \" lightyears from \",\r\n\t OneOf(\"home\", \"{P(homesystem.name, 'starsystem')}\"), \".\"\r\n\t )}\r\n } \r\n {Occasionally(7, ReportDistanceFromHome())}\r\n }\r\n\r\n {if reportsystem.comment:\r\n You made a {OneOf(\"note\", \"comment\", \"remark\")} {OneOf(\"about\", \"for\", \"on\")} this system. It {OneOf(\"is as follows\", \"says\", \"reads\", \"is\")} {reportsystem.comment}.\r\n }\r\n }\r\n}", + "script": "{_ Context }\r\n{SetState('eddi_context_last_subject', 'fsd')}\r\n{SetState('eddi_context_last_action', 'engage')}\r\n{SetState('eddi_context_system_name', event.system)}\r\n{SetState('eddi_context_system_system', event.system)}\r\n{SetState('eddi_context_fsd_target', event.target)}\r\n{SetState('eddi_context_system_lastvisit', system.lastVisitSeconds)}\r\n\r\n{_ Zero the 'remaining jump' context to only use values following this event _}\r\n{SetState('eddi_context_remaining_jumps', 0)}\r\n\r\n{if event.target = 'Hyperspace':\r\n {_ Rewrite context to represent a jump }\r\n {SetState('eddi_context_last_subject', 'jump')}\r\n {SetState('eddi_context_last_action', 'start')}\r\n\r\n {set reportsystem to SystemDetails(event.system)}\r\n\r\n {_ Wait for the FSD countdown and initial jump}\r\n {Pause(5000)}\r\n\r\n {OneOf(\"Destination confirmed\",\"Jump in progress\",\"Telemetry obtained\")}.\r\n {ShipName()} is {OneOf(\"heading to\", \"on route to\", \"travelling to\", \"in transit to\")} the {P(reportsystem.name, \"starsystem\")} system.\r\n {if reportsystem.name = homesystem.name:\r\n Welcome home, {F(\"Honorific\")}.\r\n |else:\r\n {if lastsystem.allegiance && lastsystem.allegiance != \"None\" && lastsystem.allegiance != \"Independent\" && (!reportsystem.allegiance || reportsystem.allegiance = \"None\" || reportsystem.allegiance = \"Independent\"):\r\n You {OneOf(\"are leaving\", \"have left\", \"are no longer in\")} {lastsystem.allegiance} space.\r\n |elif lastsystem.allegiance && lastsystem.allegiance != reportsystem.allegiance && system.allegiance && system.allegiance != \"None\":\r\n You {OneOf(\"are now in\", \"have entered\", \"are entering\")} {reportsystem.allegiance} space.\r\n {if cmdr.title != \"Commander\":\r\n Welcome back {F(\"Honorific\")}.\r\n }\r\n }\r\n\r\n {if reportsystem.visits = 0:\r\n This is your first visit to this system.\r\n |elif reportsystem.visits = 1:\r\n This is your second visit to this system.\r\n |elif reportsystem.visits = 2:\r\n {Occasionally(2, \"This is your third visit to this system.\")}\r\n |elif reportsystem.visits = 3:\r\n {Occasionally(2, \"This is your fourth visit to this system.\")}\r\n |else:\r\n {Occasionally(3, \"You have visited this system {reportsystem.visits} times.\")}\r\n }\r\n }\r\n}", "default": true, "name": "FSD engaged", "description": "Triggered when your FSD has engaged" @@ -2053,7 +2053,7 @@ "enabled": true, "priority": 3, "responder": true, - "script": null, + "script": "{set hazardDistance to 100} {_ Warn me when hazardous stars are within this distance (in ls) from the main star }\r\n\r\n{_ Fetch from context _}\r\n{if state.eddi_context_next_system_name:\r\n {set reportSystem to SystemDetails(state.eddi_context_selected_system_name)}\r\n|else:\r\n {set reportSystem to nextsystem}\r\n}\r\n\r\n{if event.fsd_status = 'charging' && event.hyperdrive_charging: \r\n {if len(reportSystem.systemname) > 0:\r\n \r\n {Pause(2000)}\r\n \r\n {if reportSystem.systemname != homesystem.systemname:\r\n {for compartment in ship.compartments:\r\n {if compartment.module.invariantName = 'Fuel Scoop':\r\n {set scoop_present to true}\r\n }\r\n } \r\n \r\n {set scoop_present to true}\r\n\r\n {set nearbyWhiteDwarfStars to []}\r\n {set nearbyNeutronStars to []}\r\n {set nearbyBlackHolesStars to []}\r\n {for aBody in reportSystem.bodies:\r\n {if aBody.bodyType.invariantName = 'Star':\r\n {if aBody.mainstar:\r\n {set mainstar to aBody}\r\n |elif scoop_present && aBody.scoopable && aBody.distance < secondaryScoopStar.distance:\r\n {set secondaryScoopStar to aBody)}\r\n }\r\n {if slice(aBody.stellarclass, 0, 1) = \"D\" && aBody.distance < hazardDistance:\r\n {set nearbyWhiteDwarfStars to cat(nearbyWhiteDwarfStars, [aBody])} \r\n |elif aBody.stellarclass = 'N' && aBody.distance < hazardDistance:\r\n {set nearbyNeutronStars to cat(nearbyNeutronStars, [aBody])}\r\n |elif aBody.stellarclass = 'H' && aBody.distance < hazardDistance: \r\n {set nearbyBlackHolesStars to cat(nearbyBlackHolesStars, [aBody])}\r\n }\r\n }\r\n }\r\n \r\n {set nearbyHazards to []} \r\n {if len(nearbyWhiteDwarfStars) > 0:\r\n {set hazard to: White Dwarf{if len(nearbyWhiteDwarfStars) > 1:s}}\r\n {set nearbyHazards to cat(nearbyHazards, [hazard])}\r\n }\r\n {if len(nearbyNeutronStars) > 0:\r\n {set hazard to: Neutron Star{if len(nearbyNeutronStars) > 1:s}}\r\n {set nearbyHazards to cat(nearbyHazards, [hazard])}\r\n }\r\n {if len(nearbyBlackHolesStars) > 0:\r\n {set hazard to: Black Hole{if len(nearbyBlackHolesStars) > 1:s}}\r\n {set nearbyHazards to cat(nearbyHazards, [hazard])}\r\n }\r\n \r\n {if len(nearbyHazards) > 0:\r\n Caution: {List(nearbyHazards)} detected. \r\n }\r\n\r\n {if scoop_present && mainstar && !mainstar.scoopable && !secondaryScoopStar:\r\n {if len(nearbyHazards) = 0: {Occasionally(2, \"Alert: \")}}\r\n No scoopable stars charted\r\n {Occasionally(2, \"in arrival system\")}.\r\n }\r\n }\r\n }\r\n}", "default": true, "name": "Ship fsd", "description": "Triggered when there is a change to the status of your ship's fsd" diff --git a/SpeechResponder/eddi.zh-CN.json b/SpeechResponder/eddi.zh-CN.json index 899f2c5a96..d68a22d0f8 100644 --- a/SpeechResponder/eddi.zh-CN.json +++ b/SpeechResponder/eddi.zh-CN.json @@ -2060,7 +2060,7 @@ "enabled": true, "priority": 3, "responder": true, - "script": null, + "script": "{set hazardDistance to 100} {_ Warn me when hazardous stars are within this distance (in ls) from the main star }\r\n\r\n{_ Fetch from context _}\r\n{if state.eddi_context_next_system_name:\r\n {set reportSystem to SystemDetails(state.eddi_context_selected_system_name)}\r\n|else:\r\n {set reportSystem to nextsystem}\r\n}\r\n\r\n{if event.fsd_status = 'charging' && event.hyperdrive_charging: \r\n {if len(reportSystem.systemname) > 0:\r\n \r\n {Pause(2000)}\r\n \r\n {if reportSystem.systemname != homesystem.systemname:\r\n {for compartment in ship.compartments:\r\n {if compartment.module.invariantName = 'Fuel Scoop':\r\n {set scoop_present to true}\r\n }\r\n } \r\n \r\n {set scoop_present to true}\r\n\r\n {set nearbyWhiteDwarfStars to []}\r\n {set nearbyNeutronStars to []}\r\n {set nearbyBlackHolesStars to []}\r\n {for aBody in reportSystem.bodies:\r\n {if aBody.bodyType.invariantName = 'Star':\r\n {if aBody.mainstar:\r\n {set mainstar to aBody}\r\n |elif scoop_present && aBody.scoopable && aBody.distance < secondaryScoopStar.distance:\r\n {set secondaryScoopStar to aBody)}\r\n }\r\n {if slice(aBody.stellarclass, 0, 1) = \"D\" && aBody.distance < hazardDistance:\r\n {set nearbyWhiteDwarfStars to cat(nearbyWhiteDwarfStars, [aBody])} \r\n |elif aBody.stellarclass = 'N' && aBody.distance < hazardDistance:\r\n {set nearbyNeutronStars to cat(nearbyNeutronStars, [aBody])}\r\n |elif aBody.stellarclass = 'H' && aBody.distance < hazardDistance: \r\n {set nearbyBlackHolesStars to cat(nearbyBlackHolesStars, [aBody])}\r\n }\r\n }\r\n }\r\n \r\n {set nearbyHazards to []} \r\n {if len(nearbyWhiteDwarfStars) > 0:\r\n {set hazard to: White Dwarf{if len(nearbyWhiteDwarfStars) > 1:s}}\r\n {set nearbyHazards to cat(nearbyHazards, [hazard])}\r\n }\r\n {if len(nearbyNeutronStars) > 0:\r\n {set hazard to: Neutron Star{if len(nearbyNeutronStars) > 1:s}}\r\n {set nearbyHazards to cat(nearbyHazards, [hazard])}\r\n }\r\n {if len(nearbyBlackHolesStars) > 0:\r\n {set hazard to: Black Hole{if len(nearbyBlackHolesStars) > 1:s}}\r\n {set nearbyHazards to cat(nearbyHazards, [hazard])}\r\n }\r\n \r\n {if len(nearbyHazards) > 0:\r\n Caution: {List(nearbyHazards)} detected. \r\n }\r\n\r\n {if scoop_present && mainstar && !mainstar.scoopable && !secondaryScoopStar:\r\n {if len(nearbyHazards) = 0: {Occasionally(2, \"Alert: \")}}\r\n No scoopable stars charted\r\n {Occasionally(2, \"in arrival system\")}.\r\n }\r\n }\r\n }\r\n}", "default": true }, "Ship interdicted": { diff --git a/StatusMonitor/StatusMonitor.cs b/StatusMonitor/StatusMonitor.cs index 836a370233..fce1d4dbc7 100644 --- a/StatusMonitor/StatusMonitor.cs +++ b/StatusMonitor/StatusMonitor.cs @@ -135,7 +135,7 @@ private void HandleStatus(object sender, EventArgs e) } else { - EDDI.Instance.enqueueEvent(new ShipFsdEvent(thisStatus.timestamp, thisStatus.fsd_status)); + EDDI.Instance.enqueueEvent(new ShipFsdEvent(thisStatus.timestamp, thisStatus.fsd_status, thisStatus.fsd_hyperdrive_charging)); } } if (thisStatus.low_fuel != lastStatus.low_fuel) diff --git a/VoiceAttack-Integration.md b/VoiceAttack-Integration.md index cb6adc7541..4999542430 100644 --- a/VoiceAttack-Integration.md +++ b/VoiceAttack-Integration.md @@ -57,6 +57,7 @@ Where values are indexed (the compartments on a ship for example), the zero-base * {BOOL:Status overheating} a boolean value indicating whether the commander's vehicle is overheating * {BOOL:Status low fuel} a boolean value indicating whether the commander has less than 25% fuel remaining * {TXT:Status fsd status} the current status of the ship's frame shift drive. Can be one of "ready", "cooldown", "charging", or "masslock" + * {BOOL:Status fsd hyperdrive charging} a boolean value indicating whether the FSD is currently charging for a jump to hyperspace. * {BOOL:Status srv drive assist} a boolean value indicating whether SRV drive assist is active * {BOOL:Status srv under ship} a boolean value indicating whether the SRV in within the proximity zone around the ship * {BOOL:Status srv turret deployed} a boolean value indicating whether the SRV's turret has been deployed