Skip to content
TORNLIFE More

Script Request for weapon& armors stats

Started by iribuya [2103695] on in Tools & Userscripts.

21 replies · 352 views · thread synced · 4 days ago · View on torn.com
About this thread

Posts archived: 22 / 22 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
22
Discussion span
→
Authority score
57 / 100
Historical score
24 / 100
Story score
36 / 100
Engagement score
62 / 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.

Most-liked replies

Sulsay [2173590] Tester
I was going to make exactly this, until I realised the API doesn't expose weapon/armor stats. It would be trivial to maintain a database with equipment stats, if only the data were available.
Bug [1455582] Committee Committee
So.. I made a script that grabs weapon stats from display cases and sends them to a central server.. unfortunately, there's no good way to validate what is being sent so I cannot really share the script. For your viewing pleasure however, here is the page it generates:
Helcostr [1934501] Wiki Editor
Each weapon is attached with a weapon ID. The more hits made from separate accounts (verified with API) on that weapon, the more likely the weapon info is correct.

(And auto block users that incorrectly send information)
MikePence [2029670]
what if prox himself (or with a team) can manually verify (or randomly sample) uploaded stats? only the highest/lowest stats need to be verified, so it shouldn't be too much work, as prox is doing just that his forum thread already
MikePence [2029670]
i guess another idea could be to send verification requests

so i go like: hey bug, i has some items, come check them out plz :P

and you come use the script
Bug [1455582] Committee Committee
Oooh, that's not a bad method, could certainly be done although I'm wondering if that's too much work for such a small project.

I could just give the script to Prox and let him distribute it to whomever he trusts enough and let them verify whenever someone makes a claim. (Much like Mike suggested) This would be similar to what he's currently doing anyway, just an automated process ^^
WitchChild [1987262]
Hi that's really cool and each weapon should have three entries: highest accuracy, highest damage and highest score weapon which is ACC*DAM/100. Also the highest accuracy and damage weapon should include their score which again is ACC*DAM/100.

That's how proxima is doing it in the thread.
Bug [1455582] Committee Committee
This should already be the case, each entry is a dropdown and reveals its contents when clicked. I'm currently showing the highest and lowest (green and red) for each weapon for damage, accuracy and total (using Prox's formula). Some weapons may hold multiple records meaning there could be between 1 and 6 weapons shown per weapon type.
Bug [1455582] Committee Committee
Neato, updated my script to add armor support. Also it can now pull data from bazaars :)

If anyone got any links to some winning weapon displays/bazaars I'll happily click them :D
Bug [1455582] Committee Committee
Waay ahead of you and you're already on there, been back tracking through the thread clicking people's display & bazaar :)
iribuya [2103695]
That's some awesome work. It's not able to skim inventory's yet? I have thousands of low cost weapons. Probably a beauty in there, but too lazy to calc all 'totals'.
Bug [1455582] Committee Committee
I can't say I would want to add such functionality to the script, but I'm happy to whip up something that will sort through your weapons and highlight whichever one has the best total (of its type). Here we go (please don't judge, it was quick):


// ==UserScript==
// @name Torn Weapon Highlighter
// @include *.torn.com/item.php*
// @require https://gist.github.com/raw/2625891/waitForKeyElements.js
// ==/UserScript==

waitForKeyElements("li[data-weaponinfo=1]", checkItem);
var bestWeapons = {};

function checkItem (jNode) {
  var obj = jNode[0];
     if (obj.dataset.item in bestWeapons) {
        var otherData = bestWeapons[obj.dataset.item].querySelectorAll(".bonuses-wrap > .left");
        var thisData = obj.querySelectorAll(".bonuses-wrap > .left");
        if (thisData[0].innerText * thisData[1].innerText > otherData[0].innerText * otherData[1].innerText) {
            bestWeapons[obj.dataset.item].classList.remove("bg-blue");
            bestWeapons[obj.dataset.item].classList.add("bg-gray");
            obj.classList.add("bg-blue");
            bestWeapons[obj.dataset.item] = obj;
        } else {
            obj.classList.add("bg-gray");
        }
    } else {
        obj.classList.add("bg-blue");
        bestWeapons[obj.dataset.item] = obj;
    }
}
DeKleineKobini [2114440] Committee Committee
You can ignore this error. It occurs since the editor doesn't know that waitForKeyElements is getting loaded before the script itself.