Skip to content
TORNLIFE More

War Base Calculator

Started by NZSAS [382829] on in API Development.

6 replies · 136 views · thread synced · 10 days ago · View on torn.com
About this thread

Posts archived: 7 / 7 posts (100%) · the total is Torn's reply count + the opening post at the last fetch

Counted by TornLife from the archived posts.

Archived posts
7
Discussion span
→
People posting
2
Likes on archived posts
4
Authority score
51 / 100
Historical score
19 / 100
Story score
29 / 100
Engagement score
50 / 100
NZSAS [382829]

Hi all I have made this small java program which counts how many people are currently in your war base (Just your active wars it's not counting timed out wars, Won or lost ones either).

You can also set the number of API calls this program now does per minute and set it from anywhere between 1-100 (the higher the better btw)

For those that don't want to read over the source code here is a direct download link.

https://mega.nz/#!VdtnFQoY!mEamU36TqpXKdQE9LLeCeFBwo_W_o7RVvYYQ95s4XNY

Here is the source code https://drive.google.com/file/d/0B_6xZg_rtH97X25FZzRkN3J3cFU/view?usp=sharing



F
or those that are compiling from the source code you can add your own api key In Check_War_Base.java on line 17 inbetween "" place your api key in. On line 18 inbetween "" place your faction ID. On line 19 inbetween "" place max API calls per minute.

Yes this does use mutli threading to speed things up since
  1. hi = url.openStream();
  2. BufferedReader br = new BufferedReader(new InputStreamReader(hi));
  3. data = br.readLine();
Since those lines above take around 500ms in total to call.

Number of api calls this makes is 1+number of factions u are at war with.





Any questions just ask below
NZSAS [382829]

current factions u are at war with (active wars) and when i can only base it when DA wars I only notice we declare on like 10 factions max meaning 11 api call will be made. That is why I didn't think it was really needed . Plus to get to a number even close to 100 with a maxed war base u will need like 5 ppl in each faction
Meme_Raven [1891116]

5 people using same prog making calls? It works by Key -> IP, so unless you're running 5 different copies with the same API Key that will never happen.
but lets just say you advance the code and add features. Whilst the code is simply, it's advised to add a throttle system or a wait system.
(E.g. my upcoming is currently set to 60 calls/min by default; if user is not going to use any other applications they can scale it. After Limit hit, wait 1min10sec)