Jump to content
Dante Unbound: Share Bug Reports and Feedback Here! ×

Alert Displaying And Filtering Program


Okiesmokie
 Share

Recommended Posts

No worries Okiesmokie. I think you're using C#, so I wrote a small console program that can parse any alert text regardless of flavor text. (It completely ignores the flavor text, actually.) The example I included was the T-Cyte alert, but to further complicate it for the parser, I added a reward item to the end as well. I hope you can find a way to integrate it into your code somehow.

 

http://pastebin.com/97Ks2XPh

 

I start with two helper functions, and move on to do the actual parsing in Main. One of the helper functions strips all of the letters off of a string and then converts it to an integer, to assist with grabbing the time and credits. The other strips all of the numbers off of a string. This helps find the location of the credits, which the rest of it is based off of. The credits are always there, and they're always in one of two places - the end, or one from the end. This reliability is what you need for accurate parsing, so I started with that.

 

The only two things that can break this are:

"Sparga (Eris): Enemy Robotic Archetype Located - 30m" (Not including credits, which has never happened.)

"Naga (Sedna): Foreign Emissary Located - 2000cr - 30m - Brokk Hammer (Blueprint)" (Reordered alerts, also never happened.)

 

If DE starts doing these things though, they are trolling you. Seriously. In those cases, though, you should still be able to use the non-numeric parts as "keys" to find, at the very least, the time left, and the credit reward. The item reward doesn't have such obvious identifiers, unfortunately, besides always being on the end. Hopefully it stays there.

 

It's fairly basic code, please forgive my coding style, but you should get the gist of it, and hopefully it will assist you. Enjoy.

 

Ah I see what you're doing, you're checking it starting at the end rather than the beginning, that's pretty smart.  The method you're using is basically the same as the method I'm using right now, except I'm checking from the beginning, and using Regex to split the string.

 

I think I may end up just using a better Regular Expression so that it's easier to adapt if they do end up changing the format, though.

 

 

 

OK so I just installed it... its taking up 37mb just sitting there in the tray???? That's a little.. large for something that isn't doing anything.

 

That is because it is a debug build, for obvious reasons.

 

 

 

I've built a new version with a better way of parsing tweets, this shouldn't fail on any tweet unless they change the format now.

 

Also, I wasn't able to re-create the issue someone here was having with the "Other" option.  I typed in Blueprint and it worked perfectly for me, so I'm going to need more information on what was causing it to fail.

 

1.4.3.1 Changes:

  • Re-wrote the tweet parsing method

 

Download Link: http://wfa.okiesmokie.ca/WarframeAlerts_v1.4.3.1.zip

Edited by Okiesmokie
Link to comment
Share on other sites

Ah I see what you're doing, you're checking it starting at the end rather than the beginning, that's pretty smart.  The method you're using is basically the same as the method I'm using right now, except I'm checking from the beginning, and using Regex to split the string.

 

I think I may end up just using a better Regular Expression so that it's easier to adapt if they do end up changing the format, though.

 

Okiesmokie I'd like to add one more bit of code to the cause. It's really been bothering me that the program doesn't show existing alerts on start-up, and I've been seeing other people request this same change. So I wrote a class that basically is totally encapsulated. You don't have to mess with it at all except for one function that will pass EXISTING ACTIVE alerts to your program with zero hassle.

 

Here is an example of it in use: http://pastebin.com/emUs2E4C

 

It's literally a one line ordeal. You create the object when the program loads. You pass in the feed URL, and that's it. It loads in a thread, so as you can see: http://screencast.com/t/1oQX5g7BP it isn't going to slow down your program's startup. Notice in the example "Testing" is after the declaration of the feed object? The program execution wasn't stopped, the feed loaded afterwards, on it's own time.

 

I heavily commented the class, but you only need to pay attention, really, to fireOffAlert(). That's where active existing alerts should be sent from my class to your program. You can optimize the rest to your liking, I just really think this change would push your program ahead of the multitudes of others that are out there, because it would combine the completeness of RSS with the instantness of the Streaming API. A hybrid solution, you know?

 

