Release EDDI Scripts and EDDI enabled VA Commands Thread

Here you go!

Code:
{_ Fetch from context }
{set reportbody to BodyDetails(state.eddi_context_body_name, state.eddi_context_body_system)}

{if !reportbody.name || reportbody.name = "":
    I'm not sure which body you are asking about.
|else:
    {P(reportbody.name)} is a
    {if reportbody.gravity < 0.5:
        low-gravity
    |elif reportbody.gravity <2:
        medium-gravity
    |elif reportbody.gravity <4:
        high-gravity
    |else:
        extremely high-gravity
    }

    {if reportbody.tidallylocked:
        tidally-locked
    }

    {if reportbody.terraformstate = "Terraformable":
        terra-formable
    |elif reportbody.terraformstate = "Terraformed":
        terra-formed
    }

    {if len(reportbody.rings) > 0:
        ringed
    }

    {reportbody.planettype}

    {if reportbody.terraformstate = "Terraforming":
      in the process of being terra-formed
    }

    that is

    {if reportbody.landable:
        suitable
    |else:
        unsuitable
    }
    for landing.

    {_ Atmosphere? }

    {if reportbody.volcanism:
        This planet shows signs of volcanism, with
        {if reportbody.volcanism.type = 'Geysers':
            {if reportbody.volcanism.amount = 'Major':
                high numbers of
            |elif reportbody.volcanism.amount = 'Minor':
                low numbers of
            }
            active {reportbody.volcanism.composition} guy-sers
        |else:
            {if reportbody.volcanism.amount = 'Major':
                high levels of
            |elif reportbody.volcanism.amount = 'Minor':
                low levels  of
            }
            active {reportbody.volcanism.composition} magma flows
        }.
    }

    {if reportbody.landable :
        It has a
        {if reportbody.rotationalperiod < -20.0:
            slow retrograde
        |elif reportbody.rotationalperiod < -0.5:
            retrograde
        |elif reportbody.rotationalperiod < 0:
            fast retrograde
        |elif reportbody.rotationalperiod <= 0.5:
            fast
        |elif reportbody.rotationalperiod > 20.0:
            slow
        }
        rotational period of {Humanise(reportbody.rotationalperiod)}
        day{if Humanise(reportbody.rotationalperiod) != "1":s}.

        {set goodmaterials to []}
        {set greatmaterials to []}

        {for material in reportbody.materials:
            {if material.percentage >= MaterialDetails(material.material).greatpctbody:
                {set greatmaterials to cat(greatmaterials, [material])}
            |elif material.percentage >= MaterialDetails(material.material).goodpctbody:
                {set goodmaterials to cat(goodmaterials, [material])}
            }
        }

        {if len(greatmaterials) > 0:
            This body contains very high levels of
            {if len(greatmaterials) = 1:
                {greatmaterials[0].material} at {round(greatmaterials[0].percentage, 1)} percent
            |elif len(greatmaterials) = 2:
                {greatmaterials[0].material} at {round(greatmaterials[0].percentage, 1)} percent,
                and {greatmaterials[1].material} at {round(greatmaterials[1].percentage, 1)} percent
            |else:
                {set cur to 0}
                {while cur < len(greatmaterials):
                    {if cur = 0:
                        {greatmaterials[cur].material} at {round(greatmaterials[cur].percentage, 1)} percent
                    |elif cur < len(greatmaterials) - 1:
                        , {greatmaterials[cur].material} at {round(greatmaterials[cur].percentage, 1)} percent
                    |else:
                        , and {greatmaterials[cur].material} at {round(greatmaterials[cur].percentage, 1)} percent
                    }
                    {set cur to cur + 1}
                }
            }
        }
        {if len(goodmaterials) > 0:
            {if len(greatmaterials) > 0:
                and high levels of
            |else:
                This body contains high levels of
            }
            {if len(goodmaterials) = 1:
                {goodmaterials[0].material} at {round(goodmaterials[0].percentage, 1)} percent
            |elif len(goodmaterials) = 2:
                {goodmaterials[0].material} at {round(goodmaterials[0].percentage, 1)} percent,
                and {goodmaterials[1].material}  at {round(goodmaterials[1].percentage, 1)} percent
            |else:
                {set cur to 0}
                {while cur < len(goodmaterials):
                    {if cur = 0:
                        {goodmaterials[cur].material} at {round(goodmaterials[cur].percentage, 1)} percent
                    |elif cur < len(goodmaterials) - 1:
                        , {goodmaterials[cur].material} at {round(goodmaterials[cur].percentage, 1)} percent
                    |else:
                        , and {goodmaterials[cur].material} at {round(goodmaterials[cur].percentage, 1)} percent
                    }
                    {set cur to cur + 1}
                }
            }
        }
        {if len(greatmaterials) > 0 || len(goodmaterials) > 0:
            .
        }
    }
}


