Skip to content
TORNLIFE More

[API] OC Success Probability

Started by Allenone [2033011] on in Tools & Userscripts.

39 replies · 2.54k views · thread synced · 7 days ago · View on torn.com
About this thread

Posts archived: 40 / 40 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
40
Discussion span
→
Authority score
54 / 100
Historical score
40 / 100
Story score
55 / 100
Engagement score
78 / 100

People posting, likes and official posts are not counted for this thread yet: on threads longer than one page they come from a periodic pass over the archive, which has not covered it.

Mentioned in this thread

Allenone [2033011] ×1

Allenone [2033011]

I've created a node.js server for other developers to utilize in their spreadsheets, discord bots, scripts. etc.

 

Shoutout to Emforus for his original scenario maps which allowed me to kick off this project.

 

 

Currently available endpoints: 

/api/GetRoleNames

/api/CalculateSuccess

/api/GetSupportedScenarios

/api/GetRoleWeights

 

Example Code

Swagger

 

Determining the difference between Role1 and Role2.

You can do this via the API or by intercepting the XHR data when loading the crimes page. ( ?sid=organizedCrimesData&step=crimeList ).

  • via API its the order in the list.
  • via fetch/XHR it's the key value in order (P1-P6). For example: in Blast From The Past P1 is Picklock1 and P6 is Picklock2
  • You can also grab it from the reactFiber properties on the divs

 

Response Data:

 

 

Flow Charts: 

You can view the flowcharts for every scenario on my data collection script thread.

 

 

By utilizing my API you agree to the Terms of Use of both Torn.com and the Terms below. 

 

I (Allenone [2033011]) agree to inform all parties involved if these terms ever change in any capacity other than further notating prohibited actions. This service as defined does not store any data in any capacity. It simply calculates the outcomes based on the provided data and returns the response.

 

 

Terms of Use:

By accessing or using the API service provided by myself 'Allenone [2033011]' ("the Service"), you agree to the following terms:

  1. Prohibited Actions: You agree not to engage in any activity that may:

    • Launch Distributed Denial-of-Service (DDoS) attacks;
    • Attempt to hack, exploit, or compromise the security of the Service or its associated infrastructure;
    • Disrupt, degrade, or cause harm to the availability or integrity of the Service;
    • Violate any applicable laws, regulations, or third-party rights.
  2. Consequences of Violation: Any violation of the above terms may result in immediate termination of access to the Service.

By using the Service, you acknowledge that you have read, understood, and agree to comply with these terms.

Mentions: Allenone [2033011] · [Site + Script] Torn OC Scenario Tracker

Allenone [2033011]

Updated to now also return position to role name relationships for easy upkeep in your own scripts. This was abstracted out to my API to prevent the requirement for script updates every month with new strings.

 

You can access it with the /GetRoleNames endpoint.

 

Reference the example code linked in the main post for how to call this endpoint. Please only use this endpoint once per page load. load the json data into a local variable and reference that instead of calling the API for every OC on the page.

 

Response data:

 

Reference my OC Role Display code for how to get the position from each div element on the page. ( or just use my script :) )

Mentions: [Script+PDA] OC Role Display

Allenone [2033011]

The one and only Emforus.

 

Loot Rangers discord always has information before it ends up on the forums.

 

 

PSA: Don't be like some people and lurk the discord without contributing anything :), data collection is easier when there's data to be had :)

DasLewis [2524294]

With the success chance data you have, could you possibly create an overview with the order of which positions in the scenarios have the highest impact on total success chance? For example afaik, the Muscle 3 role for Break The Bank has a lot of impact on whether you'll get a success or not, while some other roles have little impact on success chance but are mpre important for higher rewards.

This would help with setting up teams with a lot higher success chances.

 

Allenone [2033011]

I can chew on this idea a bit, it feels like too dynamic of a problem. It would almost be better to be able to input up to 6 members CPRs for each role and then have a team-builder like function where it tells you where to assign everyone- however that would require knowing everyone's CPR for every role.

 

I have a feeling it will be covered in Emforus' next OC guide though.

 

Technically you can already deduce this yourself by getting a baseline either via API call to /api/CalculateSuccess or just using the swagger page, and then inputting different values and observing the increases in overall success and specific outcomes.

bishop_actual [2617217]

I think this would be a great idea for ease of leaders to determine teams. 
I get you’d need to know everyone’s CPR but that’s a small price to pay for simplicity in making optimal teams. 

just need a way to auto save members CPR like in the old tornstats with nerve or spies logging 

Allenone [2033011]

I just tested via swagger and the endpoint and calcs are working.

 

Are you using callmericky's "OC 2.0 Helper" at the same time? right now there are some unresolved conflicts between that and my success chance script.

Allenone [2033011]

In his settings you can disable the option to use my API for success chance. that theoretically should return functionality to my OC success chance script since you won't be making duplicate API calls.

Viciously_Grim [2752611]

Thanks mate had to disable the option in the other script to show % success rate (it didn't show when I disabled your script) & made a new key just for that script & can see your % success chance now ty!!

DieselBlade [1701621] Wiki Contributor

This is great.

 

I want to be able to use my members' CPRs to create teams that always have a 70% success chance.

 

Instead of using your API to calculate every possible scenario is there minimum CPRs for each role that would result in a 70% success chance? 

 

I'm struggling to figure out how to calculate this from the weight %s. I guess I also need to know the total number of checkpoints and/or checkpoints for each role?

Allenone [2033011]

This would probably be best with Emforus's website tbh.

 

His simulator makes it pretty easy to play with the numbers in a quick way as opposed to manually using my API.

 

Generally for most OCs- 70 CPR average is roughly 70% or higher success rate.