Here is ExistingAlertFetcher.cs: http://pastebin.com/M1vWLx1M (Remember it needs a reference to System.ServiceModel!)

 

Not trying to step on your toes, I just like the program a lot, and want to help.

Edited by Arsonide
Link to comment
Share on other sites

If you're like me as in I am paranoid with my logins and passwords, then there is a simple solution: I created a new Twitter account that I use for nothing else but WarframeAlerts.

no im not paranoid, I'm just curious why API is better than RSS. now i know, i wish i've read the comments more thoroughly.

 

since right now there isn't any alerts happening yet, I would like to ask:

will the notice sound loop?

if i checked the box of "stuff", will it filter out and avoid it, or alert for "stuff"? 

Link to comment
Share on other sites

no im not paranoid, I'm just curious why API is better than RSS. now i know, i wish i've read the comments more thoroughly.

 

since right now there isn't any alerts happening yet, I would like to ask:

will the notice sound loop?

if i checked the box of "stuff", will it filter out and avoid it, or alert for "stuff"? 

 

RSS has to be periodically checked. It's a slower process, sometimes lagging minutes behind, and the only benefit of this medium is that when the program loads you can see alerts that were open while the program wasn't. The Streaming API sends push notifications. They are instantaneous, but if the program isn't open, tough luck. That's why I think a hybrid solution would be awesome.

 

The notice sound won't loop. Especially if there aren't any alerts going.

 

It will alert for "stuff". Not filter it out.

Edited by Arsonide
Link to comment
Share on other sites

is it possible that this will come so you can have it to youre phone, for that would be great!!!

 

No, sorry, the program will not be ported to the phone.  I do, however, have an alternate method of receiving your alerts via SMS in the works.  It will still require you to be running this program on your PC at the time, though.

 

Okiesmokie I'd like to add one more bit of code to the cause. It's really been bothering me that the program doesn't show existing alerts on start-up, and I've been seeing other people request this same change. So I wrote a class that basically is totally encapsulated. You don't have to mess with it at all except for one function that will pass EXISTING ACTIVE alerts to your program with zero hassle.

 

Here is an example of it in use: http://pastebin.com/emUs2E4C

 

It's literally a one line ordeal. You create the object when the program loads. You pass in the feed URL, and that's it. It loads in a thread, so as you can see: http://screencast.com/t/1oQX5g7BP it isn't going to slow down your program's startup. Notice in the example "Testing" is after the declaration of the feed object? The program execution wasn't stopped, the feed loaded afterwards, on it's own time.

 

I heavily commented the class, but you only need to pay attention, really, to fireOffAlert(). That's where active existing alerts should be sent from my class to your program. You can optimize the rest to your liking, I just really think this change would push your program ahead of the multitudes of others that are out there, because it would combine the completeness of RSS with the instantness of the Streaming API. A hybrid solution, you know?

 

Here is ExistingAlertFetcher.cs: http://pastebin.com/M1vWLx1M (Remember it needs a reference to System.ServiceModel!)

 

Not trying to step on your toes, I just like the program a lot, and want to help.

 

I really appreciate the contribution, and have added it with a few minor changes :)

 

For true encapsulation/scalability, it is better to use a delegate for the "fireOffAlert()" method, rather than requiring me to either copy/paste code into that, or have some kind of messy "parent" passing, ie: (if you're interested)

MyClass parent; public ExistingAlertFetcher(String URI, MyClass _parent) {  parent = _parent;  // ..} private void fireOffAlert(String alertText) {  parent.myAlertHandler(alertText);}

So instead I added a delegate to it:

class ExistingAlertFetcher {  public delegate void ReceiveRSSAlertMethod(string alertString, DateTimeOffset createdAt);  public ReceiveRSSAlertMethod OnReceiveRSSAlert;  // ..   private void processFeed() {  // ..  if(DateTimeOffset.Compare(now, expirationDate) < 0) {    //The alert hasn't expired at this point.    if(OnReceiveRSSAlert != null) {      OnReceiveRSSAlert(item.Title.Text.Replace("WarframeAlerts:", string.Empty).Trim(), item.PublishDate);    }  }   // ..}
 
Then in my main class:
ExistingAlertFetcher existing_alerts = new ExistingAlertFetcher("https://api.twitter.com/1/statuses/user_timeline.rss?screen_name=warframealerts");existing_alerts.OnReceiveRSSAlert += ReceiveRSSAlert;existing_alerts.Start(); // Also added this function as opposed to starting the thread in the constructor, to ensure the delegate is set before it is attempted to be called

 

 

 

1.4.4.0 Changes:

  • Now has the ability to display alerts that were posted before you ran the program, but are still currently active.  Huge thanks to Arsonide for this contribution. [1]

 

Download Link: http://wfa.okiesmokie.ca/WarframeAlerts_v1.4.4.0.zip

Edited by Okiesmokie
Link to comment
Share on other sites

For true encapsulation/scalability, it is better to use a delegate for the "fireOffAlert()" method, rather than requiring me to either copy/paste code into that, or have some kind of messy "parent" passing, ie: (if you're interested)

 

Yeah something about that felt dirty, but I couldn't put my finger on it. I rarely fire up C#, and use C++ usually. I'm glad you found a way to integrate it properly. In my opinion that's the one change that was needed to push this program ahead of the pack of others out there. (Yours is the only one that uses the Streaming API and has multiple filter sounds.)

Link to comment
Share on other sites

Doesn't work for me. Never posts anything and just eats up memory.

And yes I did set the filters.

 

Post your config and Debug Window outputs, I'm not psychic and cannot help you if you just say it doesn't work for you.

 

 

 

Say, rather than having to ask us for the import every single time... think you can have it just use a universal config instead? Just asking since I don't know squat about programming.

 
No, because the program is in its early states and I am modifying the config file regularily.
 
 
 
 

Yeah something about that felt dirty, but I couldn't put my finger on it. I rarely fire up C#, and use C++ usually. I'm glad you found a way to integrate it properly. In my opinion that's the one change that was needed to push this program ahead of the pack of others out there. (Yours is the only one that uses the Streaming API and has multiple filter sounds.)

 

 

Yeah, the C++ equivalent would be function pointers.

Edited by Okiesmokie
Link to comment
Share on other sites

I have another suggestion. I started writing a program that would sort the configuration file for people using my sound pack, but half way through it I realized it would probably be best as a feature of the program. I've created two configuration files that people can import based on what settings they'd like, but the program breaks them on import.

 

When you import a configuration file with a lot of filters, sometimes it gets them mixed up, which is fine for things like, helmets, or whatever, but with the credit filters it can actually break everything. They have to be at the end and from large to small, or the program is going to flag every alert as "Small Credits".

 

So basically, I'm just saying, it would be nice if the program, after importing a configuration file, sorted the ArrayOfFilter nodes by CreditAmountCheck, pushing the true ones to the bottom, and sorting them by CreditAmountValue.

 

The XmlDocument class has pretty good support for this, I can write another sample when I get home, but I'm at work. I'll get on it later tonight.

Link to comment
Share on other sites

I have another suggestion. I started writing a program that would sort the configuration file for people using my sound pack, but half way through it I realized it would probably be best as a feature of the program. I've created two configuration files that people can import based on what settings they'd like, but the program breaks them on import.

 

When you import a configuration file with a lot of filters, sometimes it gets them mixed up, which is fine for things like, helmets, or whatever, but with the credit filters it can actually break everything. They have to be at the end and from large to small, or the program is going to flag every alert as "Small Credits".

 

So basically, I'm just saying, it would be nice if the program, after importing a configuration file, sorted the ArrayOfFilter nodes by CreditAmountCheck, pushing the true ones to the bottom, and sorting them by CreditAmountValue.

 

The XmlDocument class has pretty good support for this, I can write another sample when I get home, but I'm at work. I'll get on it later tonight.

 

I'm not using the XmlDocument class, I'm using a class derived from System.Configuration.ApplicationSettingsBase, which loads/saves the configuration files on its own.  I'm not able to reproduce the issue you're having though?  Every time I import or overwrite the config file with another one, it is loading it in the same order that it is in the .config file.

 

I've tried running this application but it gives me a NET Framework error.

 

Make sure you've installed the Microsoft .Net Framework Runtimes, http://www.microsoft.com/en-ca/download/details.aspx?id=17718

Link to comment
Share on other sites

FYI.

Others: Blueprint still doesnt work for me.

 

Debug:

 

Alert Received: 30/4/2013 10:35:49 PM
>> Not checking credit amount
>> Not checking credit amount
>> Filter not met, aborting
Count: 6
0: Tiamat (Sedna): Destroy Enemy Facility - 30m - 2100cr - Jaw Sword (Blueprint)
1: Tiamat (Sedna)
2:  Destroy Enemy Facility
3: 30
4: 2100
5: Jaw Sword (Blueprint)
Alert Received: 30/4/2013 11:10:48 PM
>> Not checking credit amount
>> Other Rewards Check
>> Length: 5
>> Reward: Jaw Sword (Blueprint)
>> Checking For: Glaive
>> Checking For: Banshee Helmet
>> Checking For: Orokin Catalyst
>> Checking For: Orokin Reactor
>> Not checking credit amount
>> Filter not met, aborting
Count: 5

Edited by chuuburg
Link to comment
Share on other sites

FYI.

Others: Blueprint still doesnt work for me.

 

Debug:

 

Alert Received: 30/4/2013 10:35:49 PM

>> Not checking credit amount

>> Not checking credit amount

>> Filter not met, aborting

Count: 6

0: Tiamat (Sedna): Destroy Enemy Facility - 30m - 2100cr - Jaw Sword (Blueprint)

1: Tiamat (Sedna)

2:  Destroy Enemy Facility

3: 30

4: 2100

5: Jaw Sword (Blueprint)

Alert Received: 30/4/2013 11:10:48 PM

>> Not checking credit amount

>> Other Rewards Check

>> Length: 5

>> Reward: Jaw Sword (Blueprint)

>> Checking For: Glaive

>> Checking For: Banshee Helmet

>> Checking For: Orokin Catalyst

>> Checking For: Orokin Reactor

>> Not checking credit amount

>> Filter not met, aborting

Count: 5

 

I have no idea why it's not even checking others for you?  Do you have the check box checked beside Other?

 

Posting your config file would greatly help.

Edited by Okiesmokie
Link to comment
Share on other sites

So for some reason my sound pack thread was locked. I'm guessing because there was too much overlap between this thread and that one. Not sure, I asked Rebecca for clarification, but until then, I'm going to post here.

 

I changed the pack in a few major ways. Firstly, I added new sounds with exact amounts for credits. It can now audibly say "4000 Credits" or "6000 Credits" or whatever. Secondly, I am discontinuing the reverb version of the pack, since I think it sounds kind of muffled. I'm continuing the crystal clear one only. Lastly, and most importantly...

 

I added a program called ConfigureSounds.exe to the pack. If you open this program, and find your configuration file, which I've made pretty easy (it defaults to a nearby directory, and there are exhaustive instructions in the program itself and in the readme.) It will basically make setting up my sound pack a one click affair. Making this program was necessary because importing config files sometimes resorted the credit filters, resulting in really bad things. It's also nice to have, though, because it lets you the user choose on a per item basis, what sort of sounds you want to hear. (Vague or Verbose). PLEASE NOTE: THIS PROGRAM WILL ERASE YOUR EXISTING FILTERS. It was designed to be run immediately after installing Okiesmokie's program. I recommend you run it after every patch, instead of importing your old configuration file. That way the credits are always properly ordered.

 

Install Okiesmokie's program, install mine to the same folder. Run his program and log in, close his program, run the sound configure program, restart his program, and you're done. Do this after every patch. It's a lot simpler than it sounds, I'm just repeating it a lot to get it into your head.

 

https://dl.dropboxusercontent.com/u/1032313/WarframeAlertSoundPack.zip

 

Enjoy.

 

Edit: Fixed a small bug in the configurator that was causing credit alerts to be silent.

Edited by Arsonide
Link to comment
Share on other sites

This program is great! Not too worried about credits right now so I have it set for the other goodies only. I'm also using the sound pack, had a quick listen to a few of them so I knew what to listen for, very nice. Now I just have to finish unlocking all the missions so I can actually get all these great things. Thanks for coming up with these awesome things to help collectors!

Link to comment
Share on other sites

I have no idea why it's not even checking others for you?  Do you have the check box checked beside Other?

 

Posting your config file would greatly help.

 

Its the same one as here

 

https://forums.warframe.com/index.php?/topic/29688-alert-displaying-and-filtering-program/page-16#entry339936

 

If you really need the config file, do I have to upload the user.config somewhere ?

Link to comment
Share on other sites

I would like to see the config file, yes, just paste the contents here with your username and password edited out

 

This is the part for the filter, the whole thing is kinda long let me know if you really need the whole chunk.

 

<Filter>

                            <Name>No Imp</Name>

                            <AlertSound>C:\Users\Desktop\WarframeAlerts_v1.3.1\genericWeapon.wav</AlertSound>

                            <CreditAmountCheck>false</CreditAmountCheck>

                            <CreditAmountCompare>2</CreditAmountCompare>

                            <CreditAmountValue>0</CreditAmountValue>

                            <OtherRewardsCheck>false</OtherRewardsCheck>

                            <OtherRewardsFilter />

                            <OtherCheckBox>true</OtherCheckBox>

                            <OtherValue>Blueprint</OtherValue>

                        </Filter>

 

Anyhow if you could follow my previous suggestion, include 2 more check boxes, one for anything containing blueprint and one for anything containing artifacts.

Edited by chuuburg
Link to comment
Share on other sites

I have no idea why it was named Dual Dagger, I think that was a bug on their part and they will correct it, so I'm not going to include it in the program unless it happens again.  If you're concerned about that, you can add it to the other field.  (Not sure if I said this before, but if you want more than one thing in the other field, you separate it with semi-colons.  IE:  Glaive;Dual Dagger

 

This is the part for the filter, the whole thing is kinda long let me know if you really need the whole chunk.

 

<Filter>
                            <Name>No Imp</Name>
                            <AlertSound>C:\Users\Desktop\WarframeAlerts_v1.3.1\genericWeapon.wav</AlertSound>
                            <CreditAmountCheck>false</CreditAmountCheck>
                            <CreditAmountCompare>2</CreditAmountCompare>
                            <CreditAmountValue>0</CreditAmountValue>
                            <OtherRewardsCheck>false</OtherRewardsCheck>
                            <OtherRewardsFilter />
                            <OtherCheckBox>true</OtherCheckBox>
                            <OtherValue>Blueprint</OtherValue>
                        </Filter>

 

Anyhow if you could follow my previous suggestion, include 2 more check boxes, one for anything containing blueprint and one for anything containing artifacts.

 

I had that before, but it was confusing people because it overwrote other filters, so I would like to avoid that.  You can just check all the boxes to get all the blueprints.

 

I see what's wrong though, you are using *only* the other box, and no other filter, and I still have it only to check if the OtherRewardsFilter contains something.

 

 

1.4.4.1 Changes:

  • Fixed a bug where the "Other" field wouldn't function if you had no other "?" Reward specified.

 

Download Link: http://wfa.okiesmokie.ca/WarframeAlerts_v1.4.4.1.zip

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...