You can 'grep' this version of 'Body report' against the default to see what I did.

Thank you for this example. I've been using versions of this script, but what I'm looking for is something that reads off all the materials and percentages reguardless of if they are good percentages or not. I've had mixed results using the good materials script. Sometimes it works and other times it doesn't.
 
Thank you for this example. I've been using versions of this script, but what I'm looking for is something that reads off all the materials and percentages reguardless of if they are good percentages or not. I've had mixed results using the good materials script. Sometimes it works and other times it doesn't.

No worries, I figured you might be looking for something 'more complete' but thought I'd reply with the 'quick & dirty' anyway.

What you want is absolutely doable but I'd recommend making it a separate script, along the lines of a 'Body material report'...


Code:
{_ Body material report }


{_ Fetch from context }
{set reportbody to BodyDetails(state.eddi_context_body_name, state.eddi_context_body_system)}

{if !reportbody.name || reportbody.name = "":
    I'm not sure which body you are asking about.
|else:
    {if reportbody.landable:
        {if len(reportbody.materials) > 0:

            This body contains measureable levels of

            {if len(reportbody.materials) = 1:
                {reportbody.materials[0].material} at {round(reportbody.materials[0].percentage, 1)} percent
            |elif len(material) = 2:
                {reportbody.materials[0].material} at {round(reportbody.materials[0].percentage, 1)} percent,
                and {reportbody.materials[1].material} at {round(reportbody.materials[1].percentage, 1)} percent
            |else:
                {set cur to 0}
                {while cur < len(reportbody.materials):
                    {if cur = 0:
                        {reportbody.materials[cur].material} at {round(reportbody.materials[cur].percentage, 1)} percent
                    |elif cur < len(reportbody.materials) - 1:
                        , {reportbody.materials[cur].material} at {round(reportbody.materials[cur].percentage, 1)} percent
                    |else:
                        , and {reportbody.materials[cur].material} at {round(reportbody.materials[cur].percentage, 1)} percent
                    }
                    {set cur to cur + 1}
                }
            }
            {if len(reportbody.materials) > 0:
                .
            }
        |else:
            This body has no measurable materials to report.
        }
    |else:
        This body is not land-able.
    }
}


I just whipped this up 'on the fly' (stealing liberally from the Body report script) and only marginally tested it, so standard tail-light warranty applies. Be aware that this will give you everything so, as a result, it was rather 'chatty' with some of the planets I tested.



Additionally, you could call it with a simple VA command...

Code:
Set Text [Script] to 'Body material report'
Execute external plugin, 'EDDI 2.3.0-b8' and wait for return    ---> Context = "speech", Text Variables = "Script"
 
Last edited:
Is it true that the variables:

event.landable
reportbody.landable

are only set when scanned with a Detailed surface scanner?

I seem to remember having these variables set before without needing a Detailed surface scanner (ie, scanning with just an advanced discovery scanner equipped.
 
No worries, I figured you might be looking for something 'more complete' but thought I'd reply with the 'quick & dirty' anyway.

What you want is absolutely doable but I'd recommend making it a separate script, along the lines of a 'Body material report'...


Code:
{_ Body material report }


{_ Fetch from context }
{set reportbody to BodyDetails(state.eddi_context_body_name, state.eddi_context_body_system)}

{if !reportbody.name || reportbody.name = "":
    I'm not sure which body you are asking about.
|else:
    {if reportbody.landable:
        {if len(reportbody.materials) > 0:

            This body contains measureable levels of

            {if len(reportbody.materials) = 1:
                {reportbody.materials[0].material} at {round(reportbody.materials[0].percentage, 1)} percent
            |elif len(material) = 2:
                {reportbody.materials[0].material} at {round(reportbody.materials[0].percentage, 1)} percent,
                and {reportbody.materials[1].material} at {round(reportbody.materials[1].percentage, 1)} percent
            |else:
                {set cur to 0}
                {while cur < len(reportbody.materials):
                    {if cur = 0:
                        {reportbody.materials[cur].material} at {round(reportbody.materials[cur].percentage, 1)} percent
                    |elif cur < len(reportbody.materials) - 1:
                        , {reportbody.materials[cur].material} at {round(reportbody.materials[cur].percentage, 1)} percent
                    |else:
                        , and {reportbody.materials[cur].material} at {round(reportbody.materials[cur].percentage, 1)} percent
                    }
                    {set cur to cur + 1}
                }
            }
            {if len(reportbody.materials) > 0:
                .
            }
        |else:
            This body has no measurable materials to report.
        }
    |else:
        This body is not land-able.
    }
}


I just whipped this up 'on the fly' (stealing liberally from the Body report script) and only marginally tested it, so standard tail-light warranty applies. Be aware that this will give you everything so, as a result, it was rather 'chatty' with some of the planets I tested.



Additionally, you could call it with a simple VA command...

Code:
Set Text [Script] to 'Body material report'
Execute external plugin, 'EDDI 2.3.0-b8' and wait for return    ---> Context = "speech", Text Variables = "Script"

Thank you very much for the code to read out the materials and percentages. Exactly what I was looking for!
 
Looks awesome, many thanks Hoodathunk!

Would it also be possible to:

Include just 'specific' mats into the 'great/good' material script, so it does inform you on the availability (and percent) of e.g. polonium?
Or even have a VA command that you can ask specific mats for, after scanning the body?
Like body report executed, then asking 'does this body have any polonium?'

Would be the icing on the cake.
 
Last edited:
Is it true that the variables:

event.landable
reportbody.landable

are only set when scanned with a Detailed surface scanner?

I seem to remember having these variables set before without needing a Detailed surface scanner (ie, scanning with just an advanced discovery scanner equipped.

I'm pretty sure the 'event.landable' variable requires a DSS to be valid. The 'reportbody' object data comes from a cache of the EDDN/EDDB database, so one would think that this data is not dependent on a DSS. The only downside of using BodyDetails() is that if no one (either you just now or another CMDR in the past) has scanned the body with a DSS, the data will be incomplete.
 
Last edited:
Looks awesome, many thanks Hoodathunk!

Would it also be possible to:

Include just 'specific' mats into the 'great/good' material script, so it does inform you on the availability (and percent) of e.g. polonium?
Or even have a VA command that you can ask specific mats for, after scanning the body?
Like body report executed, then asking 'does this body have any polonium?'

Would be the icing on the cake.


How about a 'Body materials report' script that reports only on materials from a detailed scan that are present in the 'Materials required report' data?

I'll take a look at what kind of effort would be required to pull this off.
 
How about a 'Body materials report' script that reports only on materials from a detailed scan that are present in the 'Materials required report' data?

I'll take a look at what kind of effort would be required to pull this off.

Ooooh, i like where this is going... [big grin]

As you can imagine (from mentioning polonium) i'm out exploring atm. Outer systems, where synthesis is a must.
Having a blast.
But, some of the most rare materials (like polonium, and perhaps niobium to some extent) i yet have to discover in percentages
that would be called 'high' or above.
So, yes, i have set the amounts 'needed' in EDDI already, asking 'what materials do i need' or 'how many xxx do i have / need'.
But, the only way to check the bodies on the rarer mats is the system map atm.
That sitch is what i would like to have covered, by one way or the other.

Eventually have the body report calling that function, so it could add a line like 'You could stock up on x, y, and z here'...?
 
I'm pretty sure the 'event.landable' variable requires a DSS to be valid. The 'reportbody' object data comes from a cache of the EDDN/EDDB database, so one would think that this data is not dependent on a DSS. The only downside of using BodyDetails() is that if no one (either you just now or another CMDR in the past) has scanned the body with a DSS, the data will be incomplete.

Boo.

So now I'm looking for a way to check landing status using both the event.landable and reportbody.landable variables. Again the coding language is making my head hurt.

How would I use a if statement to check if event.landable OR reportbody.landable equals true?
 
*Sigh* A little late to the party here, but I used to have a version of 'Body Scanned' (before it was split off into Body Report) that listed all materials and their percentages, almost exactly as Hoodthunk has made this version. I would have posted that for you if I'd had time to check in here. Oh well! :)

I ended up taking it out though, as I was finding that the report was so long (even after shortening it to minimum), it was still going for the first body while I was scanning my second or third body. It was sooo tedious, it was spoiling the immersion.

On a lighter note, the Fines & Bounties system is on course for prototype testing by the weekend. Bonds and Bounties seem to be working ok, and most of the Fines and Bounties Incurred is looking good too. I have come across one potentially system-breaking problem though: there is no way to tell if a dormant fine/bounty gets reactivated. I've had to fudge it with a check to see if you get attacked by the law (military/bounty hunter/system authority) which will most likely be if they have scanned you and reactivated them.

Does anyone know if Legacy Fines can be reactivated as active fines/bounties? I can't find any information on this anywhere, so I suspect not, but I'm just not sure either way.
 
*Sigh* A little late to the party here, but I used to have a version of 'Body Scanned' (before it was split off into Body Report) that listed all materials and their percentages, almost exactly as Hoodthunk has made this version. I would have posted that for you if I'd had time to check in here. Oh well! :)

I ended up taking it out though, as I was finding that the report was so long (even after shortening it to minimum), it was still going for the first body while I was scanning my second or third body. It was sooo tedious, it was spoiling the immersion.

Yup, I can see it getting becoming tedious which is why I suggested tying a detailed body materials report to the Materials Monitor's 'Materials required report' data. Not trivial, but should be doable.

On a lighter note, the Fines & Bounties system is on course for prototype testing by the weekend. Bonds and Bounties seem to be working ok, and most of the Fines and Bounties Incurred is looking good too.

Excellent! Looking forward to see it!

On a different topic, I'm experimenting with adding 'mission failed' tracking to the database. When the Mission System starts doing more than just giving information, such as plotting 'traveling salesman' loops or 'nearest', 'most' and 'soonest expired' routes, not tracking failed missions will potentially send you on some 'wild goose' chases.

I think just deleting the mission entry on a 'failed' event is the wrong way to go because then your total Mission count would no longer reflect reality. As a result, I added 'eddi_context_mission_failed' to the database, which is initialized for each new mission to "no" by 'MissionStoreAdd' and updated to "yes" on a 'Mission failed" event by a new 'MissionStoreFailed' script.

Then add code in all the 'Check' scripts to skip mission entries where 'mission_failed' = "yes".

It was fairly trivial to modify... I'll post some scripts when I get back to my computer to show you my thoughts.
 
Last edited:
On a different topic, I'm experimenting with adding 'mission failed' tracking to the database. When the Mission System starts doing more than just giving information, such as plotting 'traveling salesman' loops or 'nearest', 'most' and 'soonest expired' routes, not tracking failed missions will potentially send you on some 'wild goose' chases.

I think just deleting the mission entry on a 'failed' event is the wrong way to go because then your total Mission count would no longer reflect reality. As a result, I added 'eddi_context_mission_failed' to the database, which is initialized for each new mission to "no" by 'MissionStoreAdd' and updated to "yes" on a 'Mission failed" event by a new 'MissionStoreFailed' script.

Ah yes, I hadn't thought of that. I'm the kind of person who gets an idea to create something, but I don't always see the full potential of what it could become. This mission system has so obviously got many more uses than I had originally envisoned, it's not surprising that it could do with a few more upgrades. I imagine that the Fines & Bounties system will be much the same. I must admit, I was more concerned with getting the whole thing working in general first, then tweak it for ages after.

I've also discovered a way edit the data in the storage strings without needing to split into arrays and then rebuild them with the new data. It's way faster and much tidier. No need for loops. I don't think this will work for deleteing the data, as I believe the split markers will still remain, but then we can use the 'except' function you found for that. :D

Code:
 {_ Set temporary string to the state variable}
    {set temparray_type to state.eddi_context_bounties_type}

 {_ Edit the string at 'position' using the "+=" as the split markers, replace with contents of 'type' variable}
    {set temparray_type to token(temparray_type, "+=", position, type)}

 {_ Rewrite the state variable}
     {SetState('eddi_context_bounties_type', temparray_type)}

I can see this being useful for changing the "no" to "yes" for the mission failed variable. :)
 
Last edited:
I've also discovered a way edit the data in the storage strings without needing to split into arrays and then rebuild them with the new data. It's way faster and much tidier. No need for loops. I don't think this will work for deleteing the data, as I believe the split markers will still remain, but then we can use the 'except' function you found for that. :D

Code:
 {_ Set temporary string to the state variable}
    {set temparray_type to state.eddi_context_bounties_type}

 {_ Edit the string at 'position' using the "+=" as the split markers, replace with contents of 'type' variable}
    {set temparray_type to token(temparray_type, "+=", position, type)}

 {_ Rewrite the state variable}
     {SetState('eddi_context_bounties_type', temparray_type)}

I can see this being useful for changing the "no" to "yes" for the mission failed variable. :)

Lol, I've used 'token' for reading, but forgot that it also had a 'replace' feature. Good catch!

The power of Cottle continues to amaze me.
 
Last edited:
Boo.

So now I'm looking for a way to check landing status using both the event.landable and reportbody.landable variables. Again the coding language is making my head hurt.

How would I use a if statement to check if event.landable OR reportbody.landable equals true?

Well, the coding would be:

Code:
{if event.landable || reportbody.landable:

}

but, from my understanding, jgm merges all realtime scans with his copy of the EDDN database (which is updated regularly, every 24 hrs I think), in addition to sending the scan data to EDDN.

So as a result, 'reportbody.landable' should always work if you're scanning with a DSS.
 
Last edited:
Hey Darkcyde, found a new trick!

As an example, in 'MissionStoreCheckGalaxy' you used:

Code:
{set number to systems_count[here] + 1}
{set systems_count to cat(slice(systems_count, 0, here), [number], slice(systems_count, here + 1))}


Try this instead:

Code:
{set number to systems_count[here] + 1}
{set systems_count to union(systems_count, [here:number])}


From the 'Union' function description:

union(map1, map2, ...)


Return a map containing all pairs from input maps, but without duplicating any key.
If a key exists more than once in all input maps, the last one will overwrite any previous pair using it.


So, you can use 'union' to modify maps as you would use 'token' to modify strings.
 
Last edited:
Well, the coding would be:

Code:
{if event.landable || reportbody.landable:

}

but, from my understanding, jgm merges all realtime scans with his copy of the EDDN database (which is updated regularly, every 24 hrs I think), in addition to sending the scan data to EDDN.

So as a result, 'reportbody.landable' should always work if you're scanning with a DSS.

This also works (and as a bonus, you can get an essentially complete body report while "testing" the body scanned script using this method:
Code:
{set reportbody to BodyDetails(state.eddi_context_body_name, state.eddi_context_body_system)}
{if !reportbody:
   {set reportbody to event}
}
 
Ooooh, i like where this is going... [big grin]

As you can imagine (from mentioning polonium) i'm out exploring atm. Outer systems, where synthesis is a must.
Having a blast.
But, some of the most rare materials (like polonium, and perhaps niobium to some extent) i yet have to discover in percentages
that would be called 'high' or above.
So, yes, i have set the amounts 'needed' in EDDI already, asking 'what materials do i need' or 'how many xxx do i have / need'.
But, the only way to check the bodies on the rarer mats is the system map atm.
That sitch is what i would like to have covered, by one way or the other.

Eventually have the body report calling that function, so it could add a line like 'You could stock up on x, y, and z here'...?

I've also been out exploring recently and have been playing around with this idea. It's still very rough, but here's what I'm playing with so far:
{_ Fetch from context }
{set reportbody to BodyDetails(state.eddi_context_body_name, state.eddi_context_body_system)}
{if !reportbody:
{set reportbody to event}
{set planettype to bodyclass}
}


{_ Material desired check _}
{set desiredmaterials to []}
{set desiredmaterialsthreshold to []}
{for material in reportbody.materials:
{if material.percentage >= MaterialDetails(material.material).greatpctbody || material.percentage >= MaterialDetails(material.material).goodpctbody:
{if material.desired && material.amount < material.desired:
{set desiredmaterials to cat(desiredmaterials, [material])}
|elif material.desired && material.amount < material.threshold:
{set desiredmaterialsthreshold to cat(desiredmaterialsthreshold, [material])}
}
}
}


{if len(desiredmaterials) > 0 || len(desiredmaterialsthreshold) > 0:


{set stop to OneOf("stop", "land")}
{OneOf("I suggest we {stop}", "I suggest {stop}ing", "We should {stop}")}
here to collect


{if len(desiredmaterials) > 0:


{if len(desiredmaterials) = 1:
{desiredmaterials[0].material}
|elif len(desiredmaterials) = 2:
{desiredmaterials[0].material} and {desiredmaterials[1].material}
|else:
{set cur to 0}
{while cur < len(desiredmaterials):
{if cur = 0:
{desiredmaterials[cur].material}
|elif cur < len(desiredmaterials) - 1:
, {desiredmaterials[cur].material}
|else:
, and {desiredmaterials[cur].material}
}
{set cur to cur + 1}
}
}
}


{if len(desiredmaterials) > 0 && len(desiredmaterialsthreshold) > 0
and (space permitting)
}


{if len(desiredmaterialsthreshold) > 0:

{if len(desiredmaterialsthreshold) = 1:
{desiredmaterialsthreshold[0].material}
|elif len(desiredmaterialsthreshold) = 2:
{desiredmaterialsthreshold[0].material} and {desiredmaterialsthreshold[1].material}
|else:
{set cur to 0}
{while cur < len(desiredmaterialsthreshold):
{if cur = 0:
{desiredmaterialsthreshold[cur].material}
|elif cur < len(greatmaterials) - 1:
, {desiredmaterialsthreshold[cur].material}
|else:
, and {desiredmaterialsthreshold[cur].material}
}
{set cur to cur + 1}
}
}
}
}
 
I've also been out exploring recently and have been playing around with this idea. It's still very rough, but here's what I'm playing with so far:
{_ Fetch from context }
{set reportbody to BodyDetails(state.eddi_context_body_name, state.eddi_context_body_system)}
{if !reportbody:
{set reportbody to event}
{set planettype to bodyclass}
}


{_ Material desired check _}
{set desiredmaterials to []}
{set desiredmaterialsthreshold to []}
{for material in reportbody.materials:
{if material.percentage >= MaterialDetails(material.material).greatpctbody || material.percentage >= MaterialDetails(material.material).goodpctbody:
{if material.desired && material.amount < material.desired:
{set desiredmaterials to cat(desiredmaterials, [material])}
|elif material.desired && material.amount < material.threshold:
{set desiredmaterialsthreshold to cat(desiredmaterialsthreshold, [material])}
}
}
}


{if len(desiredmaterials) > 0 || len(desiredmaterialsthreshold) > 0:


{set stop to OneOf("stop", "land")}
{OneOf("I suggest we {stop}", "I suggest {stop}ing", "We should {stop}")}
here to collect


{if len(desiredmaterials) > 0:


{if len(desiredmaterials) = 1:
{desiredmaterials[0].material}
|elif len(desiredmaterials) = 2:
{desiredmaterials[0].material} and {desiredmaterials[1].material}
|else:
{set cur to 0}
{while cur < len(desiredmaterials):
{if cur = 0:
{desiredmaterials[cur].material}
|elif cur < len(desiredmaterials) - 1:
, {desiredmaterials[cur].material}
|else:
, and {desiredmaterials[cur].material}
}
{set cur to cur + 1}
}
}
}


{if len(desiredmaterials) > 0 && len(desiredmaterialsthreshold) > 0
and (space permitting)
}


{if len(desiredmaterialsthreshold) > 0:

{if len(desiredmaterialsthreshold) = 1:
{desiredmaterialsthreshold[0].material}
|elif len(desiredmaterialsthreshold) = 2:
{desiredmaterialsthreshold[0].material} and {desiredmaterialsthreshold[1].material}
|else:
{set cur to 0}
{while cur < len(desiredmaterialsthreshold):
{if cur = 0:
{desiredmaterialsthreshold[cur].material}
|elif cur < len(greatmaterials) - 1:
, {desiredmaterialsthreshold[cur].material}
|else:
, and {desiredmaterialsthreshold[cur].material}
}
{set cur to cur + 1}
}
}
}
}

thx for sharing, mate.
i can't get it to read out anything sadly, is it bc the desired materials would have to be in the 'great' or 'good' lists if i read it correctly?
edit: just had germanium reported in the 'good' list, but got no advise to stock up on it, despite being in the 'needed' list.
i'm a bit lost on what may be going wrong here...

btw., where is it defined what is 'good' or 'great'? doesn't seem to be in the journal. can one modify this?
 
Last edited:
Hey Darkcyde, while testing I think I found a mission type that your mission store doesn't like... permit acquisition missions (the kind that some factions give when you become allied and are completed instantly once you select them).

These instantly completing permit acquisition missions should probably be ignored by the mission store.

Here's the relevant journal entry:
{ "timestamp":"2017-06-29T03:00:41Z", "event":"MissionAccepted", "Faction":"Hodack Prison Colony", "Name":"MISSION_genericPermit1", "Influence":"None", "Reputation":"None", "MissionID":158271736 }
 
thx for sharing, mate.
i can't get it to read out anything sadly, is it bc the desired materials would have to be in the 'great' or 'good' lists if i read it correctly?
edit: just had germanium reported in the 'good' list, but got no advise to stock up on it, despite being in the 'needed' list.
i'm a bit lost on what may be going wrong here...

btw., where is it defined what is 'good' or 'great'? doesn't seem to be in the journal. can one modify this?

Yeah, I'm still trying to make it work too. It's using elements inspired from the default 'Material required report'.
I did some more work on it today to clean it up and try to match the 'Material required report'. Here's the new version:

{_ CUSTOMIZATION _}
{_ Set the variable "goodmaterials" to 1 if you want this script to report both good and great materials. Otherwise, only great material percentages will be reported. _}
{_ Set the variable "maxmaterials" to 1 if you want this script to report materials below the maximum threshold. Otherwise, only materials below desired levels will be reported. _}
{set goodmaterials to 1}
{set maxmaterials to 0}




{_ Fetch from context }
{set reportbody to BodyDetails(state.eddi_context_body_name, state.eddi_context_body_system)}
{if !reportbody:
{set reportbody to event}
}




{_ Material desired check _}


{set desiredmaterials to []}
{set required to []}




{for material in reportbody.materials:
{_ Function to obtain a material from inventory}
{set _inventory(required) to:
{for material in materials:
{if material.material = required:
{return material}
}
}
}
{_ Fetch full material details }
{set material to MaterialDetails(material)}
{_ Fetch material details from inventory}
{set inventory to _inventory(material.name)}
{_ Evaluate materials against criteria }
{if !goodmaterials:
{if material.percentage >= MaterialDetails(material.material).greatpctbody:
{if !maxmaterials:
{if inventory:
{if inventory.desired && inventory.amount < inventory.desired:
{set desiredmaterials to cat(desiredmaterials, [material])}
}
}
|else:
{if inventory:
{if inventory.desired && inventory.amount < inventory.maximum:
{set desiredmaterials to cat(desiredmaterialsmax, [material])}
}
}
}
}
|else:
{if material.percentage >= MaterialDetails(material.material).goodpctbody:
{if !maxmaterials:
{if inventory:
{if inventory.desired && inventory.amount < inventory.desired:
{set desiredmaterials to cat(desiredmaterials, [material])}
}
}
|else:
{if inventory:
{if inventory.desired && inventory.amount < inventory.maximum:
{set desiredmaterials to cat(desiredmaterialsmax, [material])}
}
}
}
}
}
}




{_ Respond if materials are found which meet the desired criteria. _}


{if len(desiredmaterials) > 0:


{set stop to OneOf("stop", "land")}
{OneOf("I suggest we {stop}", "I suggest {stop}ing", "We should {stop}")}
here to collect


{if len(desiredmaterials) > 0:
{if len(desiredmaterials) = 1:
{desiredmaterials[0].material}
|elif len(desiredmaterials) = 2:
{desiredmaterials[0].material} and {desiredmaterials[1].material}
|else:
{set cur to 0}
{while cur < len(desiredmaterials):
{if cur = 0:
{desiredmaterials[cur].material}
|elif cur < len(desiredmaterials) - 1:
, {desiredmaterials[cur].material}
|else:
, and {desiredmaterials[cur].material}
}
{set cur to cur + 1}
}
}
}
}

The current problem is that EDDI doesn't seem to recognize 'inventory.desired', 'inventory.amount', or 'inventory.maximum' as values, even though they should be just as valid here as they are in the 'Material required report'. I'm sure that I've made a simple mistake but after several hours of debugging I still haven't found it. Rep if you find the error before I do! :)
 
Back
Top Bottom