Advertisement
Guest User

Untitled

a guest
May 29th, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. function validateOffer(offer) {
  2. var _total = 0;
  3. var _items = 0;
  4. var _shit = 0;
  5.  
  6. if (offer) {
  7. const prices = require('./prices.json');
  8. for (var i in offer) {
  9. _total += prices[offer[i].market_hash_name] : null;
  10.  
  11. var _name = offer[i].market_hash_name;
  12. if(_name.includes("Sticker") || _name.includes("Graffiti")) {
  13. _shit++;
  14. }
  15. if(_name.includes("Souvenir")) {
  16. _total += 0.1;
  17. _shit++;
  18. }
  19. }
  20. log(_total.toFixed(2) + "$ -- " + _shit + " stickers");
  21. //if(_priceall >= 2.95) { return true; } else { return false; }
  22. if(_total >= 3.10) { return true; } else { return false; }
  23. //if(_total >= 3.2) { return true; } else { return false; }
  24. }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement