EyeWire Stats - another TamperMonkey script

Thanks for explanations, make totally sense :slight_smile:
I already seen this “NaN” in a new sheet dev done about accu, don’t have the link. But in some case “NaN” is used for Unused IDs.
'Will wait and see

i have had some problems with the accuracy bars after the official version was released, mainly getting wrong colours on reap/normal play and trouble with the NaN cubes and some weird accuracy results. If i understand it correct the devs did some corrections in the test acc sheet so cubes with nothing to add and tb get this status instead of 100% (do not get the point since you either trace it correctly and add nothing or if you add merger will you then get low acc % or still NaN)

i have also had a issue with the explanation drop down for weight kind of getting stuck so it hide part of 2d and i have to go to hover over one of the bars to make it go away

1 Like

Sorry for not updating anything for such a long time, but doing additional stats in the profile took much more time, that I was hoping for. To create the stats, I had to set up a server and finding a suitable one (and free, if possible) was quite a challenge. I have tested at least 10 different hostings and each and every one of them had some important limits (like no cron jobs, no cron jobs on a specified time, db limited to 30MB or just being very, very slow). I’ve tried some combined solutions, when one server was doing some part of the job and other was doing something else (e.g. one for cron, one for interaction with users). But only about a week ago I found something, that, as of now, looks great - feedia.co. I didn’t know that hosting before, so I found it almost by accident. I don’t know, what is “wrong” with them, but their free hosting service looks better, than many other premium hostings :slight_smile: Hopefully, it will stay like that forever :slight_smile:

So, I was finally able to do:

ver. 2.0.0

in which I:
FIXED problems with recent changes in Accuracy History (and those NaNs)
FIXED problem, when a bar in the Accuracy History could change its height, but not color
ADDED admin reaps as a separate category in the History
CHANGED bar colors, so now both scythe and reap have their colors the same as in the EW or as in user settings, if somebody’s using @crazyman4865’s script to customize the colors
ADDED additional statistics in the user Profile
CLEANED the code to pass JSHint for ES6 compatibility

Here’s how the new statistics should look like:

As you might see, there are 3 tabs at the top. The first one (current) shows the normal statistics, next one is previous, which shows our results from yesterday, last week and last month. The third tab (best) shows our personal records. CAUTION: those are not all-time bests, just best results since installing the script (well, number of points and number of cubes will be from about when the current version of the script is released), because simply I don’t have access to all time bests and I’m not sure, if I want it, because some might not like me having so much data. xD

In the lower part of the Profile window there are also 3 tabs and a graph.
The graph shows our numbers of points, cubes, trailblazes, scythes and completes. Changing the tabs over the graph changes time range of the graph. The graph shows only data for already ended units of time (e.g. for last 7 days, the newest point in the graph will be yesterday, for last 10 weeks - last week, for last 12 months - last month). The Y axis on the left is common for the number of cubes, trailblazes, scythes/reaps and completed. The one on the right is for points.

Clicking on someone’s profile won’t show the new statistics (although, there might be a short glitch during extended stats will be visible, but those are our own stats, because both our and others’ profile is shown in the same window). The reason for that is, because I didn’t want to allow anybody to stalk anyone else xD

Here’s how the data collecting works:
Number of points and number of cubes are collected everyday at 23:59 EST/EDT via a cron job. These numbers are collected for all the players (no matter, if someone has or hasn’t the script installed), because it will also be used for an extenion for the original Stats window (the one with the map).
As for the other data (trailblazes, scythes and completes) things are a little bit more complicated. After each tbing, scything or completing, the data is collected from the EW server. To be precise the data is collected 15 s after each of the operations. If another operation is done within that time, the counter is reset. In other words: data is collected from EW server after 15s after the last successful operation. This is done to not unnecessary increase the traffic to the EW server when one makes one tb after another or a series of scything and completing.
The data for the current day, week and month is collected in the localStorage (on user’s computer). When the browser and the EW page is loaded another day, the first thing is to send all the data for each past period to the server and then the previous and the best data is downloaded from the server. This is also the moment, when the data for the graphs is downloaded from the server.
Example:
-you play however you like and the data is collected in the localStorage,
-you refresh the EW page or reopen the browser or turn off the computer and turn it on the next day or any other day,
-after the page has been loaded, the script checks if current (hq time) date is the same as the date of last update from the script server (the date of the last update is also stored in the localStorage).
– if the dates are the same, no update, neither on the client, nor on the server, side is performed,
– if the dates are different, the data from the client is sent to server and the server returns updated previous, best and charts data

  • date of the last update in the localStorage is set to today’s date.

Don’t worry, if you don’t play everyday or use more than one browser profile/browser/device to play EW. If the script is installed on every device, you play, everything should work ok (if not, some data might be missing).
So, if you have played for some time of a day on one computer, then changed to some other, the first one will have older data, than the latter. If on the next day you first run the first computer then the second, then the data for then-yesterday will be first updated from the first computer, then from the second one. If you first run the second computer, then the first one, the data from the second computer will be sent to server and then also the data from the first computer will be sent to the server, but because the data from the first computer has smaller values (you have played on it earlier the previous day), it won’t be written to the db.

During the development I had a lot of recurring bugs. I hope, I fixed them all, but spes mater stultorum, lol.

If you find anything wrong, please report it here or on the chat, while I’m online. But, for a few days, I will be fixing only blockers and security holes, because I really want to add the ability to display Stats (the one with the map) for a custom period (the button for that is already in the script, but it doesn’t do anything now) before the New Year.

P.S.
Some stats :slight_smile:
The script currently consists of about:
400 lines of SQL
300 lines of PHP
600 lines of CSS
3400 lines of JS

3 Likes

Incredible! Ty! :smiley:

1 Like

Amazing! Wonderful! Three cheers!

Chris is working on a way that will make it easier for players to install Eyewire extensions so that more people can see this beautiful work! Soon, hopefully!

2 Likes

Not sure it’s a bug, but if I open more than one concurrent ew tabs, say 2 or 3 or more, the stats/profile loads only on the tab that last opened/refreshed, all others won’t load (stats).

I wasn’t able to reproduce it, however I have updated some server scripts (changed MySQLi to PDO) to prevent some problems with db queries not being closed, when they should. That (unfinished queries, not the change xD ) could be the reason for the behaviour, you’re talking about, though, the reason might be in a totally different place.

1 Like

So I was checking my profile, then suddenly,

This happened lol
Even after viewing in fullscreen, it still doesn’t seem to fit within my monitor size and I can’t seem to find any way to resize it. Is there a way to automatically find the viewport size of the monitor and resize the windows accordingly? My display is 1366768 btw, and when viewed normally (not fullscreen), it’s 1366637.

1 Like

my window is also a bit too big, like randoms pic at the top and missing the link at bottom

1 Like

Yeah, I know about the problem. For now, I just wanted to release it (and do a public testing :wink: ). In not so distant future, I’mn planning to either add a scrollbar or some kind of responsize design. Currently the profile window is 800px height and it barely fits on 1080p But, like I said, it’s a first iteration.

I’m open to any suggestions, changes, things to add or remove, etc.

1 Like

ver. 2.0.1

Small fixing update:
FIXED weeks shown in the Profile stats chart (the last one was the current one, while it should be the last completed one)
Also a little FIX on the server side to correctly save weeks’ dates.

ver. 2.0.2
And another small update.
FIXED behaviour of the text to the right of accuracy bars. When a player scythed a cube, it was showing (correctly) a value of “–”, but after refreshing from the server, the value was changed to “100%”. Not it continuously shows “–”.

1 Like

I have this small “test” thing up right corner, I think I’ve also seen it in one of your screenshots here? lol How do I get rid of it? lol

1 Like

lol, i like how the url contains MMM

1 Like

lol your complaints to imgur’s auto name generator :stuck_out_tongue:

Oops, sorry about that :smiley:
I have this constant named DEBUG. When I’m releasing a public version, I’m changing its value to false and in the dev version it’s set to true. When it’s true, it allows me to make the script working with dev versions of the server scripts and adds the Test button which I’m using to invoke some server functions without a need to refresh the EW page all the time.

In the last release the constant was switched to false, but I forgot to add the Test button under condition checking if the constant is true or false, hence the button was always visible xD

Just update to ver. 2.0.3 which:
FIXES the Test button near the top being always visible.

1 Like

lol np ty for the explanation and the fix :slight_smile:

1 Like

ok so I had an ew tab open, opened a new one (with right click) to check on a cube from chat and then I tried to check my profile in new tab it worked, then i refreshed old tab and new tab does this:

old tab loads it okay with stats graphs etc.
I’m sure if I refresh the new tab it’ll load ok and old one won’t lol.

I also tried with ctrl+left click one time it didn’t do it another it did, lol

Unfortunately, I wasn’t able to reproduce it. I’ve tried different combinations, but it always worked for me. Could you describe more precise steps to do it? Like:

  1. I refreshed the original tab and didn’t open Profile
  2. I opened a new tab by right-clicking on a cube in the chat/Accuracy Tracker.
  3. I opened the Profile in the new rab still not opening it in the old one.
  4. I refreshed the old tab without ever opening the Profile tab here.
  5. I closed the new tab.
  6. The original tab shows an empty space instead of the stats in the Profile.
    Don’t know, if those were exactly the steps needed, just added an example. The important part here is, when and if you have opened the Profile dialog, because the chart is created when the dialog is opened and some of its properties are shared between tabs.

But for now, I have slightly different problem to face - weeks. Namely, there are Eurasia/ISO 8601 weeks (starting on Monday) and Americas’ weeks (starting on Sunday). There are also gregorian calendars (with gregorian counting of the weeks) and ISO 8601 week dates. In the gregorian, there are always 52 weeks and 1 day or 2 days on leap years. However, in ISO week years most years have exactly 52 weeks, but there 71 years in each 400 years, which have exactly 53 weeks. And those years aren’t in regular intervals, e.g. 2015, 2020, 2026, 2032, 2037, 2043, 2048, 2054, 2060 - the next leap years according to the ISO standard.
Also ISO week starts on Monday and are usually used in most programming languages in their date/time functions, while HQ time weeks start on Sunday.
Long story short: weeks currently don’t work as they should in the Profile stats. I’m working on it. I will probably just count, how many Wednesdays were in a year from the 1st of January til a given day. That should give me the correct number of weeks US-style.
Fun, fun, fun xD

2 Likes

ver. 2.0.4
Which (hopefully) FIXES the problems with weeks described above.

2 Likes

question dunno if its possible/feasible but say i click on my profile and i see that my accu has dropped to (for example) 78% in lv2 can it when i hover over the 78% except for the over/under percentages also tell me which cube(s) is/are doing me in and either let me seclect copy/paste or jump me there like chat links?