Facebook
From chuj, 5 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 244
  1. // ==UserScript==
  2. // @name         Bot - supremenewyork
  3. // @version      1.0
  4. // @description  try to take over the world!
  5. // @author       You
  6. // @match        *://www.supremenewyork.com/*
  7. // @grant        none
  8. // ==/UserScript==
  9.  
  10. var imie_i_nazwisko = 'Imie i nazwisko';
  11. var email = 'Email';
  12. var telefon = 'Telefon';
  13. var adres_1 = 'Adres';
  14. var adres_2 = '';
  15. var adres_3 = '';
  16. var miasto = 'Miasto';
  17. var kod_pocztowy = 'Kod pocztowy';
  18. var kraj = 'PL';
  19. var zapamietywanie_adresu = 1; // 0 lub 1
  20. var typ_karty = 'master'; // visa / american_express / master / solo / paypal
  21. var numer_karty = '5200 7413 5823 7283';
  22. var numer_miesiaca = '12';
  23. var numer_rok = '2017';
  24. var cvv = 'CVV';
  25. var link_do_produktow = 'http://www.supremenewyork.com/shop/all/pants';
  26. var kolor = 'Black'; // wielkość liter ma znaczenie
  27. var nazwa_produktu = 'Corduroy Work Pant'; // wielkość liter ma znaczenie, może być częściowa nazwa
  28. var pierwszy_rozmiar = '34';
  29. var drugi_rozmiar = 'Large';
  30.  
  31. var godzina_rozpoczecia_godzina = 11;
  32. var godzina_rozpoczecia_minuty = 59;
  33.  
  34. $(document).ready( function() { $('img').remove(); } );
  35.  
  36. refreshIntervalId = setInterval(function(){
  37.  
  38.     if ( $( ".tab-confirmation.selected" ).length )
  39.     {
  40.         clearInterval(refreshIntervalId);
  41.         return;
  42.     }
  43.     else if ( $( "#cart" ).is(':visible') )
  44.     {
  45.         window.location.replace("https://www.supremenewyork.com/checkout");
  46.         clearInterval(refreshIntervalId);
  47.     }
  48.     else if ( $('[name=commit]').length && $('[name=commit]').val() == 'process payment')
  49.     {
  50.          $('#order_billing_name').val(imie_i_nazwisko);
  51.          $('#order_email').val(email);
  52.          $('#order_tel').val(telefon);
  53.          $('input[name="order[billing_address]"]').val(adres_1);
  54.          $('input[name="order[billing_address_2]"]').val(adres_2);
  55.          $('input[name="order[billing_address_3]"]').val(adres_3);
  56.          $('#order_billing_city').val(miasto);
  57.          $('#order_billing_zip').val(kod_pocztowy);
  58.          $('#order_billing_country').val(kraj);
  59.  
  60.          if (zapamietywanie_adresu)
  61.              $('.iCheck-helper:first-child').click();
  62.  
  63.          $('#credit_card_type').val(typ_karty);
  64.          $('input[name="credit_card[cnb]"]').val(numer_karty);
  65.          $('#credit_card_month').val(numer_miesiaca);
  66.          $('#credit_card_year').val(numer_rok);
  67.          $('input[name="credit_card[vval]"]').val(cvv);
  68.  
  69.          $('.iCheck-helper:nth-child(2)').click();
  70.  
  71.          $('[name=commit]').click();
  72.          clearInterval(refreshIntervalId);
  73.     }
  74.     else if ( $('[name=commit]').length && $('[name=commit]').val() == 'add to basket' )
  75.     {
  76.          if ($('#size option').filter(function () { return $(this).html() == pierwszy_rozmiar; }).val())
  77.          {
  78.              $("#size").val($('#size option').filter(function () { return $(this).html() == pierwszy_rozmiar; }).val());
  79.          }
  80.          else if ($('#size option').filter(function () { return $(this).html() == drugi_rozmiar; }).val())
  81.          {
  82.              $("#size").val($('#size option').filter(function () { return $(this).html() == drugi_rozmiar; }).val());
  83.          }
  84.          else // JEŚLI NIE MA ROZMIARÓW TO KOŃCZY DZIAŁANIE, MOŻNA WYWALIĆ TEGO ELSE TO KUPI PIERWSZY DOSTĘPNY ROZMIAR
  85.          {
  86.              clearInterval(refreshIntervalId);
  87.              return ;
  88.          }
  89.  
  90.          $('[name=commit]').click();
  91.     }
  92.     else if ( $('a:contains("' + nazwa_produktu + '")').length )
  93.     {
  94.         if (kolor == '')
  95.         {
  96.             window.location.replace("http://www.supremenewyork.com" + $( 'a:contains("' + nazwa_produktu + '")' ).attr('href'));
  97.         }
  98.         else
  99.         {
  100.             $( 'a:contains("' + nazwa_produktu + '")' ).each(function() {
  101.                 if ( $( this ).parent().parent().find( 'p > a:contains("' + kolor + '")' ).length )
  102.                 {
  103.                     window.location.replace("http://www.supremenewyork.com" + $( this ).parent().parent().find( 'p > a' ).attr('href'));
  104.                 }
  105.             });
  106.         }
  107.         clearInterval(refreshIntervalId);
  108.     }
  109.     else if ( $('.sold-out').length )
  110.     {
  111.         clearInterval(refreshIntervalId);
  112.     }
  113.     else
  114.     {
  115.         var minuty = new Date().getMinutes();
  116.         var godziny = new Date().getHours();
  117.  
  118.         if (((godziny == godzina_rozpoczecia_godzina) && (minuty >= godzina_rozpoczecia_minuty)) ||
  119.             (godziny > godzina_rozpoczecia_godzina))
  120.         {
  121.             setInterval(function(){
  122.                 window.location.replace(link_do_produktow);
  123.             }, 2000);
  124.             clearInterval(refreshIntervalId);
  125.         }
  126.     }
  127.  
  128. }, 100);