PDA

View Full Version : PSO2 Replacing the pso2_emg_bot



Kion
Sep 12, 2013, 07:25 AM
I rewrote my Node.js twitter listener for the chrome extension, only to find that the pso2_emg_bot had mysteriously stopped posting new EQ's shortly after. A day or two later who ever is managing it posted that it wasn't working well some reason (https://twitter.com/pso2_emg_bot/status/377797435520991232). I figured I might as well make something to either replace or at least complement twitter bot for the chrome extension.

Here's what I have:

Images:
[spoiler-box]
http://arks-layer.com/story/images.png
[/spoiler-box]
Before I had everything hard coded into the chrome extension which was a pain in the ass, so I moved everything over to a database, parse the data on the server and have the client grab the appropriate text message and image from the server as necessary.

[spoiler-box]
http://arks-layer.com/story/times.png
[/spoiler-box]
This is what I'm adding, and why I didn't do this a lot sooner. I was thinking that with players from all over the world, I'd need to have everyone convert the time to JST and then post the time and date. When I realized is that EQ's always come on the approaching hour, which means I can check the time the tweet was created, see if the text in the tweet matches an appropriate time span for the EQ and adjust the status of the chrome/firefox extensions accordingly.

What I need:
So basically what I need for each tweet are three things:

a tag (thinking '#pso2_eq') or some way to screen for appropriate tweets
a ship. Ship02, ect with two digits for the ship number
an EQ name to check against the database.


For the EQ name I'm thinking it might be easy to have an abbreviated list to go by. "swirl", "falz", "elder", ect. or some single word to differentiate each EQ. A sample tweet would look like:



Ship01 falz #pso2_eq


Application:
One thing that I'm probably over worried about is that having this on a tag means that anyone, or possibly small group of people could troll the system. At this point something is better than nothing and it's possible to troubleshoot along the way, but is there a certain approach that would be preferable?

There are a few variations I'm considering:

A tag and have the EQ set after a certain number of posts
have a set of trusted accounts that can set an EQ in one tweet
have a web form for certain users to set the EQ
(ideally)work with Aida to make a desktop client for the task bar for either everyone, or a group of trusted users
Or all of the above and use a combination of methods so that nothing is missed


Feedback:
So thoughts? Ideas? What would be an easy way to post? What abbreviations would works well? Which approach would you prefer? And can someone help me fill in the announcement and effective times for the EQ times in the second image in the spoiler box above?

Ordy
Sep 12, 2013, 07:59 AM
have a web form for certain users to set the EQ

I don't like the idea of having to rely on "humans" to have automatic notifications, that's what bots are for after all. People tend to forget, make mistakes and be slower. So sending informations manually shouldn't be an alternative.


have a set of trusted accounts that can set an EQ in one tweet

I see no problem here, if it's a twitter bot account.


desktop client for the task bar

That's a little too much, just for a notification tool ^^;
And I personnaly wouldn't like to have another program using unnecessary memory space and constantly running in my task bar just to get EQ informations. The browser plugin idea is just fine :3

Oh and about the EQ time, can't you just use JS' getTimezoneOffset() function and give a client side local time?

Kion
Sep 12, 2013, 08:39 AM
Oh and about the EQ time, can't you just use JS' getTimezoneOffset() function and give a client side local time?

I was thinking in terms of parsing the text to date object, so "9/12 16:00-16:30 CST Dark Falz" or something. What I'm doing now is var date = new Date(Date.parse(tweet.created_at)); Which is a pretty easy way to get the time from the tweet object.

Ordy
Sep 12, 2013, 09:02 AM
Well, no matter how you get your EQ time, if your plugin has no time conversion, european players for example, will always have to -7 hours to the JST.

Afaik, twitter's API created_at returns something like "Week_day Month Day hh:mm:ss +TIMEZONE", so you could use the information, and return user's time, instead of JST.

But if you are rather parsing the tweet's text, I'm pretty sure the bot always follows a pattern. "SHIP DAY HOURS ..." or something, so when you get the hour, you will also have to convert anyway.

-- That's just details though, the key point of the app is to always get reliable informations. --

PS: Oh, and you can't automatically assume that ALL the EQ will be at xx:00 - xx:30. During the Quna event, we had Falz attacks 15 minutes after the concert. So it's a little tricky to predict.

Ezodagrom
Sep 12, 2013, 09:31 AM
PS: Oh, and you can't automatically assume that ALL the EQ will be at xx:00 - xx:30. During the Quna event, we had Falz attacks 15 minutes after the concert. So it's a little tricky to predict.
At xx:15 was just the warning of the EQ, the Falz Arms part of the EQ only started at xx:30.

Kion
Sep 12, 2013, 09:31 AM
PS: Oh, and you can't automatically assume that ALL the EQ will be at xx:00 - xx:30. During the Quna event, we had Falz attacks 15 minutes after the concert. So it's a little tricky to predict.

The Quna event is the Falz Elder Fragment. It has its own entry. I could also change the arrangement so that EQ's can have multiple times 45-59 and 15-29 ect. if that's the case.