Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function validateOffer(offer) {
- var _total = 0;
- var _items = 0;
- var _shit = 0;
- if (offer) {
- const prices = require('./prices.json');
- //Loop through offer and get total price
- for (var i in offer) {
- _total += prices[offer[i].market_hash_name] : null;
- var _name = offer[i].market_hash_name;
- if(_name.includes("Sticker") || _name.includes("Graffiti")) {
- _shit++;
- }
- if(_name.includes("Souvenir")) {
- _total += 0.1;
- _shit++;
- }
- }
- var _priceall = _total*eur;
- //_priceall = _priceall - _minus;
- //log(_total + " " + _priceall + "minus" + _minus);
- //log(_total + " > " + _priceall + " - " + _minus);
- log(_total.toFixed(2) + "$ > " + _priceall.toFixed(2) + "E -- " + _shit + " stickers");
- //if(_priceall >= 2.95) { return true; } else { return false; }
- if(_total >= 3.10) { return true; } else { return false; }
- //if(_total >= 3.2) { return true; } else { return false; }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement