Release EDDI Scripts and EDDI enabled VA Commands Thread

Alright, y'all thanks to your help this is my first draft. Forgive any horrible spaghetti. I'm not a programmer/scripter. X3

First, EDDI scripts.

"ship interdicted"
Code:
{if event.submitted: {SetState('eddi_context_interdicted', 'yes')}
 |elif event.succeeded:
 {SetState('eddi_context_interdicted', 'yes')}
}


{Pause(3000)}


{if !event.succeeded:


 Interdiction evaded.


 {SetState('eddi_context_interdicted', 'no')}


}



"entered normal space"
Code:
{if state.eddi_context_interdicted != "yes":

 {_ Context }
  {SetState('eddi_context_last_subject', 'fsd')}
  {SetState('eddi_context_last_action', 'disengage')}
  {SetState('eddi_context_system_name', event.system)}
  {SetState('eddi_context_body_name', event.body)}
  {SetState('eddi_context_body_system', event.system)}


  {Pause(5000)}


  {OneOf("{ShipName()} has", "")} {OneOf("left supercruise", "{OneOf(\"entered\", \"returned to\", \"dropped to\")} normal space")}


  {if event.bodytype = 'Planet':
   {OneOf("near", "close to", "in the vicinity of")} planet {P(event.body)}
  |elif event.bodytype = 'Star':
   {OneOf("near", "close to", "in the vicinity of")} star {P(event.body)}
    |elif event.bodytype = 'Station':
   {OneOf("near", "close to", "in the vicinity of")} {P(event.body)}
  }.


}


{SetState('eddi_context_interdicted', 'no')}


Now the VA stuff:

"Occasional Honorific" (voice disabled) As Tkael stated above, external plugin context is "speech".
Code:
Set small int (condition) [Occasionally] value as random from 1 to 2Set Text [Script] to 'Honorific'
Begin Small Integer Compare : [Occasionally] Equals 1
    Execute external plugin, 'EDDI 2.4.1'
End Condition

"((EDDI ship interdicted))" (voice disabled)

Code:
Begin Text Compare : [eddi_context_interdicted] Equals 'yes'    Begin Small Integer Compare : [vocal-disable] Equals 0
        Set small int (condition) [random-speech] value as random from 1 to 4
        Begin Small Integer Compare : [random-speech] Equals 1
            Say, 'I've got a bad feeling about this.'
        End Condition
        Begin Small Integer Compare : [random-speech] Equals 2
            Say, 'Interdiction!'
        End Condition
        Begin Small Integer Compare : [random-speech] Equals 3
            Say, '{TXT:Ship name} was interdicted.'
        End Condition
        Begin Small Integer Compare : [random-speech] Equals 4
            Say, 'We have been successfully interdicted '
            Execute command, 'Occasional Honorific'
        End Condition
        Set small int (condition) [random-speech] value to [Not Set]
    End Condition
    Set small int (condition) [vocal-disable] value to 1
    Set small int (condition) [left-panel-status] value to 0
    Set small int (condition) [hardpoint] value to 0
    Set small int (condition) [cargo-scoop] value to 0
    Set small int (condition) [landing-gear] value to 0
    Set small int (condition) [right-panel-status] value to 0
    Set small int (condition) [galaxy-map] value to 0
    Set small int (condition) [comms] value to 0
    Set small int (condition) [sys-map] value to 0
    Pause 1 second
    Execute command, '[Battle;Combat;Get] [Mode;Ready];Weapons Hot' (and wait until it completes)
    Execute command, 'Target Previous Ship - [Numpad /]' (and wait until it completes)
    Begin Small Integer Compare : [vocal-response] Equals 1
        Set small int (condition) [vocal-disable] value to 0
    End Condition
End Condition
Begin Text Compare : [eddi_context_interdicted] Equals 'no'
    Begin Small Integer Compare : [vocal-disable] Equals 0
        Set small int (condition) [random-speech] value as random from 1 to 2
        Begin Small Integer Compare : [random-speech] Equals 1
            Say, 'Evaded!'
        End Condition
        Begin Small Integer Compare : [random-speech] Equals 2
            Say, 'We have successfully escaped interdiction '
            Execute command, 'Occasional Honorific'
        End Condition
    End Condition
    Set small int (condition) [random-speech] value to [Not Set]
