Skip to content
TORNLIFE More

Faction API: attacking

Started by archimede [1565089] on in API Development.

6 replies · 188 views · thread synced · 8 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
5
Likes on archived posts
1
Posts by staff, officers and moderators
1
Authority score
71 / 100
Historical score
29 / 100
Story score
30 / 100
Engagement score
49 / 100

Most-liked replies

archimede [1565089]

Hi.

I'm examining the attacking info, and I have some questions/requests:

1) we have two selections, attacknewsfull and attacksfull: I think it's the same data, but why are the object IDs different? And what are exactly those IDs: some unique identifier of each row or something else?

2) would it be possibile to request only attacks made by faction members?

3) would it be possibile to request only attacks made in a specific time frame (eg. Dec 2015)?

4) would it be possibile to add the information "defender_in_warbase" (1/0) to tell war and personal hits apart?

TIA.

Alessandro
byrod [1132772]

For me, this is worth a bump...

What we want to count, is all attacks on the war base (hospitalizations, losses and stalemates). For hospitalizations it is easy to check if there is a 'respect gained' or not.

So just to make it clear: There is no way to see for losses and stalemates if it was a hit on a faction on warbase, or not. Right?

/by
LouBaker [1162207]

not sure what you are looking for here, but here goes

1: both attacknews and attacksnewsfull are the same data.
the only difference is size

attacknews is 403 lines average size 19KB
attacknewsfull is 40003 lines averagesize 1,636KB

2: it is not possibile to request only attacks made by faction members?
this can be done by downloading the attacknews and matching the IDs with your faction members
attacks done against the warbase will have the respect made for the attack

3: it is not possibile to request only attacks made in a specific time frame
this can be done by downloading the attacknewsfull and searching for dates

4: it is possibile to add the information "defender_in_warbase"
dont know what you looking for here, but yes the data can be used in some sort of warbase fixture


all the above requires downloading the data and matching IDs with other api calls
  • faction members - downloaded with <faction><your faction.ID><basic> api and storing members names and IDs
  • warbase attacks - using the above faction basic api call and reading wars section to see factions.IDs in your warbase, using this data to call api <faction><there faction.ID><basic> to read there members and mark them as warbase attackers
  • other attacks - if there not in the above they are outsiders looking to earn a buck or two
all of this is complex and requires a lot of api reads and storing of data.
most of this is unnecessary as all this is available at http://www.tornstats.com/

:)


byrod [1132772]

I am not sure what archimede does, I just want to make a simple hit counter for our faction. Name & Number of hits. Thats all.

Starting with you last comment: There is the API, so I like to try some things. I like the hits counter provided by http://www.tornstats.com/, but only because there is a tool does not mean that I don't want to find out was the API does :-) And things being complex is also no reason not to try them.

You are right with all what you wrote, my implementation does nearly the same as you mentioned in your 'requirement'.
But for me is one open point left: When I collect the data of the faction-warbase, I get only the factions which are just in this moment listed there, right?

Maybe an example explains my problem:
- We have a war, starting at 2016-01-01 with 5 factions.
- We defeat one faction at the first day, so 4 factions are left.
- I collect the warbase information and the attack logs at 2016-01-01.

--> I will not be able to see if a loss or stalemate at the first day was from the defeated faction. It will only be possible, if I regularly (e.g. every x hours) collect the warbase information and safe it somewhere.
So I will not be able to do the hit counter at the end of a war, I have to do it many times during the war. And if I don't save the factions on the warbase, my results can differ from day to day.

Long speaking, short question: Am I right, or wrong?
If I am wrong (which is surely more than possible), it would be nice if you can explain me where I make the mistake in my thinking.

Thanks for your patience with me ;-)

/by
IceBlueFire [776] Officer Officer

When you grab the faction details and it lists what factions you're at war with, you can also use the factions you have an NAP with as well (Since, 9 times out of 10 those are past wars). These stick around for a few days as well, so you can use that as a reference of a war hit after the fact, if needed.