Closed Tkael closed 7 years ago
Thank you for this script. The next release of EDDI will have persistence for Galnet articles; see https://github.com/cmdrmcdonald/EliteDangerousDataProvider/wiki/Galnet-Monitor for details.
Sounds like you've progressed far beyond where I was. Looking forward to it. :-)
I have modified the script for Galnet news, but it is hard to test adequately with the current test function embedded in EDDI (I cannot test more than one variant of the input). I thought I'd pass along what I have and see if you can improve it:
Galnet news published {set statustitle to "^(Galactic News: ((Weekly .*)|(Starport Status Update)))|(Powerplay: Incoming Update)"}
{ I'm trying to make galnet articles persistent. Most of this code is intended to do that, but it doesn't work yet and still needs tweaking. }
{set ofinterestindex to []} {set ofinteresttitle to []} {set ofinterestcontent to []} {set notofinterestindex to []} {set notofinteresttitle to []} {set notofinterestcontent to []}
{set galnetcnt to len(event.items)} {set interestcnt to 0} {set notinterestcnt to 0}
{if galnetcnt = 1: {if !match(event.items[0].title, statustitle): {set ofinterestindex to cat(ofinterestindex, [0])} {set ofinteresttitle to cat(ofinteresttitle, [0])} {set ofinterestcontent to cat(ofinterestcontent, [0])} {set interestcnt to interestcnt + 1} |else: {set notofinterestindex to cat(notofinterestindex, [0])} {set notofinteresttitle to cat(notofinteresttitle, [0])} {set notofinterestcontent to cat(notofinterestcontent, [0])} {set notinterestcnt to notinterestcnt + 1} } |elif galnetcnt > 1: {set item to 0} {while item < galnetcnt: {if !match(event.items[item].title, statustitle): {set ofinterestindex to cat(ofinterestindex, [item])} {set ofinteresttitle to cat(ofinteresttitle, [item])} {set ofinterestcontent to cat(ofinterestcontent, [item])} {set interestcnt to interestcnt + 1} |else: {set notofinterestindex to cat(notofinterestindex, [item])} {set notofinteresttitle to cat(notofinteresttitle, [item])} {set notofinterestcontent to cat(notofinterestcontent, [item])} {set notinterestcnt to notinterestcnt + 1} } {set item to item + 1} } }
{F("Galnet news report")}
Galnet news report {if interestcnt = 0:
|elif interestcnt = 1 && galnetcnt = 1:
|elif interestcnt = 1 && galnetcnt > 1:
|elif interestcnt > 1 && galnetcnt > 1:
}