End Condition
Begin Small Integer Compare : [voice-response] Equals 1
    Set small int (condition) [voice-disable] value to 0
End Condition
 
Last edited:
Alright, y'all thanks to your help this is my first draft. Forgive any horrible spaghetti. I'm not a programmer/scripter. X3

First, EDDI scripts.

"ship interdicted"
Code:
{if event.submitted: {SetState('eddi_context_interdicted', 'yes')}
 |elif event.succeeded:
 {SetState('eddi_context_interdicted', 'yes')}
}


{Pause(3000)}


{if !event.succeeded:


 Interdiction evaded.


 {SetState('eddi_context_interdicted', 'no')}


}



"entered normal space"
Code:
{if state.eddi_context_interdicted != "yes":

 {_ Context }
  {SetState('eddi_context_last_subject', 'fsd')}
  {SetState('eddi_context_last_action', 'disengage')}
  {SetState('eddi_context_system_name', event.system)}
  {SetState('eddi_context_body_name', event.body)}
  {SetState('eddi_context_body_system', event.system)}


  {Pause(5000)}


  {OneOf("{ShipName()} has", "")} {OneOf("left supercruise", "{OneOf(\"entered\", \"returned to\", \"dropped to\")} normal space")}


  {if event.bodytype = 'Planet':
   {OneOf("near", "close to", "in the vicinity of")} planet {P(event.body)}
  |elif event.bodytype = 'Star':
   {OneOf("near", "close to", "in the vicinity of")} star {P(event.body)}
    |elif event.bodytype = 'Station':
   {OneOf("near", "close to", "in the vicinity of")} {P(event.body)}
  }.


}


{SetState('eddi_context_interdicted', 'no')}


Now the VA stuff:

"Occasional Honorific" (voice disabled) As Tkael stated above, external plugin context is "speech".
Code:
Set small int (condition) [Occasionally] value as random from 1 to 2Set Text [Script] to 'Honorific'
Begin Small Integer Compare : [Occasionally] Equals 1
    Execute external plugin, 'EDDI 2.4.1'
End Condition

"((EDDI ship interdicted))" (voice disabled)

Code:
Begin Text Compare : [eddi_context_interdicted] Equals 'yes'    Begin Small Integer Compare : [vocal-disable] Equals 0
        Set small int (condition) [random-speech] value as random from 1 to 4
        Begin Small Integer Compare : [random-speech] Equals 1
            Say, 'I've got a bad feeling about this.'
        End Condition
        Begin Small Integer Compare : [random-speech] Equals 2
            Say, 'Interdiction!'
        End Condition
        Begin Small Integer Compare : [random-speech] Equals 3
            Say, '{TXT:Ship name} was interdicted.'
        End Condition
        Begin Small Integer Compare : [random-speech] Equals 4
            Say, 'We have been successfully interdicted '
            Execute command, 'Occasional Honorific'
        End Condition
        Set small int (condition) [random-speech] value to [Not Set]
    End Condition
    Set small int (condition) [vocal-disable] value to 1
    Set small int (condition) [left-panel-status] value to 0
    Set small int (condition) [hardpoint] value to 0
    Set small int (condition) [cargo-scoop] value to 0
    Set small int (condition) [landing-gear] value to 0
    Set small int (condition) [right-panel-status] value to 0
    Set small int (condition) [galaxy-map] value to 0
    Set small int (condition) [comms] value to 0
    Set small int (condition) [sys-map] value to 0
    Pause 1 second
    Execute command, '[Battle;Combat;Get] [Mode;Ready];Weapons Hot' (and wait until it completes)
    Execute command, 'Target Previous Ship - [Numpad /]' (and wait until it completes)
    Begin Small Integer Compare : [vocal-response] Equals 1
        Set small int (condition) [vocal-disable] value to 0
    End Condition
End Condition
Begin Text Compare : [eddi_context_interdicted] Equals 'no'
    Begin Small Integer Compare : [vocal-disable] Equals 0
        Set small int (condition) [random-speech] value as random from 1 to 2
        Begin Small Integer Compare : [random-speech] Equals 1
            Say, 'Evaded!'
        End Condition
        Begin Small Integer Compare : [random-speech] Equals 2
            Say, 'We have successfully escaped interdiction '
            Execute command, 'Occasional Honorific'
        End Condition
    End Condition
    Set small int (condition) [random-speech] value to [Not Set]
End Condition
Begin Small Integer Compare : [voice-response] Equals 1
    Set small int (condition) [voice-disable] value to 0
End Condition

Hi,

first tip: in entered normal space event, you should do the basic Setstate stuff every time the event happens, to be able to use those variables later.

like this:

{_ Context }
{SetState('eddi_context_last_subject', 'fsd')}
{SetState('eddi_context_last_action', 'disengage')}
{SetState('eddi_context_system_name', event.system)}
{SetState('eddi_context_body_name', event.body)}
{SetState('eddi_context_body_system', event.system)}

{if state.eddi_context_interdicted != "yes":

{Pause(5000)}

{OneOf("{ShipName()} has", "")} {OneOf("left supercruise", "{OneOf("entered", "returned to", "dropped to")} normal space")}

{if event.bodytype = 'Planet':
{OneOf("near", "close to", "in the vicinity of")} planet {P(event.body)}
|elif event.bodytype = 'Star':
{OneOf("near", "close to", "in the vicinity of")} star {P(event.body)}
|elif event.bodytype = 'Station':
{OneOf("near", "close to", "in the vicinity of")} {P(event.body)}
}.

}

{SetState('eddi_context_interdicted', 'no')}

I'm curious, how you progress with your project, for me also exactly this (prepare for fight when interdicted) was the first step in learning combining EDDI and VA. Darkcyde helped me a lot understanding how Setstate works, what is possible to do with it. If you go back on this thread a few pages, you can find some useful hints.

If you are patient enough to complete this project, you will be able to do some very tricky stuff :) !

I don't know if it is true or not, but a programmer guy once told me, his job is 10% coding, 90% eliminating bugs.

Best regards!
 
Think i move in here with my detailed question from the EDDI thread.
I picked quite some snippets of delicious code outta this thread already, so thanks to everyone involved here.

I have a small pro with giving me the info on gravity in the entered normal space event.
I'm sure it has worked for quite some time, maybe 2.4 changed things, i dunno...

Code:
{_ Context }
{SetState('eddi_context_last_subject', 'fsd')}
{SetState('eddi_context_last_action', 'disengage')}
{SetState('eddi_context_system_name', event.system)}
{SetState('eddi_context_body_name', event.body)}
{SetState('eddi_context_body_system', event.system)}

{Pause(5000)}

{OneOf("{ShipName()} has", "")} {OneOf("left supercruise", "{OneOf(\"entered\", \"returned to\", \"dropped to\")} normal space")}

{if event.bodytype = 'Planet':

    {OneOf("near", "close to", "in the vicinity of")}

    {for body in system.bodies:
        {if body.name = event.body:
            {if body.gravity >= 9:
               the {body.gravity} G  
           |elif body.gravity >= 3:
               the 
               {OneOf("super-high gravity", "super heavy gravity", "extreme gravity", "extremely high gravity")}
           |elif body.gravity >= 1.5:
               the high gravity
            |elif body.gravity > 0.5:
               the
            |else:
               the low gravity
            }
        }
    }

    {OneOf("planet", "world")}
    {P(event.body)}

|elif event.bodytype = 'Star':

    {OneOf("near", "close to", "in the vicinity of")} star {P(event.body)}

|elif event.bodytype = 'Station':

{OneOf("near", "close to", "in the vicinity of")} {P(event.body)}
 
  {_ Function to find a given commodity in market}
   {set market(commodity) to:
       {for marketcommodity in station.commodities:
           {if marketcommodity.EDDBID = commodity.EDDBID:
               {return marketcommodity}
           }
       }
   }

   {set stolencommodities to []}

   {for cargo in ship.cargo:
       {if cargo.commodity.name != 'Limpet':
           {set marketcommodity to market(cargo.commodity)}
           {if cargo.stolen = true:
               {set stolencommodities to cat(stolencommodities, [cargo.commodity])}
           |elif cargo.missionid:
               {_ don't do anything with mission cargo at the moment}
           }
       }
   }

   {if len(stolencommodities) > 0:
      {set stolen_desc to OneOf("stolen", "illegal")}
      {set stolen_goods to OneOf("cargo", "goods")}
      
      Reminder: You 
      
      {OneOf(
      "have {stolen_desc} {stolen_goods} on-board", 
      "are carrying {stolen_desc} {stolen_goods}"
      )}
   }

|elif event.bodytype = "PlanetaryRing":
   Planetary Ring {P(token(event.body," Ring",0))}

}.

When it fires, it seems to always say '...in the vicinity of G planet', leaving the value out.
But as you can see, the req. would be to have body.gravity >=9...
Is there a way to actually find out what's happening with the values?
 
I'm not at my computer but you could try Cottle's dump() command:

Code:
{if body.name = event.body:
    Gravity is {dump(body.gravity)}
    ... etc...

Another useful trick is to enable the output to text file and examine the text in Notepad++ or similar.
 
I'm not at my computer but you could try Cottle's dump() command:

Code:
{if body.name = event.body:
    Gravity is {dump(body.gravity)}
    ... etc...

Another useful trick is to enable the output to text file and examine the text in Notepad++ or similar.

Tried the output to text first, this is what i got:

Exiting No-fire Zone.
left supercruise close to the G world Tai Szu 2.
Touchdown on Tai Szu 2. Coordinates are -0.46 degrees latitude, 78.07 degrees longitude.
Buggy away.
Landmines now on board.
Landmines now on board.
Landmines now on board.
Landmines now on board.
Buggy docked.
Lift off.
dropped to normal space near the G world Tai Szu 3.
Touchdown on Tai Szu 3. Coordinates are -15.63 degrees latitude, 34.57 degrees longitude.

Will check out the dump function tomorrow. Perhaps a dumb question: where is it dumped to?
A file in the %appdata%, too?
Just can't get my head around why it's firing the line at all when it only should at >=9G...
 
So basicly im very much lost how to do anything as i don´t understand the programming language/methode at all (and my english is not the best )

Im currently "trying" to build a script (without VA) that gives me a warnig if my cockpit is breached.

currently its just this:
Code:
{_ Context }
{SetState('eddi_context_last_subject', 'cockpit')}
{SetState('eddi_context_last_action', 'breach')}

cockpit breached - ALERT! Cockpit Breached - ALERT!
Emergency Oxygen Active! Dock in a nearby Station immediately.

and im not sure if this even works! after that i would like to use the Material monitor and readout the times i can synthesis the emergency oxygen and let eddi give me a feedback to this ( for example if it is avaible tell me the time how much i can to or if not give me another warning!)

can anybody help me out?

sry for the push but im still stuck anybody an idea? (whitout using Voice attack)?
 
Tried the output to text first, this is what i got:

Exiting No-fire Zone.
left supercruise close to the G world Tai Szu 2.
Touchdown on Tai Szu 2. Coordinates are -0.46 degrees latitude, 78.07 degrees longitude.
Buggy away.
Landmines now on board.
Landmines now on board.
Landmines now on board.
Landmines now on board.
Buggy docked.
Lift off.
dropped to normal space near the G world Tai Szu 3.
Touchdown on Tai Szu 3. Coordinates are -15.63 degrees latitude, 34.57 degrees longitude.

Will check out the dump function tomorrow. Perhaps a dumb question: where is it dumped to?
A file in the %appdata%, too?
Just can't get my head around why it's firing the line at all when it only should at >=9G...

I've taken a quick look at this, and body.gravity is "void", so not set. That's why you are getting the line spoken and nothing being said for the actual variable. "Void" is considered 'greater than' the 9 you have set (I even experimented with 90 billion, and it was still spoken).

I tried hard-coding the planet name I was near while parked in a station, and tried setting body to BodyDetails(), but that produced the same result, body.gravity was "void". However, body.name, body.earthmass, and body.rotationalperiod were all set correctly. These are also spoken correctly when inserted into your original code. It looks like 'gravity' isn't being set for some reason.

Unfortunately I don't have any time to look further right now, but hopefully this can point someone else in the right direction for you.

Regards,

-=] Darkcyde [=-
 
I've taken a quick look at this, and body.gravity is "void", so not set. That's why you are getting the line spoken and nothing being said for the actual variable. "Void" is considered 'greater than' the 9 you have set (I even experimented with 90 billion, and it was still spoken).

I tried hard-coding the planet name I was near while parked in a station, and tried setting body to BodyDetails(), but that produced the same result, body.gravity was "void". However, body.name, body.earthmass, and body.rotationalperiod were all set correctly. These are also spoken correctly when inserted into your original code. It looks like 'gravity' isn't being set for some reason.

Unfortunately I don't have any time to look further right now, but hopefully this can point someone else in the right direction for you.

Regards,

-=] Darkcyde [=-

The server feeding data to the BodyDetails function occasionally has incomplete data. If you share the location where you experienced this error, we should be able to confirm.
 
The server feeding data to the BodyDetails function occasionally has incomplete data. If you share the location where you experienced this error, we should be able to confirm.

Location is Tai Szu 2 according to the cited output.
Scripts can defend against a value being void by testing for it explicitly, ISTR we already did that for gravity but maybe it was in a different script. Away from my main computer now so can't check.

Edit: just remembered it was the Body Report script that we fixed. Have a look at the default script for that, it will show how to test.
 
Last edited:
The server feeding data to the BodyDetails function occasionally has incomplete data. If you share the location where you experienced this error, we should be able to confirm.

I'm docked at 'Bacon City Station' above 'Macdara Peter Gamboni' in the 'Carnoeck' system. I hard-coded the planet and system name into BodyDetails().

I tried both methods, BodyDetails() (with and without the system parameter) and Punkerich's {for body in system.bodies: neither of them had gravity set for this planet.

On a side note, in my Body report script, I use a triple redundancy, although I'm not sure how effective it really is as I only ever trigger the report from a DSS scan which in turn uses the event data in the report and that always seems to have everything set. When creating the script I did hard-code some planets to test the viability of the 2nd & 3rd redundancies though.

This is what I have at the top of my Body report script. I set eventdata to use further into the script to determine the source of the information. This way I can make the correct calculations for 'radius', as the data for this is different depending on where the data comes from (meters verses kilometres).

Code:
{_ Set reportbody to event data _}
{set reportbody to event}
{set eventdata to true}

{_ Fallback to BodyDetails if no event data _}
{if !reportbody.name || reportbody.name = "":
    {set reportbody to BodyDetails(state.eddi_context_body_name, state.eddi_context_body_system)}
    {set eventdata to false}
}

{_ Second fallback if BodyDetails fails with system argument above _}
{if !reportbody.name || reportbody.name = "":
    {set reportbody to BodyDetails(state.eddi_context_body_name)}
    {set eventdata to false}
}
 
Hello cmdrs! Say is there an 'event' that could trigger a cmd like "how many jumps do i have left" when you have a route ploted in EDDI? I'm looking for some information on the help and ED journal but no luck so far! o7
 
Hello cmdrs! Say is there an 'event' that could trigger a cmd like "how many jumps do i have left" when you have a route ploted in EDDI? I'm looking for some information on the help and ED journal but no luck so far! o7

Hi,

if there is one, I'm interested too!

I couldn't find something like like this, so I did a semi-automatic countdown with VA+EDDI, which works quite okay and comfortable (compared to none). It is a bit more complicated to describe here with a few words, but if you are interested, I can share my VA and EDDI profile and explain the details.

It was an amazing feeling hearing the countdown after every jump on a 137 jump-trip :) "You have 137 jumps left to your destination...".

Best regards!
 
am trying to manufacture an EDDI/VA script that will give me choice of what is (or is not said).

So using VA setstate i have integrated "full" and "min"like so:

FSD engaged:

Code: [View]
{_ Context }
{SetState('eddi_context_last_subject', 'fsd')}
{SetState('eddi_context_last_action', 'engage')}
{SetState('eddi_context_system_name', event.system)}
{SetState('eddi_context_system_system', event.system)}
{SetState('eddi_context_fsd_target', event.target)}

{if event.target = 'Hyperspace':
{_ Rewrite context to represent a jump }
{SetState('eddi_context_last_subject', 'jump')}
{SetState('eddi_context_last_action', 'start')}

{set system to SystemDetails(event.system)}

{_ Wait for the FSD countdown and initial jump}
{Pause(6000)}

{if state.jumpingdetails= "full":
{F("FSD full")}
else
{if state.jumpingdetails= "min":
{F("FSD min")}
}}}

Which hopefully will link to either:

The "FSD full" which to save space is the a copy EDDI included FSD engaged script

or

FSD min:

Code: [View]
{set scoopables to ["O", "B", "A", "F", "G", "K", "M"]}
{if slice(event.stellarclass, 0, 1) = "D":
Caution: white dwarf detected.
|elif event.stellarclass = "N":
Caution: neutron star detected.
|elif event.stellarclass = "H":
Caution: black hole detected.
|elif find(scoopables, event.stellarclass) = -1:
Information: arrival star is not scoopable.
}

Hope this makes sense and if I have messed up any help or guidance would be greatly appreciated. This doesn't work. Would you say my issue is with the VA side setstate?

Sorry bout not code ing the code. Copied from old locked Eddi thread
 
Last edited:
{if state.jumpingdetails= "full":
{F("FSD full")}
else
{if state.jumpingdetails= "min":
{F("FSD min")}
}}}
You're close, but I'm seeing a couple of bugs here. Your 'else' statement is formatted incorrectly and it'd be better to drop the second 'if' statement so that your script has a default when state.jumpingdetails is not set. Maybe revise it like this?
Code:
{_ Context }
{SetState('eddi_context_last_subject', 'fsd')}
{SetState('eddi_context_last_action', 'engage')}
{SetState('eddi_context_system_name', event.system)}
{SetState('eddi_context_system_system', event.system)}
{SetState('eddi_context_fsd_target', event.target)}


{if event.target = 'Hyperspace':
   {_ Rewrite context to represent a jump }
   {SetState('eddi_context_last_subject', 'jump')}
   {SetState('eddi_context_last_action', 'start')}


   {set system to SystemDetails(event.system)}


   {_ Wait for the FSD countdown and initial jump}
   {Pause(6000)}


   {if state.jumpingdetails= "full":
      {F("FSD full")}
   |else:
      {F("FSD min")}
   }
}
You can test the script in EDDI and be confident that it is working as intended by adding '{SetState("jumpingdetails", "full")}' or similar to the top of the script and seeing how EDDI responds.
 
Last edited:
Hello cmdrs! Say is there an 'event' that could trigger a cmd like "how many jumps do i have left" when you have a route ploted in EDDI? I'm looking for some information on the help and ED journal but no luck so far! o7

Unfortunately, route information is not something that Frontier has chosen to share with us. I'm hopeful that one day they shall.
In the meantime, you still have a few options. For example:
- Use VoiceAttack to set a counter equal to the number of jumps in your journey and then subtract from that counter as you jump until you reach zero
- Use VoiceAttack to set the name of a destination system (your home system or another frequently visited system perhaps?) and then trigger a reaction when your stated destination matches the system name in EDDI's variables.
 
Last edited:
Location is Tai Szu 2 according to the cited output.
Scripts can defend against a value being void by testing for it explicitly, ISTR we already did that for gravity but maybe it was in a different script. Away from my main computer now so can't check.

Edit: just remembered it was the Body Report script that we fixed. Have a look at the default script for that, it will show how to test.
Then I can confirm that the server data does not contain a value for gravity. I'll be looking at options for improving this situation in the coming weeks.
 
Last edited:
You're close, but I'm seeing a couple of bugs here. Your 'else' statement is formatted incorrectly and it'd be better to drop the second 'if' statement so that your script has a default when state.jumpingdetails is not set. Maybe revise it like this?
Code:
{_ Context }
{SetState('eddi_context_last_subject', 'fsd')}
{SetState('eddi_context_last_action', 'engage')}
{SetState('eddi_context_system_name', event.system)}
{SetState('eddi_context_system_system', event.system)}
{SetState('eddi_context_fsd_target', event.target)}


{if event.target = 'Hyperspace':
   {_ Rewrite context to represent a jump }
   {SetState('eddi_context_last_subject', 'jump')}
   {SetState('eddi_context_last_action', 'start')}


   {set system to SystemDetails(event.system)}


   {_ Wait for the FSD countdown and initial jump}
   {Pause(6000)}


   {if state.jumpingdetails= "full":
      {F("FSD full")}
   |else:
      {F("FSD min")}
   }
}
You can test the script in EDDI and be confident that it is working as intended by adding '{SetState("jumpingdetails", "full")}' or similar to the top of the script and seeing how EDDI responds.

May thanks I will try it out tonight. Great sub thread guys.
 
Back
Top Bottom