Advertisement
Guest User

Untitled

a guest
May 29th, 2017
40
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 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. //Loop through offer and get total price
  9. for (var i in offer) {
  10. _total += prices[offer[i].market_hash_name] : null;
  11.  
  12. var _name = offer[i].market_hash_name;
  13. if(_name.includes("Sticker") || _name.includes("Graffiti")) {
  14. _shit++;
  15. }
  16. if(_name.includes("Souvenir")) {
  17. _total += 0.1;
  18. _shit++;
  19. }
  20. }
  21.  
  22. var _priceall = _total*eur;
  23. //_priceall = _priceall - _minus;
  24. //log(_total + " " + _priceall + "minus" + _minus);
  25. //log(_total + " > " + _priceall + " - " + _minus);
  26. log(_total.toFixed(2) + "$ > " + _priceall.toFixed(2) + "E -- " + _shit + " stickers");
  27. //if(_priceall >= 2.95) { return true; } else { return false; }
  28. if(_total >= 3.10) { return true; } else { return false; }
  29. //if(_total >= 3.2) { return true; } else { return false; }
  30. }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement