tropicdome / MyPetBattle

6 stars 7 forks source link

Add basic statistics #18

Open tropicdome opened 11 years ago

tropicdome commented 11 years ago

Add basic statistics (daily or per session)

tropicdome commented 11 years ago

I am currently working on this and building a stats table with loot you receive, works out great so far. I have not committed this yet though.

Question: Would like the stats to be reset on each login, gathered from each toon or your account in general?

joevt commented 11 years ago

How about all of the above? Really, if you have a question like that, some user will want one thing and another user will want another. So add some options. The BigPicture addon for AuctioneerAdvanced stores stats for all characters and adds them together. You can display stats for each character and also a global stats.

But since pets are account wide, I'm not sure it's worth the effort to make stats for each character. Then again, we won't complain if you do add that :-)

As for resetting, I think that you can have one set that is a total (not reset) and another set that is reset each login. Just so the user can compare progress. This can be taken further, so that there's a stat set for each login period and the last 10 login periods are remembered (like how Recount has stats for the last 10 battles) - just name them by date/time.

Of course you should program it in such a way that all stat sets use the same code (reduce duplication of code). For example, you have a lot of variables that have names like pet1, pet2, pet3. I understand that some of these can't be an array and indexed like pet[i] because they are defined in the xml (right?). But they can be indexed programmatically like this _G["pet" .. i]

tropicdome commented 11 years ago

He he, well asking the question and letting people brainstorm does not mean I am going to implement it all ;)

As for storing stats for each character and account wide is pretty simple, will just require to variables that I add to. I think I am going to store some account wide and some per character e.g. Lesser Charm of Good Fortune as you only win them per character, where as Battle Stones are account-bound and as you say pets too.

Right now I am saving the pet names captured over time, but not sure this is necessary. I know for me, I rarely catch pets anymore since I have soooo many :)