Advertisement
rAthus

[csgolounge.com] search skin and quality in results v1

Sep 2nd, 2015
352
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var itemName = 'M4A1-S | Cyrex (Factory New)'; // nom de l'item
  2. var prctWanted = 99; // pourcentage de qualité minimum souhaité
  3.  
  4. var found = false;
  5. $('.name').each(function()
  6. {
  7.     if ($(this).find('b').text()==itemName)
  8.     {
  9.         var html = $(this).html();
  10.         if (html.split('Condition: ').length>1)
  11.         {
  12.             var prct = html.split('Condition: ')[1].split('%')[0]*1;
  13.             if (prct>=prctWanted)
  14.             {
  15.                 found = prct;
  16.                 $(this).parent().css({'border':'5px solid red'});
  17.                 alert('Found '+found+'%!');
  18.             }
  19.         }
  20.     }
  21. });
  22. if (!found)
  23. {
  24.     location.href = $('.simplePagerNav').find('li').eq($('.simplePagerNav').find('li.currentPage').index()+1).find('a').attr('href');
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement