Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var cases = [];
- fetch("https://api.datdrop.com/api/dropcase/", {
- "headers": {
- "accept": "application/json",
- "accept-language": "he-IL,he;q=0.9,en-US;q=0.8,en;q=0.7,nl;q=0.6",
- "sec-fetch-dest": "empty",
- "sec-fetch-mode": "cors",
- "sec-fetch-site": "same-site",
- "x-application-id": "730",
- "x-client-id": "15828987403100.204253287691756",
- "x-client-version": "7",
- "x-language": "en",
- "x-nonce": "3004542"
- },
- "referrer": "https://datdrop.com/",
- "referrerPolicy": "no-referrer-when-downgrade",
- "body": null,
- "method": "GET",
- "mode": "cors",
- "credentials": "omit"
- }).then((response) => response.json()).then((myJson) => {
- cases = myJson;
- var count = 0;
- var cases = cases.filter((a) => a.stock == "in_stock" && a.human_price < 350).sort((a, b) => a.human_price - b.human_price);
- for (var c of cases) {
- var slug = c.slug;
- callTimeOut(slug, count++);
- }
- function callTimeOut(caseName, count) {
- setTimeout(function () {
- calculateCase(caseName);
- }, 1000 * count);
- }
- });
- var output = "";
- function calculateCase(caseName) {
- fetch("https://api.datdrop.com/api/dropcase/" + caseName, {
- "headers": {
- "accept": "application/json",
- "accept-language": "he-IL,he;q=0.9,en-US;q=0.8,en;q=0.7,nl;q=0.6",
- "sec-fetch-dest": "empty",
- "sec-fetch-mode": "cors",
- "sec-fetch-site": "same-site",
- "x-application-id": "730",
- "x-client-id": "15985402558040.49803865996272023",
- "x-client-version": "7",
- "x-language": "en",
- "x-nonce": "6905797"
- },
- "referrer": "https://datdrop.com/",
- "referrerPolicy": "strict-origin-when-cross-origin",
- "body": null,
- "method": "GET",
- "mode": "cors",
- "credentials": "omit"
- }).then((response) => response.json()).then((myJson) => {
- var items = myJson.items;
- var chances = myJson.chances;
- var casePrice = myJson.human_price;
- var shouldBePrice = 0;
- for (var item of items) {
- var chance = chances[item.id].human_chance;
- var price = item.human_drop_price;
- shouldBePrice += price * chance;
- }
- var houseEdge = (1 - (1 / (casePrice / shouldBePrice))) * 100;
- output += "Case Name: " + myJson.name + " | Case Price: " + casePrice.toFixed(2) + " | Price should be: " + shouldBePrice.toFixed(2) + " | House Edge: " + houseEdge.toFixed(2) + "%\n";
- console.log("Case Name: " + myJson.name + " | Case Price: " + casePrice.toFixed(2) + " | Price should be: " + shouldBePrice.toFixed(2) + " | House Edge: " + houseEdge.toFixed(2) + "%");
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement