Facebook
From Smelly Bison, 3 Years ago, written in JavaScript.
Embed
Download Paste or View Raw
Hits: 53
  1. // ==UserScript==
  2. // @name         automatyczne wypelnianie
  3. // @namespace    http://tampermonkey.net/
  4. // @version      1.1
  5. // @description  Skrypt automatyzujący rejestrację i zdobywanie kodów do Xbox game pass w promocji pringles.
  6. // @updateURL      http://srv18949.microhost.com.pl/scripts/pringles-bot.user.js
  7. // @downloadURL    http://srv18949.microhost.com.pl/scripts/pringles-bot.user.js
  8. // @match        https://gaming.pringles.com/*
  9. // @grant        none
  10. // ==/UserScript==
  11. var wersjajezykowa="mk_MK"; //Kod wybranej wersji językowej na której ma działać skrypt (znajduje się w adresie strony). Zalecane "lv_LV" (Łotwa, brak puzzli i brak kodów z puszki).
  12. var registertimeout=120; //czas w sekundach po ilu ma być przeładowana strona rejestracji konta (np. w przypadku zamulających serwerów).
  13. var firstclicktimeout=3000; //UWAGA!!! Jeśli będziesz miał problem z wczytywaniem wersji niemieckiej (de_DE) mimo ustawienia innej, zwiększ tę wartość na 2000 lub 3000.
  14.  
  15. var gmail_name="pringlesgamepasscodes"; //mail KONIECZNIE na Gmailu (sam alias, bez części po znaku @), do niego będzie doklejany losowy ciąg znaków i na ten adres przyjdą kody do Game Passa. Przykład: dla adresu [email protected] wpisz tu tylko: jankowalski
  16. var password="haH432hhbvc32%y"; //hasło do tworzonych kont pringles - minimum 8 znaków, duża i mała litera, cyfra i znak specjalny.
  17.  
  18.  
  19. function fillform(){
  20.     var tempid=makeid(20);
  21. document.getElementById("KSTL-Registration-FirstName").value="brave";
  22. document.getElementById("KSTL-Registration-LastName").value="hera";
  23. document.getElementById("KSTL-Registration-City").value="vilno";
  24. document.getElementById("KSTL-Registration-Password").value=password;
  25. document.getElementById("KSTL-Registration-PasswordConfirm").value=password;
  26. document.getElementById("KSTL-Registration-AddressLine1").value="greta 12";
  27. document.getElementById("KSTL-Registration-PostalCode").value="42-152";
  28. document.getElementById("KSTL-Registration-PhoneNumber2").value="5521356311";
  29. document.getElementById("KSTL-Registration-UserNameConfirm").value=gmail_name+"+"+tempid+"@gmail.com";
  30. document.getElementById("KSTL-Registration-UserName").value=gmail_name+"+"+tempid+"@gmail.com";
  31. document.getElementById("KSTL-Registration-Country-0").click();
  32. document.getElementById("KSTL-Registration-TermsConditions1").click();
  33. document.getElementById("KSTL-Registration-PrivacyPolicy").click();
  34.  
  35. fireChangeEvents(document.getElementById("KSTL-Registration-FirstName"));
  36. fireChangeEvents(document.getElementById("KSTL-Registration-LastName"));
  37. fireChangeEvents(document.getElementById("KSTL-Registration-Password"));
  38. fireChangeEvents(document.getElementById("KSTL-Registration-PasswordConfirm"));
  39. fireChangeEvents(document.getElementById("KSTL-Registration-AddressLine1"));
  40. fireChangeEvents(document.getElementById("KSTL-Registration-PostalCode"));
  41. fireChangeEvents(document.getElementById("KSTL-Registration-PhoneNumber2"));
  42. fireChangeEvents(document.getElementById("KSTL-Registration-City"));
  43. fireChangeEvents(document.getElementById("KSTL-Registration-UserName"));
  44. fireChangeEvents(document.getElementById("KSTL-Registration-UserNameConfirm"));
  45. }
  46.  
  47. function makeid(length) {
  48.    var result           = '';
  49.    var characters       = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
  50.    var charactersLength = characters.length;
  51.    for ( var i = 0; i < length; i++ ) {
  52.       result += characters.charAt(Math.floor(Math.random() * charactersLength));
  53.    }
  54.    return result;
  55. }
  56.  
  57. function fireChangeEvents(element){
  58.     var changeEvent = null;
  59.     changeEvent = document.createEvent ("HTMLEvents");
  60.     changeEvent.initEvent ("input", true, true);
  61.     element.dispatchEvent (changeEvent);
  62.     console.debug('input event dispatched for element: '+element.id);
  63.     changeEvent = document.createEvent ("HTMLEvents");
  64.     changeEvent.initEvent ("keyup", true, true);
  65.     element.dispatchEvent (changeEvent);
  66.     console.debug('keyup event dispatched for element: '+element.id);
  67.     changeEvent = document.createEvent ("HTMLEvents");
  68.     changeEvent.initEvent ("change", true, true);
  69.     element.dispatchEvent (changeEvent);
  70.     console.debug('change event dispatched for element: '+element.id);
  71. }
  72.  
  73. function deleteAllCookies() {
  74.     var cookies = document.cookie.split(";");
  75.  
  76.     for (var i = 0; i < cookies.length; i++) {
  77.         var cookie = cookies[i];
  78.         var eqPos = cookie.indexOf("=");
  79.         var name = eqPos > -1 ? cookie.substr(0, eqPos) : cookie;
  80.         document.cookie = name + "=;expires=Thu, 01 Jan 1970 00:00:00 GMT";
  81.     }
  82. }
  83.  
  84. function auto(){
  85.  
  86.         if ((document.getElementById("KSTL-Registration-UserName").value=="")&&(document.getElementById("KSTL-Registration-FirstName").value=="")){
  87.             fillform();
  88.             //window.scrollTo(0,document.body.scrollHeight);
  89.             window.scrollBy(0,1400);
  90.         }
  91.  
  92. }
  93.  
  94. (function() {
  95.     'use strict';
  96. window.onkeyup = function(e) {
  97.     var key = e.keyCode ? e.keyCode : e.which;
  98.     if (key == 192){
  99.         deleteAllCookies();
  100.         sessionStorage.clear();
  101.         window.location.href="https://gaming.pringles.com/"+wersjajezykowa+"/Home";
  102.     } else if (key == 17) {
  103.         if ((window.location.href=="https://gaming.pringles.com/"+wersjajezykowa+"/Login")&&(document.getElementById("KSTL-Registration-UserName").value!="")){
  104.             document.getElementById("KSTL-Registration-Password").value=password;
  105.             fireChangeEvents(document.getElementById("KSTL-Registration-Password"));
  106.         }
  107.         else if (window.location.href=="https://gaming.pringles.com/"+wersjajezykowa+"/Register") {
  108.             if ((document.getElementById("KSTL-Registration-UserName").value!="")&&(document.getElementById("KSTL-Registration-FirstName").value=="")){
  109.                 fillform();
  110.         }
  111.     }
  112.     }
  113. }
  114.  
  115. setInterval(auto, 1000);
  116.  
  117. })();