thunder-spb / wot-api-description

World of Tanks Unofficial API Description
http://wotapi.ru
Do What The F*ck You Want To Public License
46 stars 9 forks source link

Clan Administration #1

Closed TheSnoStorm closed 11 years ago

TheSnoStorm commented 11 years ago

Is there a way to retrieve the total gold a clan has? I know it would require authentication using a member of that clan.

Also, I'm trying to figure out a way to automate paying out gold to clan members. Which I know is a lot more complicated then just retrieving info, but was wondering if you might know a good place for me to start or be able to point me in the right direction (my web-related programing knowledge is somewhat limited)?

The reason for both questions is because I've developed a teamspeak bot that tracks attendance during clan wars, calculates a player's attendance contribution compared to the total attendance value since the last payout (also allows scaling based on rank and roles), and lets you know how much gold each member should get (the bot also does a lot of other things like auto notifying members about battle schedule changes, poking people who aren't in a clan wars channel 5 minutes before a battle pops, and others things with the help of the wot-api you have here). Attendance is based on being available (not based on if you're picked for battle so even if you're not picked you still get credit), so basically provides the fairest method for clan payouts possible. The only problem is that it's a pain in the butt to allocate a different amount of gold to each player, so adding an automated payout feature would be pretty nice.

thunder-spb commented 11 years ago

Yeah, this is really good idea.

Concerning authorization, there is links, that I've found in WoT Assistant API that allows you to authorize in tanks, so you can retrieve clan stash. And then retrieve http://worldoftanks.ru/uc/clanwars/provinces/regions/5/?ct=json&hash=[HASH_ID]&_=[SOME_ID_HERE], you can find this link on global map via firebug for example. After that you can use this link http://worldoftanks.ru/community/clans/[YOUR-CLAN-ID]-[YOUR-CLAN-TAG]/members/edit/?type=divide_profits with POST like members=8245126,10625623 per_person_fee=8 , where numbers is a members IDs and second parameter is amount of gold per selected member.

On web interface it requires confirmation via authorization, not really sure without testing how to pass this, but i think it is possible.

Addition about authorization: ofcourse you need to keep all cookies for all these actions.

TheSnoStorm commented 11 years ago

Awesome thanks. I've been trying to figure out how to get the total gold from the global map page but haven't had any luck. I've considered using some sort of browser automation like greasemonkey or autoit, but would much rather have all of the bot written in 1 language (which is java since the bot started as a basic ts bot I found). Another goal is to keep it gui-less so it can be run as a service/daemon alongside the ts server so that the server they run on doesn't require someone logged in.

I'll let you know how it goes, but it may be a little while before I can really play around with it, since I'm currently in the middle of rewriting the attendance functionality to utilize a sqlite db (instead of a text file and a google spreadsheet it currently uses) for data storage.

thunder-spb commented 11 years ago

Yeah, this script will be very usefull. Thanks.